summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc/Graph/Main.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-02-04 10:48:49 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-02-04 10:48:49 +0000
commit335b9f366ac440259318777c4c07e4fa42fbbec6 (patch)
tree6eaa6bee7a0af467c18ed1d42eb47b38c52a9169 /compiler/nativeGen/RegAlloc/Graph/Main.hs
parentd9f7177402769968e8f42b49c1941661e18c5773 (diff)
downloadhaskell-335b9f366ac440259318777c4c07e4fa42fbbec6.tar.gz
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.
Diffstat (limited to 'compiler/nativeGen/RegAlloc/Graph/Main.hs')
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Main.hs18
1 files changed, 3 insertions, 15 deletions
diff --git a/compiler/nativeGen/RegAlloc/Graph/Main.hs b/compiler/nativeGen/RegAlloc/Graph/Main.hs
index 5fa771cfb8..35ec879eb2 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Main.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Main.hs
@@ -380,25 +380,13 @@ seqNode node
`seq` (seqVirtualRegList (uniqSetToList (Color.nodeCoalesce node)))
seqVirtualReg :: VirtualReg -> ()
-seqVirtualReg reg
- = case reg of
- VirtualRegI _ -> ()
- VirtualRegHi _ -> ()
- VirtualRegF _ -> ()
- VirtualRegD _ -> ()
+seqVirtualReg reg = reg `seq` ()
seqRealReg :: RealReg -> ()
-seqRealReg reg
- = case reg of
- RealRegSingle _ -> ()
- RealRegPair _ _ -> ()
+seqRealReg reg = reg `seq` ()
seqRegClass :: RegClass -> ()
-seqRegClass c
- = case c of
- RcInteger -> ()
- RcFloat -> ()
- RcDouble -> ()
+seqRegClass c = c `seq` ()
seqMaybeRealReg :: Maybe RealReg -> ()
seqMaybeRealReg mr