Skip to content

Commit

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

flag no-msse4.2
description: Instruct GHC to *not* use -msse4.2. Typical use is for older
architectures to use unordered-containers. Expect performance
regressions on newer architectures.
default: False


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

ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
if flag(no-msse4.2)
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 e153ffb

Please sign in to comment.