authorgravatar for 81774659+gracefuu@users.noreply.github.comgracefu <81774659+gracefuu@users.noreply.github.com> 2021-04-12 01:29:40+08:00
committergravatar for 81774659+gracefuu@users.noreply.github.comgracefu <81774659+gracefuu@users.noreply.github.com> 2021-04-16 15:21:17+08:00
logcfeb412a4263809698f941081197cd0ff7f260aa
tree09f34468d720286fc3791c0c2083bbcde277a520
parentdc136627251c920713536807e0da922c140ca588
signaturelock-open Commit is signed but in an unrecognized format.

stage2 x86_64: fix incorrect comment in genX8664BinMath

Co-authored-by: joachimschmidt557 <joachim.schmidt557@outlook.com>

1 files changed, 7 insertions(+), 1 deletions(-)

src/codegen.zig+7-1
...@@ -1505,8 +1505,14 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {...@@ -1505,8 +1505,14 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
1505 /// ADD, SUB, XOR, OR, AND1505 /// ADD, SUB, XOR, OR, AND
1506 fn genX8664BinMath(self: *Self, inst: *ir.Inst, op_lhs: *ir.Inst, op_rhs: *ir.Inst) !MCValue {1506 fn genX8664BinMath(self: *Self, inst: *ir.Inst, op_lhs: *ir.Inst, op_rhs: *ir.Inst) !MCValue {
1507 // We'll handle these ops in two steps.1507 // We'll handle these ops in two steps.
1508 // 1) Prepare an output register, and put one of the arguments in it1508 // 1) Prepare an output location (register or memory)
1509 // This location will be the location of the operand that dies (if one exists)
1510 // or just a temporary register (if one doesn't exist)
1509 // 2) Perform the op with the other argument1511 // 2) Perform the op with the other argument
1512 // 3) Sometimes, the output location is memory but the op doesn't support it.
1513 // In this case, copy that location to a register, then perform the op to that register instead.
1514 //
1515 // TODO: make this algorithm less bad
15101516
1511 try self.code.ensureCapacity(self.code.items.len + 8);1517 try self.code.ensureCapacity(self.code.items.len + 8);
15121518