Add x86 legalization for SIMD ineg

This commit is contained in:
Andrew Brown
2019-09-18 10:50:01 -07:00
parent ca1df499a0
commit ba393afd4d
5 changed files with 77 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
test run
test binemit
test legalizer
set enable_simd
target x86_64 skylake
@@ -85,3 +86,37 @@ ebb0(v0: i8x16 [%xmm3], v1: i8x16 [%xmm4]):
[-, %xmm3] v2 = isub v0, v1 ; bin: 66 0f f8 dc
return v2
}
function %ineg_i32x4() -> b1 {
ebb0:
v0 = vconst.i32x4 [1 1 1 1]
v2 = ineg v0
; check: v5 = vconst.i32x4 0x00
; nextln: v2 = isub v5, v0
v3 = extractlane v2, 0
v4 = icmp_imm eq v3, -1
return v4 ; bin: c3
}
; run
function %ineg_legalized() {
ebb0:
v0 = vconst.i8x16 0x00
v1 = ineg v0
; check: v6 = vconst.i8x16 0x00
; nextln: v1 = isub v6, v0
v2 = raw_bitcast.i16x8 v0
v3 = ineg v2
; check: v7 = vconst.i16x8 0x00
; nextln: v3 = isub v7, v2
v4 = raw_bitcast.i64x2 v0
v5 = ineg v4
; check: v8 = vconst.i64x2 0x00
; nextln: v5 = isub v8, v4
return ; bin: c3
}