]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 23 Sep 2009 15:11:49 +0000 (10:11 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 23 Sep 2009 15:11:49 +0000 (10:11 -0500)
Conflicts:
basis/math/vectors/simd/simd-docs.factor

1  2 
basis/math/vectors/simd/simd-docs.factor
basis/specialized-arrays/specialized-arrays-tests.factor

index d35f8589b61d0924f21cab366587810e90a56c5f,02ed7f5ff8e0d197f8be4dbb6466fbe44254625b..5153b0c6f48de28bb0378ee6d1d4241af6158422
@@@ -1,5 -1,5 +1,5 @@@
 -USING: help.markup help.syntax help.vocabs sequences math
 -math.vectors multiline kernel.private classes.tuple.private
 +USING: help.markup help.syntax sequences math math.vectors
- kernel.private classes.tuple.private
++classes.tuple.private
  math.vectors.simd.intrinsics cpu.architecture ;
  IN: math.vectors.simd
  
@@@ -79,11 -87,13 +87,13 @@@ SYMBOLS: x y 
      double-4{ 1.5 2.0 3.7 0.4 } x set
      double-4{ 1.5 2.0 3.7 0.4 } y set
      x get y get v+
 -] optimizer-report."> }
 +] optimizer-report.""" }
  "The following word benefits from SIMD optimization, because it begins with an unsafe declaration:"
  { $code
 -<" USING: compiler.tree.debugger kernel.private
 +"""USING: compiler.tree.debugger kernel.private
  math.vectors math.vectors.simd ;
+ SIMD: float-4
+ IN: simd-demo
  
  : interpolate ( v a b -- w )
      { float-4 float-4 float-4 } declare
  $nl
  "Here is a better version of the " { $snippet "interpolate" } " words above that uses hints:"
  { $code
 -<" USING: compiler.tree.debugger hints
 +"""USING: compiler.tree.debugger hints
  math.vectors math.vectors.simd ;
+ SIMD: float-4
+ IN: simd-demo
  
  : interpolate ( v a b -- w )
      [ v* ] [ [ 1.0 ] dip n-v v* ] bi-curry* bi v+ ;
@@@ -109,7 -121,8 +121,8 @@@ $n
  $nl
  "In the " { $snippet "interpolate" } " word, there is still a call to the " { $link <tuple-boa> } " primitive, because the return value at the end is being boxed on the heap. In the next example, no memory allocation occurs at all because the SIMD vectors are stored inside a struct class (see " { $link "classes.struct" } "); also note the use of inlining:"
  { $code
 -<" USING: compiler.tree.debugger math.vectors math.vectors.simd ;
 +"""USING: compiler.tree.debugger math.vectors math.vectors.simd ;
+ SIMD: float-4
  IN: simd-demo
  
  STRUCT: actor