From c38d523185d74da370b8428447c69ce08c452a7e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 25 Sep 2009 21:44:14 -0500 Subject: [PATCH] math.vectors: fix SIMD unit tests --- basis/math/vectors/simd/simd-tests.factor | 10 +++++++--- basis/math/vectors/vectors.factor | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/basis/math/vectors/simd/simd-tests.factor b/basis/math/vectors/simd/simd-tests.factor index 535a671359..f7c051fdce 100644 --- a/basis/math/vectors/simd/simd-tests.factor +++ b/basis/math/vectors/simd/simd-tests.factor @@ -81,9 +81,13 @@ CONSTANT: simd-classes : check-optimizer ( seq inputs quot eq-quot -- ) '[ @ - [ "print-mr" get [ nip test-mr mr. ] [ 2drop ] if ] - [ [ call ] dip call ] - [ [ call ] dip compile-call ] 2tri @ not + { + [ "print-mr" get [ nip test-mr mr. ] [ 2drop ] if ] + [ "print-checks" get [ [ . ] bi@ ] [ 2drop ] if ] + [ [ call ] dip call ] + [ [ call ] dip compile-call ] + } 2cleave + @ not ] filter ; inline "== Checking -new constructors" print diff --git a/basis/math/vectors/vectors.factor b/basis/math/vectors/vectors.factor index 1bd202f2ad..e3e4f51e28 100644 --- a/basis/math/vectors/vectors.factor +++ b/basis/math/vectors/vectors.factor @@ -61,8 +61,8 @@ PRIVATE> : vbitor ( u v -- w ) over '[ _ [ bitor ] fp-bitwise-op ] 2map ; : vbitxor ( u v -- w ) over '[ _ [ bitxor ] fp-bitwise-op ] 2map ; -: vlshift ( u n -- w ) HEX: ff bitand '[ _ shift ] map ; -: vrshift ( u n -- w ) HEX: ff bitand neg '[ _ shift ] map ; +: vlshift ( u n -- w ) HEX: ffffffff bitand '[ _ shift ] map ; +: vrshift ( u n -- w ) HEX: ffffffff bitand neg '[ _ shift ] map ; : vfloor ( u -- v ) [ floor ] map ; : vceiling ( u -- v ) [ ceiling ] map ;