| ... | ... | @@ -27209,14 +27209,57 @@ fn regExtraBits(self: *CodeGen, ty: Type) u64 { |
| 27209 | 27209 | return self.regBitSize(ty) - ty.bitSize(self.pt.zcu); |
| 27210 | 27210 | } |
| 27211 | 27211 | |
| 27212 | | fn hasFeature(self: *CodeGen, feature: std.Target.x86.Feature) bool { |
| 27213 | | return std.Target.x86.featureSetHas(self.target.cpu.features, feature); |
| 27214 | | } |
| 27215 | | fn hasAnyFeatures(self: *CodeGen, features: anytype) bool { |
| 27216 | | return std.Target.x86.featureSetHasAny(self.target.cpu.features, features); |
| 27217 | | } |
| 27218 | | fn hasAllFeatures(self: *CodeGen, features: anytype) bool { |
| 27219 | | return std.Target.x86.featureSetHasAll(self.target.cpu.features, features); |
| 27212 | fn hasFeature(cg: *CodeGen, feature: std.Target.x86.Feature) bool { |
| 27213 | return switch (feature) { |
| 27214 | .@"64bit" => switch (cg.target.cpu.arch) { |
| 27215 | else => unreachable, |
| 27216 | .x86 => false, |
| 27217 | .x86_64 => true, |
| 27218 | }, |
| 27219 | .false_deps_getmant, |
| 27220 | .false_deps_lzcnt_tzcnt, |
| 27221 | .false_deps_mulc, |
| 27222 | .false_deps_mullq, |
| 27223 | .false_deps_perm, |
| 27224 | .false_deps_popcnt, |
| 27225 | .false_deps_range, |
| 27226 | .slow_3ops_lea, |
| 27227 | .slow_incdec, |
| 27228 | .slow_lea, |
| 27229 | .slow_pmaddwd, |
| 27230 | .slow_pmulld, |
| 27231 | .slow_shld, |
| 27232 | .slow_two_mem_ops, |
| 27233 | .slow_unaligned_mem_16, |
| 27234 | .slow_unaligned_mem_32, |
| 27235 | => switch (cg.mod.optimize_mode) { |
| 27236 | .Debug, .ReleaseSafe, .ReleaseFast => null, |
| 27237 | .ReleaseSmall => false, |
| 27238 | }, |
| 27239 | .fast_11bytenop, |
| 27240 | .fast_15bytenop, |
| 27241 | .fast_7bytenop, |
| 27242 | .fast_bextr, |
| 27243 | .fast_dpwssd, |
| 27244 | .fast_gather, |
| 27245 | .fast_hops, |
| 27246 | .fast_imm16, |
| 27247 | .fast_lzcnt, |
| 27248 | .fast_movbe, |
| 27249 | .fast_scalar_fsqrt, |
| 27250 | .fast_scalar_shift_masks, |
| 27251 | .fast_shld_rotate, |
| 27252 | .fast_variable_crosslane_shuffle, |
| 27253 | .fast_variable_perlane_shuffle, |
| 27254 | .fast_vector_fsqrt, |
| 27255 | .fast_vector_shift_masks, |
| 27256 | => switch (cg.mod.optimize_mode) { |
| 27257 | .Debug, .ReleaseSafe, .ReleaseFast => null, |
| 27258 | .ReleaseSmall => true, |
| 27259 | }, |
| 27260 | .mmx => false, |
| 27261 | else => null, |
| 27262 | } orelse std.Target.x86.featureSetHas(cg.target.cpu.features, feature); |
| 27220 | 27263 | } |
| 27221 | 27264 | |
| 27222 | 27265 | fn typeOf(self: *CodeGen, inst: Air.Inst.Ref) Type { |
| ... | ... | @@ -29090,15 +29133,7 @@ fn select( |
| 29090 | 29133 | cases: []const Select.Case, |
| 29091 | 29134 | ) !void { |
| 29092 | 29135 | cases: for (cases) |case| { |
| 29093 | | for (case.required_features) |required_feature| if (required_feature) |feature| if (!switch (feature) { |
| 29094 | | .@"64bit" => switch (cg.target.cpu.arch) { |
| 29095 | | else => unreachable, |
| 29096 | | .x86 => false, |
| 29097 | | .x86_64 => true, |
| 29098 | | }, |
| 29099 | | .mmx => false, |
| 29100 | | else => cg.hasFeature(feature), |
| 29101 | | }) continue :cases; |
| 29136 | for (case.required_features) |required_feature| if (required_feature) |feature| if (!cg.hasFeature(feature)) continue :cases; |
| 29102 | 29137 | for (case.dst_constraints[0..dst_temps.len], dst_tys) |dst_constraint, dst_ty| if (!dst_constraint.accepts(dst_ty, cg)) continue :cases; |
| 29103 | 29138 | for (case.src_constraints[0..src_temps.len], src_temps) |src_constraint, src_temp| if (!src_constraint.accepts(src_temp.typeOf(cg), cg)) continue :cases; |
| 29104 | 29139 | if (std.debug.runtime_safety) { |