aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-03-11 18:24:37 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2025-03-21 21:51:08 -0400
commitc5c1c8538dc047bc7df9acd685791c4ba3e20ffb (patch)
treeca21b8d0f19c2b3e2a5d73d1659b495e2e2a6b4c /src/codegen
parented284c1f98ae08a36a7ef0776e22a4cfb2527fee (diff)
downloadzig-c5c1c8538dc047bc7df9acd685791c4ba3e20ffb.tar.gz
zig-c5c1c8538dc047bc7df9acd685791c4ba3e20ffb.zip
x86_64: rewrite wrapping multiplication
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c/Type.zig60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/codegen/c/Type.zig b/src/codegen/c/Type.zig
index ec1bf40e0c..451bbc7818 100644
--- a/src/codegen/c/Type.zig
+++ b/src/codegen/c/Type.zig
@@ -1474,6 +1474,66 @@ pub const Pool = struct {
};
return pool.fromFields(allocator, .@"struct", &fields, kind);
},
+ .vector_1_u8_type => {
+ const vector_ctype = try pool.getVector(allocator, .{
+ .elem_ctype = .u8,
+ .len = 1,
+ });
+ 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_2_u8_type => {
+ const vector_ctype = try pool.getVector(allocator, .{
+ .elem_ctype = .u8,
+ .len = 2,
+ });
+ 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_u8_type => {
+ const vector_ctype = try pool.getVector(allocator, .{
+ .elem_ctype = .u8,
+ .len = 4,
+ });
+ 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_8_u8_type => {
+ const vector_ctype = try pool.getVector(allocator, .{
+ .elem_ctype = .u8,
+ .len = 8,
+ });
+ 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_16_u8_type => {
const vector_ctype = try pool.getVector(allocator, .{
.elem_ctype = .u8,