authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-02-27 16:12:02-05:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-02-27 16:30:15-05:00
log6bed45b87358975da97fec45fd30eb095ad1dfc9
tree64667cc40b95097f2d834fad1f0971ac8f9f9971
parent57236961e6fc9da02623f79131f58113e3fa0531

codegen: fix test failures

Various backend were mismatching arg instructions and function args.

3 files changed, 12 insertions(+), 6 deletions(-)

src/arch/aarch64/CodeGen.zig+4-2
......@@ -4177,8 +4177,10 @@ fn airFieldParentPtr(self: *Self, inst: Air.Inst.Index) !void {
41774177}
41784178
41794179fn airArg(self: *Self, inst: Air.Inst.Index) !void {
4180 const arg_index = self.arg_index;
4181 self.arg_index += 1;
4180 // skip zero-bit arguments as they don't have a corresponding arg instruction
4181 var arg_index = self.arg_index;
4182 while (self.args[arg_index] == .none) arg_index += 1;
4183 self.arg_index = arg_index + 1;
41824184
41834185 const ty = self.air.typeOfIndex(inst);
41844186 const tag = self.air.instructions.items(.tag)[inst];
src/arch/arm/CodeGen.zig+4-2
......@@ -4125,8 +4125,10 @@ fn genInlineMemsetCode(
41254125}
41264126
41274127fn airArg(self: *Self, inst: Air.Inst.Index) !void {
4128 const arg_index = self.arg_index;
4129 self.arg_index += 1;
4128 // skip zero-bit arguments as they don't have a corresponding arg instruction
4129 var arg_index = self.arg_index;
4130 while (self.args[arg_index] == .none) arg_index += 1;
4131 self.arg_index = arg_index + 1;
41304132
41314133 const ty = self.air.typeOfIndex(inst);
41324134 const tag = self.air.instructions.items(.tag)[inst];
src/arch/x86_64/CodeGen.zig+4-2
......@@ -3827,8 +3827,10 @@ fn genIntMulComplexOpMir(self: *Self, dst_ty: Type, dst_mcv: MCValue, src_mcv: M
38273827}
38283828
38293829fn airArg(self: *Self, inst: Air.Inst.Index) !void {
3830 const arg_index = self.arg_index;
3831 self.arg_index += 1;
3830 // skip zero-bit arguments as they don't have a corresponding arg instruction
3831 var arg_index = self.arg_index;
3832 while (self.args[arg_index] == .none) arg_index += 1;
3833 self.arg_index = arg_index + 1;
38323834
38333835 const ty = self.air.typeOfIndex(inst);
38343836 const mcv = self.args[arg_index];