adding OpFMul
All checks were successful
Test / build (push) Successful in 46s
Build / build (push) Successful in 58s

This commit is contained in:
2026-01-12 16:59:53 +01:00
parent 8a79e8316d
commit 14e802709c
7 changed files with 90 additions and 37 deletions

View File

@@ -293,6 +293,14 @@ pub fn deinit(self: *Self, allocator: std.mem.Allocator) void {
self.decorations.deinit(allocator);
}
pub fn getValue(self: *Self) RuntimeError!*Value {
return switch (self.variant orelse return RuntimeError.InvalidSpirV) {
.Variable => |*v| &v.value,
.Constant => |*v| v,
else => RuntimeError.InvalidSpirV,
};
}
/// Performs a deep copy
pub fn dupe(self: *const Self, allocator: std.mem.Allocator) RuntimeError!Self {
return .{
@@ -330,7 +338,7 @@ pub fn dupe(self: *const Self, allocator: std.mem.Allocator) RuntimeError!Self {
},
},
},
else => {},
else => break :blk .{ .Type = t },
},
.Variable => |v| break :blk .{
.Variable = .{