Files
wasmtime/cranelift/filetests/filetests/runtests/floor.clif
Afonso Bordado 4d2a2cfae6 cranelift: Use cranelift-jit in runtests (#4453)
* cranelift: Use JIT in runtests

Using `cranelift-jit` in run tests allows us to preform relocations and
libcalls. This is important since some instruction lowerings fallback
to libcall's when an extension is missing, or when it's too complicated
to implement manually.

This is also a first step to being able to test `call`'s between functions
in the runtest suite. It should also make it easier to eventually test
TLS relocations, symbol resolution and ABI's.

Another benefit of this is that we also get to test the JIT more, since
it now runs the runtests, and gets some fuzzing via `fuzzgen` (which
uses the `SingleFunctionCompiler`).

This change causes regressions in terms of runtime for the filetests.
I haven't done any serious benchmarking but what I've been seeing is
that it now takes about ~3 seconds to run the testsuite while it
previously took around 2 seconds.

* Add FMA tests for X86
2022-08-09 14:54:25 -07:00

149 lines
4.6 KiB
Plaintext

test interpret
test run
target x86_64
target x86_64 has_sse41=false
target aarch64
target s390x
function %floor_f32(f32) -> f32 {
block0(v0: f32):
v1 = floor v0
return v1
}
; run: %floor_f32(0x0.5) == 0x0.0
; run: %floor_f32(0x1.0) == 0x1.0
; run: %floor_f32(0x1.5) == 0x1.0
; run: %floor_f32(0x2.9) == 0x1.0p1
; run: %floor_f32(0x1.1p10) == 0x1.1p10
; run: %floor_f32(0x1.400000p1) == 0x1.0p1
; run: %floor_f32(0x1.4cccccp0) == 0x1.0
; run: %floor_f32(0x1.800000p0) == 0x1.0
; run: %floor_f32(0x1.b33334p0) == 0x1.0
; run: %floor_f32(0x1.99999ap-2) == 0x0.0
; run: %floor_f32(0x1.333334p-1) == 0x0.0
; run: %floor_f32(0x1.666666p1) == 0x1.0p1
; Negatives
; run: %floor_f32(-0x0.5) == -0x1.0
; run: %floor_f32(-0x1.0) == -0x1.0
; run: %floor_f32(-0x1.5) == -0x1.0p1
; run: %floor_f32(-0x2.9) == -0x1.8p1
; run: %floor_f32(-0x1.1p10) == -0x1.1p10
; run: %floor_f32(-0x1.333334p-1) == -0x1.0
; run: %floor_f32(-0x1.99999ap-2) == -0x1.0
; run: %floor_f32(-0x1.4cccccp0) == -0x1.0p1
; run: %floor_f32(-0x1.800000p0) == -0x1.0p1
; run: %floor_f32(-0x1.b33334p0) == -0x1.0p1
; run: %floor_f32(-0x1.400000p1) == -0x1.8p1
; run: %floor_f32(-0x1.666666p1) == -0x1.8p1
; Specials
; run: %floor_f32(0x0.0) == 0x0.0
; run: %floor_f32(-0x0.0) == -0x0.0
; run: %floor_f32(+Inf) == +Inf
; run: %floor_f32(-Inf) == -Inf
; F32 Epsilon / Max / Min Positive
; run: %floor_f32(0x1.000000p-23) == 0x0.0
; run: %floor_f32(0x1.fffffep127) == 0x1.fffffep127
; run: %floor_f32(0x1.000000p-126) == 0x0.0
; F32 Subnormals
; run: %floor_f32(0x0.800000p-126) == 0x0.0
; run: %floor_f32(-0x0.800002p-126) == -0x1.0
; F32 NaN's
; For NaN's this operation is specified as producing a value that is a NaN
function %floor_is_nan_f32(f32) -> i32 {
block0(v0: f32):
v1 = floor v0
v2 = fcmp ne v1, v1
v3 = bint.i32 v2
return v3
}
; run: %floor_is_nan_f32(+NaN) == 1
; run: %floor_is_nan_f32(-NaN) == 1
; run: %floor_is_nan_f32(+NaN:0x0) == 1
; run: %floor_is_nan_f32(+NaN:0x1) == 1
; run: %floor_is_nan_f32(+NaN:0x300001) == 1
; run: %floor_is_nan_f32(-NaN:0x0) == 1
; run: %floor_is_nan_f32(-NaN:0x1) == 1
; run: %floor_is_nan_f32(-NaN:0x300001) == 1
; run: %floor_is_nan_f32(+sNaN:0x1) == 1
; run: %floor_is_nan_f32(-sNaN:0x1) == 1
; run: %floor_is_nan_f32(+sNaN:0x200001) == 1
; run: %floor_is_nan_f32(-sNaN:0x200001) == 1
function %floor_f64(f64) -> f64 {
block0(v0: f64):
v1 = floor v0
return v1
}
; run: %floor_f64(0x0.5) == 0x0.0
; run: %floor_f64(0x1.0) == 0x1.0
; run: %floor_f64(0x1.5) == 0x1.0
; run: %floor_f64(0x2.9) == 0x1.0p1
; run: %floor_f64(0x1.1p10) == 0x1.1p10
; run: %floor_f64(0x1.4000000000000p1) == 0x1.0p1
; run: %floor_f64(0x1.4cccccccccccdp0) == 0x1.0
; run: %floor_f64(0x1.8000000000000p0) == 0x1.0
; run: %floor_f64(0x1.b333333333333p0) == 0x1.0
; run: %floor_f64(0x1.999999999999ap-2) == 0x0.0
; run: %floor_f64(0x1.3333333333333p-1) == 0x0.0
; run: %floor_f64(0x1.6666666666666p1) == 0x1.0p1
; Negatives
; run: %floor_f64(-0x0.5) == -0x1.0
; run: %floor_f64(-0x1.0) == -0x1.0
; run: %floor_f64(-0x1.5) == -0x1.0p1
; run: %floor_f64(-0x2.9) == -0x1.8p1
; run: %floor_f64(-0x1.1p10) == -0x1.1p10
; run: %floor_f64(-0x1.3333333333333p-1) == -0x1.0
; run: %floor_f64(-0x1.999999999999ap-2) == -0x1.0
; run: %floor_f64(-0x1.4cccccccccccdp0) == -0x1.0p1
; run: %floor_f64(-0x1.8000000000000p0) == -0x1.0p1
; run: %floor_f64(-0x1.b333333333333p0) == -0x1.0p1
; run: %floor_f64(-0x1.4000000000000p1) == -0x1.8p1
; run: %floor_f64(-0x1.6666666666666p1) == -0x1.8p1
; Specials
; run: %floor_f64(0x0.0) == 0x0.0
; run: %floor_f64(-0x0.0) == -0x0.0
; run: %floor_f64(+Inf) == +Inf
; run: %floor_f64(-Inf) == -Inf
; F64 Epsilon / Max / Min Positive
; run: %floor_f64(0x1.0000000000000p-52) == 0x0.0
; run: %floor_f64(0x1.fffffffffffffp1023) == 0x1.fffffffffffffp1023
; run: %floor_f64(0x1.0000000000000p-1022) == 0x0.0
; F64 Subnormals
; run: %floor_f64(0x0.8000000000000p-1022) == 0x0.0
; run: %floor_f64(-0x0.8000000000000p-1022) == -0x1.0
; F64 NaN's
; For NaN's this operation is specified as producing a value that is a NaN
function %floor_is_nan_f64(f64) -> i32 {
block0(v0: f64):
v1 = floor v0
v2 = fcmp ne v1, v1
v3 = bint.i32 v2
return v3
}
; run: %floor_is_nan_f64(+NaN) == 1
; run: %floor_is_nan_f64(-NaN) == 1
; run: %floor_is_nan_f64(+NaN:0x0) == 1
; run: %floor_is_nan_f64(+NaN:0x1) == 1
; run: %floor_is_nan_f64(+NaN:0x4000000000001) == 1
; run: %floor_is_nan_f64(-NaN:0x0) == 1
; run: %floor_is_nan_f64(-NaN:0x1) == 1
; run: %floor_is_nan_f64(-NaN:0x4000000000001) == 1
; run: %floor_is_nan_f64(+sNaN:0x1) == 1
; run: %floor_is_nan_f64(-sNaN:0x1) == 1
; run: %floor_is_nan_f64(+sNaN:0x4000000000001) == 1
; run: %floor_is_nan_f64(-sNaN:0x4000000000001) == 1