improve error reporting of failing simd fallbacks

db4
Joe Groff 2009-10-16 16:28:53 -05:00
parent 21b289e836
commit dd6308ead5
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ sequences sets effects accessors namespaces
lexer parser vocabs.parser words arrays math.vectors ; lexer parser vocabs.parser words arrays math.vectors ;
IN: math.vectors.simd.intrinsics IN: math.vectors.simd.intrinsics
ERROR: bad-simd-call ; ERROR: bad-simd-call word ;
<< <<
@ -24,7 +24,7 @@ V{ } clone simd-ops set-global
: (SIMD-OP:) ( accum quot -- accum ) : (SIMD-OP:) ( accum quot -- accum )
[ [
scan-word dup name>> "(simd-" ")" surround create-in scan-word dup name>> "(simd-" ")" surround create-in
[ nip [ bad-simd-call ] define ] [ nip dup '[ _ bad-simd-call ] define ]
] dip ] dip
'[ _ dip set-stack-effect ] '[ _ dip set-stack-effect ]
[ 2array simd-ops get push ] [ 2array simd-ops get push ]
@ -147,7 +147,7 @@ GENERIC# supported-simd-op? 1 ( rep intrinsic -- ? )
cc> %compare-vector-reps [ int-vector-rep? ] filter cc> %compare-vector-reps [ int-vector-rep? ] filter
%xor-vector-reps [ float-vector-rep? ] filter %xor-vector-reps [ float-vector-rep? ] filter
union union
{ uchar-16-rep ushort-8-rep uint-4-rep ulonglong-2-rep } union ; [ { } ] [ { uchar-16-rep ushort-8-rep uint-4-rep ulonglong-2-rep } union ] if-empty ;
: (%shuffle-imm-reps) ( -- reps ) : (%shuffle-imm-reps) ( -- reps )
%shuffle-vector-reps %shuffle-vector-imm-reps union ; %shuffle-vector-reps %shuffle-vector-imm-reps union ;

View File

@ -394,10 +394,10 @@ simd-classes [
[ [ declaration declare vany? [ yes ] [ no ] if ] compile-call ] [ [ declaration declare vany? [ yes ] [ no ] if ] compile-call ]
[ [ declaration declare vall? [ yes ] [ no ] if ] compile-call ] tri ; inline [ [ declaration declare vall? [ yes ] [ no ] if ] compile-call ] tri ; inline
SYMBOL: !!inconsistent!! TUPLE: inconsistent-vector-test bool branch ;
: ?inconsistent ( a b -- ab/inconsistent ) : ?inconsistent ( bool branch -- ?/inconsistent )
2dup = [ drop ] [ 2drop !!inconsistent!! ] if ; 2dup = [ drop ] [ inconsistent-vector-test boa ] if ;
:: test-vector-tests ( vector decl -- none? any? all? ) :: test-vector-tests ( vector decl -- none? any? all? )
vector decl test-vector-tests-bool :> bool-all :> bool-any :> bool-none vector decl test-vector-tests-bool :> bool-all :> bool-any :> bool-none