| author | |
| committer | |
| log | c334956a54c691ad7e76341193d2d46df18090ef |
| tree | dbaaa5f600487979cb17c1f5f6c549a946b30347 |
| parent | dea3ed7f59347e87a1b8fa237202873988084ae8 |
14 files changed, 221 insertions(+), 150 deletions(-)
lib/std/builtin.zig+6-3| ... | ... | @@ -895,8 +895,8 @@ pub const VaList = switch (builtin.cpu.arch) { |
| 895 | 895 | .windows => *u8, |
| 896 | 896 | .ios, .macos, .tvos, .watchos, .visionos => *u8, |
| 897 | 897 | else => switch (builtin.zig_backend) { |
| 898 | .stage2_aarch64 => VaListAarch64, | |
| 899 | else => @compileError("disabled due to miscompilations"), | |
| 898 | else => VaListAarch64, | |
| 899 | .stage2_llvm => @compileError("disabled due to miscompilations"), | |
| 900 | 900 | }, |
| 901 | 901 | }, |
| 902 | 902 | .arm, .armeb, .thumb, .thumbeb => switch (builtin.os.tag) { |
| ... | ... | @@ -921,7 +921,10 @@ pub const VaList = switch (builtin.cpu.arch) { |
| 921 | 921 | .wasm32, .wasm64 => *anyopaque, |
| 922 | 922 | .x86 => *u8, |
| 923 | 923 | .x86_64 => switch (builtin.os.tag) { |
| 924 | .windows => @compileError("disabled due to miscompilations"), // *u8, | |
| 924 | .windows => switch (builtin.zig_backend) { | |
| 925 | else => *u8, | |
| 926 | .stage2_llvm => @compileError("disabled due to miscompilations"), | |
| 927 | }, | |
| 925 | 928 | else => VaListX86_64, |
| 926 | 929 | }, |
| 927 | 930 | .xtensa => VaListXtensa, |
lib/std/start.zig-1| ... | ... | @@ -626,7 +626,6 @@ pub inline fn callMain() u8 { |
| 626 | 626 | |
| 627 | 627 | const result = root.main() catch |err| { |
| 628 | 628 | switch (builtin.zig_backend) { |
| 629 | .stage2_aarch64, | |
| 630 | 629 | .stage2_powerpc, |
| 631 | 630 | .stage2_riscv64, |
| 632 | 631 | => { |
src/codegen/aarch64/Select.zig+215-109| ... | ... | @@ -3261,7 +3261,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 3261 | 3261 | assert(dst_int_info.bits == src_child_int_info.bits * src_len); |
| 3262 | 3262 | const src_child_size = src_ty.childType(zcu).abiSize(zcu); |
| 3263 | 3263 | if (8 * src_child_size == src_child_int_info.bits) { |
| 3264 | try dst_vi.value.defAddr(isel, dst_ty, dst_int_info, comptime &.initFill(.free)) orelse break :unused; | |
| 3264 | try dst_vi.value.defAddr(isel, dst_ty, .{ .wrap = dst_int_info }) orelse break :unused; | |
| 3265 | 3265 | |
| 3266 | 3266 | try call.prepareReturn(isel); |
| 3267 | 3267 | try call.finishReturn(isel); |
| ... | ... | @@ -3288,7 +3288,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 3288 | 3288 | assert(dst_child_int_info.bits * dst_len == src_int_info.bits); |
| 3289 | 3289 | const dst_child_size = dst_ty.childType(zcu).abiSize(zcu); |
| 3290 | 3290 | if (8 * dst_child_size == dst_child_int_info.bits) { |
| 3291 | try dst_vi.value.defAddr(isel, dst_ty, null, comptime &.initFill(.free)) orelse break :unused; | |
| 3291 | try dst_vi.value.defAddr(isel, dst_ty, .{}) orelse break :unused; | |
| 3292 | 3292 | |
| 3293 | 3293 | try call.prepareReturn(isel); |
| 3294 | 3294 | try call.finishReturn(isel); |
| ... | ... | @@ -3438,12 +3438,9 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 3438 | 3438 | .value, .constant => unreachable, |
| 3439 | 3439 | .address => |address_vi| { |
| 3440 | 3440 | maybe_ret_addr_vi = address_vi; |
| 3441 | _ = try def_ret_vi.value.defAddr( | |
| 3442 | isel, | |
| 3443 | isel.air.typeOfIndex(air.inst_index, ip), | |
| 3444 | null, | |
| 3445 | &call.caller_saved_regs, | |
| 3446 | ); | |
| 3441 | _ = try def_ret_vi.value.defAddr(isel, isel.air.typeOfIndex(air.inst_index, ip), .{ | |
| 3442 | .expected_live_registers = &call.caller_saved_regs, | |
| 3443 | }); | |
| 3447 | 3444 | }, |
| 3448 | 3445 | } |
| 3449 | 3446 | } |
| ... | ... | @@ -4953,37 +4950,34 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 4953 | 4950 | if (ptr_info.flags.is_volatile) _ = try isel.use(air.inst_index.toRef()); |
| 4954 | 4951 | if (isel.live_values.fetchRemove(air.inst_index)) |dst_vi| unused: { |
| 4955 | 4952 | defer dst_vi.value.deref(isel); |
| 4956 | switch (dst_vi.value.size(isel)) { | |
| 4957 | 0 => unreachable, | |
| 4958 | 1...Value.max_parts => { | |
| 4959 | const ptr_vi = try isel.use(ty_op.operand); | |
| 4960 | const ptr_mat = try ptr_vi.matReg(isel); | |
| 4961 | _ = try dst_vi.value.load(isel, ty_op.ty.toType(), ptr_mat.ra, .{ | |
| 4962 | .@"volatile" = ptr_info.flags.is_volatile, | |
| 4963 | }); | |
| 4964 | try ptr_mat.finish(isel); | |
| 4965 | }, | |
| 4966 | else => |size| { | |
| 4967 | try dst_vi.value.defAddr(isel, .fromInterned(ptr_info.child), null, comptime &.initFill(.free)) orelse break :unused; | |
| 4953 | const size = dst_vi.value.size(isel); | |
| 4954 | if (size <= Value.max_parts and ip.zigTypeTag(ptr_info.child) != .@"union") { | |
| 4955 | const ptr_vi = try isel.use(ty_op.operand); | |
| 4956 | const ptr_mat = try ptr_vi.matReg(isel); | |
| 4957 | _ = try dst_vi.value.load(isel, ty_op.ty.toType(), ptr_mat.ra, .{ | |
| 4958 | .@"volatile" = ptr_info.flags.is_volatile, | |
| 4959 | }); | |
| 4960 | try ptr_mat.finish(isel); | |
| 4961 | } else { | |
| 4962 | try dst_vi.value.defAddr(isel, .fromInterned(ptr_info.child), .{}) orelse break :unused; | |
| 4968 | 4963 | |
| 4969 | try call.prepareReturn(isel); | |
| 4970 | try call.finishReturn(isel); | |
| 4964 | try call.prepareReturn(isel); | |
| 4965 | try call.finishReturn(isel); | |
| 4971 | 4966 | |
| 4972 | try call.prepareCallee(isel); | |
| 4973 | try isel.global_relocs.append(gpa, .{ | |
| 4974 | .name = "memcpy", | |
| 4975 | .reloc = .{ .label = @intCast(isel.instructions.items.len) }, | |
| 4976 | }); | |
| 4977 | try isel.emit(.bl(0)); | |
| 4978 | try call.finishCallee(isel); | |
| 4967 | try call.prepareCallee(isel); | |
| 4968 | try isel.global_relocs.append(gpa, .{ | |
| 4969 | .name = "memcpy", | |
| 4970 | .reloc = .{ .label = @intCast(isel.instructions.items.len) }, | |
| 4971 | }); | |
| 4972 | try isel.emit(.bl(0)); | |
| 4973 | try call.finishCallee(isel); | |
| 4979 | 4974 | |
| 4980 | try call.prepareParams(isel); | |
| 4981 | const ptr_vi = try isel.use(ty_op.operand); | |
| 4982 | try isel.movImmediate(.x2, size); | |
| 4983 | try call.paramLiveOut(isel, ptr_vi, .r1); | |
| 4984 | try call.paramAddress(isel, dst_vi.value, .r0); | |
| 4985 | try call.finishParams(isel); | |
| 4986 | }, | |
| 4975 | try call.prepareParams(isel); | |
| 4976 | const ptr_vi = try isel.use(ty_op.operand); | |
| 4977 | try isel.movImmediate(.x2, size); | |
| 4978 | try call.paramLiveOut(isel, ptr_vi, .r1); | |
| 4979 | try call.paramAddress(isel, dst_vi.value, .r0); | |
| 4980 | try call.finishParams(isel); | |
| 4987 | 4981 | } |
| 4988 | 4982 | } |
| 4989 | 4983 | |
| ... | ... | @@ -5727,26 +5721,14 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 5727 | 5721 | const error_set_size = error_set_ty.abiSize(zcu); |
| 5728 | 5722 | const payload_size = payload_ty.abiSize(zcu); |
| 5729 | 5723 | |
| 5724 | var error_set_part_it = error_union_vi.value.field(error_union_ty, error_set_offset, error_set_size); | |
| 5725 | const error_set_part_vi = try error_set_part_it.only(isel); | |
| 5726 | try error_set_part_vi.?.move(isel, ty_op.operand); | |
| 5730 | 5727 | if (payload_size > 0) { |
| 5731 | 5728 | var payload_part_it = error_union_vi.value.field(error_union_ty, payload_offset, payload_size); |
| 5732 | 5729 | const payload_part_vi = try payload_part_it.only(isel); |
| 5733 | if (try payload_part_vi.?.defReg(isel)) |payload_part_ra| try isel.emit(switch (payload_size) { | |
| 5734 | else => unreachable, | |
| 5735 | 1...4 => .orr(payload_part_ra.w(), .wzr, .{ .immediate = .{ | |
| 5736 | .N = .word, | |
| 5737 | .immr = 0b000001, | |
| 5738 | .imms = 0b111100, | |
| 5739 | } }), | |
| 5740 | 5...8 => .orr(payload_part_ra.x(), .xzr, .{ .immediate = .{ | |
| 5741 | .N = .word, | |
| 5742 | .immr = 0b000001, | |
| 5743 | .imms = 0b111100, | |
| 5744 | } }), | |
| 5745 | }); | |
| 5730 | try payload_part_vi.?.defUndef(isel, payload_ty, .{}); | |
| 5746 | 5731 | } |
| 5747 | var error_set_part_it = error_union_vi.value.field(error_union_ty, error_set_offset, error_set_size); | |
| 5748 | const error_set_part_vi = try error_set_part_it.only(isel); | |
| 5749 | try error_set_part_vi.?.move(isel, ty_op.operand); | |
| 5750 | 5732 | } |
| 5751 | 5733 | if (air.next()) |next_air_tag| continue :air_tag next_air_tag; |
| 5752 | 5734 | }, |
| ... | ... | @@ -5820,7 +5802,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 5820 | 5802 | if (air.next()) |next_air_tag| continue :air_tag next_air_tag; |
| 5821 | 5803 | }, |
| 5822 | 5804 | .struct_field_val => { |
| 5823 | if (isel.live_values.fetchRemove(air.inst_index)) |field_vi| { | |
| 5805 | if (isel.live_values.fetchRemove(air.inst_index)) |field_vi| unused: { | |
| 5824 | 5806 | defer field_vi.value.deref(isel); |
| 5825 | 5807 | |
| 5826 | 5808 | const ty_pl = air.data(air.inst_index).ty_pl; |
| ... | ... | @@ -5847,27 +5829,55 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 5847 | 5829 | }); |
| 5848 | 5830 | |
| 5849 | 5831 | const agg_vi = try isel.use(extra.struct_operand); |
| 5850 | var agg_part_it = agg_vi.field(agg_ty, @divExact(field_bit_offset, 8), @divExact(field_bit_size, 8)); | |
| 5851 | while (try agg_part_it.next(isel)) |agg_part| { | |
| 5852 | var field_part_it = field_vi.value.field(ty_pl.ty.toType(), agg_part.offset, agg_part.vi.size(isel)); | |
| 5853 | const field_part_vi = try field_part_it.only(isel); | |
| 5854 | if (field_part_vi.? == agg_part.vi) continue; | |
| 5855 | var field_subpart_it = field_part_vi.?.parts(isel); | |
| 5856 | const field_part_offset = if (field_subpart_it.only()) |field_subpart_vi| | |
| 5857 | field_subpart_vi.get(isel).offset_from_parent | |
| 5858 | else | |
| 5859 | 0; | |
| 5860 | while (field_subpart_it.next()) |field_subpart_vi| { | |
| 5861 | const field_subpart_ra = try field_subpart_vi.defReg(isel) orelse continue; | |
| 5862 | const field_subpart_offset, const field_subpart_size = field_subpart_vi.position(isel); | |
| 5863 | var agg_subpart_it = agg_part.vi.field( | |
| 5864 | field_ty, | |
| 5865 | agg_part.offset + field_subpart_offset - field_part_offset, | |
| 5866 | field_subpart_size, | |
| 5867 | ); | |
| 5868 | const agg_subpart_vi = try agg_subpart_it.only(isel); | |
| 5869 | try agg_subpart_vi.?.liveOut(isel, field_subpart_ra); | |
| 5870 | } | |
| 5832 | switch (agg_ty.zigTypeTag(zcu)) { | |
| 5833 | else => unreachable, | |
| 5834 | .@"struct" => { | |
| 5835 | var agg_part_it = agg_vi.field(agg_ty, @divExact(field_bit_offset, 8), @divExact(field_bit_size, 8)); | |
| 5836 | while (try agg_part_it.next(isel)) |agg_part| { | |
| 5837 | var field_part_it = field_vi.value.field(ty_pl.ty.toType(), agg_part.offset, agg_part.vi.size(isel)); | |
| 5838 | const field_part_vi = try field_part_it.only(isel); | |
| 5839 | if (field_part_vi.? == agg_part.vi) continue; | |
| 5840 | var field_subpart_it = field_part_vi.?.parts(isel); | |
| 5841 | const field_part_offset = if (field_subpart_it.only()) |field_subpart_vi| | |
| 5842 | field_subpart_vi.get(isel).offset_from_parent | |
| 5843 | else | |
| 5844 | 0; | |
| 5845 | while (field_subpart_it.next()) |field_subpart_vi| { | |
| 5846 | const field_subpart_ra = try field_subpart_vi.defReg(isel) orelse continue; | |
| 5847 | const field_subpart_offset, const field_subpart_size = field_subpart_vi.position(isel); | |
| 5848 | var agg_subpart_it = agg_part.vi.field( | |
| 5849 | field_ty, | |
| 5850 | agg_part.offset + field_subpart_offset - field_part_offset, | |
| 5851 | field_subpart_size, | |
| 5852 | ); | |
| 5853 | const agg_subpart_vi = try agg_subpart_it.only(isel); | |
| 5854 | try agg_subpart_vi.?.liveOut(isel, field_subpart_ra); | |
| 5855 | } | |
| 5856 | } | |
| 5857 | }, | |
| 5858 | .@"union" => { | |
| 5859 | try field_vi.value.defAddr(isel, field_ty, .{}) orelse break :unused; | |
| 5860 | ||
| 5861 | try call.prepareReturn(isel); | |
| 5862 | try call.finishReturn(isel); | |
| 5863 | ||
| 5864 | try call.prepareCallee(isel); | |
| 5865 | try isel.global_relocs.append(gpa, .{ | |
| 5866 | .name = "memcpy", | |
| 5867 | .reloc = .{ .label = @intCast(isel.instructions.items.len) }, | |
| 5868 | }); | |
| 5869 | try isel.emit(.bl(0)); | |
| 5870 | try call.finishCallee(isel); | |
| 5871 | ||
| 5872 | try call.prepareParams(isel); | |
| 5873 | const union_layout = agg_ty.unionGetLayout(zcu); | |
| 5874 | var payload_it = agg_vi.field(agg_ty, union_layout.payloadOffset(), union_layout.payload_size); | |
| 5875 | const payload_vi = try payload_it.only(isel); | |
| 5876 | try isel.movImmediate(.x2, field_vi.value.size(isel)); | |
| 5877 | try call.paramAddress(isel, payload_vi.?, .r1); | |
| 5878 | try call.paramAddress(isel, field_vi.value, .r0); | |
| 5879 | try call.finishParams(isel); | |
| 5880 | }, | |
| 5871 | 5881 | } |
| 5872 | 5882 | } |
| 5873 | 5883 | if (air.next()) |next_air_tag| continue :air_tag next_air_tag; |
| ... | ... | @@ -6899,16 +6909,45 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 6899 | 6909 | } |
| 6900 | 6910 | if (air.next()) |next_air_tag| continue :air_tag next_air_tag; |
| 6901 | 6911 | }, |
| 6902 | .union_init => { | |
| 6903 | if (isel.live_values.fetchRemove(air.inst_index)) |un_vi| unused: { | |
| 6904 | defer un_vi.value.deref(isel); | |
| 6912 | .union_init => |air_tag| { | |
| 6913 | if (isel.live_values.fetchRemove(air.inst_index)) |union_vi| unused: { | |
| 6914 | defer union_vi.value.deref(isel); | |
| 6905 | 6915 | |
| 6906 | 6916 | const ty_pl = air.data(air.inst_index).ty_pl; |
| 6907 | 6917 | const extra = isel.air.extraData(Air.UnionInit, ty_pl.payload).data; |
| 6908 | const un_ty = ty_pl.ty.toType(); | |
| 6909 | if (un_ty.containerLayout(zcu) != .@"extern") return isel.fail("bad union init {f}", .{isel.fmtType(un_ty)}); | |
| 6910 | ||
| 6911 | try un_vi.value.defAddr(isel, un_ty, null, comptime &.initFill(.free)) orelse break :unused; | |
| 6918 | const union_ty = ty_pl.ty.toType(); | |
| 6919 | const loaded_union = ip.loadUnionType(union_ty.toIntern()); | |
| 6920 | const union_layout = ZigType.getUnionLayout(loaded_union, zcu); | |
| 6921 | ||
| 6922 | if (union_layout.tag_size > 0) unused_tag: { | |
| 6923 | const loaded_tag = loaded_union.loadTagType(ip); | |
| 6924 | var tag_it = union_vi.value.field(union_ty, union_layout.tagOffset(), union_layout.tag_size); | |
| 6925 | const tag_vi = try tag_it.only(isel); | |
| 6926 | const tag_ra = try tag_vi.?.defReg(isel) orelse break :unused_tag; | |
| 6927 | switch (union_layout.tag_size) { | |
| 6928 | 0 => unreachable, | |
| 6929 | 1...4 => try isel.movImmediate(tag_ra.w(), @as(u32, switch (loaded_tag.values.len) { | |
| 6930 | 0 => extra.field_index, | |
| 6931 | else => switch (ip.indexToKey(loaded_tag.values.get(ip)[extra.field_index]).int.storage) { | |
| 6932 | .u64 => |imm| @intCast(imm), | |
| 6933 | .i64 => |imm| @bitCast(@as(i32, @intCast(imm))), | |
| 6934 | else => unreachable, | |
| 6935 | }, | |
| 6936 | })), | |
| 6937 | 5...8 => try isel.movImmediate(tag_ra.x(), switch (loaded_tag.values.len) { | |
| 6938 | 0 => extra.field_index, | |
| 6939 | else => switch (ip.indexToKey(loaded_tag.values.get(ip)[extra.field_index]).int.storage) { | |
| 6940 | .u64 => |imm| imm, | |
| 6941 | .i64 => |imm| @bitCast(imm), | |
| 6942 | else => unreachable, | |
| 6943 | }, | |
| 6944 | }), | |
| 6945 | else => return isel.fail("too big {s} {f}", .{ @tagName(air_tag), isel.fmtType(union_ty) }), | |
| 6946 | } | |
| 6947 | } | |
| 6948 | var payload_it = union_vi.value.field(union_ty, union_layout.payloadOffset(), union_layout.payload_size); | |
| 6949 | const payload_vi = try payload_it.only(isel); | |
| 6950 | try payload_vi.?.defAddr(isel, union_ty, .{ .root_vi = union_vi.value }) orelse break :unused; | |
| 6912 | 6951 | |
| 6913 | 6952 | try call.prepareReturn(isel); |
| 6914 | 6953 | try call.finishReturn(isel); |
| ... | ... | @@ -6925,7 +6964,7 @@ pub fn body(isel: *Select, air_body: []const Air.Inst.Index) error{ OutOfMemory, |
| 6925 | 6964 | const init_vi = try isel.use(extra.init); |
| 6926 | 6965 | try isel.movImmediate(.x2, init_vi.size(isel)); |
| 6927 | 6966 | try call.paramAddress(isel, init_vi, .r1); |
| 6928 | try call.paramAddress(isel, un_vi.value, .r0); | |
| 6967 | try call.paramAddress(isel, payload_vi.?, .r0); | |
| 6929 | 6968 | try call.finishParams(isel); |
| 6930 | 6969 | } |
| 6931 | 6970 | if (air.next()) |next_air_tag| continue :air_tag next_air_tag; |
| ... | ... | @@ -8944,9 +8983,18 @@ pub const Value = struct { |
| 8944 | 8983 | var dst_part_it = dst_vi.parts(isel); |
| 8945 | 8984 | if (dst_part_it.only()) |dst_part_vi| { |
| 8946 | 8985 | var src_part_it = src_vi.parts(isel); |
| 8947 | if (src_part_it.only()) |src_part_vi| { | |
| 8948 | try src_part_vi.liveOut(isel, try dst_part_vi.defReg(isel) orelse return); | |
| 8949 | } else while (src_part_it.next()) |src_part_vi| { | |
| 8986 | if (src_part_it.only()) |src_part_vi| only: { | |
| 8987 | const src_part_size = src_part_vi.size(isel); | |
| 8988 | if (src_part_size > @as(@TypeOf(src_part_size), if (src_part_vi.isVector(isel)) 16 else 8)) { | |
| 8989 | var subpart_it = root.src_vi.field(root.ty, root.src_offset, src_part_size - 1); | |
| 8990 | _ = try subpart_it.next(isel); | |
| 8991 | src_part_it = src_vi.parts(isel); | |
| 8992 | assert(src_part_it.only() == null); | |
| 8993 | break :only; | |
| 8994 | } | |
| 8995 | return src_part_vi.liveOut(isel, try dst_part_vi.defReg(isel) orelse return); | |
| 8996 | } | |
| 8997 | while (src_part_it.next()) |src_part_vi| { | |
| 8950 | 8998 | const src_part_offset, const src_part_size = src_part_vi.position(isel); |
| 8951 | 8999 | var dst_field_it = root.dst_vi.field(root.ty, root.dst_offset + src_part_offset, src_part_size); |
| 8952 | 9000 | const dst_field_vi = try dst_field_it.only(isel); |
| ... | ... | @@ -9420,9 +9468,12 @@ pub const Value = struct { |
| 9420 | 9468 | fn defAddr( |
| 9421 | 9469 | def_vi: Value.Index, |
| 9422 | 9470 | isel: *Select, |
| 9423 | def_ty: ZigType, | |
| 9424 | wrap: ?std.builtin.Type.Int, | |
| 9425 | expected_live_registers: *const LiveRegisters, | |
| 9471 | root_ty: ZigType, | |
| 9472 | opts: struct { | |
| 9473 | root_vi: Value.Index = .free, | |
| 9474 | wrap: ?std.builtin.Type.Int = null, | |
| 9475 | expected_live_registers: *const LiveRegisters = &.initFill(.free), | |
| 9476 | }, | |
| 9426 | 9477 | ) !?void { |
| 9427 | 9478 | if (!def_vi.isUsed(isel)) return null; |
| 9428 | 9479 | const offset_from_parent: i65, const parent_vi = def_vi.valueParent(isel); |
| ... | ... | @@ -9431,11 +9482,12 @@ pub const Value = struct { |
| 9431 | 9482 | .stack_slot => |stack_slot| .{ stack_slot, false }, |
| 9432 | 9483 | else => unreachable, |
| 9433 | 9484 | }; |
| 9434 | _ = try def_vi.load(isel, def_ty, stack_slot.base, .{ | |
| 9485 | _ = try def_vi.load(isel, root_ty, stack_slot.base, .{ | |
| 9486 | .root_vi = opts.root_vi, | |
| 9435 | 9487 | .offset = @intCast(stack_slot.offset + offset_from_parent), |
| 9436 | 9488 | .split = false, |
| 9437 | .wrap = wrap, | |
| 9438 | .expected_live_registers = expected_live_registers, | |
| 9489 | .wrap = opts.wrap, | |
| 9490 | .expected_live_registers = opts.expected_live_registers, | |
| 9439 | 9491 | }); |
| 9440 | 9492 | if (allocated) parent_vi.setParent(isel, .{ .stack_slot = stack_slot }); |
| 9441 | 9493 | } |
| ... | ... | @@ -9514,6 +9566,53 @@ pub const Value = struct { |
| 9514 | 9566 | } |
| 9515 | 9567 | } |
| 9516 | 9568 | |
| 9569 | pub fn defUndef(def_vi: Value.Index, isel: *Select, root_ty: ZigType, opts: struct { | |
| 9570 | root_vi: Value.Index = .free, | |
| 9571 | offset: u64 = 0, | |
| 9572 | split: bool = true, | |
| 9573 | }) !void { | |
| 9574 | const root_vi = switch (opts.root_vi) { | |
| 9575 | _ => |root_vi| root_vi, | |
| 9576 | .allocating => unreachable, | |
| 9577 | .free => def_vi, | |
| 9578 | }; | |
| 9579 | var part_it = def_vi.parts(isel); | |
| 9580 | if (part_it.only()) |part_vi| only: { | |
| 9581 | const part_size = part_vi.size(isel); | |
| 9582 | const part_is_vector = part_vi.isVector(isel); | |
| 9583 | if (part_size > @as(@TypeOf(part_size), if (part_is_vector) 16 else 8)) { | |
| 9584 | if (!opts.split) return; | |
| 9585 | var subpart_it = root_vi.field(root_ty, opts.offset, part_size - 1); | |
| 9586 | _ = try subpart_it.next(isel); | |
| 9587 | part_it = def_vi.parts(isel); | |
| 9588 | assert(part_it.only() == null); | |
| 9589 | break :only; | |
| 9590 | } | |
| 9591 | return if (try part_vi.defReg(isel)) |part_ra| try isel.emit(if (part_is_vector) | |
| 9592 | .movi(switch (part_size) { | |
| 9593 | else => unreachable, | |
| 9594 | 1...8 => part_ra.@"8b"(), | |
| 9595 | 9...16 => part_ra.@"16b"(), | |
| 9596 | }, 0xaa, .{ .lsl = 0 }) | |
| 9597 | else switch (part_size) { | |
| 9598 | else => unreachable, | |
| 9599 | 1...4 => .orr(part_ra.w(), .wzr, .{ .immediate = .{ | |
| 9600 | .N = .word, | |
| 9601 | .immr = 0b000001, | |
| 9602 | .imms = 0b111100, | |
| 9603 | } }), | |
| 9604 | 5...8 => .orr(part_ra.x(), .xzr, .{ .immediate = .{ | |
| 9605 | .N = .word, | |
| 9606 | .immr = 0b000001, | |
| 9607 | .imms = 0b111100, | |
| 9608 | } }), | |
| 9609 | }); | |
| 9610 | } | |
| 9611 | while (part_it.next()) |part_vi| try part_vi.defUndef(isel, root_ty, .{ | |
| 9612 | .root_vi = root_vi, | |
| 9613 | }); | |
| 9614 | } | |
| 9615 | ||
| 9517 | 9616 | pub fn liveIn( |
| 9518 | 9617 | vi: Value.Index, |
| 9519 | 9618 | isel: *Select, |
| ... | ... | @@ -9846,24 +9945,31 @@ pub const Value = struct { |
| 9846 | 9945 | _ = vi.addPart(isel, 8, 8); |
| 9847 | 9946 | } else unreachable, |
| 9848 | 9947 | }, |
| 9849 | .opt_type => |child_type| if (ty.optionalReprIsPayload(zcu)) | |
| 9850 | continue :type_key ip.indexToKey(child_type) | |
| 9851 | else switch (ZigType.fromInterned(child_type).abiSize(zcu)) { | |
| 9852 | 0...8, 16 => |child_size| if (offset == 0 and size == ty_size) { | |
| 9853 | vi.setParts(isel, 2); | |
| 9854 | _ = vi.addPart(isel, 0, child_size); | |
| 9855 | _ = vi.addPart(isel, child_size, 1); | |
| 9856 | } else unreachable, | |
| 9857 | 9...15 => |child_size| if (offset == 0 and size == ty_size) { | |
| 9858 | vi.setParts(isel, 2); | |
| 9859 | _ = vi.addPart(isel, 0, 8); | |
| 9860 | _ = vi.addPart(isel, 8, ty_size - 8); | |
| 9861 | } else if (offset == 8 and size == ty_size - 8) { | |
| 9862 | vi.setParts(isel, 2); | |
| 9863 | _ = vi.addPart(isel, 0, child_size - 8); | |
| 9864 | _ = vi.addPart(isel, child_size - 8, 1); | |
| 9865 | } else unreachable, | |
| 9866 | else => return isel.fail("Value.FieldPartIterator.next({f})", .{isel.fmtType(ty)}), | |
| 9948 | .opt_type => |child_type| if (ty.optionalReprIsPayload(zcu)) continue :type_key ip.indexToKey(child_type) else { | |
| 9949 | const child_ty: ZigType = .fromInterned(child_type); | |
| 9950 | const child_size = child_ty.abiSize(zcu); | |
| 9951 | if (offset == 0 and size == child_size) { | |
| 9952 | ty = child_ty; | |
| 9953 | ty_size = child_size; | |
| 9954 | continue :type_key ip.indexToKey(child_type); | |
| 9955 | } | |
| 9956 | switch (child_size) { | |
| 9957 | 0...8, 16 => if (offset == 0 and size == ty_size) { | |
| 9958 | vi.setParts(isel, 2); | |
| 9959 | _ = vi.addPart(isel, 0, child_size); | |
| 9960 | _ = vi.addPart(isel, child_size, 1); | |
| 9961 | } else unreachable, | |
| 9962 | 9...15 => if (offset == 0 and size == ty_size) { | |
| 9963 | vi.setParts(isel, 2); | |
| 9964 | _ = vi.addPart(isel, 0, 8); | |
| 9965 | _ = vi.addPart(isel, 8, ty_size - 8); | |
| 9966 | } else if (offset == 8 and size == ty_size - 8) { | |
| 9967 | vi.setParts(isel, 2); | |
| 9968 | _ = vi.addPart(isel, 0, child_size - 8); | |
| 9969 | _ = vi.addPart(isel, child_size - 8, 1); | |
| 9970 | } else unreachable, | |
| 9971 | else => return isel.fail("Value.FieldPartIterator.next({f})", .{isel.fmtType(ty)}), | |
| 9972 | } | |
| 9867 | 9973 | }, |
| 9868 | 9974 | .array_type => |array_type| { |
| 9869 | 9975 | const min_part_log2_stride: u5 = if (size > 16) 4 else if (size > 8) 3 else 0; |
test/behavior/array.zig-2| ... | ... | @@ -395,7 +395,6 @@ test "array literal as argument to function" { |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | test "double nested array to const slice cast in array literal" { |
| 398 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 399 | 398 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 400 | 399 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 401 | 400 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -650,7 +649,6 @@ test "runtime initialized sentinel-terminated array literal" { |
| 650 | 649 | } |
| 651 | 650 | |
| 652 | 651 | test "array of array agregate init" { |
| 653 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 654 | 652 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 655 | 653 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 656 | 654 |
test/behavior/defer.zig-2| ... | ... | @@ -107,7 +107,6 @@ test "mixing normal and error defers" { |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | test "errdefer with payload" { |
| 110 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 111 | 110 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 112 | 111 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 113 | 112 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -129,7 +128,6 @@ test "errdefer with payload" { |
| 129 | 128 | } |
| 130 | 129 | |
| 131 | 130 | test "reference to errdefer payload" { |
| 132 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 133 | 131 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 134 | 132 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 135 | 133 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO |
test/behavior/optional.zig-1| ... | ... | @@ -390,7 +390,6 @@ test "0-bit child type coerced to optional" { |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | test "array of optional unaligned types" { |
| 393 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 394 | 393 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 395 | 394 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 396 | 395 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/behavior/pointers.zig-1| ... | ... | @@ -246,7 +246,6 @@ test "implicit casting between C pointer and optional non-C pointer" { |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | test "implicit cast error unions with non-optional to optional pointer" { |
| 249 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 250 | 249 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 251 | 250 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 252 | 251 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/behavior/slice.zig-1| ... | ... | @@ -710,7 +710,6 @@ test "slice pointer-to-array zero length" { |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | test "type coercion of pointer to anon struct literal to pointer to slice" { |
| 713 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 714 | 713 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 715 | 714 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 716 | 715 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/behavior/struct.zig-1| ... | ... | @@ -955,7 +955,6 @@ test "tuple element initialized with fn call" { |
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | test "struct with union field" { |
| 958 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 959 | 958 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 960 | 959 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 961 | 960 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/struct_contains_slice_of_itself.zig-2| ... | ... | @@ -12,7 +12,6 @@ const NodeAligned = struct { |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 | test "struct contains slice of itself" { |
| 15 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 16 | 15 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 17 | 16 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 18 | 17 | |
| ... | ... | @@ -53,7 +52,6 @@ test "struct contains slice of itself" { |
| 53 | 52 | } |
| 54 | 53 | |
| 55 | 54 | test "struct contains aligned slice of itself" { |
| 56 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 57 | 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 58 | 56 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 59 | 57 |
test/behavior/switch.zig-4| ... | ... | @@ -466,7 +466,6 @@ test "switch on integer with else capturing expr" { |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | test "else prong of switch on error set excludes other cases" { |
| 469 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 470 | 469 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 471 | 470 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 472 | 471 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -502,7 +501,6 @@ test "else prong of switch on error set excludes other cases" { |
| 502 | 501 | } |
| 503 | 502 | |
| 504 | 503 | test "switch prongs with error set cases make a new error set type for capture value" { |
| 505 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 506 | 504 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 507 | 505 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 508 | 506 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -733,7 +731,6 @@ test "switch on error set with single else" { |
| 733 | 731 | } |
| 734 | 732 | |
| 735 | 733 | test "switch capture copies its payload" { |
| 736 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 737 | 734 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 738 | 735 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 739 | 736 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -928,7 +925,6 @@ test "nested break ignores switch conditions and breaks instead" { |
| 928 | 925 | } |
| 929 | 926 | |
| 930 | 927 | test "peer type resolution on switch captures ignores unused payload bits" { |
| 931 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 932 | 928 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 933 | 929 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 934 | 930 |
test/behavior/switch_prong_err_enum.zig-1| ... | ... | @@ -21,7 +21,6 @@ fn doThing(form_id: u64) anyerror!FormValue { |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | test "switch prong returns error enum" { |
| 24 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 25 | 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 26 | 25 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 27 | 26 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
test/behavior/try.zig-1| ... | ... | @@ -47,7 +47,6 @@ test "try then not executed with assignment" { |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | test "`try`ing an if/else expression" { |
| 50 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 51 | 50 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 52 | 51 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 53 | 52 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
test/behavior/union.zig-21| ... | ... | @@ -12,7 +12,6 @@ const FooWithFloats = union { |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 | test "basic unions with floats" { |
| 15 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 16 | 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 17 | 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 18 | 17 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -29,7 +28,6 @@ fn setFloat(foo: *FooWithFloats, x: f64) void { |
| 29 | 28 | } |
| 30 | 29 | |
| 31 | 30 | test "init union with runtime value - floats" { |
| 32 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 33 | 31 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 34 | 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 35 | 33 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -41,7 +39,6 @@ test "init union with runtime value - floats" { |
| 41 | 39 | } |
| 42 | 40 | |
| 43 | 41 | test "basic unions" { |
| 44 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 45 | 42 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 46 | 43 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | 44 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -60,7 +57,6 @@ const Foo = union { |
| 60 | 57 | }; |
| 61 | 58 | |
| 62 | 59 | test "init union with runtime value" { |
| 63 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 64 | 60 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 65 | 61 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 66 | 62 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -101,7 +97,6 @@ const FooExtern = extern union { |
| 101 | 97 | }; |
| 102 | 98 | |
| 103 | 99 | test "basic extern unions" { |
| 104 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 105 | 100 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 106 | 101 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 107 | 102 | |
| ... | ... | @@ -332,7 +327,6 @@ pub const PackThis = union(enum) { |
| 332 | 327 | }; |
| 333 | 328 | |
| 334 | 329 | test "constant packed union" { |
| 335 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 336 | 330 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 337 | 331 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 338 | 332 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -478,7 +472,6 @@ pub const FooUnion = union(enum) { |
| 478 | 472 | var glbl_array: [2]FooUnion = undefined; |
| 479 | 473 | |
| 480 | 474 | test "initialize global array of union" { |
| 481 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 482 | 475 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 483 | 476 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 484 | 477 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -810,7 +803,6 @@ test "return union init with void payload" { |
| 810 | 803 | } |
| 811 | 804 | |
| 812 | 805 | test "@unionInit stored to a const" { |
| 813 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 814 | 806 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 815 | 807 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 816 | 808 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -917,7 +909,6 @@ test "extern union doesn't trigger field check at comptime" { |
| 917 | 909 | } |
| 918 | 910 | |
| 919 | 911 | test "anonymous union literal syntax" { |
| 920 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 921 | 912 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 922 | 913 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 923 | 914 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1086,7 +1077,6 @@ test "union enum type gets a separate scope" { |
| 1086 | 1077 | } |
| 1087 | 1078 | |
| 1088 | 1079 | test "global variable struct contains union initialized to non-most-aligned field" { |
| 1089 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1090 | 1080 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1091 | 1081 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1092 | 1082 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -1113,7 +1103,6 @@ test "global variable struct contains union initialized to non-most-aligned fiel |
| 1113 | 1103 | } |
| 1114 | 1104 | |
| 1115 | 1105 | test "union with no result loc initiated with a runtime value" { |
| 1116 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1117 | 1106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1118 | 1107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1119 | 1108 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1131,7 +1120,6 @@ test "union with no result loc initiated with a runtime value" { |
| 1131 | 1120 | } |
| 1132 | 1121 | |
| 1133 | 1122 | test "union with a large struct field" { |
| 1134 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1135 | 1123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1136 | 1124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1137 | 1125 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1286,7 +1274,6 @@ test "noreturn field in union" { |
| 1286 | 1274 | } |
| 1287 | 1275 | |
| 1288 | 1276 | test "@unionInit uses tag value instead of field index" { |
| 1289 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1290 | 1277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1291 | 1278 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1292 | 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1395,7 +1382,6 @@ test "union int tag type is properly managed" { |
| 1395 | 1382 | } |
| 1396 | 1383 | |
| 1397 | 1384 | test "no dependency loop when function pointer in union returns the union" { |
| 1398 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1399 | 1385 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1400 | 1386 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 1401 | 1387 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1417,7 +1403,6 @@ test "no dependency loop when function pointer in union returns the union" { |
| 1417 | 1403 | } |
| 1418 | 1404 | |
| 1419 | 1405 | test "union reassignment can use previous value" { |
| 1420 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1421 | 1406 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1422 | 1407 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1423 | 1408 | |
| ... | ... | @@ -1619,7 +1604,6 @@ test "union with 128 bit integer" { |
| 1619 | 1604 | } |
| 1620 | 1605 | |
| 1621 | 1606 | test "memset extern union" { |
| 1622 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1623 | 1607 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 1624 | 1608 | |
| 1625 | 1609 | const U = extern union { |
| ... | ... | @@ -1941,7 +1925,6 @@ test "packed union initialized via reintepreted struct field initializer" { |
| 1941 | 1925 | } |
| 1942 | 1926 | |
| 1943 | 1927 | test "store of comptime reinterpreted memory to extern union" { |
| 1944 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 1945 | 1928 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 1946 | 1929 | |
| 1947 | 1930 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; |
| ... | ... | @@ -2048,7 +2031,6 @@ test "circular dependency through pointer field of a union" { |
| 2048 | 2031 | } |
| 2049 | 2032 | |
| 2050 | 2033 | test "pass nested union with rls" { |
| 2051 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 2052 | 2034 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2053 | 2035 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 2054 | 2036 | |
| ... | ... | @@ -2070,7 +2052,6 @@ test "pass nested union with rls" { |
| 2070 | 2052 | } |
| 2071 | 2053 | |
| 2072 | 2054 | test "runtime union init, most-aligned field != largest" { |
| 2073 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 2074 | 2055 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2075 | 2056 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2076 | 2057 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| ... | ... | @@ -2239,7 +2220,6 @@ test "matching captures causes union equivalence" { |
| 2239 | 2220 | } |
| 2240 | 2221 | |
| 2241 | 2222 | test "signed enum tag with negative value" { |
| 2242 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 2243 | 2223 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2244 | 2224 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 2245 | 2225 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2296,7 +2276,6 @@ test "extern union @FieldType" { |
| 2296 | 2276 | } |
| 2297 | 2277 | |
| 2298 | 2278 | test "assign global tagged union" { |
| 2299 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 2300 | 2279 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 2301 | 2280 | |
| 2302 | 2281 | const U = union(enum) { |