| ... | @@ -3617,7 +3617,6 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -3617,7 +3617,6 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 3617 | .Packed => switch (struct_ty.zigTypeTag()) { | 3617 | .Packed => switch (struct_ty.zigTypeTag()) { |
| 3618 | .Struct => result: { | 3618 | .Struct => result: { |
| 3619 | const struct_obj = struct_ty.castTag(.@"struct").?.data; | 3619 | const struct_obj = struct_ty.castTag(.@"struct").?.data; |
| 3620 | assert(struct_obj.layout == .Packed); | | |
| 3621 | const offset = struct_obj.packedFieldBitOffset(func.target, field_index); | 3620 | const offset = struct_obj.packedFieldBitOffset(func.target, field_index); |
| 3622 | const backing_ty = struct_obj.backing_int_ty; | 3621 | const backing_ty = struct_obj.backing_int_ty; |
| 3623 | const wasm_bits = toWasmBits(backing_ty.intInfo(func.target).bits) orelse { | 3622 | const wasm_bits = toWasmBits(backing_ty.intInfo(func.target).bits) orelse { |
| ... | @@ -3661,7 +3660,10 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -3661,7 +3660,10 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 3661 | const truncated = try func.trunc(shifted_value, field_ty, backing_ty); | 3660 | const truncated = try func.trunc(shifted_value, field_ty, backing_ty); |
| 3662 | break :result try truncated.toLocal(func, field_ty); | 3661 | break :result try truncated.toLocal(func, field_ty); |
| 3663 | }, | 3662 | }, |
| 3664 | .Union => return func.fail("TODO: airStructFieldVal for packed unions", .{}), | 3663 | .Union => result: { |
| | 3664 | const val = try func.load(operand, field_ty, 0); |
| | 3665 | break :result try val.toLocal(func, field_ty); |
| | 3666 | }, |
| 3665 | else => unreachable, | 3667 | else => unreachable, |
| 3666 | }, | 3668 | }, |
| 3667 | else => result: { | 3669 | else => result: { |
| ... | @@ -5032,7 +5034,7 @@ fn airUnionInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -5032,7 +5034,7 @@ fn airUnionInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5032 | break :result result_ptr; | 5034 | break :result result_ptr; |
| 5033 | }; | 5035 | }; |
| 5034 | | 5036 | |
| 5035 | func.finishAir(inst, result, &.{extra.init}); | 5037 | return func.finishAir(inst, result, &.{extra.init}); |
| 5036 | } | 5038 | } |
| 5037 | | 5039 | |
| 5038 | fn airPrefetch(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | 5040 | fn airPrefetch(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |