Legalize: make the feature set comptime-known in zig1
This allows legalizations to be added that aren't used by zig1 without affecting the size of zig1.
This commit is contained in:
@@ -23,12 +23,19 @@ const BigIntLimb = std.math.big.Limb;
|
||||
const BigInt = std.math.big.int;
|
||||
|
||||
pub fn legalizeFeatures(_: *const std.Target) ?*const Air.Legalize.Features {
|
||||
return if (dev.env.supports(.legalize)) comptime &.initMany(&.{
|
||||
.expand_intcast_safe,
|
||||
.expand_add_safe,
|
||||
.expand_sub_safe,
|
||||
.expand_mul_safe,
|
||||
}) else null; // we don't currently ask zig1 to use safe optimization modes
|
||||
return comptime switch (dev.env.supports(.legalize)) {
|
||||
inline false, true => |supports_legalize| &.init(.{
|
||||
// we don't currently ask zig1 to use safe optimization modes
|
||||
.expand_intcast_safe = supports_legalize,
|
||||
.expand_add_safe = supports_legalize,
|
||||
.expand_sub_safe = supports_legalize,
|
||||
.expand_mul_safe = supports_legalize,
|
||||
|
||||
.expand_packed_load = true,
|
||||
.expand_packed_store = true,
|
||||
.expand_packed_struct_field_val = true,
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
/// For most backends, MIR is basically a sequence of machine code instructions, perhaps with some
|
||||
|
||||
Reference in New Issue
Block a user