Add x86 SIMD floating-point absolute value

This commit is contained in:
Andrew Brown
2019-11-11 12:47:01 -08:00
parent 1f17e35e95
commit 91d29c09d0
3 changed files with 43 additions and 0 deletions

View File

@@ -49,3 +49,14 @@ ebb0:
return
}
function %fabs_legalized() {
ebb0:
v0 = vconst.f64x2 [0x1.0 -0x2.0]
v1 = fabs v0
; check: v2 = vconst.i64x2 0xffffffffffffffffffffffffffffffff
; nextln: v3 = ushr_imm v2, 1
; nextln: v4 = raw_bitcast.f64x2 v3
; nextln: v1 = band v0, v4
return
}

View File

@@ -239,3 +239,16 @@ ebb0:
return v4
}
; run
function %fabs_f32x4() -> b1 {
ebb0:
v0 = vconst.f32x4 [0x0.0 -0x1.0 0x2.0 -0x3.0]
v1 = fabs v0
v2 = vconst.f32x4 [0x0.0 0x1.0 0x2.0 0x3.0]
v3 = fcmp eq v1, v2
v4 = vall_true v3
return v4
}
; run