]> gitweb.factorcode.org Git - factor.git/commitdiff
cpu.x86: enable bit-count intrinsic if POPCNT available
authorJoe Groff <arcata@gmail.com>
Sat, 15 May 2010 21:00:12 +0000 (14:00 -0700)
committerJoe Groff <arcata@gmail.com>
Sat, 15 May 2010 21:00:12 +0000 (14:00 -0700)
basis/cpu/x86/x86.factor

index 66610c9349ca4a1c460dae635a1d874eeb7ba8c5..b1c5836bf8869d26957d715e1ce1cc3a4782e626 100644 (file)
@@ -1534,9 +1534,10 @@ enable-float-min/max
 enable-fsqrt
 
 : check-sse ( -- )
-    [ { (sse-version) } compile ] with-optimizer
+    [ { (sse-version) (popcnt?) } compile ] with-optimizer
     sse-version 20 < [
         "Factor requires SSE2, which your CPU does not support." print
         flush
         1 exit
-    ] when ;
+    ] when
+    popcnt? [ enable-bit-count ] when ;