patch applied (ghc): Implement SSE2 floating-point support in the
x86 native code generator (#594)
Simon Marlow
marlowsd at gmail.com
Thu Feb 4 07:50:51 EST 2010
Thu Feb 4 02:48:49 PST 2010 Simon Marlow <marlowsd at gmail.com>
* Implement SSE2 floating-point support in the x86 native code generator (#594)
The new flag -msse2 enables code generation for SSE2 on x86. It
results in substantially faster floating-point performance; the main
reason for doing this was that our x87 code generation is appallingly
bad, and since we plan to drop -fvia-C soon, we need a way to generate
half-decent floating-point code.
The catch is that SSE2 is only available on CPUs that support it (P4+,
AMD K8+). We'll have to think hard about whether we should enable it
by default for the libraries we ship. In the meantime, at least
-msse2 should be an acceptable replacement for "-fvia-C
-optc-ffast-math -fexcess-precision".
SSE2 also has the advantage of performing all operations at the
correct precision, so floating-point results are consistent with other
platforms.
I also tweaked the x87 code generation a bit while I was here, now
it's slighlty less bad than before.
M ./compiler/main/DynFlags.hs +4
M ./compiler/nativeGen/PPC/Ppr.hs +1
M ./compiler/nativeGen/PPC/Regs.hs -23 +6
M ./compiler/nativeGen/Reg.hs +5
M ./compiler/nativeGen/RegAlloc/Graph/Main.hs -15 +3
M ./compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs -2 +16
M ./compiler/nativeGen/RegClass.hs +3
M ./compiler/nativeGen/SPARC/Instr.hs +3
M ./compiler/nativeGen/SPARC/Ppr.hs +1
M ./compiler/nativeGen/SPARC/Regs.hs -7 +7
M ./compiler/nativeGen/X86/CodeGen.hs -412 +380
M ./compiler/nativeGen/X86/Instr.hs -61 +27
M ./compiler/nativeGen/X86/Ppr.hs -43 +50
M ./compiler/nativeGen/X86/RegInfo.hs -16 +18
M ./compiler/nativeGen/X86/Regs.hs -165 +78
M ./docs/users_guide/flags.xml +8
M ./docs/users_guide/using.xml -1 +19
View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20100204104849-12142-a1cb7bcdfb7ec0aec38f612fad44ad0ab6dab294.gz
More information about the Cvs-ghc
mailing list