Merge pull request #16392 from Bo98/westmere

os/mac/hardware: use Westmere on >= Ventura
This commit is contained in:
Bo Anderson 2023-12-23 16:45:35 +00:00 committed by GitHub
commit 338d626ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -11,9 +11,11 @@ module Hardware
end end
if CPU.arch == :arm64 if CPU.arch == :arm64
:arm_vortex_tempest :arm_vortex_tempest
# This cannot use a newer CPU e.g. ivybridge because Rosetta 2 does not # This cannot use a newer CPU e.g. haswell because Rosetta 2 does not
# support AVX instructions in bottles: # support AVX instructions in bottles:
# https://github.com/Homebrew/homebrew-core/issues/67713 # https://github.com/Homebrew/homebrew-core/issues/67713
elsif version >= :ventura
:westmere
elsif version >= :mojave elsif version >= :mojave
:nehalem :nehalem
else else

View File

@ -29,10 +29,11 @@ module Hardware
native: arch_flag("native"), native: arch_flag("native"),
ivybridge: "-march=ivybridge", ivybridge: "-march=ivybridge",
sandybridge: "-march=sandybridge", sandybridge: "-march=sandybridge",
westmere: "-march=westmere",
nehalem: "-march=nehalem", nehalem: "-march=nehalem",
core2: "-march=core2", core2: "-march=core2",
core: "-march=prescott", core: "-march=prescott",
arm_vortex_tempest: "", arm_vortex_tempest: "", # TODO: -mcpu=apple-m1 when we've patched all our GCCs to support it
armv6: "-march=armv6", armv6: "-march=armv6",
armv8: "-march=armv8-a", armv8: "-march=armv8-a",
ppc64: "-mcpu=powerpc64", ppc64: "-mcpu=powerpc64",
@ -225,7 +226,7 @@ module Hardware
@target_cpu ||= case (cpu = oldest_cpu) @target_cpu ||= case (cpu = oldest_cpu)
when :core when :core
:prescott :prescott
when :native, :ivybridge, :sandybridge, :nehalem, :core2 when :native, :ivybridge, :sandybridge, :westmere, :nehalem, :core2
cpu cpu
end end
return if @target_cpu.blank? return if @target_cpu.blank?