mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Revert "x86_64: fix safety crashes in storeRegs"
This reverts commit 37985613c760d1d20a1fbba292fd5c25129f400a.
This commit is contained in:
parent
e647d1a570
commit
d07b67a55c
@ -186975,13 +186975,7 @@ const Temp = struct {
|
|||||||
},
|
},
|
||||||
.struct_type => {
|
.struct_type => {
|
||||||
assert(src_regs.len - part_index == std.math.divCeil(u32, src_abi_size, 8) catch unreachable);
|
assert(src_regs.len - part_index == std.math.divCeil(u32, src_abi_size, 8) catch unreachable);
|
||||||
break :part_ty switch (src_abi_size) {
|
break :part_ty .u64;
|
||||||
0, 3, 5...7 => unreachable,
|
|
||||||
1 => .u8,
|
|
||||||
2 => .u16,
|
|
||||||
4 => .u32,
|
|
||||||
else => .u64,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
.tuple_type => |tuple_type| {
|
.tuple_type => |tuple_type| {
|
||||||
assert(tuple_type.types.len == src_regs.len);
|
assert(tuple_type.types.len == src_regs.len);
|
||||||
@ -186990,6 +186984,10 @@ const Temp = struct {
|
|||||||
};
|
};
|
||||||
const part_size: u31 = @intCast(part_ty.abiSize(zcu));
|
const part_size: u31 = @intCast(part_ty.abiSize(zcu));
|
||||||
const src_rc = src_reg.class();
|
const src_rc = src_reg.class();
|
||||||
|
const part_bit_size = switch (src_rc) {
|
||||||
|
else => 8 * part_size,
|
||||||
|
.x87 => part_ty.bitSize(zcu),
|
||||||
|
};
|
||||||
if (src_rc == .x87 or std.math.isPowerOfTwo(part_size)) {
|
if (src_rc == .x87 or std.math.isPowerOfTwo(part_size)) {
|
||||||
// hack around linker relocation bugs
|
// hack around linker relocation bugs
|
||||||
switch (ptr.tracking(cg).short) {
|
switch (ptr.tracking(cg).short) {
|
||||||
@ -186998,15 +186996,7 @@ const Temp = struct {
|
|||||||
}
|
}
|
||||||
const strat = try cg.moveStrategy(part_ty, src_rc, false);
|
const strat = try cg.moveStrategy(part_ty, src_rc, false);
|
||||||
try strat.write(cg, try ptr.tracking(cg).short.deref().mem(cg, .{
|
try strat.write(cg, try ptr.tracking(cg).short.deref().mem(cg, .{
|
||||||
.size = switch (src_rc) {
|
.size = .fromBitSize(part_bit_size),
|
||||||
else => .fromBitSize(8 * part_size),
|
|
||||||
.x87 => switch (abi.classifySystemV(src_ty, zcu, cg.target, .other)[part_index]) {
|
|
||||||
else => unreachable,
|
|
||||||
.float => .dword,
|
|
||||||
.float_combine, .sse => .qword,
|
|
||||||
.x87 => .tbyte,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
.disp = part_disp,
|
.disp = part_disp,
|
||||||
}), registerAlias(src_reg, part_size));
|
}), registerAlias(src_reg, part_size));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user