Skip to content

Commit

Permalink
cabal: add no-msse4.2 flag
Browse files Browse the repository at this point in the history
- Closes #464
  • Loading branch information
doyougnu committed Sep 12, 2023
1 parent 259dc9e commit 1c9160a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion unordered-containers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ flag debug
description: Enable debug support
default: False

flag noMsse42
description: Instruct GHC to *not* use -msse4.2. Typical use case is to allow
older architectures to use unordered-containers. Only relevant
for x86; expect performance regressions on newer architectures
when enabled.
default: False


library
exposed-modules:
Data.HashMap.Internal
Expand Down Expand Up @@ -69,7 +77,15 @@ library
MagicHash,
BangPatterns

ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
if flag(noMsse42)
ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
else
-- only enable flag on x86
if arch(i386) || arch(x86_64)
ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans -msse4.2
else
-- else, get whatever GHC gives you
ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans

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

0 comments on commit 1c9160a

Please sign in to comment.