diff options
author | Johan Tibell <johan.tibell@gmail.com> | 2013-01-10 15:30:21 -0800 |
---|---|---|
committer | Johan Tibell <johan.tibell@gmail.com> | 2013-01-10 15:30:21 -0800 |
commit | bab8dc7925a374ef91df3bca3d9a2aa9755212e1 (patch) | |
tree | 6fd1d42e1c62bba11d9f23880822ea85d5d1ee2e /compiler/nativeGen | |
parent | ccd8c6f00d6a4ebb2f11383aaff1d444a66131b4 (diff) | |
download | haskell-bab8dc7925a374ef91df3bca3d9a2aa9755212e1.tar.gz |
Add preprocessor defines when SSE is enabled
This will add the following preprocessor defines when Haskell source
files are compiled:
* __SSE__ - If any version of SSE is enabled
* __SSE2__ - If SSE2 or greater is enabled
* __SSE4_2_ - If SSE4.2 is enabled
Note that SSE2 is enabled by default on x86-64.
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r-- | compiler/nativeGen/X86/CodeGen.hs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs index 30cf060e74..d01470926b 100644 --- a/compiler/nativeGen/X86/CodeGen.hs +++ b/compiler/nativeGen/X86/CodeGen.hs @@ -71,20 +71,12 @@ is32BitPlatform = do sse2Enabled :: NatM Bool sse2Enabled = do dflags <- getDynFlags - case platformArch (targetPlatform dflags) of - ArchX86_64 -> -- SSE2 is fixed on for x86_64. It would be - -- possible to make it optional, but we'd need to - -- fix at least the foreign call code where the - -- calling convention specifies the use of xmm regs, - -- and possibly other places. - return True - ArchX86 -> return (gopt Opt_SSE2 dflags || gopt Opt_SSE4_2 dflags) - _ -> panic "sse2Enabled: Not an X86* arch" + return (isSse2Enabled dflags) sse4_2Enabled :: NatM Bool sse4_2Enabled = do dflags <- getDynFlags - return (gopt Opt_SSE4_2 dflags) + return (isSse4_2Enabled dflags) if_sse2 :: NatM a -> NatM a -> NatM a if_sse2 sse2 x87 = do |