[commit: ghc] master: If -msse is specified, pass it to the LLVM backend (571ecdd)
Johan Tibell
johan.tibell at gmail.com
Fri Jan 18 00:11:45 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/571ecdd84d3d619b45d0413da2424f56b8e857f7
>---------------------------------------------------------------
commit 571ecdd84d3d619b45d0413da2424f56b8e857f7
Author: Johan Tibell <johan.tibell at gmail.com>
Date: Thu Jan 17 13:18:44 2013 -0800
If -msse is specified, pass it to the LLVM backend
>---------------------------------------------------------------
compiler/main/DriverPipeline.hs | 7 ++++++-
compiler/main/DynFlags.hs | 4 ++++
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index b128c1f..f14bfbe 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1436,7 +1436,8 @@ runPhase LlvmLlc input_fn dflags
++ map SysTools.Option lc_opts
++ [SysTools.Option tbaa]
++ map SysTools.Option fpOpts
- ++ map SysTools.Option abiOpts)
+ ++ map SysTools.Option abiOpts
+ ++ map SysTools.Option sseOpts)
return (next_phase, output_fn)
where
@@ -1462,6 +1463,10 @@ runPhase LlvmLlc input_fn dflags
ArchARM ARMv7 _ _ -> []
_ -> []
+ sseOpts | isSse4_2Enabled dflags = ["-mattr=+sse42"]
+ | isSse2Enabled dflags = ["-mattr=+sse2"]
+ | otherwise = []
+
-----------------------------------------------------------------------------
-- LlvmMangle phase
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index bead9ad..e2f10c7 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3410,6 +3410,10 @@ makeDynFlagsConsistent dflags
-- -----------------------------------------------------------------------------
-- SSE
+-- TODO: Instead of using a separate predicate (i.e. isSse2Enabled) to
+-- check if SSE is enabled, we might have x86-64 imply the -msse2
+-- flag.
+
isSse2Enabled :: DynFlags -> Bool
isSse2Enabled dflags = case platformArch (targetPlatform dflags) of
ArchX86_64 -> -- SSE2 is fixed on for x86_64. It would be
More information about the ghc-commits
mailing list