Enable -msse to be specified by itself.

This sets the SSE "version" to 1.0.
parent d2b95264
......@@ -220,7 +220,7 @@ processOneArg opt_kind rest arg args
Just min <- parseInt min_s -> Right (f maj min, args)
| [maj_s] <- split '.' rest_no_eq,
Just maj <- parseInt maj_s -> Right (f maj 0, args)
| otherwise -> Left ("malformed version argument in " ++ dash_arg)
| otherwise -> Right (f 1 0, args)
findArg :: [Flag m] -> String -> Maybe (String, OptKind m)
......
......@@ -1414,6 +1414,7 @@ runPhase (RealPhase LlvmLlc) input_fn dflags
sseOpts | isSse4_2Enabled dflags = ["-mattr=+sse42"]
| isSse2Enabled dflags = ["-mattr=+sse2"]
| isSseEnabled dflags = ["-mattr=+sse"]
| otherwise = []
avxOpts | isAvx512fEnabled dflags = ["-mattr=+avx512f"]
......@@ -2033,12 +2034,10 @@ doCpp dflags raw input_fn output_fn = do
-- remember, in code we *compile*, the HOST is the same our TARGET,
-- and BUILD is the same as our HOST.
let sse2 = isSse2Enabled dflags
sse4_2 = isSse4_2Enabled dflags
sse_defs =
[ "-D__SSE__=1" | sse2 || sse4_2 ] ++
[ "-D__SSE2__=1" | sse2 || sse4_2 ] ++
[ "-D__SSE4_2__=1" | sse4_2 ]
let sse_defs =
[ "-D__SSE__=1" | isSseEnabled dflags ] ++
[ "-D__SSE2__=1" | isSse2Enabled dflags ] ++
[ "-D__SSE4_2__=1" | isSse4_2Enabled dflags ]
let avx_defs =
[ "-D__AVX__=1" | isAvxEnabled dflags ] ++
......
......@@ -129,6 +129,7 @@ module DynFlags (
unsafeGlobalDynFlags, setUnsafeGlobalDynFlags,
-- * SSE and AVX
isSseEnabled,
isSse2Enabled,
isSse4_2Enabled,
isAvxEnabled,
......@@ -3617,6 +3618,12 @@ setUnsafeGlobalDynFlags = writeIORef v_unsafeGlobalDynFlags
-- check if SSE is enabled, we might have x86-64 imply the -msse2
-- flag.
isSseEnabled :: DynFlags -> Bool
isSseEnabled dflags = case platformArch (targetPlatform dflags) of
ArchX86_64 -> True
ArchX86 -> sseVersion dflags >= Just (1,0)
_ -> False
isSse2Enabled :: DynFlags -> Bool
isSse2Enabled dflags = case platformArch (targetPlatform dflags) of
ArchX86_64 -> -- SSE2 is fixed on for x86_64. It would be
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment