Files
wasmtime/meta/cretonne/formats.py
Jakob Stoklund Olesen 3670f57c40 Synchronize InstructionFormat and InstructionData.
These two enums must have identical variants. One is generated from the
instruction formats in meta/cretonne/formats.py, the other defines the contents
of an instruction.

Emit a conversion from InstructionData to InstructionFormat which also serves
to verify the correspondence. Rustc will error is the match is not complete.
2016-05-13 14:29:14 -07:00

29 lines
862 B
Python

"""
The cretonne.formats defines all instruction formats.
Every instruction format has a corresponding `InstructionData` variant in the
Rust representation of cretonne IL, so all instruction formats must be defined
in this module.
"""
from . import InstructionFormat, value, args
from immediates import imm64, ieee32, ieee64, immvector
Nullary = InstructionFormat()
Unary = InstructionFormat(value)
UnaryImm = InstructionFormat(imm64)
UnaryIeee32 = InstructionFormat(ieee32)
UnaryIeee64 = InstructionFormat(ieee64)
UnaryImmVector = InstructionFormat(immvector)
Binary = InstructionFormat(value, value)
BinaryImm = InstructionFormat(value, imm64)
BinaryImmRev = InstructionFormat(imm64, value)
Call = InstructionFormat(args, multiple_results=True)
# Finally extract the names of global variables in this module.
InstructionFormat.extract_names(globals())