]> gitweb.factorcode.org Git - factor.git/commitdiff
math.vectors.simd: slightly faster 'sum' on 256-bit vectors: add the two components...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 4 Sep 2009 07:23:25 +0000 (02:23 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 4 Sep 2009 07:23:25 +0000 (02:23 -0500)
basis/math/vectors/simd/functor/functor.factor
basis/math/vectors/simd/simd-docs.factor
basis/math/vectors/simd/simd.factor

index 1ed7cf7df74175de507c9f8d6d655034a877ba69..cabb731fefbfba55d9a3dcb24efd733f0bbb6ed4 100644 (file)
@@ -140,10 +140,8 @@ INSTANCE: A sequence
     [ [ [ underlying2>> ] bi@ A-rep ] dip call ] 3bi
     \ A boa ; inline
 
-: A-v->n-op ( v1 quot scalar-quot -- v2 )
-    [
-        [ [ underlying1>> A-rep ] dip call ]
-        [ [ underlying2>> A-rep ] dip call ] 2bi
-    ] dip call ; inline
+: A-v->n-op ( v1 combine-quot reduce-quot -- v2 )
+    [ [ [ underlying1>> ] [ underlying2>> ] bi A-rep ] dip call A-rep ]
+    dip call ; inline
 
 ;FUNCTOR
index 400f677341f19bd1775962bbdf8a884e96a38999..f535595833a24c116a1b0a6dd335ebac656b233b 100644 (file)
@@ -139,7 +139,7 @@ M\ actor advance optimized.">
 <" USE: compiler.tree.debugger
 
 M\ actor advance test-mr mr.">
-} ;
+"An example of a high-performance algorithm that uses SIMD primitives can be found in the " { $vocab-link "benchmark.nbody-simd" } " vocabulary." } ;
 
 ARTICLE: "math.vectors.simd.intrinsics" "Low-level SIMD primitives"
 "The words in the " { $vocab-link "math.vectors.simd.intrinsics" } " vocabulary are used to implement SIMD support. These words have three disadvantages compared to the higher-level " { $link "math-vectors" } " words:"
index ee49503863dacb2657a60df350894d38623d8e20..a7de12d140138e7e0afa4a533633e9899dad4c2d 100644 (file)
@@ -174,7 +174,7 @@ PRIVATE>
     { v/ [ [ (simd-v/) ] double-4-vv->v-op ] }
     { vmin [ [ (simd-vmin) ] double-4-vv->v-op ] }
     { vmax [ [ (simd-vmax) ] double-4-vv->v-op ] }
-    { sum [ [ (simd-sum) ] [ + ] double-4-v->n-op ] }
+    { sum [ [ (simd-v+) ] [ (simd-sum) ] double-4-v->n-op ] }
 } simd-vector-words
 
 >>