Add ImmediateType for declaring immediate operands.

This commit is contained in:
Jakob Stoklund Olesen
2016-03-30 11:36:23 -07:00
parent 3d67d4d6b9
commit 05de34b1a3
4 changed files with 60 additions and 1 deletions

View File

@@ -200,6 +200,18 @@ in this reference.
Either :type:`bool` or :type:`iN`.
Immediate operand types
-----------------------
These types are not part of the normal SSA type system. They are used to
indicate the different kinds of immediate operands on an instruction.
.. type:: imm64
A 64-bit immediate integer. The value of this operand is interpreted as a
signed two's complement integer. Instruction encodings may limit the valid
range.
Control flow
============

View File

@@ -38,13 +38,28 @@ Predefined types
.. automodule:: cretonne.types
:members:
.. currentmodule:: cretonne
Parametric polymorphism
-----------------------
.. currentmodule:: cretonne
Instruction operands can be defined with *type variables* instead of concrete
types for their operands. This makes the instructions polymorphic.
.. autoclass:: TypeVar
Immediates
----------
Immediate instruction operands don't correspond to SSA values, but have values
that are encoded directly in the instruction. Immediate operands don't
have types from the :class:`cretonne.Type` type system; they often have
enumerated values of a specific type. The type of an immediate operand is
indicated with an instance of :class:`ImmediateType`.
.. autoclass:: ImmediateType
.. automodule:: cretonne.immediates
:members:
.. currentmodule:: cretonne