From 9d985413ce2b60a1a8cf001913ee8dac81c03aac Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Fri, 13 Jan 2023 01:36:56 +0000 Subject: fix lots more issues, add endian conversions to ObjGenMachO, add 64-bit kludge to Switch.c --- compiler_and_linker/unsorted/InterferenceGraph.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'compiler_and_linker/unsorted/InterferenceGraph.c') diff --git a/compiler_and_linker/unsorted/InterferenceGraph.c b/compiler_and_linker/unsorted/InterferenceGraph.c index a849d1a..cc78a63 100644 --- a/compiler_and_linker/unsorted/InterferenceGraph.c +++ b/compiler_and_linker/unsorted/InterferenceGraph.c @@ -55,9 +55,7 @@ static void buildinterferencematrix(void) { for (block = pcbasicblocks; block; block = block->nextBlock) { bitvectorcopy(vec, liveinfo[block->blockIndex].out, regs); for (instr = block->lastPCode; instr; instr = instr->prevPCode) { - op = instr->args; - i = instr->argCount; - while (i--) { + for (op = instr->args, i = instr->argCount; i--; op++) { if (PC_OP_IS_WRITE_ANY_REGISTER(op, coloring_class)) { reg = op->data.reg.reg; bitvectorclearbit(reg, vec); @@ -73,23 +71,19 @@ static void buildinterferencematrix(void) { } } } - op++; } - op = instr->args; - i = instr->argCount; - while (i--) { + for (op = instr->args, i = instr->argCount; i--; op++) { if (PC_OP_IS_READ_ANY_REGISTER(op, coloring_class)) { reg = op->data.reg.reg; if (bitvectorgetbit(reg, vec) == 0) op->data.reg.effect |= Effect4; bitvectorsetbit(reg, vec); } - op++; } if (coloring_class == RegClass_GPR) { - if (PCODE_FLAG_SET_F(instr) & (fIsRead | fIsWrite | fPCodeFlag40000)) { + if (PCODE_FLAG_SET_F(instr) & (fIsRead | fIsWrite | fPCodeFlag400000)) { if (instr->args[1].data.reg.reg >= n_real_registers[coloring_class]) makeinterfere(0, instr->args[1].data.reg.reg); if (PCODE_FLAG_SET_F(instr) & fUpdatesPtr) @@ -124,7 +118,7 @@ static void buildinterferencematrix(void) { op = instr->args; CError_ASSERT(219, instr->argCount != 0); - while (op->kind != PCOp_REGISTER && !(op->data.reg.effect & EffectWrite)) { + while (op->kind != PCOp_REGISTER || !(op->data.reg.effect & EffectWrite)) { i++; op++; CError_ASSERT(226, i <= instr->argCount); @@ -136,6 +130,7 @@ static void buildinterferencematrix(void) { for (j = 0; j < n_scratch_registers[coloring_class]; j++) makeinterfere(op->data.reg.reg, scratch_registers[coloring_class][j]); } + i++; op++; } } -- cgit v1.2.3