Define icmp and fcmp comparison instructions.

Add new intcc and floatcc operand types for the immediate condition codes on
these instructions.

Add new IntCompare and FloatCompare instruction formats.

Add a generic match_enum() parser function that can match any identifier-like
enumerated operand kind that implements FromStr.

Define the icmp and fcmp instructions in case.py. Include documentation for the
condition codes with these two instructions.
This commit is contained in:
Jakob Stoklund Olesen
2016-07-07 11:20:56 -07:00
parent 70507a3be0
commit 5d8fb0fdc3
9 changed files with 218 additions and 52 deletions

View File

@@ -21,3 +21,17 @@ ebb0:
v1 = extractlane v0, 3
v2 = insertlane v0, 1, v1
}
function icmp(i32, i32) {
ebb0(vx0: i32, vx1: i32):
v0 = icmp eq, vx0, vx1
v1 = icmp ult, vx0, vx1
v2 = icmp sge, vx0, vx1
}
function fcmp(f32, f32) {
ebb0(vx0: f32, vx1: f32):
v0 = fcmp eq, vx0, vx1
v1 = fcmp uno, vx0, vx1
v2 = fcmp lt, vx0, vx1
}