diff --git a/lib/compiler/aro/aro/Compilation.zig b/lib/compiler/aro/aro/Compilation.zig index 68bad1a5ce9a..798c1925167e 100644 --- a/lib/compiler/aro/aro/Compilation.zig +++ b/lib/compiler/aro/aro/Compilation.zig @@ -1087,7 +1087,7 @@ pub fn fixedEnumTagSpecifier(comp: *const Compilation) ?Type.Specifier { } pub fn getCharSignedness(comp: *const Compilation) std.builtin.Signedness { - return comp.langopts.char_signedness_override orelse comp.target.charSignedness(); + return comp.langopts.char_signedness_override orelse comp.target.cCharSignedness(); } /// Add built-in aro headers directory to system include paths diff --git a/lib/compiler_rt/divmodei4.zig b/lib/compiler_rt/divmodei4.zig index f5ed41d9d70f..9e5e4333b999 100644 --- a/lib/compiler_rt/divmodei4.zig +++ b/lib/compiler_rt/divmodei4.zig @@ -33,18 +33,20 @@ fn divmod(q: ?[]u32, r: ?[]u32, u: []u32, v: []u32) !void { if (r) |x| if (u_sign < 0) neg(x); } -pub fn __divei4(r_q: [*]u32, u_p: [*]u32, v_p: [*]u32, bits: usize) callconv(.c) void { +pub fn __divei4(q_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void { @setRuntimeSafety(builtin.is_test); - const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const q = r_q[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + const q: []u32 = @ptrCast(@alignCast(q_p[0..byte_size])); + const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size])); + const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size])); @call(.always_inline, divmod, .{ q, null, u, v }) catch unreachable; } -pub fn __modei4(r_p: [*]u32, u_p: [*]u32, v_p: [*]u32, bits: usize) callconv(.c) void { +pub fn __modei4(r_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void { @setRuntimeSafety(builtin.is_test); - const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const r = r_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + const r: []u32 = @ptrCast(@alignCast(r_p[0..byte_size])); + const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size])); + const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size])); @call(.always_inline, divmod, .{ null, r, u, v }) catch unreachable; } diff --git a/lib/compiler_rt/fixdfei.zig b/lib/compiler_rt/fixdfei.zig index 9be2719422a9..95189b0f7b41 100644 --- a/lib/compiler_rt/fixdfei.zig +++ b/lib/compiler_rt/fixdfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixdfei, .{ .name = "__fixdfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixdfei(r: [*]u32, bits: usize, a: f64) callconv(.c) void { - return bigIntFromFloat(.signed, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixdfei(r: [*]u8, bits: usize, a: f64) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixhfei.zig b/lib/compiler_rt/fixhfei.zig index 4211007f9985..c4532f18c043 100644 --- a/lib/compiler_rt/fixhfei.zig +++ b/lib/compiler_rt/fixhfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixhfei, .{ .name = "__fixhfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixhfei(r: [*]u32, bits: usize, a: f16) callconv(.c) void { - return bigIntFromFloat(.signed, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixhfei(r: [*]u8, bits: usize, a: f16) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixsfei.zig b/lib/compiler_rt/fixsfei.zig index bad397e494db..8182ca055108 100644 --- a/lib/compiler_rt/fixsfei.zig +++ b/lib/compiler_rt/fixsfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixsfei, .{ .name = "__fixsfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixsfei(r: [*]u32, bits: usize, a: f32) callconv(.c) void { - return bigIntFromFloat(.signed, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixsfei(r: [*]u8, bits: usize, a: f32) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixtfei.zig b/lib/compiler_rt/fixtfei.zig index 5f5085b135e7..02a2c164a624 100644 --- a/lib/compiler_rt/fixtfei.zig +++ b/lib/compiler_rt/fixtfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixtfei, .{ .name = "__fixtfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixtfei(r: [*]u32, bits: usize, a: f128) callconv(.c) void { - return bigIntFromFloat(.signed, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixtfei(r: [*]u8, bits: usize, a: f128) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixunsdfei.zig b/lib/compiler_rt/fixunsdfei.zig index bda88b513478..a88c344bc66f 100644 --- a/lib/compiler_rt/fixunsdfei.zig +++ b/lib/compiler_rt/fixunsdfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixunsdfei, .{ .name = "__fixunsdfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixunsdfei(r: [*]u32, bits: usize, a: f64) callconv(.c) void { - return bigIntFromFloat(.unsigned, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixunsdfei(r: [*]u8, bits: usize, a: f64) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixunshfei.zig b/lib/compiler_rt/fixunshfei.zig index afa0be969199..056d2faaf74a 100644 --- a/lib/compiler_rt/fixunshfei.zig +++ b/lib/compiler_rt/fixunshfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixunshfei, .{ .name = "__fixunshfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixunshfei(r: [*]u32, bits: usize, a: f16) callconv(.c) void { - return bigIntFromFloat(.unsigned, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixunshfei(r: [*]u8, bits: usize, a: f16) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixunssfei.zig b/lib/compiler_rt/fixunssfei.zig index 0f8c1a2948ec..179e395de077 100644 --- a/lib/compiler_rt/fixunssfei.zig +++ b/lib/compiler_rt/fixunssfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixunssfei, .{ .name = "__fixunssfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixunssfei(r: [*]u32, bits: usize, a: f32) callconv(.c) void { - return bigIntFromFloat(.unsigned, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixunssfei(r: [*]u8, bits: usize, a: f32) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixunstfei.zig b/lib/compiler_rt/fixunstfei.zig index 8668e439846e..b69fb31ab600 100644 --- a/lib/compiler_rt/fixunstfei.zig +++ b/lib/compiler_rt/fixunstfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixunstfei, .{ .name = "__fixunstfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixunstfei(r: [*]u32, bits: usize, a: f128) callconv(.c) void { - return bigIntFromFloat(.unsigned, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixunstfei(r: [*]u8, bits: usize, a: f128) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixunsxfei.zig b/lib/compiler_rt/fixunsxfei.zig index 079aa7fe9f77..ca1bae9a805a 100644 --- a/lib/compiler_rt/fixunsxfei.zig +++ b/lib/compiler_rt/fixunsxfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixunsxfei, .{ .name = "__fixunsxfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixunsxfei(r: [*]u32, bits: usize, a: f80) callconv(.c) void { - return bigIntFromFloat(.unsigned, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixunsxfei(r: [*]u8, bits: usize, a: f80) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/fixxfei.zig b/lib/compiler_rt/fixxfei.zig index 8a4d3d0de121..5efe7da7e952 100644 --- a/lib/compiler_rt/fixxfei.zig +++ b/lib/compiler_rt/fixxfei.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__fixxfei, .{ .name = "__fixxfei", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __fixxfei(r: [*]u32, bits: usize, a: f80) callconv(.c) void { - return bigIntFromFloat(.signed, r[0 .. divCeil(usize, bits, 32) catch unreachable], a); +pub fn __fixxfei(r: [*]u8, bits: usize, a: f80) callconv(.c) void { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a); } diff --git a/lib/compiler_rt/float_from_int_test.zig b/lib/compiler_rt/float_from_int_test.zig index f04dd30bfc5f..8c908f420959 100644 --- a/lib/compiler_rt/float_from_int_test.zig +++ b/lib/compiler_rt/float_from_int_test.zig @@ -1,8 +1,6 @@ const std = @import("std"); -const builtin = @import("builtin"); const testing = std.testing; const math = std.math; -const endian = builtin.cpu.arch.endian(); const __floatunsihf = @import("floatunsihf.zig").__floatunsihf; @@ -237,12 +235,10 @@ test "floatuntisf" { fn test_floateisf(expected: u32, comptime T: type, a: T) !void { const int = @typeInfo(T).int; - var a_buf: [@divExact(int.bits, 32)]u32 = undefined; - std.mem.writeInt(T, std.mem.asBytes(&a_buf), a, endian); const r = switch (int.signedness) { .signed => __floateisf, .unsigned => __floatuneisf, - }(&a_buf, int.bits); + }(@ptrCast(&a), int.bits); try testing.expect(expected == @as(u32, @bitCast(r))); } diff --git a/lib/compiler_rt/floateidf.zig b/lib/compiler_rt/floateidf.zig index 4cdaf37ce7ba..c540cc1d1c40 100644 --- a/lib/compiler_rt/floateidf.zig +++ b/lib/compiler_rt/floateidf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floateidf, .{ .name = "__floateidf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floateidf(a: [*]const u32, bits: usize) callconv(.c) f64 { - return floatFromBigInt(f64, .signed, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floateidf(a: [*]const u8, bits: usize) callconv(.c) f64 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f64, .signed, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floateihf.zig b/lib/compiler_rt/floateihf.zig index 7b74a981e738..b9544cc9b021 100644 --- a/lib/compiler_rt/floateihf.zig +++ b/lib/compiler_rt/floateihf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floateihf, .{ .name = "__floateihf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floateihf(a: [*]const u32, bits: usize) callconv(.c) f16 { - return floatFromBigInt(f16, .signed, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floateihf(a: [*]const u8, bits: usize) callconv(.c) f16 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f16, .signed, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floateisf.zig b/lib/compiler_rt/floateisf.zig index 2857b807857e..6420016d00de 100644 --- a/lib/compiler_rt/floateisf.zig +++ b/lib/compiler_rt/floateisf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floateisf, .{ .name = "__floateisf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floateisf(a: [*]const u32, bits: usize) callconv(.c) f32 { - return floatFromBigInt(f32, .signed, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floateisf(a: [*]const u8, bits: usize) callconv(.c) f32 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f32, .signed, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floateitf.zig b/lib/compiler_rt/floateitf.zig index bedd37e21db6..6dfaac295574 100644 --- a/lib/compiler_rt/floateitf.zig +++ b/lib/compiler_rt/floateitf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floateitf, .{ .name = "__floateitf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floateitf(a: [*]const u32, bits: usize) callconv(.c) f128 { - return floatFromBigInt(f128, .signed, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floateitf(a: [*]const u8, bits: usize) callconv(.c) f128 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f128, .signed, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floateixf.zig b/lib/compiler_rt/floateixf.zig index e0b72e075f2d..4c76e8b12f1a 100644 --- a/lib/compiler_rt/floateixf.zig +++ b/lib/compiler_rt/floateixf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floateixf, .{ .name = "__floateixf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floateixf(a: [*]const u32, bits: usize) callconv(.c) f80 { - return floatFromBigInt(f80, .signed, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floateixf(a: [*]const u8, bits: usize) callconv(.c) f80 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f80, .signed, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floatuneidf.zig b/lib/compiler_rt/floatuneidf.zig index 34d700c2d368..e47ae0309ba6 100644 --- a/lib/compiler_rt/floatuneidf.zig +++ b/lib/compiler_rt/floatuneidf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floatuneidf, .{ .name = "__floatuneidf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floatuneidf(a: [*]const u32, bits: usize) callconv(.c) f64 { - return floatFromBigInt(f64, .unsigned, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floatuneidf(a: [*]const u8, bits: usize) callconv(.c) f64 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f64, .unsigned, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floatuneihf.zig b/lib/compiler_rt/floatuneihf.zig index 93ebe4221efa..cc8962161cdd 100644 --- a/lib/compiler_rt/floatuneihf.zig +++ b/lib/compiler_rt/floatuneihf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floatuneihf, .{ .name = "__floatuneihf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floatuneihf(a: [*]const u32, bits: usize) callconv(.c) f16 { - return floatFromBigInt(f16, .unsigned, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floatuneihf(a: [*]const u8, bits: usize) callconv(.c) f16 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f16, .unsigned, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floatuneisf.zig b/lib/compiler_rt/floatuneisf.zig index 58e873e81e19..325b0afe7088 100644 --- a/lib/compiler_rt/floatuneisf.zig +++ b/lib/compiler_rt/floatuneisf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floatuneisf, .{ .name = "__floatuneisf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floatuneisf(a: [*]const u32, bits: usize) callconv(.c) f32 { - return floatFromBigInt(f32, .unsigned, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floatuneisf(a: [*]const u8, bits: usize) callconv(.c) f32 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f32, .unsigned, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floatuneitf.zig b/lib/compiler_rt/floatuneitf.zig index 61c2c93b2895..727d301f7bf3 100644 --- a/lib/compiler_rt/floatuneitf.zig +++ b/lib/compiler_rt/floatuneitf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floatuneitf, .{ .name = "__floatuneitf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floatuneitf(a: [*]const u32, bits: usize) callconv(.c) f128 { - return floatFromBigInt(f128, .unsigned, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floatuneitf(a: [*]const u8, bits: usize) callconv(.c) f128 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f128, .unsigned, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/floatuneixf.zig b/lib/compiler_rt/floatuneixf.zig index f2043dabba1f..adfa8aa5ee1c 100644 --- a/lib/compiler_rt/floatuneixf.zig +++ b/lib/compiler_rt/floatuneixf.zig @@ -1,6 +1,7 @@ -const divCeil = @import("std").math.divCeil; -const common = @import("./common.zig"); -const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt; +const std = @import("std"); +const builtin = @import("builtin"); +const common = @import("common.zig"); +const floatFromBigInt = @import("float_from_int.zig").floatFromBigInt; pub const panic = common.panic; @@ -8,6 +9,7 @@ comptime { @export(&__floatuneixf, .{ .name = "__floatuneixf", .linkage = common.linkage, .visibility = common.visibility }); } -pub fn __floatuneixf(a: [*]const u32, bits: usize) callconv(.c) f80 { - return floatFromBigInt(f80, .unsigned, a[0 .. divCeil(usize, bits, 32) catch unreachable]); +pub fn __floatuneixf(a: [*]const u8, bits: usize) callconv(.c) f80 { + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + return floatFromBigInt(f80, .unsigned, @ptrCast(@alignCast(a[0..byte_size]))); } diff --git a/lib/compiler_rt/int_from_float_test.zig b/lib/compiler_rt/int_from_float_test.zig index 5305ecf2a065..de96954dd154 100644 --- a/lib/compiler_rt/int_from_float_test.zig +++ b/lib/compiler_rt/int_from_float_test.zig @@ -1,8 +1,6 @@ const std = @import("std"); -const builtin = @import("builtin"); const testing = std.testing; const math = std.math; -const endian = builtin.cpu.arch.endian(); const __fixunshfti = @import("fixunshfti.zig").__fixunshfti; const __fixunsxfti = @import("fixunsxfti.zig").__fixunsxfti; @@ -350,14 +348,12 @@ test "fixunssfti" { fn test_fixsfei(comptime T: type, expected: T, a: f32) !void { const int = @typeInfo(T).int; - var expected_buf: [@divExact(int.bits, 32)]u32 = undefined; - std.mem.writeInt(T, std.mem.asBytes(&expected_buf), expected, endian); - var actual_buf: [@divExact(int.bits, 32)]u32 = undefined; + var actual: T = undefined; _ = switch (int.signedness) { .signed => __fixsfei, .unsigned => __fixunssfei, - }(&actual_buf, int.bits, a); - try testing.expect(std.mem.eql(u32, &expected_buf, &actual_buf)); + }(@ptrCast(&actual), int.bits, a); + try testing.expect(expected == actual); } test "fixsfei" { @@ -685,14 +681,12 @@ test "fixunsdfti" { fn test_fixdfei(comptime T: type, expected: T, a: f64) !void { const int = @typeInfo(T).int; - var expected_buf: [@divExact(int.bits, 32)]u32 = undefined; - std.mem.writeInt(T, std.mem.asBytes(&expected_buf), expected, endian); - var actual_buf: [@divExact(int.bits, 32)]u32 = undefined; + var actual: T = undefined; _ = switch (int.signedness) { .signed => __fixdfei, .unsigned => __fixunsdfei, - }(&actual_buf, int.bits, a); - try testing.expect(std.mem.eql(u32, &expected_buf, &actual_buf)); + }(@ptrCast(&actual), int.bits, a); + try testing.expect(expected == actual); } test "fixdfei" { diff --git a/lib/compiler_rt/udivmodei4.zig b/lib/compiler_rt/udivmodei4.zig index fa7f9746b10b..d84bace9fbac 100644 --- a/lib/compiler_rt/udivmodei4.zig +++ b/lib/compiler_rt/udivmodei4.zig @@ -112,19 +112,21 @@ pub fn divmod(q: ?[]u32, r: ?[]u32, u: []const u32, v: []const u32) !void { } } -pub fn __udivei4(r_q: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) callconv(.c) void { +pub fn __udivei4(q_p: [*]u8, u_p: [*]const u8, v_p: [*]const u8, bits: usize) callconv(.c) void { @setRuntimeSafety(builtin.is_test); - const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const q = r_q[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + const q: []u32 = @ptrCast(@alignCast(q_p[0..byte_size])); + const u: []const u32 = @ptrCast(@alignCast(u_p[0..byte_size])); + const v: []const u32 = @ptrCast(@alignCast(v_p[0..byte_size])); @call(.always_inline, divmod, .{ q, null, u, v }) catch unreachable; } -pub fn __umodei4(r_p: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) callconv(.c) void { +pub fn __umodei4(r_p: [*]u8, u_p: [*]const u8, v_p: [*]const u8, bits: usize) callconv(.c) void { @setRuntimeSafety(builtin.is_test); - const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; - const r = r_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; + const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits)); + const r: []u32 = @ptrCast(@alignCast(r_p[0..byte_size])); + const u: []const u32 = @ptrCast(@alignCast(u_p[0..byte_size])); + const v: []const u32 = @ptrCast(@alignCast(v_p[0..byte_size])); @call(.always_inline, divmod, .{ null, r, u, v }) catch unreachable; } diff --git a/lib/std/Target.zig b/lib/std/Target.zig index e9a973f2fd6e..e445ab42e6cd 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -2695,7 +2695,7 @@ pub fn stackAlignment(target: Target) u16 { /// Default signedness of `char` for the native C compiler for this target /// Note that char signedness is implementation-defined and many compilers provide /// an option to override the default signedness e.g. GCC's -funsigned-char / -fsigned-char -pub fn charSignedness(target: Target) std.builtin.Signedness { +pub fn cCharSignedness(target: Target) std.builtin.Signedness { if (target.os.tag.isDarwin() or target.os.tag == .windows or target.os.tag == .uefi) return .signed; return switch (target.cpu.arch) { @@ -3273,6 +3273,68 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { ); } +pub fn cMaxIntAlignment(target: std.Target) u16 { + return switch (target.cpu.arch) { + .avr => 1, + + .msp430 => 2, + + .xcore, + .propeller, + => 4, + + .amdgcn, + .arm, + .armeb, + .thumb, + .thumbeb, + .lanai, + .hexagon, + .mips, + .mipsel, + .powerpc, + .powerpcle, + .riscv32, + .s390x, + => 8, + + // Even LLVMABIAlignmentOfType(i128) agrees on these targets. + .aarch64, + .aarch64_be, + .bpfel, + .bpfeb, + .mips64, + .mips64el, + .nvptx, + .nvptx64, + .powerpc64, + .powerpc64le, + .riscv64, + .sparc, + .sparc64, + .wasm32, + .wasm64, + .x86, + .x86_64, + => 16, + + // Below this comment are unverified but based on the fact that C requires + // int128_t to be 16 bytes aligned, it's a safe default. + .arc, + .csky, + .kalimba, + .loongarch32, + .loongarch64, + .m68k, + .spirv, + .spirv32, + .spirv64, + .ve, + .xtensa, + => 16, + }; +} + pub fn cCallingConvention(target: Target) ?std.builtin.CallingConvention { return switch (target.cpu.arch) { .x86_64 => switch (target.os.tag) { diff --git a/lib/std/zig/target.zig b/lib/std/zig/target.zig index 2574f26d18e0..4b20c132a684 100644 --- a/lib/std/zig/target.zig +++ b/lib/std/zig/target.zig @@ -352,6 +352,38 @@ fn eqlIgnoreCase(ignore_case: bool, a: []const u8, b: []const u8) bool { } } +pub fn intByteSize(target: std.Target, bits: u16) u19 { + return std.mem.alignForward(u19, @intCast((@as(u17, bits) + 7) / 8), intAlignment(target, bits)); +} + +pub fn intAlignment(target: std.Target, bits: u16) u16 { + return switch (target.cpu.arch) { + .x86 => switch (bits) { + 0 => 0, + 1...8 => 1, + 9...16 => 2, + 17...32 => 4, + 33...64 => switch (target.os.tag) { + .uefi, .windows => 8, + else => 4, + }, + else => 16, + }, + .x86_64 => switch (bits) { + 0 => 0, + 1...8 => 1, + 9...16 => 2, + 17...32 => 4, + 33...64 => 8, + else => 16, + }, + else => return @min( + std.math.ceilPowerOfTwoPromote(u16, @as(u16, @intCast((@as(u17, bits) + 7) / 8))), + target.cMaxIntAlignment(), + ), + }; +} + const std = @import("std"); const assert = std.debug.assert; const Allocator = std.mem.Allocator; diff --git a/src/Type.zig b/src/Type.zig index f067ac84b25e..a789edefe193 100644 --- a/src/Type.zig +++ b/src/Type.zig @@ -968,7 +968,7 @@ pub fn abiAlignmentInner( else => switch (ip.indexToKey(ty.toIntern())) { .int_type => |int_type| { if (int_type.bits == 0) return .{ .scalar = .@"1" }; - return .{ .scalar = intAbiAlignment(int_type.bits, target) }; + return .{ .scalar = .fromByteUnits(std.zig.target.intAlignment(target, int_type.bits)) }; }, .ptr_type, .anyframe_type => { return .{ .scalar = ptrAbiAlignment(target) }; @@ -1021,7 +1021,7 @@ pub fn abiAlignmentInner( .error_set_type, .inferred_error_set_type => { const bits = zcu.errorSetBits(); if (bits == 0) return .{ .scalar = .@"1" }; - return .{ .scalar = intAbiAlignment(bits, target) }; + return .{ .scalar = .fromByteUnits(std.zig.target.intAlignment(target, bits)) }; }, // represents machine code; not a pointer @@ -1034,7 +1034,7 @@ pub fn abiAlignmentInner( .usize, .isize, - => return .{ .scalar = intAbiAlignment(target.ptrBitWidth(), target) }, + => return .{ .scalar = .fromByteUnits(std.zig.target.intAlignment(target, target.ptrBitWidth())) }, .c_char => return .{ .scalar = cTypeAlign(target, .char) }, .c_short => return .{ .scalar = cTypeAlign(target, .short) }, @@ -1065,7 +1065,7 @@ pub fn abiAlignmentInner( .anyerror, .adhoc_inferred_error_set => { const bits = zcu.errorSetBits(); if (bits == 0) return .{ .scalar = .@"1" }; - return .{ .scalar = intAbiAlignment(bits, target) }; + return .{ .scalar = .fromByteUnits(std.zig.target.intAlignment(target, bits)) }; }, .void, @@ -1297,7 +1297,7 @@ pub fn abiSizeInner( else => switch (ip.indexToKey(ty.toIntern())) { .int_type => |int_type| { if (int_type.bits == 0) return .{ .scalar = 0 }; - return .{ .scalar = intAbiSize(int_type.bits, target) }; + return .{ .scalar = std.zig.target.intByteSize(target, int_type.bits) }; }, .ptr_type => |ptr_type| switch (ptr_type.flags.size) { .slice => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) * 2 }, @@ -1359,7 +1359,7 @@ pub fn abiSizeInner( .error_set_type, .inferred_error_set_type => { const bits = zcu.errorSetBits(); if (bits == 0) return .{ .scalar = 0 }; - return .{ .scalar = intAbiSize(bits, target) }; + return .{ .scalar = std.zig.target.intByteSize(target, bits) }; }, .error_union_type => |error_union_type| { @@ -1452,7 +1452,7 @@ pub fn abiSizeInner( .anyerror, .adhoc_inferred_error_set => { const bits = zcu.errorSetBits(); if (bits == 0) return .{ .scalar = 0 }; - return .{ .scalar = intAbiSize(bits, target) }; + return .{ .scalar = std.zig.target.intByteSize(target, bits) }; }, .noreturn => unreachable, @@ -1606,100 +1606,6 @@ pub fn ptrAbiAlignment(target: Target) Alignment { return Alignment.fromNonzeroByteUnits(@divExact(target.ptrBitWidth(), 8)); } -pub fn intAbiSize(bits: u16, target: Target) u64 { - return intAbiAlignment(bits, target).forward(@as(u16, @intCast((@as(u17, bits) + 7) / 8))); -} - -pub fn intAbiAlignment(bits: u16, target: Target) Alignment { - return switch (target.cpu.arch) { - .x86 => switch (bits) { - 0 => .none, - 1...8 => .@"1", - 9...16 => .@"2", - 17...32 => .@"4", - 33...64 => switch (target.os.tag) { - .uefi, .windows => .@"8", - else => .@"4", - }, - else => .@"16", - }, - .x86_64 => switch (bits) { - 0 => .none, - 1...8 => .@"1", - 9...16 => .@"2", - 17...32 => .@"4", - 33...64 => .@"8", - else => .@"16", - }, - else => return Alignment.fromByteUnits(@min( - std.math.ceilPowerOfTwoPromote(u16, @as(u16, @intCast((@as(u17, bits) + 7) / 8))), - maxIntAlignment(target), - )), - }; -} - -pub fn maxIntAlignment(target: std.Target) u16 { - return switch (target.cpu.arch) { - .avr => 1, - - .msp430 => 2, - - .xcore, - .propeller, - => 4, - - .amdgcn, - .arm, - .armeb, - .thumb, - .thumbeb, - .lanai, - .hexagon, - .mips, - .mipsel, - .powerpc, - .powerpcle, - .riscv32, - .s390x, - => 8, - - // Even LLVMABIAlignmentOfType(i128) agrees on these targets. - .aarch64, - .aarch64_be, - .bpfel, - .bpfeb, - .mips64, - .mips64el, - .nvptx, - .nvptx64, - .powerpc64, - .powerpc64le, - .riscv64, - .sparc, - .sparc64, - .wasm32, - .wasm64, - .x86, - .x86_64, - => 16, - - // Below this comment are unverified but based on the fact that C requires - // int128_t to be 16 bytes aligned, it's a safe default. - .arc, - .csky, - .kalimba, - .loongarch32, - .loongarch64, - .m68k, - .spirv, - .spirv32, - .spirv64, - .ve, - .xtensa, - => 16, - }; -} - pub fn bitSize(ty: Type, zcu: *const Zcu) u64 { return bitSizeInner(ty, .normal, zcu, {}) catch unreachable; } @@ -2331,7 +2237,7 @@ pub fn isInt(self: Type, zcu: *const Zcu) bool { /// Returns true if and only if the type is a fixed-width, signed integer. pub fn isSignedInt(ty: Type, zcu: *const Zcu) bool { return switch (ty.toIntern()) { - .c_char_type => zcu.getTarget().charSignedness() == .signed, + .c_char_type => zcu.getTarget().cCharSignedness() == .signed, .isize_type, .c_short_type, .c_int_type, .c_long_type, .c_longlong_type => true, else => switch (zcu.intern_pool.indexToKey(ty.toIntern())) { .int_type => |int_type| int_type.signedness == .signed, @@ -2343,7 +2249,7 @@ pub fn isSignedInt(ty: Type, zcu: *const Zcu) bool { /// Returns true if and only if the type is a fixed-width, unsigned integer. pub fn isUnsignedInt(ty: Type, zcu: *const Zcu) bool { return switch (ty.toIntern()) { - .c_char_type => zcu.getTarget().charSignedness() == .unsigned, + .c_char_type => zcu.getTarget().cCharSignedness() == .unsigned, .usize_type, .c_ushort_type, .c_uint_type, .c_ulong_type, .c_ulonglong_type => true, else => switch (zcu.intern_pool.indexToKey(ty.toIntern())) { .int_type => |int_type| int_type.signedness == .unsigned, @@ -2374,7 +2280,7 @@ pub fn intInfo(starting_ty: Type, zcu: *const Zcu) InternPool.Key.IntType { }, .usize_type => return .{ .signedness = .unsigned, .bits = target.ptrBitWidth() }, .isize_type => return .{ .signedness = .signed, .bits = target.ptrBitWidth() }, - .c_char_type => return .{ .signedness = zcu.getTarget().charSignedness(), .bits = target.cTypeBitSize(.char) }, + .c_char_type => return .{ .signedness = zcu.getTarget().cCharSignedness(), .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) }, diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index c0eea14c9274..ceffcb3c7a79 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -15995,7 +15995,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, } }, }, .{ @@ -16028,7 +16028,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, } }, }, .{ @@ -16468,7 +16468,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ .@"0:", ._, .lea, .tmp1p, .memia(.dst0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp3p, .memia(.src1, .tmp0, .add_unaligned_size), ._, ._ }, - .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .add, .tmp0p, .sa(.src0, .add_elem_size), ._, ._ }, .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, @@ -16504,7 +16504,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ .@"0:", ._, .lea, .tmp1p, .memia(.dst0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp3p, .memia(.src1, .tmp0, .add_unaligned_size), ._, ._ }, - .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .add, .tmp0p, .sa(.src0, .add_elem_size), ._, ._ }, .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, @@ -72598,7 +72598,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", .v_ps, .xor, .tmp4x, .tmp4x, .tmp4x, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .vp_w, .insr, .tmp4x, .tmp4x, .memia(.src0w, .tmp0, .add_unaligned_size), .ui(0) }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -72633,7 +72633,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", .v_ps, .xor, .tmp4x, .tmp4x, .tmp4x, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .vp_w, .insr, .tmp4x, .tmp4x, .memia(.src0w, .tmp0, .add_unaligned_size), .ui(0) }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -72668,7 +72668,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._ps, .xor, .tmp4x, .tmp4x, ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .p_w, .insr, .tmp4x, .memia(.src0w, .tmp0, .add_unaligned_size), .ui(0), ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -72703,7 +72703,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._ps, .xor, .tmp4x, .tmp4x, ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .p_w, .insr, .tmp4x, .memia(.src0w, .tmp0, .add_unaligned_size), .ui(0), ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -72739,7 +72739,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ .@"0:", ._, .movzx, .tmp3d, .memia(.src0w, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, .{ ._, ._, .mov, .tmp4d, .tmp3d, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ss, .mov, .tmp5x, .tmp4d, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -72775,7 +72775,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ .@"0:", ._, .movzx, .tmp3d, .memia(.src0w, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, .{ ._, ._, .mov, .tmp4d, .tmp3d, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ss, .mov, .tmp5x, .tmp4d, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -74166,7 +74166,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_ss, .mov, .tmp4x, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -74200,7 +74200,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_ss, .mov, .tmp4x, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -74234,7 +74234,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ss, .mov, .tmp4x, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -74268,7 +74268,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ss, .mov, .tmp4x, .memia(.src0d, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -74626,7 +74626,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -74654,7 +74654,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -76322,7 +76322,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_sd, .mov, .tmp4x, .memia(.src0q, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -76356,7 +76356,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_sd, .mov, .tmp4x, .memia(.src0q, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -76390,7 +76390,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._sd, .mov, .tmp4x, .memia(.src0q, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -76424,7 +76424,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._sd, .mov, .tmp4x, .memia(.src0q, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -76459,7 +76459,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._ps, .xor, .tmp4x, .tmp4x, ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .movl, .tmp4x, .memia(.src0q, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -76494,7 +76494,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._ps, .xor, .tmp4x, .tmp4x, ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .movl, .tmp4x, .memia(.src0q, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -77437,7 +77437,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_dqa, .mov, .tmp2x, .src0x, ._, ._ }, .{ ._, .v_dqa, .mov, .tmp3x, .tmp2x, ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, @@ -77467,7 +77467,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_dqa, .mov, .tmp2x, .src0x, ._, ._ }, .{ ._, .v_dqa, .mov, .tmp3x, .tmp2x, ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, @@ -77497,7 +77497,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._dqa, .mov, .tmp2x, .src0x, ._, ._ }, .{ ._, ._dqa, .mov, .tmp3x, .tmp2x, ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, @@ -77527,7 +77527,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._dqa, .mov, .tmp2x, .src0x, ._, ._ }, .{ ._, ._dqa, .mov, .tmp3x, .tmp2x, ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, @@ -77557,7 +77557,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .mova, .tmp2x, .src0x, ._, ._ }, .{ ._, ._ps, .mova, .tmp3x, .tmp2x, ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, @@ -77587,7 +77587,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .mova, .tmp2x, .src0x, ._, ._ }, .{ ._, ._ps, .mova, .tmp3x, .tmp2x, ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, @@ -77620,7 +77620,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", .v_dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_dqa, .mov, .tmp5x, .tmp4x, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -77655,7 +77655,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", .v_dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_dqa, .mov, .tmp5x, .tmp4x, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -77690,7 +77690,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._dqa, .mov, .tmp5x, .tmp4x, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -77725,7 +77725,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._dqa, .mov, .tmp5x, .tmp4x, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -77760,7 +77760,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._ps, .mova, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .mova, .tmp5x, .tmp4x, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -77795,7 +77795,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._ps, .mova, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .mova, .tmp5x, .tmp4x, ._, ._ }, .{ ._, ._, .call, .tmp6d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -78838,7 +78838,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -78866,7 +78866,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -78896,7 +78896,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -78930,7 +78930,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, .v_dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -78964,7 +78964,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -78998,7 +78998,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._dqa, .mov, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -79032,7 +79032,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .mova, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -79066,7 +79066,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.dst0), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp1p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.dst0, .add_bit_size), ._, ._ }, .{ ._, ._ps, .mova, .tmp4x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .lea, .tmp1p, .leaa(.tmp1, .add_dst0_elem_size), ._, ._ }, @@ -79581,7 +79581,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -79609,7 +79609,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -81638,7 +81638,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .vp_w, .extr, .memia(.dst0w, .tmp1, .add_unaligned_size), .tmp5x, .ui(0), ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -81672,7 +81672,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .p_w, .extr, .memia(.dst0w, .tmp1, .add_unaligned_size), .tmp5x, .ui(0), ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -81706,7 +81706,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .p_w, .extr, .tmp2d, .tmp5x, .ui(0), ._ }, .{ ._, ._, .mov, .memia(.dst0w, .tmp1, .add_unaligned_size), .tmp2w, ._, ._ }, @@ -81741,7 +81741,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ss, .mov, .tmp6d, .tmp5d, ._, ._ }, .{ ._, ._, .mov, .tmp2d, .tmp6d, ._, ._ }, @@ -81777,7 +81777,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .vp_w, .extr, .memia(.dst0w, .tmp1, .add_unaligned_size), .tmp5x, .ui(0), ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -81811,7 +81811,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .p_w, .extr, .memia(.dst0w, .tmp1, .add_unaligned_size), .tmp5x, .ui(0), ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -81845,7 +81845,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .p_w, .extr, .tmp2d, .tmp5x, .ui(0), ._ }, .{ ._, ._, .mov, .memia(.dst0w, .tmp1, .add_unaligned_size), .tmp2w, ._, ._ }, @@ -81880,7 +81880,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ss, .mov, .tmp6d, .tmp5d, ._, ._ }, .{ ._, ._, .mov, .tmp2d, .tmp6d, ._, ._ }, @@ -82358,7 +82358,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -82386,7 +82386,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -83892,7 +83892,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .v_ss, .mov, .memia(.dst0d, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -83926,7 +83926,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ss, .mov, .memia(.dst0d, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -83960,7 +83960,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .v_ss, .mov, .memia(.dst0d, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -83994,7 +83994,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ss, .mov, .memia(.dst0d, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -84688,7 +84688,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -84716,7 +84716,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -86579,7 +86579,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .v_sd, .mov, .memia(.dst0q, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -86613,7 +86613,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._sd, .mov, .memia(.dst0q, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -86647,7 +86647,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ps, .movl, .memia(.dst0q, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -86681,7 +86681,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .v_sd, .mov, .memia(.dst0q, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -86715,7 +86715,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._sd, .mov, .memia(.dst0q, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -86749,7 +86749,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ps, .movl, .memia(.dst0q, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -87050,7 +87050,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -87078,7 +87078,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -87721,7 +87721,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ .pseudo, .f_cstp, .de, ._, ._, ._, ._ }, .{ ._, .f_p, .st, .memia(.dst0t, .tmp1, .add_unaligned_size), ._, ._, ._ }, @@ -87756,7 +87756,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ .pseudo, .f_cstp, .de, ._, ._, ._, ._ }, .{ ._, .f_p, .st, .memia(.dst0t, .tmp1, .add_unaligned_size), ._, ._, ._ }, @@ -88057,7 +88057,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -88085,7 +88085,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .clobbers = .{ .eflags = true, .caller_preserved = .ccc }, .each = .{ .once = &.{ .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, - .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp1d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp2d, ._, ._, ._ }, } }, }, .{ @@ -89261,7 +89261,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .v_dqa, .mov, .memia(.dst0x, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -89295,7 +89295,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._dqa, .mov, .memia(.dst0x, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -89329,7 +89329,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ps, .mova, .memia(.dst0x, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -89363,7 +89363,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, .v_dqa, .mov, .memia(.dst0x, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -89397,7 +89397,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._dqa, .mov, .memia(.dst0x, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -89431,7 +89431,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { .{ ._, ._, .lea, .tmp0p, .mem(.src0), ._, ._ }, .{ ._, ._, .mov, .tmp1p, .sa(.dst0, .sub_unaligned_size), ._, ._ }, .{ .@"0:", ._, .mov, .tmp2p, .tmp0p, ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, .{ ._, ._ps, .mova, .memia(.dst0x, .tmp1, .add_unaligned_size), .tmp5x, ._, ._ }, .{ ._, ._, .lea, .tmp0p, .leaa(.tmp0, .add_src0_elem_size), ._, ._ }, @@ -109873,7 +109873,7 @@ fn intInfo(cg: *CodeGen, ty: Type) ?std.builtin.Type.Int { .anyerror => .{ .signedness = .unsigned, .bits = zcu.errorSetBits() }, .isize => .{ .signedness = .signed, .bits = cg.target.ptrBitWidth() }, .usize => .{ .signedness = .unsigned, .bits = cg.target.ptrBitWidth() }, - .c_char => .{ .signedness = cg.target.charSignedness(), .bits = cg.target.cTypeBitSize(.char) }, + .c_char => .{ .signedness = cg.target.cCharSignedness(), .bits = cg.target.cTypeBitSize(.char) }, .c_short => .{ .signedness = .signed, .bits = cg.target.cTypeBitSize(.short) }, .c_ushort => .{ .signedness = .unsigned, .bits = cg.target.cTypeBitSize(.short) }, .c_int => .{ .signedness = .signed, .bits = cg.target.cTypeBitSize(.int) }, @@ -114554,7 +114554,7 @@ const Temp = struct { .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, } }, }, .{ @@ -114587,7 +114587,7 @@ const Temp = struct { .{ ._, ._, .lea, .tmp0p, .mem(.dst0), ._, ._ }, .{ ._, ._, .lea, .tmp1p, .mem(.src0), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .mem(.src1), ._, ._ }, - .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_8_size), ._, ._ }, + .{ ._, ._, .mov, .tmp3d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp4d, ._, ._, ._ }, } }, }, .{ @@ -115027,7 +115027,7 @@ const Temp = struct { .{ .@"0:", ._, .lea, .tmp1p, .memia(.dst0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp3p, .memia(.src1, .tmp0, .add_unaligned_size), ._, ._ }, - .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .add, .tmp0p, .sa(.src0, .add_elem_size), ._, ._ }, .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, @@ -115063,7 +115063,7 @@ const Temp = struct { .{ .@"0:", ._, .lea, .tmp1p, .memia(.dst0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp2p, .memia(.src0, .tmp0, .add_unaligned_size), ._, ._ }, .{ ._, ._, .lea, .tmp3p, .memia(.src1, .tmp0, .add_unaligned_size), ._, ._ }, - .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_8_elem_size), ._, ._ }, + .{ ._, ._, .mov, .tmp4d, .sa(.src0, .add_bit_size), ._, ._ }, .{ ._, ._, .call, .tmp5d, ._, ._, ._ }, .{ ._, ._, .add, .tmp0p, .sa(.src0, .add_elem_size), ._, ._ }, .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, @@ -116414,7 +116414,6 @@ const Select = struct { const none: Adjust = .{ .sign = .pos, .lhs = .none, .op = .mul, .rhs = .@"1" }; const sub_ptr_size: Adjust = .{ .sign = .neg, .lhs = .ptr_size, .op = .mul, .rhs = .@"1" }; const add_ptr_bit_size: Adjust = .{ .sign = .pos, .lhs = .ptr_bit_size, .op = .mul, .rhs = .@"1" }; - const add_8_size: Adjust = .{ .sign = .pos, .lhs = .size, .op = .mul, .rhs = .@"8" }; const add_size: Adjust = .{ .sign = .pos, .lhs = .size, .op = .mul, .rhs = .@"1" }; const add_size_div_4: Adjust = .{ .sign = .pos, .lhs = .size, .op = .div, .rhs = .@"4" }; const add_size_div_8: Adjust = .{ .sign = .pos, .lhs = .size, .op = .div, .rhs = .@"8" }; @@ -116446,7 +116445,6 @@ const Select = struct { const add_2_len: Adjust = .{ .sign = .pos, .lhs = .len, .op = .mul, .rhs = .@"2" }; const add_len: Adjust = .{ .sign = .pos, .lhs = .len, .op = .mul, .rhs = .@"1" }; const sub_len: Adjust = .{ .sign = .neg, .lhs = .len, .op = .mul, .rhs = .@"1" }; - const add_8_elem_size: Adjust = .{ .sign = .pos, .lhs = .elem_size, .op = .mul, .rhs = .@"8" }; const add_elem_size: Adjust = .{ .sign = .pos, .lhs = .elem_size, .op = .mul, .rhs = .@"1" }; const add_elem_size_div_8: Adjust = .{ .sign = .pos, .lhs = .elem_size, .op = .div, .rhs = .@"8" }; const sub_elem_size_div_8: Adjust = .{ .sign = .neg, .lhs = .elem_size, .op = .div, .rhs = .@"8" }; diff --git a/src/codegen/c/Type.zig b/src/codegen/c/Type.zig index 451bbc781871..0b3066f9bdf5 100644 --- a/src/codegen/c/Type.zig +++ b/src/codegen/c/Type.zig @@ -78,7 +78,7 @@ pub fn isInteger(ctype: CType) bool { pub fn signedness(ctype: CType, mod: *Module) std.builtin.Signedness { return switch (ctype.index) { - .char => mod.resolved_target.result.charSignedness(), + .char => mod.resolved_target.result.cCharSignedness(), .@"signed char", .short, .int, @@ -1319,10 +1319,9 @@ pub const Pool = struct { }, else => { const target = &mod.resolved_target.result; - const abi_align = Type.intAbiAlignment(int_info.bits, target.*); - const abi_align_bytes = abi_align.toByteUnits().?; + const abi_align_bytes = std.zig.target.intAlignment(target.*, int_info.bits); const array_ctype = try pool.getArray(allocator, .{ - .len = @divExact(Type.intAbiSize(int_info.bits, target.*), abi_align_bytes), + .len = @divExact(std.zig.target.intByteSize(target.*, int_info.bits), abi_align_bytes), .elem_ctype = try pool.fromIntInfo(allocator, .{ .signedness = .unsigned, .bits = @intCast(abi_align_bytes * 8), @@ -1333,7 +1332,7 @@ pub const Pool = struct { .{ .name = .{ .index = .array }, .ctype = array_ctype, - .alignas = AlignAs.fromAbiAlignment(abi_align), + .alignas = AlignAs.fromAbiAlignment(.fromByteUnits(abi_align_bytes)), }, }; return pool.fromFields(allocator, .@"struct", &fields, kind); @@ -1437,7 +1436,7 @@ pub const Pool = struct { .name = .{ .index = .len }, .ctype = .usize, .alignas = AlignAs.fromAbiAlignment( - Type.intAbiAlignment(target.ptrBitWidth(), target.*), + .fromByteUnits(std.zig.target.intAlignment(target.*, target.ptrBitWidth())), ), }, }; @@ -1937,7 +1936,7 @@ pub const Pool = struct { .name = .{ .index = .len }, .ctype = .usize, .alignas = AlignAs.fromAbiAlignment( - Type.intAbiAlignment(target.ptrBitWidth(), target.*), + .fromByteUnits(std.zig.target.intAlignment(target.*, target.ptrBitWidth())), ), }, }; @@ -2057,7 +2056,7 @@ pub const Pool = struct { .name = .{ .index = .@"error" }, .ctype = error_set_ctype, .alignas = AlignAs.fromAbiAlignment( - Type.intAbiAlignment(error_set_bits, target.*), + .fromByteUnits(std.zig.target.intAlignment(target.*, error_set_bits)), ), }, .{ diff --git a/src/link/C.zig b/src/link/C.zig index 8a438456399c..0689faaae17e 100644 --- a/src/link/C.zig +++ b/src/link/C.zig @@ -396,7 +396,7 @@ fn abiDefines(self: *C, target: std.Target) !std.ArrayList(u8) { else => {}, } try writer.print("#define ZIG_TARGET_MAX_INT_ALIGNMENT {d}\n", .{ - Type.maxIntAlignment(target), + target.cMaxIntAlignment(), }); return defines; }