Hello Dan,

Friday, February 20, 2009, 5:39:25 PM, you wrote:

> Not that I'd be sad if GHC could reduce that whole constant at compile time,
> but GCC isn't doing 1 billion adds in 6 (or even 60) milliseconds.

yes, that's what was done actually:

  22 0020 8D44D01C              leal    28(%eax,%edx,8), %eax
  23 0024 83C208                addl    $8, %edx

so, i rechecked with multiplies:

mult.hs      12.667
mult-fast.hs  2.512
mult.cpp      0.938

and xors:

mult.hs      12.605
mult-fast.hs  1.856
xor.cpp       0.339


-- 
Best regards,
 Bulat                            mailto:bulat.zigans...@gmail.com

Attachment: xor.hs
Description: Binary data

Attachment: xor-fast.hs
Description: Binary data

Attachment: xor.cpp
Description: Binary data

Attachment: mult.cpp
Description: Binary data

Attachment: mult.hs
Description: Binary data

Attachment: mult-fast.hs
Description: Binary data

Attachment: sum-fast.hs
Description: Binary data

Attachment: sum.cpp
Description: Binary data

Attachment: sum.hs
Description: Binary data

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to