| ... | @@ -74,6 +74,7 @@ pub fn detectNativeCpuAndFeatures(arch: Target.Cpu.Arch) Target.Cpu { | ... | @@ -74,6 +74,7 @@ pub fn detectNativeCpuAndFeatures(arch: Target.Cpu.Arch) Target.Cpu { |
| 74 | if (switch (vendor) { | 74 | if (switch (vendor) { |
| 75 | 0x756e6547 => detectIntelProcessor(&cpu, family, model, brand_id), | 75 | 0x756e6547 => detectIntelProcessor(&cpu, family, model, brand_id), |
| 76 | 0x68747541 => detectAmdProcessor(&cpu, family, model), | 76 | 0x68747541 => detectAmdProcessor(&cpu, family, model), |
| | 77 | 0x6f677948 => detectHygonProcessor(family, model), |
| 77 | else => null, | 78 | else => null, |
| 78 | }) |m| b: { | 79 | }) |m| b: { |
| 79 | // Some hypervisors are evil liars and will operate in long mode while identifying as a | 80 | // Some hypervisors are evil liars and will operate in long mode while identifying as a |
| ... | @@ -217,6 +218,19 @@ fn detectAmdProcessor(cpu: *const Target.Cpu, family: u32, model: u32) ?*const T | ... | @@ -217,6 +218,19 @@ fn detectAmdProcessor(cpu: *const Target.Cpu, family: u32, model: u32) ?*const T |
| 217 | }; | 218 | }; |
| 218 | } | 219 | } |
| 219 | | 220 | |
| | 221 | fn detectHygonProcessor(family: u32, model: u32) ?*const Target.Cpu.Model { |
| | 222 | return switch (family) { |
| | 223 | 24 => switch (model) { |
| | 224 | 4 => &Target.x86.cpu.c86_4g_m4, |
| | 225 | 6 => &Target.x86.cpu.c86_4g_m6, |
| | 226 | 7 => &Target.x86.cpu.c86_4g_m7, |
| | 227 | 8 => &Target.x86.cpu.c86_4g_m8, |
| | 228 | else => null, |
| | 229 | }, |
| | 230 | else => null, |
| | 231 | }; |
| | 232 | } |
| | 233 | |
| 220 | fn detectNativeFeatures(cpu: *Target.Cpu) void { | 234 | fn detectNativeFeatures(cpu: *Target.Cpu) void { |
| 221 | var leaf = cpuid(0, 0); | 235 | var leaf = cpuid(0, 0); |
| 222 | | 236 | |