Add x86 implementation of fcvt_from_sint

This commit is contained in:
Andrew Brown
2020-03-06 19:10:00 -08:00
parent ec90509387
commit 444d021ede
4 changed files with 33 additions and 0 deletions

View File

@@ -9,3 +9,9 @@ block0:
[-, %xmm2] v2 = raw_bitcast.i32x4 v1 ; bin:
return
}
function %fcvt_32(i32x4) {
block0(v0: i32x4 [%xmm6]):
[-, %xmm2] v1 = fcvt_from_sint.f32x4 v0 ; bin: 40 0f 5b d6
return
}

View File

@@ -0,0 +1,14 @@
test run
set enable_simd
function %fcvt_from_sint() -> b1 {
block0:
v0 = vconst.i32x4 [-1 0 1 123456789]
v1 = fcvt_from_sint.f32x4 v0
v2 = vconst.f32x4 [-0x1.0 0.0 0x1.0 0x75bcd18.0] ; 123456789 rounds to 123456792.0, an error of 3
v3 = fcmp eq v1, v2
v4 = vall_true v3
return v4
}
; run