diff --git a/lib/compiler/aro/aro/Parser.zig b/lib/compiler/aro/aro/Parser.zig index e21bd0bf097c..956dc5e114e3 100644 --- a/lib/compiler/aro/aro/Parser.zig +++ b/lib/compiler/aro/aro/Parser.zig @@ -5631,15 +5631,15 @@ pub const Result = struct { }; const a_spec = a.ty.canonicalize(.standard).specifier; const b_spec = b.ty.canonicalize(.standard).specifier; - if (p.comp.target.c_type_bit_size(.longdouble) == 128) { + if (p.comp.target.cTypeBitSize(.longdouble) == 128) { if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; } if (try a.floatConversion(b, a_spec, b_spec, p, float_types[1])) return; - if (p.comp.target.c_type_bit_size(.longdouble) == 80) { + if (p.comp.target.cTypeBitSize(.longdouble) == 80) { if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; } if (try a.floatConversion(b, a_spec, b_spec, p, float_types[2])) return; - if (p.comp.target.c_type_bit_size(.longdouble) == 64) { + if (p.comp.target.cTypeBitSize(.longdouble) == 64) { if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; } if (try a.floatConversion(b, a_spec, b_spec, p, float_types[3])) return; diff --git a/lib/compiler/aro/aro/Type.zig b/lib/compiler/aro/aro/Type.zig index a2ba4707c4b4..13fa8ce2e204 100644 --- a/lib/compiler/aro/aro/Type.zig +++ b/lib/compiler/aro/aro/Type.zig @@ -991,19 +991,19 @@ pub fn sizeof(ty: Type, comp: *const Compilation) ?u64 { .incomplete_array => return if (comp.langopts.emulate == .msvc) @as(?u64, 0) else null, .func, .var_args_func, .old_style_func, .void, .bool => 1, .char, .schar, .uchar => 1, - .short => comp.target.c_type_byte_size(.short), - .ushort => comp.target.c_type_byte_size(.ushort), - .int => comp.target.c_type_byte_size(.int), - .uint => comp.target.c_type_byte_size(.uint), - .long => comp.target.c_type_byte_size(.long), - .ulong => comp.target.c_type_byte_size(.ulong), - .long_long => comp.target.c_type_byte_size(.longlong), - .ulong_long => comp.target.c_type_byte_size(.ulonglong), - .long_double => comp.target.c_type_byte_size(.longdouble), + .short => comp.target.cTypeByteSize(.short), + .ushort => comp.target.cTypeByteSize(.ushort), + .int => comp.target.cTypeByteSize(.int), + .uint => comp.target.cTypeByteSize(.uint), + .long => comp.target.cTypeByteSize(.long), + .ulong => comp.target.cTypeByteSize(.ulong), + .long_long => comp.target.cTypeByteSize(.longlong), + .ulong_long => comp.target.cTypeByteSize(.ulonglong), + .long_double => comp.target.cTypeByteSize(.longdouble), .int128, .uint128 => 16, .fp16, .float16 => 2, - .float => comp.target.c_type_byte_size(.float), - .double => comp.target.c_type_byte_size(.double), + .float => comp.target.cTypeByteSize(.float), + .double => comp.target.cTypeByteSize(.double), .float80 => 16, .float128 => 16, .bit_int => { @@ -1049,7 +1049,7 @@ pub fn bitSizeof(ty: Type, comp: *const Compilation) ?u64 { .typeof_expr => ty.data.expr.ty.bitSizeof(comp), .attributed => ty.data.attributed.base.bitSizeof(comp), .bit_int => return ty.data.int.bits, - .long_double => comp.target.c_type_bit_size(.longdouble), + .long_double => comp.target.cTypeBitSize(.longdouble), .float80 => return 80, else => 8 * (ty.sizeof(comp) orelse return null), }; @@ -1104,24 +1104,24 @@ pub fn alignof(ty: Type, comp: *const Compilation) u29 { => return ty.makeReal().alignof(comp), // zig fmt: on - .short => comp.target.c_type_alignment(.short), - .ushort => comp.target.c_type_alignment(.ushort), - .int => comp.target.c_type_alignment(.int), - .uint => comp.target.c_type_alignment(.uint), + .short => comp.target.cTypeAlignment(.short), + .ushort => comp.target.cTypeAlignment(.ushort), + .int => comp.target.cTypeAlignment(.int), + .uint => comp.target.cTypeAlignment(.uint), - .long => comp.target.c_type_alignment(.long), - .ulong => comp.target.c_type_alignment(.ulong), - .long_long => comp.target.c_type_alignment(.longlong), - .ulong_long => comp.target.c_type_alignment(.ulonglong), + .long => comp.target.cTypeAlignment(.long), + .ulong => comp.target.cTypeAlignment(.ulong), + .long_long => comp.target.cTypeAlignment(.longlong), + .ulong_long => comp.target.cTypeAlignment(.ulonglong), .bit_int => @min( std.math.ceilPowerOfTwoPromote(u16, (ty.data.int.bits + 7) / 8), 16, // comp.target.maxIntAlignment(), please use your own logic for this value as it is implementation-defined ), - .float => comp.target.c_type_alignment(.float), - .double => comp.target.c_type_alignment(.double), - .long_double => comp.target.c_type_alignment(.longdouble), + .float => comp.target.cTypeAlignment(.float), + .double => comp.target.cTypeAlignment(.double), + .long_double => comp.target.cTypeAlignment(.longdouble), .int128, .uint128 => if (comp.target.cpu.arch == .s390x and comp.target.os.tag == .linux and comp.target.isGnu()) 8 else 16, .fp16, .float16 => 2, diff --git a/lib/compiler/aro/aro/target.zig b/lib/compiler/aro/aro/target.zig index 87b362aeb1f5..407ef4dfd01b 100644 --- a/lib/compiler/aro/aro/target.zig +++ b/lib/compiler/aro/aro/target.zig @@ -306,7 +306,7 @@ pub const FPSemantics = enum { /// Only intended for generating float.h macros for the preprocessor pub fn forType(ty: std.Target.CType, target: std.Target) FPSemantics { std.debug.assert(ty == .float or ty == .double or ty == .longdouble); - return switch (target.c_type_bit_size(ty)) { + return switch (target.cTypeBitSize(ty)) { 32 => .IEEESingle, 64 => .IEEEDouble, 80 => .x87ExtendedDouble, @@ -350,7 +350,7 @@ pub const FPSemantics = enum { }; pub fn isLP64(target: std.Target) bool { - return target.c_type_bit_size(.int) == 32 and target.ptrBitWidth() == 64; + return target.cTypeBitSize(.int) == 32 and target.ptrBitWidth() == 64; } pub fn isKnownWindowsMSVCEnvironment(target: std.Target) bool { diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 1d08e7faf324..2ca02aa2d341 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -964,7 +964,7 @@ pub const Cpu = struct { } }; - pub fn feature_set_fns(comptime F: type) type { + pub fn FeatureSetFns(comptime F: type) type { return struct { /// Populates only the feature bits specified. pub fn featureSet(features: []const F) Set { @@ -2017,7 +2017,7 @@ pub const CType = enum { longdouble, }; -pub fn c_type_byte_size(t: Target, c_type: CType) u16 { +pub fn cTypeByteSize(t: Target, c_type: CType) u16 { return switch (c_type) { .char, .short, @@ -2030,20 +2030,20 @@ pub fn c_type_byte_size(t: Target, c_type: CType) u16 { .ulonglong, .float, .double, - => @divExact(c_type_bit_size(t, c_type), 8), + => @divExact(cTypeBitSize(t, c_type), 8), - .longdouble => switch (c_type_bit_size(t, c_type)) { + .longdouble => switch (cTypeBitSize(t, c_type)) { 16 => 2, 32 => 4, 64 => 8, - 80 => @intCast(std.mem.alignForward(usize, 10, c_type_alignment(t, .longdouble))), + 80 => @intCast(std.mem.alignForward(usize, 10, cTypeAlignment(t, .longdouble))), 128 => 16, else => unreachable, }, }; } -pub fn c_type_bit_size(target: Target, c_type: CType) u16 { +pub fn cTypeBitSize(target: Target, c_type: CType) u16 { switch (target.os.tag) { .freestanding, .other => switch (target.cpu.arch) { .msp430 => switch (c_type) { @@ -2340,7 +2340,7 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 { } } -pub fn c_type_alignment(target: Target, c_type: CType) u16 { +pub fn cTypeAlignment(target: Target, c_type: CType) u16 { // Overrides for unusual alignments switch (target.cpu.arch) { .avr => return 1, @@ -2360,7 +2360,7 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 { // Next-power-of-two-aligned, up to a maximum. return @min( - std.math.ceilPowerOfTwoAssert(u16, (c_type_bit_size(target, c_type) + 7) / 8), + std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8), @as(u16, switch (target.cpu.arch) { .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { .netbsd => switch (target.abi) { @@ -2432,7 +2432,7 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 { ); } -pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 { +pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { // Overrides for unusual alignments switch (target.cpu.arch) { .arm, .armeb, .thumb, .thumbeb => switch (target.os.tag) { @@ -2485,7 +2485,7 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 { // Next-power-of-two-aligned, up to a maximum. return @min( - std.math.ceilPowerOfTwoAssert(u16, (c_type_bit_size(target, c_type) + 7) / 8), + std.math.ceilPowerOfTwoAssert(u16, (cTypeBitSize(target, c_type) + 7) / 8), @as(u16, switch (target.cpu.arch) { .msp430 => 2, diff --git a/lib/std/Target/aarch64.zig b/lib/std/Target/aarch64.zig index a1f977d7747b..7755f7959a49 100644 --- a/lib/std/Target/aarch64.zig +++ b/lib/std/Target/aarch64.zig @@ -235,10 +235,10 @@ pub const Feature = enum { zcz_gp, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { @setEvalBranchQuota(2000); diff --git a/lib/std/Target/amdgpu.zig b/lib/std/Target/amdgpu.zig index 5980fea1dc36..9fe574bd852b 100644 --- a/lib/std/Target/amdgpu.zig +++ b/lib/std/Target/amdgpu.zig @@ -177,10 +177,10 @@ pub const Feature = enum { xnack_support, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/arc.zig b/lib/std/Target/arc.zig index eff13c66375f..37fc2243c320 100644 --- a/lib/std/Target/arc.zig +++ b/lib/std/Target/arc.zig @@ -8,10 +8,10 @@ pub const Feature = enum { norm, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/arm.zig b/lib/std/Target/arm.zig index 0fc5f1dbc320..d8b3216a1268 100644 --- a/lib/std/Target/arm.zig +++ b/lib/std/Target/arm.zig @@ -208,10 +208,10 @@ pub const Feature = enum { zcz, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { @setEvalBranchQuota(10000); diff --git a/lib/std/Target/avr.zig b/lib/std/Target/avr.zig index bda274d2e643..0512bd871818 100644 --- a/lib/std/Target/avr.zig +++ b/lib/std/Target/avr.zig @@ -43,10 +43,10 @@ pub const Feature = enum { xmegau, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/bpf.zig b/lib/std/Target/bpf.zig index f1d96505b3f7..2d17805fbc20 100644 --- a/lib/std/Target/bpf.zig +++ b/lib/std/Target/bpf.zig @@ -10,10 +10,10 @@ pub const Feature = enum { dwarfris, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/csky.zig b/lib/std/Target/csky.zig index 66cd0fd6f032..bdb8637709ae 100644 --- a/lib/std/Target/csky.zig +++ b/lib/std/Target/csky.zig @@ -70,10 +70,10 @@ pub const Feature = enum { vdspv2, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/hexagon.zig b/lib/std/Target/hexagon.zig index c84b2cb0c8b9..c1cfc777e5b2 100644 --- a/lib/std/Target/hexagon.zig +++ b/lib/std/Target/hexagon.zig @@ -49,10 +49,10 @@ pub const Feature = enum { zreg, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/loongarch.zig b/lib/std/Target/loongarch.zig index 5a4cdeeeb7a5..999c33f9c257 100644 --- a/lib/std/Target/loongarch.zig +++ b/lib/std/Target/loongarch.zig @@ -22,10 +22,10 @@ pub const Feature = enum { ual, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/m68k.zig b/lib/std/Target/m68k.zig index 054b3974d1fc..549ecd46682c 100644 --- a/lib/std/Target/m68k.zig +++ b/lib/std/Target/m68k.zig @@ -30,10 +30,10 @@ pub const Feature = enum { reserve_d7, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/mips.zig b/lib/std/Target/mips.zig index 8f3c0994d1dc..0d3f587683fb 100644 --- a/lib/std/Target/mips.zig +++ b/lib/std/Target/mips.zig @@ -59,10 +59,10 @@ pub const Feature = enum { xgot, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/msp430.zig b/lib/std/Target/msp430.zig index 98ea32d17fbb..1fb473420d08 100644 --- a/lib/std/Target/msp430.zig +++ b/lib/std/Target/msp430.zig @@ -11,10 +11,10 @@ pub const Feature = enum { hwmultf5, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/nvptx.zig b/lib/std/Target/nvptx.zig index 9cc953a8d4d3..a97994a0d170 100644 --- a/lib/std/Target/nvptx.zig +++ b/lib/std/Target/nvptx.zig @@ -52,10 +52,10 @@ pub const Feature = enum { sm_90a, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/powerpc.zig b/lib/std/Target/powerpc.zig index b2b3c4988e25..3397446bd1f6 100644 --- a/lib/std/Target/powerpc.zig +++ b/lib/std/Target/powerpc.zig @@ -89,10 +89,10 @@ pub const Feature = enum { vsx, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/riscv.zig b/lib/std/Target/riscv.zig index 5484579dc4d3..ac310709805b 100644 --- a/lib/std/Target/riscv.zig +++ b/lib/std/Target/riscv.zig @@ -195,10 +195,10 @@ pub const Feature = enum { zvl8192b, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/s390x.zig b/lib/std/Target/s390x.zig index c6974b92135f..c9516be0740b 100644 --- a/lib/std/Target/s390x.zig +++ b/lib/std/Target/s390x.zig @@ -49,10 +49,10 @@ pub const Feature = enum { vector_packed_decimal_enhancement_2, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/sparc.zig b/lib/std/Target/sparc.zig index 70b55089d205..7b550fd2c5bf 100644 --- a/lib/std/Target/sparc.zig +++ b/lib/std/Target/sparc.zig @@ -54,10 +54,10 @@ pub const Feature = enum { vis3, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/spirv.zig b/lib/std/Target/spirv.zig index 9d79aff2212c..8bc81e189d8e 100644 --- a/lib/std/Target/spirv.zig +++ b/lib/std/Target/spirv.zig @@ -294,10 +294,10 @@ pub const Feature = enum { LongConstantCompositeINTEL, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { @setEvalBranchQuota(2000); diff --git a/lib/std/Target/ve.zig b/lib/std/Target/ve.zig index 6aa5c3f61c3d..cfd6576ff746 100644 --- a/lib/std/Target/ve.zig +++ b/lib/std/Target/ve.zig @@ -8,10 +8,10 @@ pub const Feature = enum { vpu, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/wasm.zig b/lib/std/Target/wasm.zig index efc25babe9ab..7f0ae49a78a7 100644 --- a/lib/std/Target/wasm.zig +++ b/lib/std/Target/wasm.zig @@ -20,10 +20,10 @@ pub const Feature = enum { tail_call, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/x86.zig b/lib/std/Target/x86.zig index 20820cbb6bea..09ce8cd33e21 100644 --- a/lib/std/Target/x86.zig +++ b/lib/std/Target/x86.zig @@ -193,10 +193,10 @@ pub const Feature = enum { xsaves, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/lib/std/Target/xtensa.zig b/lib/std/Target/xtensa.zig index 22851c4554cf..40143512c0f3 100644 --- a/lib/std/Target/xtensa.zig +++ b/lib/std/Target/xtensa.zig @@ -8,10 +8,10 @@ pub const Feature = enum { density, }; -pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; -pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; -pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; -pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; +pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; +pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; +pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; +pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; pub const all_features = blk: { const len = @typeInfo(Feature).Enum.fields.len; diff --git a/src/Sema.zig b/src/Sema.zig index 2d8858d7cd63..cdcbee42a522 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -30943,7 +30943,7 @@ fn coerceVarArgParam( .Array => return sema.fail(block, inst_src, "arrays must be passed by reference to variadic function", .{}), .Float => float: { const target = zcu.getTarget(); - const double_bits = target.c_type_bit_size(.double); + const double_bits = target.cTypeBitSize(.double); const inst_bits = uncasted_ty.floatBits(target); if (inst_bits >= double_bits) break :float inst; switch (double_bits) { @@ -30956,21 +30956,21 @@ fn coerceVarArgParam( if (!try sema.validateExternType(uncasted_ty, .param_ty)) break :int inst; const target = zcu.getTarget(); const uncasted_info = uncasted_ty.intInfo(zcu); - if (uncasted_info.bits <= target.c_type_bit_size(switch (uncasted_info.signedness) { + if (uncasted_info.bits <= target.cTypeBitSize(switch (uncasted_info.signedness) { .signed => .int, .unsigned => .uint, })) break :int try sema.coerce(block, switch (uncasted_info.signedness) { .signed => Type.c_int, .unsigned => Type.c_uint, }, inst, inst_src); - if (uncasted_info.bits <= target.c_type_bit_size(switch (uncasted_info.signedness) { + if (uncasted_info.bits <= target.cTypeBitSize(switch (uncasted_info.signedness) { .signed => .long, .unsigned => .ulong, })) break :int try sema.coerce(block, switch (uncasted_info.signedness) { .signed => Type.c_long, .unsigned => Type.c_ulong, }, inst, inst_src); - if (uncasted_info.bits <= target.c_type_bit_size(switch (uncasted_info.signedness) { + if (uncasted_info.bits <= target.cTypeBitSize(switch (uncasted_info.signedness) { .signed => .longlong, .unsigned => .ulonglong, })) break :int try sema.coerce(block, switch (uncasted_info.signedness) { diff --git a/src/Type.zig b/src/Type.zig index 7412ef0f2f85..f2e51614e8df 100644 --- a/src/Type.zig +++ b/src/Type.zig @@ -1005,15 +1005,15 @@ pub fn abiAlignmentAdvanced( .f16 => return .{ .scalar = .@"2" }, .f32 => return .{ .scalar = cTypeAlign(target, .float) }, - .f64 => switch (target.c_type_bit_size(.double)) { + .f64 => switch (target.cTypeBitSize(.double)) { 64 => return .{ .scalar = cTypeAlign(target, .double) }, else => return .{ .scalar = .@"8" }, }, - .f80 => switch (target.c_type_bit_size(.longdouble)) { + .f80 => switch (target.cTypeBitSize(.longdouble)) { 80 => return .{ .scalar = cTypeAlign(target, .longdouble) }, else => return .{ .scalar = Type.u80.abiAlignment(pt) }, }, - .f128 => switch (target.c_type_bit_size(.longdouble)) { + .f128 => switch (target.cTypeBitSize(.longdouble)) { 128 => return .{ .scalar = cTypeAlign(target, .longdouble) }, else => return .{ .scalar = .@"16" }, }, @@ -1366,8 +1366,8 @@ pub fn abiSizeAdvanced( .f32 => return .{ .scalar = 4 }, .f64 => return .{ .scalar = 8 }, .f128 => return .{ .scalar = 16 }, - .f80 => switch (target.c_type_bit_size(.longdouble)) { - 80 => return .{ .scalar = target.c_type_byte_size(.longdouble) }, + .f80 => switch (target.cTypeBitSize(.longdouble)) { + 80 => return .{ .scalar = target.cTypeByteSize(.longdouble) }, else => return .{ .scalar = Type.u80.abiSize(pt) }, }, @@ -1375,16 +1375,16 @@ pub fn abiSizeAdvanced( .isize, => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) }, - .c_char => return .{ .scalar = target.c_type_byte_size(.char) }, - .c_short => return .{ .scalar = target.c_type_byte_size(.short) }, - .c_ushort => return .{ .scalar = target.c_type_byte_size(.ushort) }, - .c_int => return .{ .scalar = target.c_type_byte_size(.int) }, - .c_uint => return .{ .scalar = target.c_type_byte_size(.uint) }, - .c_long => return .{ .scalar = target.c_type_byte_size(.long) }, - .c_ulong => return .{ .scalar = target.c_type_byte_size(.ulong) }, - .c_longlong => return .{ .scalar = target.c_type_byte_size(.longlong) }, - .c_ulonglong => return .{ .scalar = target.c_type_byte_size(.ulonglong) }, - .c_longdouble => return .{ .scalar = target.c_type_byte_size(.longdouble) }, + .c_char => return .{ .scalar = target.cTypeByteSize(.char) }, + .c_short => return .{ .scalar = target.cTypeByteSize(.short) }, + .c_ushort => return .{ .scalar = target.cTypeByteSize(.ushort) }, + .c_int => return .{ .scalar = target.cTypeByteSize(.int) }, + .c_uint => return .{ .scalar = target.cTypeByteSize(.uint) }, + .c_long => return .{ .scalar = target.cTypeByteSize(.long) }, + .c_ulong => return .{ .scalar = target.cTypeByteSize(.ulong) }, + .c_longlong => return .{ .scalar = target.cTypeByteSize(.longlong) }, + .c_ulonglong => return .{ .scalar = target.cTypeByteSize(.ulonglong) }, + .c_longdouble => return .{ .scalar = target.cTypeByteSize(.longdouble) }, .anyopaque, .void, @@ -1724,16 +1724,16 @@ pub fn bitSizeAdvanced( .isize, => return target.ptrBitWidth(), - .c_char => return target.c_type_bit_size(.char), - .c_short => return target.c_type_bit_size(.short), - .c_ushort => return target.c_type_bit_size(.ushort), - .c_int => return target.c_type_bit_size(.int), - .c_uint => return target.c_type_bit_size(.uint), - .c_long => return target.c_type_bit_size(.long), - .c_ulong => return target.c_type_bit_size(.ulong), - .c_longlong => return target.c_type_bit_size(.longlong), - .c_ulonglong => return target.c_type_bit_size(.ulonglong), - .c_longdouble => return target.c_type_bit_size(.longdouble), + .c_char => return target.cTypeBitSize(.char), + .c_short => return target.cTypeBitSize(.short), + .c_ushort => return target.cTypeBitSize(.ushort), + .c_int => return target.cTypeBitSize(.int), + .c_uint => return target.cTypeBitSize(.uint), + .c_long => return target.cTypeBitSize(.long), + .c_ulong => return target.cTypeBitSize(.ulong), + .c_longlong => return target.cTypeBitSize(.longlong), + .c_ulonglong => return target.cTypeBitSize(.ulonglong), + .c_longdouble => return target.cTypeBitSize(.longdouble), .bool => return 1, .void => return 0, @@ -2310,15 +2310,15 @@ pub fn intInfo(starting_ty: Type, mod: *Module) InternPool.Key.IntType { }, .usize_type => return .{ .signedness = .unsigned, .bits = target.ptrBitWidth() }, .isize_type => return .{ .signedness = .signed, .bits = target.ptrBitWidth() }, - .c_char_type => return .{ .signedness = mod.getTarget().charSignedness(), .bits = target.c_type_bit_size(.char) }, - .c_short_type => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.short) }, - .c_ushort_type => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ushort) }, - .c_int_type => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.int) }, - .c_uint_type => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.uint) }, - .c_long_type => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.long) }, - .c_ulong_type => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ulong) }, - .c_longlong_type => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.longlong) }, - .c_ulonglong_type => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ulonglong) }, + .c_char_type => return .{ .signedness = mod.getTarget().charSignedness(), .bits = target.cTypeBitSize(.char) }, + .c_short_type => return .{ .signedness = .signed, .bits = target.cTypeBitSize(.short) }, + .c_ushort_type => return .{ .signedness = .unsigned, .bits = target.cTypeBitSize(.ushort) }, + .c_int_type => return .{ .signedness = .signed, .bits = target.cTypeBitSize(.int) }, + .c_uint_type => return .{ .signedness = .unsigned, .bits = target.cTypeBitSize(.uint) }, + .c_long_type => return .{ .signedness = .signed, .bits = target.cTypeBitSize(.long) }, + .c_ulong_type => return .{ .signedness = .unsigned, .bits = target.cTypeBitSize(.ulong) }, + .c_longlong_type => return .{ .signedness = .signed, .bits = target.cTypeBitSize(.longlong) }, + .c_ulonglong_type => return .{ .signedness = .unsigned, .bits = target.cTypeBitSize(.ulonglong) }, else => switch (ip.indexToKey(ty.toIntern())) { .int_type => |int_type| return int_type, .struct_type => ty = Type.fromInterned(ip.loadStructType(ty.toIntern()).backingIntTypeUnordered(ip)), @@ -2427,7 +2427,7 @@ pub fn floatBits(ty: Type, target: Target) u16 { .f64_type => 64, .f80_type => 80, .f128_type, .comptime_float_type => 128, - .c_longdouble_type => target.c_type_bit_size(.longdouble), + .c_longdouble_type => target.cTypeBitSize(.longdouble), else => unreachable, }; @@ -4025,5 +4025,5 @@ pub fn smallestUnsignedBits(max: u64) u16 { pub const packed_struct_layout_version = 2; fn cTypeAlign(target: Target, c_type: Target.CType) Alignment { - return Alignment.fromByteUnits(target.c_type_alignment(c_type)); + return Alignment.fromByteUnits(target.cTypeAlignment(c_type)); } diff --git a/src/arch/riscv64/CodeGen.zig b/src/arch/riscv64/CodeGen.zig index b5384542e73f..a78ff4b1b853 100644 --- a/src/arch/riscv64/CodeGen.zig +++ b/src/arch/riscv64/CodeGen.zig @@ -8304,7 +8304,7 @@ fn promoteVarArg(func: *Func, ty: Type) Type { switch (ty.floatBits(func.target.*)) { 32, 64 => return Type.f64, else => |float_bits| { - assert(float_bits == func.target.c_type_bit_size(.longdouble)); + assert(float_bits == func.target.cTypeBitSize(.longdouble)); return Type.c_longdouble; }, } diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index a36bd981bcc8..70601bdec6bf 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -19374,7 +19374,7 @@ fn promoteVarArg(self: *Self, ty: Type) Type { switch (ty.floatBits(self.target.*)) { 32, 64 => return Type.f64, else => |float_bits| { - assert(float_bits == self.target.c_type_bit_size(.longdouble)); + assert(float_bits == self.target.cTypeBitSize(.longdouble)); return Type.c_longdouble; }, } diff --git a/src/codegen/c/Type.zig b/src/codegen/c/Type.zig index 943f54ae9606..c89d9d19f7b0 100644 --- a/src/codegen/c/Type.zig +++ b/src/codegen/c/Type.zig @@ -326,9 +326,9 @@ pub fn renderLiteralSuffix(ctype: CType, writer: anytype, pool: *const Pool) @Ty pub fn floatActiveBits(ctype: CType, mod: *Module) u16 { const target = &mod.resolved_target.result; return switch (ctype.index) { - .float => target.c_type_bit_size(.float), - .double => target.c_type_bit_size(.double), - .@"long double", .zig_c_longdouble => target.c_type_bit_size(.longdouble), + .float => target.cTypeBitSize(.float), + .double => target.cTypeBitSize(.double), + .@"long double", .zig_c_longdouble => target.cTypeBitSize(.longdouble), .zig_f16 => 16, .zig_f32 => 32, .zig_f64 => 64, @@ -344,17 +344,17 @@ pub fn byteSize(ctype: CType, pool: *const Pool, mod: *Module) u64 { .basic => |basic_info| switch (basic_info) { .void => 0, .char, .@"signed char", ._Bool, .@"unsigned char", .bool, .uint8_t, .int8_t => 1, - .short => target.c_type_byte_size(.short), - .int => target.c_type_byte_size(.int), - .long => target.c_type_byte_size(.long), - .@"long long" => target.c_type_byte_size(.longlong), - .@"unsigned short" => target.c_type_byte_size(.ushort), - .@"unsigned int" => target.c_type_byte_size(.uint), - .@"unsigned long" => target.c_type_byte_size(.ulong), - .@"unsigned long long" => target.c_type_byte_size(.ulonglong), - .float => target.c_type_byte_size(.float), - .double => target.c_type_byte_size(.double), - .@"long double" => target.c_type_byte_size(.longdouble), + .short => target.cTypeByteSize(.short), + .int => target.cTypeByteSize(.int), + .long => target.cTypeByteSize(.long), + .@"long long" => target.cTypeByteSize(.longlong), + .@"unsigned short" => target.cTypeByteSize(.ushort), + .@"unsigned int" => target.cTypeByteSize(.uint), + .@"unsigned long" => target.cTypeByteSize(.ulong), + .@"unsigned long long" => target.cTypeByteSize(.ulonglong), + .float => target.cTypeByteSize(.float), + .double => target.cTypeByteSize(.double), + .@"long double" => target.cTypeByteSize(.longdouble), .size_t, .ptrdiff_t, .uintptr_t, @@ -364,11 +364,11 @@ pub fn byteSize(ctype: CType, pool: *const Pool, mod: *Module) u64 { .uint32_t, .int32_t, .zig_f32 => 4, .uint64_t, .int64_t, .zig_f64 => 8, .zig_u128, .zig_i128, .zig_f128 => 16, - .zig_f80 => if (target.c_type_bit_size(.longdouble) == 80) - target.c_type_byte_size(.longdouble) + .zig_f80 => if (target.cTypeBitSize(.longdouble) == 80) + target.cTypeByteSize(.longdouble) else 16, - .zig_c_longdouble => target.c_type_byte_size(.longdouble), + .zig_c_longdouble => target.cTypeByteSize(.longdouble), .va_list => unreachable, _ => unreachable, }, diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index e65615058440..4e056d206963 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -564,9 +564,9 @@ const DataLayoutBuilder = struct { .float => &.{ .float, .double, .longdouble }, .vector, .aggregate => &.{}, })) |cty| { - if (self.target.c_type_bit_size(cty) != size) continue; - abi = self.target.c_type_alignment(cty) * 8; - pref = self.target.c_type_preferred_alignment(cty) * 8; + if (self.target.cTypeBitSize(cty) != size) continue; + abi = self.target.cTypeAlignment(cty) * 8; + pref = self.target.cTypePreferredAlignment(cty) * 8; break; } switch (kind) { @@ -3122,7 +3122,7 @@ pub const Object = struct { .c_ulong_type, .c_longlong_type, .c_ulonglong_type, - => |tag| try o.builder.intType(target.c_type_bit_size( + => |tag| try o.builder.intType(target.cTypeBitSize( @field(std.Target.CType, @tagName(tag)["c_".len .. @tagName(tag).len - "_type".len]), )), .c_longdouble_type, @@ -11799,8 +11799,8 @@ fn backendSupportsF128(target: std.Target) bool { fn intrinsicsAllowed(scalar_ty: Type, target: std.Target) bool { return switch (scalar_ty.toIntern()) { .f16_type => backendSupportsF16(target), - .f80_type => (target.c_type_bit_size(.longdouble) == 80) and backendSupportsF80(target), - .f128_type => (target.c_type_bit_size(.longdouble) == 128) and backendSupportsF128(target), + .f80_type => (target.cTypeBitSize(.longdouble) == 80) and backendSupportsF80(target), + .f128_type => (target.cTypeBitSize(.longdouble) == 128) and backendSupportsF128(target), else => true, }; } diff --git a/tools/generate_c_size_and_align_checks.zig b/tools/generate_c_size_and_align_checks.zig index 45e099ec4bdc..397989a3e969 100644 --- a/tools/generate_c_size_and_align_checks.zig +++ b/tools/generate_c_size_and_align_checks.zig @@ -8,7 +8,7 @@ const std = @import("std"); -fn c_name(ty: std.Target.CType) []const u8 { +fn cName(ty: std.Target.CType) []const u8 { return switch (ty) { .char => "char", .short => "short", @@ -46,16 +46,16 @@ pub fn main() !void { inline for (@typeInfo(std.Target.CType).Enum.fields) |field| { const c_type: std.Target.CType = @enumFromInt(field.value); try stdout.print("_Static_assert(sizeof({0s}) == {1d}, \"sizeof({0s}) == {1d}\");\n", .{ - c_name(c_type), - target.c_type_byte_size(c_type), + cName(c_type), + target.cTypeByteSize(c_type), }); try stdout.print("_Static_assert(_Alignof({0s}) == {1d}, \"_Alignof({0s}) == {1d}\");\n", .{ - c_name(c_type), - target.c_type_alignment(c_type), + cName(c_type), + target.cTypeAlignment(c_type), }); try stdout.print("_Static_assert(__alignof({0s}) == {1d}, \"__alignof({0s}) == {1d}\");\n\n", .{ - c_name(c_type), - target.c_type_preferred_alignment(c_type), + cName(c_type), + target.cTypePreferredAlignment(c_type), }); } } diff --git a/tools/update_cpu_features.zig b/tools/update_cpu_features.zig index 169418ed59a7..068237e45cd1 100644 --- a/tools/update_cpu_features.zig +++ b/tools/update_cpu_features.zig @@ -1336,10 +1336,10 @@ fn processOneTarget(job: Job) anyerror!void { try w.writeAll( \\}; \\ - \\pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; - \\pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; - \\pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; - \\pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; + \\pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; + \\pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; + \\pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; + \\pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; \\ \\pub const all_features = blk: { \\ diff --git a/tools/update_spirv_features.zig b/tools/update_spirv_features.zig index 33a3f6ec3f14..ac5c0a1bfcc0 100644 --- a/tools/update_spirv_features.zig +++ b/tools/update_spirv_features.zig @@ -122,10 +122,10 @@ pub fn main() !void { try w.writeAll( \\}; \\ - \\pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet; - \\pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas; - \\pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny; - \\pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll; + \\pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; + \\pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; + \\pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; + \\pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; \\ \\pub const all_features = blk: { \\ @setEvalBranchQuota(2000);