authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-01-17 21:52:15+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-01-17 21:52:15+01:00
log3145fa97c21704d8822db928e5f988f22497b1b8
tree6cc041ad74dff9922e03a1a7fc5fafe3f48a7dbc
parentab204f81b0632661f9f839ba33df19dfa0b5a84a

stage2: separate ptr and stack offset codepaths in genSetStack


1 files changed, 5 insertions(+), 3 deletions(-)

src/arch/x86_64/CodeGen.zig+5-3
...@@ -3252,9 +3252,11 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro...@@ -3252,9 +3252,11 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro
3252 }3252 }
3253 return self.fail("TODO implement memcpy for setting stack from {}", .{mcv});3253 return self.fail("TODO implement memcpy for setting stack from {}", .{mcv});
3254 },3254 },
3255 .ptr_stack_offset,3255 .ptr_stack_offset => {
3256 .stack_offset,3256 const reg = try self.copyToTmpRegister(ty, mcv);
3257 => |off| {3257 return self.genSetStack(ty, stack_offset, MCValue{ .register = reg });
3258 },
3259 .stack_offset => |off| {
3258 if (stack_offset == off) {3260 if (stack_offset == off) {
3259 // Copy stack variable to itself; nothing to do.3261 // Copy stack variable to itself; nothing to do.
3260 return;3262 return;