| author | |
| committer | |
| log | 16d17addcbc0b217b0b575928a2b2690be81a736 |
| tree | 839d24bf5558a5162b9678a36772e3235c3fb0f3 |
| parent | b463e429b8e2b3d39592ff1c84bd886f46d21452 |
2 files changed, 9 insertions(+), 9 deletions(-)
src/translate_c.zig+6-6| ... | ... | @@ -2799,14 +2799,14 @@ fn transInitListExprVector( |
| 2799 | 2799 | const element_qt = vector_ty.getElementType(); |
| 2800 | 2800 | |
| 2801 | 2801 | if (init_count == 0) { |
| 2802 | const zero_node = try Tag.as.create(c.arena, .{ | |
| 2803 | .lhs = try transQualType(c, scope, element_qt, loc), | |
| 2804 | .rhs = Tag.zero_literal.init(), | |
| 2802 | const vec_node = try Tag.vector.create(c.arena, .{ | |
| 2803 | .lhs = try transCreateNodeNumber(c, num_elements, .int), | |
| 2804 | .rhs = try transQualType(c, scope, element_qt, loc), | |
| 2805 | 2805 | }); |
| 2806 | 2806 | |
| 2807 | return Tag.vector_zero_init.create(c.arena, .{ | |
| 2808 | .lhs = try transCreateNodeNumber(c, num_elements, .int), | |
| 2809 | .rhs = zero_node, | |
| 2807 | return Tag.as.create(c.arena, .{ | |
| 2808 | .lhs = vec_node, | |
| 2809 | .rhs = try Tag.vector_zero_init.create(c.arena, Tag.zero_literal.init()), | |
| 2810 | 2810 | }); |
| 2811 | 2811 | } |
| 2812 | 2812 |
src/translate_c/ast.zig+3-3| ... | ... | @@ -153,7 +153,7 @@ pub const Node = extern union { |
| 153 | 153 | div_exact, |
| 154 | 154 | /// @offsetOf(lhs, rhs) |
| 155 | 155 | offset_of, |
| 156 | /// @splat(lhs, rhs) | |
| 156 | /// @splat(operand) | |
| 157 | 157 | vector_zero_init, |
| 158 | 158 | /// @shuffle(type, a, b, mask) |
| 159 | 159 | shuffle, |
| ... | ... | @@ -284,6 +284,7 @@ pub const Node = extern union { |
| 284 | 284 | .int_cast, |
| 285 | 285 | .const_cast, |
| 286 | 286 | .volatile_cast, |
| 287 | .vector_zero_init, | |
| 287 | 288 | => Payload.UnOp, |
| 288 | 289 | |
| 289 | 290 | .add, |
| ... | ... | @@ -334,7 +335,6 @@ pub const Node = extern union { |
| 334 | 335 | .div_exact, |
| 335 | 336 | .offset_of, |
| 336 | 337 | .helpers_cast, |
| 337 | .vector_zero_init, | |
| 338 | 338 | => Payload.BinOp, |
| 339 | 339 | |
| 340 | 340 | .integer_literal, |
| ... | ... | @@ -1918,7 +1918,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { |
| 1918 | 1918 | }, |
| 1919 | 1919 | .vector_zero_init => { |
| 1920 | 1920 | const payload = node.castTag(.vector_zero_init).?.data; |
| 1921 | return renderBuiltinCall(c, "@splat", &.{ payload.lhs, payload.rhs }); | |
| 1921 | return renderBuiltinCall(c, "@splat", &.{payload}); | |
| 1922 | 1922 | }, |
| 1923 | 1923 | .field_access => { |
| 1924 | 1924 | const payload = node.castTag(.field_access).?.data; |