]> gitweb.factorcode.org Git - factor.git/commitdiff
fix sporadic "fall-through in cond" failure in float math.vectors.simd tests
authorJoe Groff <arcata@gmail.com>
Sat, 17 Oct 2009 21:54:51 +0000 (16:54 -0500)
committerJoe Groff <arcata@gmail.com>
Sat, 17 Oct 2009 21:54:51 +0000 (16:54 -0500)
basis/math/vectors/simd/simd-tests.factor

index 71ad09e002b2cc30d709c6d6fafb26a9c156fe05..8d0b88c39379c50314e9e405659dd878c584ee3b 100644 (file)
@@ -193,22 +193,18 @@ CONSTANT: simd-classes
         '[ first2 inputs _ _ check-vector-op ]
     ] dip check-optimizer ; inline
 
-: approx= ( x y -- ? )
+: (approx=) ( x y -- ? )
     {
         { [ 2dup [ fp-nan? ] both? ] [ 2drop t ] }
-        { [ 2dup [ float? ] both? ] [ -1.e8 ~ ] }
+        { [ 2dup [ fp-nan? ] either? ] [ 2drop f ] }
         { [ 2dup [ fp-infinity? ] either? ] [ fp-bitwise= ] }
-        { [ 2dup [ sequence? ] both? ] [
-            [
-                {
-                    { [ 2dup [ fp-nan? ] both? ] [ 2drop t ] }
-                    { [ 2dup [ fp-infinity? ] either? ] [ fp-bitwise= ] }
-                    { [ 2dup [ fp-nan? ] either? not ] [ -1.e8 ~ ] }
-                } cond
-            ] 2all?
-        ] }
+        { [ 2dup [ float? ] both? ] [ -1.e8 ~ ] }
     } cond ;
 
+: approx= ( x y -- ? )
+    2dup [ sequence? ] both?
+    [ [ (approx=) ] 2all? ] [ (approx=) ] if ;
+
 : exact= ( x y -- ? )
     {
         { [ 2dup [ float? ] both? ] [ fp-bitwise= ] }