118 lines
2.9 KiB
Plaintext
118 lines
2.9 KiB
Plaintext
test legalizer
|
|
set enable_simd
|
|
target x86_64 skylake
|
|
|
|
function %ineg_i32x4() -> b1 {
|
|
; check: const0 = 0x00000001000000010000000100000001
|
|
; nextln: const1 = 0x00000000000000000000000000000000
|
|
block0:
|
|
v0 = vconst.i32x4 [1 1 1 1]
|
|
v2 = ineg v0
|
|
; check: v5 = vconst.i32x4 const1
|
|
; nextln: v2 = isub v5, v0
|
|
|
|
v3 = extractlane v2, 0
|
|
v4 = icmp_imm eq v3, -1
|
|
|
|
return v4
|
|
}
|
|
|
|
function %ineg_legalized() {
|
|
; check: const0 = 0x00000000000000000000000000000000
|
|
block0:
|
|
v0 = vconst.i8x16 0x00
|
|
v1 = ineg v0
|
|
; check: v6 = vconst.i8x16 const0
|
|
; nextln: v1 = isub v6, v0
|
|
|
|
v2 = raw_bitcast.i16x8 v0
|
|
v3 = ineg v2
|
|
; check: v7 = vconst.i16x8 const0
|
|
; nextln: v3 = isub v7, v2
|
|
|
|
v4 = raw_bitcast.i64x2 v0
|
|
v5 = ineg v4
|
|
; check: v8 = vconst.i64x2 const0
|
|
; nextln: v5 = isub v8, v4
|
|
|
|
return
|
|
}
|
|
|
|
function %fneg_legalized() {
|
|
; check: const2 = 0xffffffffffffffffffffffffffffffff
|
|
block0:
|
|
v0 = vconst.f32x4 [0x1.0 0x2.0 0x3.0 0x4.0]
|
|
v1 = fneg v0
|
|
; check: v4 = vconst.i32x4 const2
|
|
; nextln: v5 = ishl_imm v4, 31
|
|
; nextln: v6 = raw_bitcast.f32x4 v5
|
|
; nextln: v1 = bxor v0, v6
|
|
|
|
v2 = vconst.f64x2 [0x1.0 0x2.0]
|
|
v3 = fneg v2
|
|
; check: v7 = vconst.i64x2 const2
|
|
; nextln: v8 = ishl_imm v7, 63
|
|
; nextln: v9 = raw_bitcast.f64x2 v8
|
|
; nextln: v3 = bxor v2, v9
|
|
|
|
return
|
|
}
|
|
|
|
function %fabs_legalized() {
|
|
; check: const1 = 0xffffffffffffffffffffffffffffffff
|
|
block0:
|
|
v0 = vconst.f64x2 [0x1.0 -0x2.0]
|
|
v1 = fabs v0
|
|
; check: v2 = vconst.i64x2 const1
|
|
; nextln: v3 = ushr_imm v2, 1
|
|
; nextln: v4 = raw_bitcast.f64x2 v3
|
|
; nextln: v1 = band v0, v4
|
|
return
|
|
}
|
|
|
|
function %imul_i64x2(i64x2, i64x2) {
|
|
block0(v0:i64x2, v1:i64x2):
|
|
v2 = imul v0, v1
|
|
; check: v3 = ushr_imm v0, 32
|
|
; nextln: v4 = x86_pmuludq v3, v1
|
|
; nextln: v5 = ushr_imm v1, 32
|
|
; nextln: v6 = x86_pmuludq v5, v0
|
|
; nextln: v7 = iadd v4, v6
|
|
; nextln: v8 = ishl_imm v7, 32
|
|
; nextln: v9 = x86_pmuludq v0, v1
|
|
; nextln: v2 = iadd v9, v8
|
|
return
|
|
}
|
|
|
|
function %fmin_f32x4(f32x4, f32x4) {
|
|
block0(v0:f32x4, v1:f32x4):
|
|
v2 = fmin v0, v1
|
|
; check: v3 = x86_fmin v0, v1
|
|
; nextln: v4 = x86_fmin v1, v0
|
|
; nextln: v5 = bor v4, v3
|
|
; nextln: v6 = fcmp uno v3, v5
|
|
; nextln: v7 = raw_bitcast.f32x4 v6
|
|
; nextln: v8 = bor v5, v7
|
|
; nextln: v9 = raw_bitcast.i32x4 v7
|
|
; nextln: v10 = ushr_imm v9, 10
|
|
; nextln: v11 = raw_bitcast.f32x4 v10
|
|
; nextln: v2 = band_not v8, v11
|
|
return
|
|
}
|
|
|
|
function %fmax_f64x2(f64x2, f64x2) {
|
|
block0(v0:f64x2, v1:f64x2):
|
|
v2 = fmax v0, v1
|
|
; check: v3 = x86_fmax v0, v1
|
|
; nextln: v4 = x86_fmax v1, v0
|
|
; nextln: v5 = bxor v3, v4
|
|
; nextln: v6 = bor v4, v5
|
|
; nextln: v7 = fsub v6, v5
|
|
; nextln: v8 = fcmp uno v5, v7
|
|
; nextln: v9 = raw_bitcast.i64x2 v8
|
|
; nextln: v10 = ushr_imm v9, 13
|
|
; nextln: v11 = raw_bitcast.f64x2 v10
|
|
; nextln: v2 = band_not v7, v11
|
|
return
|
|
}
|