Skip to content

u-c: cabal: add no-msse4.2 flag, enable -msse4.2 as default on x86 architectures #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [0.2.19.2] – September 2023

* [By default pass `-msse4.2` on x86 architectures](https://github.com/haskell-unordered-containers/unordered-containers/pull/483)

[0.2.19.2]: https://github.com/haskell-unordered-containers/unordered-containers/compare/v0.2.19.1...v0.2.19.2

## [0.2.19.1] – April 2022

* [Fix bug in `intersection[With[Key]]`](https://github.com/haskell-unordered-containers/unordered-containers/pull/427)
Expand Down
11 changes: 11 additions & 0 deletions 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 sse42
description: Instruct GHC to use -msse4.2. Disable this to allow
older architectures to use unordered-containers. Only relevant
for x86; expect performance regressions on newer architectures
when disabled.
default: True
manual: True

library
exposed-modules:
Data.HashMap.Internal
Expand Down Expand Up @@ -70,6 +78,9 @@ library
BangPatterns

ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
if flag(sse42) && arch(x86_64)
-- only enable flag on x86
ghc-options: -msse4.2

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