Skip to content

Commit e153ffb

Browse files
author
doyougnu
committed
cabal: add no-msse4.2 flag
- Closes haskell-unordered-containers#464
1 parent 259dc9e commit e153ffb

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

unordered-containers.cabal

+16-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ flag debug
4242
description: Enable debug support
4343
default: False
4444

45+
flag no-msse4.2
46+
description: Instruct GHC to *not* use -msse4.2. Typical use is for older
47+
architectures to use unordered-containers. Expect performance
48+
regressions on newer architectures.
49+
default: False
50+
51+
4552
library
4653
exposed-modules:
4754
Data.HashMap.Internal
@@ -69,7 +76,15 @@ library
6976
MagicHash,
7077
BangPatterns
7178

72-
ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
79+
if flag(no-msse4.2)
80+
ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
81+
else
82+
-- only enable flag on x86
83+
if arch(i386) || arch(x86_64)
84+
ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans -msse4.2
85+
else
86+
-- else, get whatever GHC gives you
87+
ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
7388

7489
-- For dumping the generated code:
7590
-- ghc-options: -ddump-simpl -ddump-stg-final -ddump-cmm -ddump-asm -ddump-to-file

0 commit comments

Comments
 (0)