inline alien-vector and set-alien-vector if SIMD is not available for a small speedup

db4
Slava Pestov 2009-09-08 13:56:17 -05:00
parent 82a8ef7beb
commit 1e5bc3b376
2 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors byte-arrays combinators
USING: accessors byte-arrays combinators fry
compiler.tree.propagation.info cpu.architecture kernel words math
math.intervals math.vectors.simd.intrinsics ;
IN: compiler.tree.propagation.simd
@ -40,3 +40,13 @@ IN: compiler.tree.propagation.simd
] "outputs" set-word-prop
\ alien-vector { byte-array } "default-output-classes" set-word-prop
! If SIMD is not available, inline alien-vector and set-alien-vector
! to get a speedup
: inline-unless-intrinsic ( word -- )
dup '[ drop _ dup "intrinsic" word-prop [ drop f ] [ def>> ] if ]
"custom-inlining" set-word-prop ;
\ alien-vector inline-unless-intrinsic
\ set-alien-vector inline-unless-intrinsic

View File

@ -67,7 +67,7 @@ M: double-rep reg-class-of drop float-regs ;
M: vector-rep reg-class-of drop float-regs ;
M: stack-params reg-class-of drop stack-params ;
GENERIC: rep-size ( rep -- n )
GENERIC: rep-size ( rep -- n ) foldable
M: tagged-rep rep-size drop cell ;
M: int-rep rep-size drop cell ;