| ... | @@ -325,22 +325,19 @@ pub const NativeTargetInfo = struct { | ... | @@ -325,22 +325,19 @@ pub const NativeTargetInfo = struct { |
| 325 | // native CPU architecture as being different than the current target), we use this: | 325 | // native CPU architecture as being different than the current target), we use this: |
| 326 | const cpu_arch = cross_target.getCpuArch(); | 326 | const cpu_arch = cross_target.getCpuArch(); |
| 327 | | 327 | |
| 328 | const cpu = switch (cross_target.cpu_model) { | 328 | var cpu = switch (cross_target.cpu_model) { |
| 329 | .native => detectNativeCpuAndFeatures(cpu_arch, os, cross_target), | 329 | .native => detectNativeCpuAndFeatures(cpu_arch, os, cross_target), |
| 330 | .baseline => baselineCpuAndFeatures(cpu_arch, cross_target), | 330 | .baseline => Target.Cpu.baseline(cpu_arch), |
| 331 | .determined_by_cpu_arch => if (cross_target.cpu_arch == null) | 331 | .determined_by_cpu_arch => if (cross_target.cpu_arch == null) |
| 332 | detectNativeCpuAndFeatures(cpu_arch, os, cross_target) | 332 | detectNativeCpuAndFeatures(cpu_arch, os, cross_target) |
| 333 | else | 333 | else |
| 334 | baselineCpuAndFeatures(cpu_arch, cross_target), | 334 | Target.Cpu.baseline(cpu_arch), |
| 335 | .explicit => |model| blk: { | 335 | .explicit => |model| model.toCpu(cpu_arch), |
| 336 | var adjusted_model = model.toCpu(cpu_arch); | | |
| 337 | cross_target.updateCpuFeatures(&adjusted_model.features); | | |
| 338 | break :blk adjusted_model; | | |
| 339 | }, | | |
| 340 | } orelse backup_cpu_detection: { | 336 | } orelse backup_cpu_detection: { |
| 341 | cpu_detection_unimplemented = true; | 337 | cpu_detection_unimplemented = true; |
| 342 | break :backup_cpu_detection baselineCpuAndFeatures(cpu_arch, cross_target); | 338 | break :backup_cpu_detection Target.Cpu.baseline(cpu_arch); |
| 343 | }; | 339 | }; |
| | 340 | cross_target.updateCpuFeatures(&cpu.features); |
| 344 | | 341 | |
| 345 | var target = try detectAbiAndDynamicLinker(allocator, cpu, os, cross_target); | 342 | var target = try detectAbiAndDynamicLinker(allocator, cpu, os, cross_target); |
| 346 | target.cpu_detection_unimplemented = cpu_detection_unimplemented; | 343 | target.cpu_detection_unimplemented = cpu_detection_unimplemented; |
| ... | @@ -884,10 +881,4 @@ pub const NativeTargetInfo = struct { | ... | @@ -884,10 +881,4 @@ pub const NativeTargetInfo = struct { |
| 884 | }, | 881 | }, |
| 885 | } | 882 | } |
| 886 | } | 883 | } |
| 887 | | | |
| 888 | fn baselineCpuAndFeatures(cpu_arch: Target.Cpu.Arch, cross_target: CrossTarget) Target.Cpu { | | |
| 889 | var adjusted_baseline = Target.Cpu.baseline(cpu_arch); | | |
| 890 | cross_target.updateCpuFeatures(&adjusted_baseline.features); | | |
| 891 | return adjusted_baseline; | | |
| 892 | } | | |
| 893 | }; | 884 | }; |