]> gitweb.factorcode.org Git - factor.git/commitdiff
break vector conversion intrinsics off to a math.vectors.conversion.backend vocab...
authorJoe Groff <arcata@gmail.com>
Wed, 7 Oct 2009 02:28:33 +0000 (21:28 -0500)
committerJoe Groff <arcata@gmail.com>
Wed, 7 Oct 2009 02:28:33 +0000 (21:28 -0500)
basis/math/vectors/conversion/backend/backend.factor [new file with mode: 0644]
basis/math/vectors/conversion/conversion.factor
basis/math/vectors/simd/functor/functor.factor
basis/math/vectors/simd/intrinsics/intrinsics.factor
basis/math/vectors/specialization/specialization.factor

diff --git a/basis/math/vectors/conversion/backend/backend.factor b/basis/math/vectors/conversion/backend/backend.factor
new file mode 100644 (file)
index 0000000..d47fab1
--- /dev/null
@@ -0,0 +1,21 @@
+! (c)Joe Groff bsd license
+USING: accessors alien.c-types arrays assocs classes combinators
+cords fry kernel math math.vectors sequences ;
+IN: math.vectors.conversion.backend
+
+: saturate-map-as ( v quot result -- w )
+    [ element-type '[ @ _ c-type-clamp ] ] keep map-as ; inline
+
+: (v>float) ( i to-type -- f )
+    [ >float ] swap new map-as ;
+: (v>integer) ( f to-type -- i )
+    [ >integer ] swap new map-as ;
+: (vpack-signed) ( a b to-type -- ab )
+    [ cord-append [ ] ] dip new saturate-map-as ;
+: (vpack-unsigned) ( a b to-type -- ab )
+    [ cord-append [ ] ] dip new saturate-map-as ;
+: (vunpack-head) ( ab to-type -- a )
+    [ dup length 2 /i head-slice ] dip new like ;
+: (vunpack-tail) ( ab to-type -- b )
+    [ dup length 2 /i tail-slice ] dip new like ;
+
index 7f09e50498c39dddf7a887bd73a934d228ee702d..863cb9fea51684f7ee32f1cd1d309e4185be5a87 100644 (file)
@@ -1,7 +1,7 @@
 ! (c)Joe Groff bsd license
 USING: accessors alien.c-types arrays assocs classes combinators
 combinators.short-circuit cords fry kernel locals math
-math.vectors sequences ;
+math.vectors math.vectors.conversion.backend sequences ;
 FROM: alien.c-types => char uchar short ushort int uint longlong ulonglong float double ;
 IN: math.vectors.conversion
 
@@ -10,22 +10,6 @@ ERROR: bad-vconvert-input value expected-type ;
 
 <PRIVATE
 
-: saturate-map-as ( v quot result -- w )
-    [ element-type '[ @ _ c-type-clamp ] ] keep map-as ; inline
-
-: (v>float) ( i to-type -- f )
-    [ >float ] swap new map-as ;
-: (v>integer) ( f to-type -- i )
-    [ >integer ] swap new map-as ;
-: (vpack-signed) ( a b to-type -- ab )
-    [ cord-append [ ] ] dip new saturate-map-as ;
-: (vpack-unsigned) ( a b to-type -- ab )
-    [ cord-append [ ] ] dip new saturate-map-as ;
-: (vunpack-head) ( ab to-type -- a )
-    [ dup length 2 /i head-slice ] dip new like ;
-: (vunpack-tail) ( ab to-type -- b )
-    [ dup length 2 /i tail-slice ] dip new like ;
-
 : float-type? ( c-type -- ? )
     { float double } memq? ;
 : unsigned-type? ( c-type -- ? )
index efdddc16e0745f0d2276ad471c0ea597eed5b23f..15e37bbcd9e253288b9426679de80c13effbf64f 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors assocs byte-arrays classes classes.algebra effects fry
 functors generalizations kernel literals locals math math.functions
 math.vectors math.vectors.private math.vectors.simd.intrinsics
-math.vectors.conversion math.vectors.conversion.private
+math.vectors.conversion.backend
 math.vectors.specialization parser prettyprint.custom sequences
 sequences.private strings words definitions macros cpu.architecture
 namespaces arrays quotations combinators combinators.short-circuit sets
index 6f0bea3b9899e60a1886f661a00d63ba9a6c6a35..ee15c8d997c96c0ec128cdd72e83e3a5ab429125 100644 (file)
@@ -3,7 +3,7 @@
 USING: alien alien.c-types alien.data assocs combinators
 cpu.architecture compiler.cfg.comparisons fry generalizations
 kernel libc macros math
-math.vectors.conversion math.vectors.conversion.private
+math.vectors.conversion.backend
 sequences effects accessors namespaces
 lexer parser vocabs.parser words arrays math.vectors ;
 IN: math.vectors.simd.intrinsics
index fd76b005c6aa6bcee138d47c8df2d379a357654d..be959a2a2e202b92f0176b2e81581d4673641a71 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: words kernel make sequences effects sets kernel.private
 accessors combinators math math.intervals math.vectors
-math.vectors.conversion math.vectors.conversion.private
+math.vectors.conversion.backend
 namespaces assocs fry splitting classes.algebra generalizations
 locals compiler.tree.propagation.info ;
 IN: math.vectors.specialization