Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2009-10-01 11:59:17 -05:00
commit be110afe27
2 changed files with 11 additions and 15 deletions

View File

@ -397,13 +397,13 @@ M: ppc %alien-cell LWZ ;
M: ppc %alien-float LFS ; M: ppc %alien-float LFS ;
M: ppc %alien-double LFD ; M: ppc %alien-double LFD ;
M: ppc %set-alien-integer-1 swapd STB ; M: ppc %set-alien-integer-1 -rot STB ;
M: ppc %set-alien-integer-2 swapd STH ; M: ppc %set-alien-integer-2 -rot STH ;
M: ppc %set-alien-cell swapd STW ; M: ppc %set-alien-cell -rot STW ;
M: ppc %set-alien-float swapd STFS ; M: ppc %set-alien-float -rot STFS ;
M: ppc %set-alien-double swapd STFD ; M: ppc %set-alien-double -rot STFD ;
: load-zone-ptr ( reg -- ) : load-zone-ptr ( reg -- )
"nursery" %load-vm-field-addr ; "nursery" %load-vm-field-addr ;

View File

@ -7,6 +7,7 @@ math.vectors.specialization parser prettyprint.custom sequences
sequences.private strings words definitions macros cpu.architecture sequences.private strings words definitions macros cpu.architecture
namespaces arrays quotations combinators sets layouts ; namespaces arrays quotations combinators sets layouts ;
QUALIFIED-WITH: alien.c-types c QUALIFIED-WITH: alien.c-types c
QUALIFIED: math.private
IN: math.vectors.simd.functor IN: math.vectors.simd.functor
ERROR: bad-length got expected ; ERROR: bad-length got expected ;
@ -16,8 +17,8 @@ MACRO: simd-boa ( rep class -- simd-array )
: can-be-unboxed? ( type -- ? ) : can-be-unboxed? ( type -- ? )
{ {
{ c:float [ t ] } { c:float [ \ math.private:float+ "intrinsic" word-prop ] }
{ c:double [ t ] } { c:double [ \ math.private:float+ "intrinsic" word-prop ] }
[ c:heap-size cell < ] [ c:heap-size cell < ]
} case ; } case ;
@ -37,7 +38,7 @@ MACRO: simd-boa ( rep class -- simd-array )
: simd-with ( rep class x -- simd-array ) : simd-with ( rep class x -- simd-array )
[ rep-components ] [ new ] [ '[ _ ] ] tri* swap replicate-as ; inline [ rep-components ] [ new ] [ '[ _ ] ] tri* swap replicate-as ; inline
: simd-with-fast? ( rep -- ? ) : simd-with/nth-fast? ( rep -- ? )
[ \ (simd-vshuffle) supported-simd-op? ] [ \ (simd-vshuffle) supported-simd-op? ]
[ rep-component-type can-be-unboxed? ] [ rep-component-type can-be-unboxed? ]
bi and ; bi and ;
@ -45,16 +46,11 @@ MACRO: simd-boa ( rep class -- simd-array )
:: define-with-custom-inlining ( word rep class -- ) :: define-with-custom-inlining ( word rep class -- )
word [ word [
drop drop
rep simd-with-fast? [ rep simd-with/nth-fast? [
[ rep rep-coerce rep (simd-with) class boa ] [ rep rep-coerce rep (simd-with) class boa ]
] [ word def>> ] if ] [ word def>> ] if
] "custom-inlining" set-word-prop ; ] "custom-inlining" set-word-prop ;
: simd-nth-fast? ( rep -- ? )
[ \ (simd-vshuffle) supported-simd-op? ]
[ rep-component-type can-be-unboxed? ]
bi and ;
: simd-nth-fast ( rep -- quot ) : simd-nth-fast ( rep -- quot )
[ rep-components ] keep [ rep-components ] keep
'[ swap _ '[ _ _ (simd-select) ] 2array ] map-index '[ swap _ '[ _ _ (simd-select) ] 2array ] map-index
@ -64,7 +60,7 @@ MACRO: simd-boa ( rep class -- simd-array )
rep-component-type dup c:c-type-getter-boxer c:array-accessor ; rep-component-type dup c:c-type-getter-boxer c:array-accessor ;
MACRO: simd-nth ( rep -- x ) MACRO: simd-nth ( rep -- x )
dup simd-nth-fast? [ simd-nth-fast ] [ simd-nth-slow ] if ; dup simd-with/nth-fast? [ simd-nth-fast ] [ simd-nth-slow ] if ;
: boa-effect ( rep n -- effect ) : boa-effect ( rep n -- effect )
[ rep-components ] dip * [ rep-components ] dip *