mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
Update translate-c to new splat syntax
This commit is contained in:
parent
b463e429b8
commit
16d17addcb
@ -2799,14 +2799,14 @@ fn transInitListExprVector(
|
||||
const element_qt = vector_ty.getElementType();
|
||||
|
||||
if (init_count == 0) {
|
||||
const zero_node = try Tag.as.create(c.arena, .{
|
||||
.lhs = try transQualType(c, scope, element_qt, loc),
|
||||
.rhs = Tag.zero_literal.init(),
|
||||
const vec_node = try Tag.vector.create(c.arena, .{
|
||||
.lhs = try transCreateNodeNumber(c, num_elements, .int),
|
||||
.rhs = try transQualType(c, scope, element_qt, loc),
|
||||
});
|
||||
|
||||
return Tag.vector_zero_init.create(c.arena, .{
|
||||
.lhs = try transCreateNodeNumber(c, num_elements, .int),
|
||||
.rhs = zero_node,
|
||||
return Tag.as.create(c.arena, .{
|
||||
.lhs = vec_node,
|
||||
.rhs = try Tag.vector_zero_init.create(c.arena, Tag.zero_literal.init()),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ pub const Node = extern union {
|
||||
div_exact,
|
||||
/// @offsetOf(lhs, rhs)
|
||||
offset_of,
|
||||
/// @splat(lhs, rhs)
|
||||
/// @splat(operand)
|
||||
vector_zero_init,
|
||||
/// @shuffle(type, a, b, mask)
|
||||
shuffle,
|
||||
@ -284,6 +284,7 @@ pub const Node = extern union {
|
||||
.int_cast,
|
||||
.const_cast,
|
||||
.volatile_cast,
|
||||
.vector_zero_init,
|
||||
=> Payload.UnOp,
|
||||
|
||||
.add,
|
||||
@ -334,7 +335,6 @@ pub const Node = extern union {
|
||||
.div_exact,
|
||||
.offset_of,
|
||||
.helpers_cast,
|
||||
.vector_zero_init,
|
||||
=> Payload.BinOp,
|
||||
|
||||
.integer_literal,
|
||||
@ -1918,7 +1918,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {
|
||||
},
|
||||
.vector_zero_init => {
|
||||
const payload = node.castTag(.vector_zero_init).?.data;
|
||||
return renderBuiltinCall(c, "@splat", &.{ payload.lhs, payload.rhs });
|
||||
return renderBuiltinCall(c, "@splat", &.{payload});
|
||||
},
|
||||
.field_access => {
|
||||
const payload = node.castTag(.field_access).?.data;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user