diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-05-18 13:12:12 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-05-28 15:10:22 -0400 |
| commit | d69f4c48fc6694293573aec6e370d429877a4c7d (patch) | |
| tree | bbe286dda007ce43f43f40bb2225e6e5a90cfc3f /src/codegen | |
| parent | 4f3b59f708058ce4e4b6a1cacd2a3dae6e1c7aae (diff) | |
| download | zig-d69f4c48fc6694293573aec6e370d429877a4c7d.tar.gz zig-d69f4c48fc6694293573aec6e370d429877a4c7d.zip | |
x86_64: rewrite bitwise `@reduce`
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/c/Type.zig | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/codegen/c/Type.zig b/src/codegen/c/Type.zig index 98edeb54a6..2fa3856cfc 100644 --- a/src/codegen/c/Type.zig +++ b/src/codegen/c/Type.zig @@ -1374,6 +1374,10 @@ pub const Pool = struct { .i64_type => return .i64, .u80_type, .u128_type => return .u128, .i128_type => return .i128, + .u256_type => return pool.fromIntInfo(allocator, .{ + .signedness = .unsigned, + .bits = 256, + }, mod, kind), .usize_type => return .usize, .isize_type => return .isize, .c_char_type => return .{ .index = .char }, @@ -1578,6 +1582,21 @@ pub const Pool = struct { }; return pool.fromFields(allocator, .@"struct", &fields, kind); }, + .vector_64_u8_type => { + const vector_ctype = try pool.getVector(allocator, .{ + .elem_ctype = .u8, + .len = 64, + }); + if (!kind.isParameter()) return vector_ctype; + var fields = [_]Info.Field{ + .{ + .name = .{ .index = .array }, + .ctype = vector_ctype, + .alignas = AlignAs.fromAbiAlignment(Type.u8.abiAlignment(zcu)), + }, + }; + return pool.fromFields(allocator, .@"struct", &fields, kind); + }, .vector_4_i16_type => { const vector_ctype = try pool.getVector(allocator, .{ .elem_ctype = .i16, @@ -1788,6 +1807,21 @@ pub const Pool = struct { }; return pool.fromFields(allocator, .@"struct", &fields, kind); }, + .vector_1_u128_type => { + const vector_ctype = try pool.getVector(allocator, .{ + .elem_ctype = .u128, + .len = 1, + }); + if (!kind.isParameter()) return vector_ctype; + var fields = [_]Info.Field{ + .{ + .name = .{ .index = .array }, + .ctype = vector_ctype, + .alignas = AlignAs.fromAbiAlignment(Type.u128.abiAlignment(zcu)), + }, + }; + return pool.fromFields(allocator, .@"struct", &fields, kind); + }, .vector_2_u128_type => { const vector_ctype = try pool.getVector(allocator, .{ .elem_ctype = .u128, @@ -1803,6 +1837,24 @@ pub const Pool = struct { }; return pool.fromFields(allocator, .@"struct", &fields, kind); }, + .vector_1_u256_type => { + const vector_ctype = try pool.getVector(allocator, .{ + .elem_ctype = try pool.fromIntInfo(allocator, .{ + .signedness = .unsigned, + .bits = 256, + }, mod, kind), + .len = 1, + }); + if (!kind.isParameter()) return vector_ctype; + var fields = [_]Info.Field{ + .{ + .name = .{ .index = .array }, + .ctype = vector_ctype, + .alignas = AlignAs.fromAbiAlignment(Type.u256.abiAlignment(zcu)), + }, + }; + return pool.fromFields(allocator, .@"struct", &fields, kind); + }, .vector_4_f16_type => { const vector_ctype = try pool.getVector(allocator, .{ .elem_ctype = .f16, |
