Legalize uextend and sextend to 128bit ints

This commit is contained in:
bjorn3
2019-11-16 16:25:57 +01:00
committed by Andrew Brown
parent 0b7e7916bd
commit c5e74986e1
5 changed files with 100 additions and 7 deletions

View File

@@ -0,0 +1,26 @@
test run
target x86_64
function u0:0() -> b1 {
ebb0:
v0 = iconst.i64 0xffff_ffff_eeee_0000
v1 = uextend.i128 v0
v2, v3 = isplit v1
v4 = icmp_imm eq v2, 0xffff_ffff_eeee_0000
v5 = icmp_imm eq v3, 0
v6 = band v4, v5
return v6
}
; run
function u0:1() -> b1 {
ebb0:
v0 = iconst.i64 0xffff_ffff_eeee_0000
v1 = sextend.i128 v0
v2, v3 = isplit v1
v4 = icmp_imm eq v2, 0xffff_ffff_eeee_0000
v5 = icmp_imm eq v3, 0xffff_ffff_ffff_ffff
v6 = band v4, v5
return v6
}
; run

View File

@@ -0,0 +1,37 @@
test compile
target x86_64
function u0:0() -> b1 {
ebb0:
v0 = iconst.i64 0xffff_ffff_eeee_0000
; check: v0 = iconst.i64 0xffff_ffff_eeee_0000
; nextln: v2 -> v0
v1 = uextend.i128 v0
; nextln: v7 = iconst.i64 0
; nextln: v3 -> v7
; nextln: v1 = iconcat v0, v7
v2, v3 = isplit v1
v4 = icmp_imm eq v2, 0xffff_ffff_eeee_0000
v5 = icmp_imm eq v3, 0
v6 = band v4, v5
return v6
}
function u0:1() -> b1 {
ebb0:
v0 = iconst.i64 0xffff_ffff_eeee_0000
; check: v0 = iconst.i64 0xffff_ffff_eeee_0000
; nextln: v2 -> v0
v1 = sextend.i128 v0
; nextln: v8 = copy v0
; nextln: v7 = sshr_imm v8, 63
; nextln: v3 -> v7
v2, v3 = isplit v1
v4 = icmp_imm eq v2, 0xffff_ffff_eeee_0000
v5 = icmp_imm eq v3, 0xffff_ffff_ffff_ffff
v6 = band v4, v5
return v6
}