diff --git a/basis/compiler/cfg/builder/builder-tests.factor b/basis/compiler/cfg/builder/builder-tests.factor index 8da73a1e0e..db0dd65a83 100644 --- a/basis/compiler/cfg/builder/builder-tests.factor +++ b/basis/compiler/cfg/builder/builder-tests.factor @@ -192,14 +192,16 @@ IN: compiler.cfg.builder.tests [ [ ##unbox-alien? ] contains-insn? ] bi ] unit-test -[ f t ] [ - [ { byte-array fixnum } declare alien-cell 4 alien-float ] - [ [ ##box-alien? ] contains-insn? ] - [ [ ##box-float? ] contains-insn? ] bi -] unit-test +\ alien-float "intrinsic" word-prop [ + [ f t ] [ + [ { byte-array fixnum } declare alien-cell 4 alien-float ] + [ [ ##box-alien? ] contains-insn? ] + [ [ ##box-float? ] contains-insn? ] bi + ] unit-test -[ f t ] [ - [ { byte-array fixnum } declare alien-cell { simple-alien } declare 4 alien-float ] - [ [ ##box-alien? ] contains-insn? ] - [ [ ##box-float? ] contains-insn? ] bi -] unit-test \ No newline at end of file + [ f t ] [ + [ { byte-array fixnum } declare alien-cell { simple-alien } declare 4 alien-float ] + [ [ ##box-alien? ] contains-insn? ] + [ [ ##box-float? ] contains-insn? ] bi + ] unit-test +] when \ No newline at end of file diff --git a/basis/math/floats/env/env-tests.factor b/basis/math/floats/env/env-tests.factor index 0c38d69ea9..c1d8913703 100644 --- a/basis/math/floats/env/env-tests.factor +++ b/basis/math/floats/env/env-tests.factor @@ -1,6 +1,7 @@ USING: kernel math math.floats.env math.floats.env.private math.functions math.libm sequences tools.test locals -compiler.units kernel.private fry compiler math.private words ; +compiler.units kernel.private fry compiler math.private words +system ; IN: math.floats.env.tests : set-default-fp-env ( -- ) @@ -29,7 +30,13 @@ set-default-fp-env [ t ] +fp-overflow+ [ 1.0e250 1.0e100 ] [ * ] test-fp-exception-compiled unit-test [ t ] +fp-underflow+ [ 1.0e-250 1.0e-100 ] [ * ] test-fp-exception-compiled unit-test [ t ] +fp-overflow+ [ 2.0 100,000.0 ] [ fpow ] test-fp-exception-compiled unit-test -[ t ] +fp-underflow+ [ 2.0 -100,000.0 ] [ fpow ] test-fp-exception-compiled unit-test + +! No underflow on Linux with this test, just inexact. Reported as an Ubuntu bug: +! https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/429113 +os linux? cpu x86.64? and [ + [ t ] +fp-underflow+ [ 2.0 -100,000.0 ] [ fpow ] test-fp-exception-compiled unit-test +] unless + [ t ] +fp-invalid-operation+ [ 0.0 0.0 ] [ /f ] test-fp-exception-compiled unit-test [ t ] +fp-invalid-operation+ [ -1.0 ] [ fsqrt ] test-fp-exception-compiled unit-test @@ -106,19 +113,19 @@ set-default-fp-env append '[ _ _ with-fp-traps ] ; : test-traps-compiled ( traps inputs quot -- quot' ) - swapd '[ _ [ _ _ with-fp-traps ] compile-call ] ; + swapd '[ @ [ _ _ with-fp-traps ] compile-call ] ; -{ +fp-zero-divide+ } [ 1.0 0.0 ] [ /f ] test-traps must-fail -{ +fp-inexact+ } [ 1.0 3.0 ] [ /f ] test-traps must-fail +{ +fp-zero-divide+ } [ 1.0 0.0 ] [ /f ] test-traps must-fail +{ +fp-inexact+ } [ 1.0 3.0 ] [ /f ] test-traps must-fail { +fp-invalid-operation+ } [ -1.0 ] [ fsqrt ] test-traps must-fail -{ +fp-overflow+ } [ 2.0 ] [ 100,000.0 ^ ] test-traps must-fail -{ +fp-underflow+ } [ 2.0 ] [ -100,000.0 ^ ] test-traps must-fail +{ +fp-overflow+ } [ 2.0 ] [ 100,000.0 ^ ] test-traps must-fail +{ +fp-underflow+ +fp-inexact+ } [ 2.0 ] [ -100,000.0 ^ ] test-traps must-fail -{ +fp-zero-divide+ } [ 1.0 0.0 ] [ /f ] test-traps-compiled must-fail -{ +fp-inexact+ } [ 1.0 3.0 ] [ /f ] test-traps-compiled must-fail +{ +fp-zero-divide+ } [ 1.0 0.0 ] [ /f ] test-traps-compiled must-fail +{ +fp-inexact+ } [ 1.0 3.0 ] [ /f ] test-traps-compiled must-fail { +fp-invalid-operation+ } [ -1.0 ] [ fsqrt ] test-traps-compiled must-fail -{ +fp-overflow+ } [ 2.0 ] [ 100,000.0 ^ ] test-traps-compiled must-fail -{ +fp-underflow+ } [ 2.0 ] [ -100,000.0 ^ ] test-traps-compiled must-fail +{ +fp-overflow+ } [ 2.0 ] [ 100,000.0 ^ ] test-traps-compiled must-fail +{ +fp-underflow+ +fp-inexact+ } [ 2.0 ] [ -100,000.0 ^ ] test-traps-compiled must-fail ! Ensure ordered comparisons raise traps :: test-comparison-quot ( word -- quot ) diff --git a/basis/math/functions/functions-tests.factor b/basis/math/functions/functions-tests.factor index cde1c64f94..7a6da72005 100644 --- a/basis/math/functions/functions-tests.factor +++ b/basis/math/functions/functions-tests.factor @@ -33,9 +33,9 @@ IN: math.functions.tests [ 0.0 ] [ 1.0 log ] unit-test [ 1.0 ] [ e log ] unit-test -[ t ] [ 1 exp e = ] unit-test -[ t ] [ 1.0 exp e = ] unit-test -[ 1.0 ] [ -1 exp e * ] unit-test +[ t ] [ 1 exp e 1.e-10 ~ ] unit-test +[ t ] [ 1.0 exp e 1.e-10 ~ ] unit-test +[ t ] [ -1 exp e * 1.0 1.e-10 ~ ] unit-test [ 1.0 ] [ 0 cosh ] unit-test [ 1.0 ] [ 0.0 cosh ] unit-test diff --git a/extra/benchmark/simd-1/simd-1.factor b/extra/benchmark/simd-1/simd-1.factor index d5576b8cf5..4f57cca0bb 100644 --- a/extra/benchmark/simd-1/simd-1.factor +++ b/extra/benchmark/simd-1/simd-1.factor @@ -25,6 +25,6 @@ IN: benchmark.simd-1 >fixnum make-points [ normalize-points ] [ max-points ] bi print-point ; : main ( -- ) - 5000000 simd-benchmark ; + 10 [ 500000 simd-benchmark ] times ; MAIN: main diff --git a/extra/benchmark/struct-arrays/struct-arrays.factor b/extra/benchmark/struct-arrays/struct-arrays.factor index 799ef2d467..24c3ec965d 100644 --- a/extra/benchmark/struct-arrays/struct-arrays.factor +++ b/extra/benchmark/struct-arrays/struct-arrays.factor @@ -47,6 +47,6 @@ SPECIALIZED-ARRAY: point : struct-array-benchmark ( len -- ) make-points [ normalize-points ] [ max-points ] bi print-point ; -: main ( -- ) 5000000 struct-array-benchmark ; +: main ( -- ) 10 [ 500000 struct-array-benchmark ] times ; MAIN: main