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
}

View File

@@ -24,8 +24,8 @@ ebb0:
; check: v16, v17 = iadd_ifcout v12, v14
; check: v18 = iadd_ifcin v13, v15, v17
; check: v11 = iconcat v16, v18
; check: v4 = uextend.i128 v11
; check: v19, v20 = isplit v4
; check: v21, v22 = isplit v19
; check: v23, v24 = isplit v20
; check: return v21, v22, v23, v24
; check: v20 = iconst.i32 0
; check: v21 = iconst.i32 0
; check: v19 = iconcat v20, v21
; check: v4 = iconcat v11, v19
; check: return v16, v18, v20, v21