haskell-unordered-containers / unordered-containers

Efficient hashing-based container types
BSD 3-Clause "New" or "Revised" License
221 stars 97 forks source link

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

Open doyougnu opened 1 year ago

doyougnu commented 1 year ago

closes #464.

I didn't test this locally so we'll see what CI says.

Also I assumed this would be in a new minor release so I added that to the CHANGE.md file but did not change the versioning in the cabal file

phadej commented 11 months ago

I'd suggest OP use some global version of ghc-options: -msse4.2, rather than adding it to individual packages. Adding to packages doesn't scale. I opened a GHC issue https://gitlab.haskell.org/ghc/ghc/-/issues/24073

TeofilC commented 5 months ago

unordered-containers is quite inlining heavy, eg, I often see lookups inlined quite heavily when looking at Core. If the popcount call ends up being inlined when compiling another package (that isn't passed -msse4.2) will this flag still apply?

phadej commented 5 months ago

@TeofilC

will this flag still apply?

Good question. I think it wont, as at Core level (i.e. in unfoldings to be inlined) we only have magic popCount# primop, and the code generation happens later.