Skip to content

Commit

Permalink
Merge pull request #18743 from Homebrew/linux-cpus
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab authored Nov 9, 2024
2 parents 3b40ab6 + 017c8d0 commit 645ff44
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Library/Homebrew/extend/os/linux/hardware/cpu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def family
return :dunno unless intel?

# See https://software.intel.com/en-us/articles/intel-architecture-and-processor-identification-with-cpuid-model-and-family-numbers
# and https://github.com/llvm-mirror/llvm/blob/HEAD/lib/Support/Host.cpp
# and https://github.com/llvm/llvm-project/blob/main/llvm/lib/TargetParser/Host.cpp
# and https://en.wikipedia.org/wiki/List_of_Intel_CPU_microarchitectures#Roadmap
vendor_id = cpuinfo[/^vendor_id\s*: (.*)/, 1]
cpu_family = cpuinfo[/^cpu family\s*: ([0-9]+)/, 1].to_i
Expand All @@ -42,7 +42,7 @@ def intel_family(family, cpu_model)
:sandybridge
when 0x25, 0x2c, 0x2f
:westmere
when 0x1e, 0x1a, 0x2e
when 0x1a, 0x1e, 0x1f, 0x2e
:nehalem
when 0x17, 0x1d
:penryn
Expand All @@ -56,12 +56,26 @@ def intel_family(family, cpu_model)
:haswell
when 0x3d, 0x47, 0x4f, 0x56
:broadwell
when 0x4e, 0x55, 0x5e, 0x8e, 0x9e
when 0x4e, 0x5e, 0x8e, 0x9e, 0xa5, 0xa6
:skylake
when 0x66
:cannonlake
when 0x6a, 0x6c, 0x7d, 0x7e
:icelake
when 0xa7
:rocketlake
when 0x8c, 0x8d
:tigerlake
when 0x97, 0x9a, 0xbe, 0xb7, 0xba, 0xbf, 0xaa, 0xac
:alderlake
when 0xc5, 0xb5, 0xc6, 0xbd
:arrowlake
when 0xcc
:pantherlake
when 0xad, 0xae
:graniterapids
when 0xcf, 0x8f
:sapphirerapids
end
when 0x0f
case cpu_model
Expand Down

0 comments on commit 645ff44

Please sign in to comment.