This affects the comparison instructions which now read "icmp ult a, b". This mimics LLVM's style and makes it simpler to add instruction flags in the future, such as "load v1" -> "load aligned v1". These enumerated operands and flags feel like opcode modifiers rather than value operands, so displaying them differently makes sense. Value and numeric operands are still comma separated.
33 lines
801 B
Plaintext
33 lines
801 B
Plaintext
; Test the legalization of i32 instructions that don't have RISC-V versions.
|
|
test legalizer
|
|
|
|
set is_64bit=0
|
|
isa riscv supports_m=1
|
|
|
|
set is_64bit=1
|
|
isa riscv supports_m=1
|
|
|
|
; regex: V=vx?\d+
|
|
|
|
function carry_out(i32, i32) -> i32, b1 {
|
|
ebb0(v1: i32, v2: i32):
|
|
v3, v4 = iadd_cout v1, v2
|
|
return v3, v4
|
|
}
|
|
; check: $v3 = iadd $v1, $v2
|
|
; check: $(cout=$V) = icmp ult $v3, $v1
|
|
; It's possible the legalizer will rewrite these value aliases in the future.
|
|
; check: $v4 -> $cout
|
|
; check: return $v3, $v4
|
|
|
|
; Expanding illegal immediate constants.
|
|
; Note that at some point we'll probably expand the iconst as well.
|
|
function large_imm(i32) -> i32 {
|
|
ebb0(v0: i32):
|
|
v1 = iadd_imm v0, 1000000000
|
|
return v1
|
|
}
|
|
; check: $(cst=$V) = iconst.i32 0x3b9a_ca00
|
|
; check: $v1 = iadd $v0, $cst
|
|
; check: return $v1
|