codegen: fix test failures

Various backend were mismatching arg instructions and function args.
This commit is contained in:
Jacob Young 2023-02-27 16:12:02 -05:00
parent 57236961e6
commit 6bed45b873
3 changed files with 12 additions and 6 deletions

View File

@ -4177,8 +4177,10 @@ fn airFieldParentPtr(self: *Self, inst: Air.Inst.Index) !void {
}
fn airArg(self: *Self, inst: Air.Inst.Index) !void {
const arg_index = self.arg_index;
self.arg_index += 1;
// skip zero-bit arguments as they don't have a corresponding arg instruction
var arg_index = self.arg_index;
while (self.args[arg_index] == .none) arg_index += 1;
self.arg_index = arg_index + 1;
const ty = self.air.typeOfIndex(inst);
const tag = self.air.instructions.items(.tag)[inst];

View File

@ -4125,8 +4125,10 @@ fn genInlineMemsetCode(
}
fn airArg(self: *Self, inst: Air.Inst.Index) !void {
const arg_index = self.arg_index;
self.arg_index += 1;
// skip zero-bit arguments as they don't have a corresponding arg instruction
var arg_index = self.arg_index;
while (self.args[arg_index] == .none) arg_index += 1;
self.arg_index = arg_index + 1;
const ty = self.air.typeOfIndex(inst);
const tag = self.air.instructions.items(.tag)[inst];

View File

@ -3827,8 +3827,10 @@ fn genIntMulComplexOpMir(self: *Self, dst_ty: Type, dst_mcv: MCValue, src_mcv: M
}
fn airArg(self: *Self, inst: Air.Inst.Index) !void {
const arg_index = self.arg_index;
self.arg_index += 1;
// skip zero-bit arguments as they don't have a corresponding arg instruction
var arg_index = self.arg_index;
while (self.args[arg_index] == .none) arg_index += 1;
self.arg_index = arg_index + 1;
const ty = self.air.typeOfIndex(inst);
const mcv = self.args[arg_index];