diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb index 24eaf7b20d66e..c23a06e8245da 100644 --- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb @@ -28,7 +28,7 @@ def family when "GenuineIntel" intel_family(cpu_family, cpu_model) when "AuthenticAMD" - amd_family(cpu_family) + amd_family(cpu_family, cpu_model) end || unknown end @@ -87,7 +87,7 @@ def intel_family(family, cpu_model) end end - def amd_family(family) + def amd_family(family, cpu_model) case family when 0x06 :amd_k7 @@ -106,9 +106,21 @@ def amd_family(family) when 0x16 :jaguar when 0x17 - :zen + case cpu_model + when 0x10..0x2f + :zen + when 0x30..0x3f, 0x47, 0x60..0x7f, 0x84..0x87, 0x90..0xaf + :zen2 + end when 0x19 - :zen3 + case cpu_model + when ..0x0f, 0x20..0x5f + :zen3 + when 0x10..0x1f, 0x60..0x7f, 0xa0..0xaf + :zen4 + end + when 0x1a + :zen5 end end diff --git a/Library/Homebrew/test/hardware/cpu_spec.rb b/Library/Homebrew/test/hardware/cpu_spec.rb index a8c11bb31ebff..093b579eef349 100644 --- a/Library/Homebrew/test/hardware/cpu_spec.rb +++ b/Library/Homebrew/test/hardware/cpu_spec.rb @@ -21,6 +21,7 @@ describe "::family" do let(:cpu_families) do [ + :alderlake, :amd_k7, :amd_k8, :amd_k8_k10_hybrid, @@ -38,6 +39,7 @@ :arm_twister, :arm_typhoon, :arm_vortex_tempest, + :arrowlake, :atom, :bobcat, :broadwell, @@ -47,6 +49,7 @@ :core, :core2, :dothan, + :graniterapids, :haswell, :icelake, :ivybridge, @@ -54,15 +57,22 @@ :kabylake, :merom, :nehalem, + :pantherlake, :penryn, :ppc, :prescott, :presler, + :rocketlake, :sandybridge, + :sapphirerapids, :skylake, + :tigerlake, :westmere, :zen, + :zen2, :zen3, + :zen4, + :zen5, :dunno, ] end