Add two new value types: iflags and fflags.

These two value types represent the state of CPU flags after an integer
comparison and a floating point comparison respectively.

Instructions using these types TBD.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-12 12:49:10 -07:00
parent dbaa919ca9
commit 15461c1e4b
8 changed files with 119 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
The base.types module predefines all the Cretonne scalar types.
"""
from __future__ import absolute_import
from cdsl.types import IntType, FloatType, BoolType
from cdsl.types import IntType, FloatType, BoolType, FlagsType
#: Boolean.
b1 = BoolType(1) #: 1-bit bool. Type is abstract (can't be stored in mem)
@@ -31,3 +31,16 @@ f64 = FloatType(
*binary64* interchange format. This corresponds to the :c:type:`double`
type in most C implementations.
""")
#: CPU flags from an integer comparison.
iflags = FlagsType(
'iflags', """
CPU flags representing the result of an integer comparison. These flags
can be tested with an `intcc` condition code.
""")
#: CPU flags from a floating point comparison.
fflags = FlagsType(
'fflags', """
CPU flags representing the result of a floating point comparison. These
flags can be tested with a `floatcc` condition code.
""")