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
hardware: use Nehalem flags on >= Sierra. #5429
hardware: use Nehalem flags on >= Sierra. #5429
Conversation
See my comment at #5425 (comment) |
To restate myself: yes, they could be but that's unnecessarily reducing the targeted CPU. |
These timing results are all on Linux. My apologies for omitting that important detail. No similar change in compiler occurred on Linux in that time. |
It sounds as though changing the default to |
I’m open to a follow up PR before this lands in a tag that builds everything from source for those people with unsupported configurations (by us or Apple) but I personally would recommend waiting for an actual user report. |
@claui On your Penryn system, could you please try changing brew/Library/Homebrew/hardware.rb Line 10 in a2b4d4a
to core2: "-march=nehalem -msse4.2", and |
@sjackman Thanks, I’m on it. Will report back in a few minutes. |
@sjackman It prints |
For completeness: I tried |
@sjackman On disassembling the Any idea on how to trick the compiler into using one of the SSE4.2 instructions? |
You'd need to find a software app that uses one of the SSE 4.2 instructions. |
Adapted from https://docs.microsoft.com/en-us/previous-versions/bb531394(v=vs.120):
The actual CRC32 intrinsic is SSE4.2. The |
@fredemmott Thanks for the code! As expected, your example bails with
@MikeMcQuaid Fair enough. Building from source should be acceptable. (It’s not that users of Penryn Macs are exactly reaching for the stars anyway.) Bottles built for SSE4.2, however, are going to break stuff for those people left and right so I’m definitely going to look into that follow-up PR.
After
This is due to
You’re right, and I stand corrected. In fact, I’ve been convinced since I learned there was a 5 – 10 % improvement and more on the table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said earlier: a 5 – 10 % improvement would have been significant enough to change my mind, and warrant abandoning Penryn. Actually, we’re even dealing with 2×(ish) improvement for real-life workloads so I’ve changed my mind to 👍 of course.
Fallout needs to be mitigated in a separate PR in time before the next tag is cut.
Thanks for review, folks. |
Thanks for the change, Mike. I'd like to do something similar for Linux. I'll think on it. |
@sjackman That will need something to avoid bottles being used in that case. Personally I'm unsure whether that would be worth it for the Linuxbrew case given how diverse the systems are in comparison to macOS. |
Linux's bottle tag is currently |
Is there support in recipes for “bottle requires $ARCH, automatically build from source on older CPUs”? That would be nice for Linux from a usability perspective |
@fredemmott If there's no bottle it'll be built from source so: yep 👍 |
I don’t use Linuxbrew, but just to be sure: AIUI macOS bottles are keyed by OS, not microarchitecture; this is different for Linux? |
We build only a single bottle on Linux. Those bottles currently require x86_64 ≥ Core2 (Penryn) and glibc ≥ 2.23, which can be installed by Linuxbrew if the host's glibc is older. On Linux we could build for multiple microarchitectures, but do not currently. |
See https://en.wikipedia.org/wiki/MacOS_Sierra#System_requirements.
While we're here, copy Hackintosh comment from ENV/std to ENV/super so it's more
obvious that this change won't break those Hackintoshes.
Fixes #5425.
CC @claui @sjackman @fredemmott
brew style
with your changes locally?brew tests
with your changes locally?