Add instructions using CPU flags.

Add integer and floating comparison instructions that return CPU flags:
ifcmp, ifcmp_imm, and ffcmp.

Add conditional branch instructions that check CPU flags: brif, brff

Add instructions that check a condition in the CPU flags and return a
b1: trueif, trueff.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-12 15:21:40 -07:00
parent 15461c1e4b
commit 1f98fc491c
8 changed files with 262 additions and 28 deletions

View File

@@ -141,11 +141,21 @@ pub enum InstructionData {
arg: Value,
imm: Imm64,
},
IntCond {
opcode: Opcode,
cond: IntCC,
arg: Value,
},
FloatCompare {
opcode: Opcode,
cond: FloatCC,
args: [Value; 2],
},
FloatCond {
opcode: Opcode,
cond: FloatCC,
arg: Value,
},
Jump {
opcode: Opcode,
destination: Ebb,
@@ -162,6 +172,18 @@ pub enum InstructionData {
destination: Ebb,
args: ValueList,
},
BranchInt {
opcode: Opcode,
cond: IntCC,
destination: Ebb,
args: ValueList,
},
BranchFloat {
opcode: Opcode,
cond: FloatCC,
destination: Ebb,
args: ValueList,
},
BranchTable {
opcode: Opcode,
arg: Value,