Add an icmp_imm instruction.
Compare a scalar integer to an immediate constant. Both Intel and RISC-V ISAs have this operation. This requires the addition of a new IntCompareImm instruction format.
This commit is contained in:
@@ -54,14 +54,14 @@ function icmp(i32, i32) {
|
||||
ebb0(vx0: i32, vx1: i32):
|
||||
v0 = icmp eq, vx0, vx1
|
||||
v1 = icmp ult, vx0, vx1
|
||||
v2 = icmp sge, vx0, vx1
|
||||
v2 = icmp_imm sge, vx0, -12
|
||||
v3 = irsub_imm vx1, 45
|
||||
}
|
||||
; sameln: function icmp(i32, i32) {
|
||||
; nextln: ebb0(vx0: i32, vx1: i32):
|
||||
; nextln: v0 = icmp eq, vx0, vx1
|
||||
; nextln: v1 = icmp ult, vx0, vx1
|
||||
; nextln: v2 = icmp sge, vx0, vx1
|
||||
; nextln: v2 = icmp_imm sge, vx0, -12
|
||||
; nextln: v3 = irsub_imm vx1, 45
|
||||
; nextln: }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user