Skip to content
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

os/mac/hardware: use Westmere on >= Ventura #16392

Merged
merged 1 commit into from Dec 23, 2023
Merged

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Dec 23, 2023

Although we can't use anything with AVX in order to support Rosetta (similar to how Apple also avoid AVX in their own tools), we can do a minor bump to Westmere which adds CLMUL instructions that Rosetta 2 supports.

Not much of a difference to Nehalem, but it's something.

nehalem: "-march=nehalem",
core2: "-march=core2",
core: "-march=prescott",
arm_vortex_tempest: "",
arm_vortex_tempest: "", # TODO: -mcpu=apple-m1 when we've patched all our GCCs to support it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some earlier versions of Xcode may barf on this too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of LLVM: added in LLVM 13, though we don't support versioned LLVM as a compiler yet.

That would equate to Xcode 13.3 but it's very possible Apple had it in their internal Clang earlier. If we find any of Xcode 12.2-13.2 don't support it, we could probably swap it on shim level to -mcpu=apple-a13 or something (not quite the same but close enough). We don't support 12.2-12.4 in the CLT so we could drop that on the Xcode side should -mcpu=apple-m1 only be a problem there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, Apple clang supported the flag earlier than upstream LLVM did IIRC. ("earlier" in a corresponding upstream LLVM version sense -- I think it was the latest released version of Xcode when upstream LLVM 13 dropped.)

NBD to enable this flag as-is as soon as we have sufficient GCC support -- we can fix any problems that come up as they emerge.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked Apple's OSS LLVM fork but it wasn't there prior to it landing in LLVM so it seems they kept it in their private builds initially.

I can easily test with some CLT versions when the time arrives. The ones to test really are Xcode/CLT 12.2, 12.5 and 13.0 as those are the main big Clang branches, narrowing down further if necessary.

@Bo98 Bo98 merged commit 338d626 into Homebrew:master Dec 23, 2023
23 of 24 checks passed
@Bo98 Bo98 deleted the westmere branch December 23, 2023 16:45
@MikeMcQuaid
Copy link
Member

Thanks again @Bo98!

@github-actions github-actions bot added the outdated PR was locked due to age label Jan 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants