jmkrauz
5 years ago
committed by
Benjamin Bouvier
2 changed files with 56 additions and 1 deletions
@ -0,0 +1,55 @@ |
|||
test legalizer |
|||
target riscv32 |
|||
|
|||
; regex: V=v\d+ |
|||
|
|||
function %icmp_imm_eq(i64) -> b1 { |
|||
ebb0(v0: i64): |
|||
v1 = icmp_imm eq v0, 0x20202020_10101010 |
|||
return v1 |
|||
} |
|||
; check: ebb0($(v0l=$V): i32, $(v0h=$V): i32, $(link=$V): i32): |
|||
; nextln: $(v2l=$V) -> $(v0l) |
|||
; nextln: $(v2h=$V) -> $(v0h) |
|||
; nextln: v0 = iconcat $(v0l), $(v0h) |
|||
; nextln: $(imm_low=$V) = iconst.i32 0x1010_1010 |
|||
; nextln: $(imm_high=$V) = iconst.i32 0x2020_2020 |
|||
; nextln: $(v3=$V) = icmp eq $(v2l), $(imm_low) |
|||
; nextln: $(v4=$V) = icmp eq $(v2h), $(imm_high) |
|||
; nextln: v1 = band $(v3), $(v4) |
|||
; nextln: return v1, $(link) |
|||
|
|||
function %icmp_imm_ne(i64) -> b1 { |
|||
ebb0(v0: i64): |
|||
v1 = icmp_imm ne v0, 0x33333333_44444444 |
|||
return v1 |
|||
} |
|||
; check: ebb0($(v0l=$V): i32, $(v0h=$V): i32, $(link=$V): i32): |
|||
; nextln: $(v2l=$V) -> $(v0l) |
|||
; nextln: $(v2h=$V) -> $(v0h) |
|||
; nextln: v0 = iconcat $(v0l), $(v0h) |
|||
; nextln: $(imm_low=$V) = iconst.i32 0x4444_4444 |
|||
; nextln: $(imm_high=$V) = iconst.i32 0x3333_3333 |
|||
; nextln: $(v3=$V) = icmp ne $(v2l), $(imm_low) |
|||
; nextln: $(v4=$V) = icmp ne $(v2h), $(imm_high) |
|||
; nextln: v1 = bor $(v3), $(v4) |
|||
; nextln: return v1, $(link) |
|||
|
|||
function %icmp_imm_sge(i64) -> b1 { |
|||
ebb0(v0: i64): |
|||
v1 = icmp_imm sge v0, 0x01020304_05060708 |
|||
return v1 |
|||
} |
|||
; check: ebb0($(v0l=$V): i32, $(v0h=$V): i32, $(link=$V): i32): |
|||
; nextln: $(v2l=$V) -> $(v0l) |
|||
; nextln: $(v2h=$V) -> $(v0h) |
|||
; nextln: v0 = iconcat $(v0l), $(v0h) |
|||
; nextln: $(imm_low=$V) = iconst.i32 0x0506_0708 |
|||
; nextln: $(imm_high=$V) = iconst.i32 0x0102_0304 |
|||
; nextln: $(v3=$V) = icmp sgt $(v2h), $(imm_high) |
|||
; nextln: $(v4=$V) = icmp slt $(v2h), $(imm_high) |
|||
; nextln: $(v5=$V) = icmp uge $(v2l), $(imm_low) |
|||
; nextln: $(v6=$V) = bnot $v4 |
|||
; nextln: $(v7=$V) = band $v6, $v5 |
|||
; nextln: v1 = bor $(v3), $(v7) |
|||
; nextln: return v1, $(link) |
Loading…
Reference in new issue