fix sporadic "fall-through in cond" failure in float math.vectors.simd tests

db4
Joe Groff 2009-10-17 16:54:51 -05:00
parent 11e89b016d
commit b9d2c068a4
1 changed files with 7 additions and 11 deletions

View File

@ -193,22 +193,18 @@ CONSTANT: simd-classes
'[ first2 inputs _ _ check-vector-op ] '[ first2 inputs _ _ check-vector-op ]
] dip check-optimizer ; inline ] dip check-optimizer ; inline
: approx= ( x y -- ? ) : (approx=) ( x y -- ? )
{ {
{ [ 2dup [ fp-nan? ] both? ] [ 2drop t ] } { [ 2dup [ fp-nan? ] both? ] [ 2drop t ] }
{ [ 2dup [ fp-nan? ] either? ] [ 2drop f ] }
{ [ 2dup [ fp-infinity? ] either? ] [ fp-bitwise= ] }
{ [ 2dup [ float? ] both? ] [ -1.e8 ~ ] } { [ 2dup [ float? ] both? ] [ -1.e8 ~ ] }
{ [ 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?
] }
} cond ; } cond ;
: approx= ( x y -- ? )
2dup [ sequence? ] both?
[ [ (approx=) ] 2all? ] [ (approx=) ] if ;
: exact= ( x y -- ? ) : exact= ( x y -- ? )
{ {
{ [ 2dup [ float? ] both? ] [ fp-bitwise= ] } { [ 2dup [ float? ] both? ] [ fp-bitwise= ] }