TSC update cycle fixes.

This commit is contained in:
OBattler
2020-07-12 21:05:46 +02:00
parent bef8f8093a
commit 38828bdc3b
4 changed files with 5 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ void codegen_accumulate(int acc_reg, int delta)
addbyte(0x04);
addbyte(0x25);
addlong((uint32_t) (uintptr_t) &(acycs));
addlong(delta);
addlong(-delta);
}
}

View File

@@ -25,7 +25,7 @@ void codegen_accumulate(int acc_reg, int delta)
addbyte(0x81); /*ADD $acc_regs[c].count,acc_regs[c].dest*/
addbyte(0x05);
addlong((uint32_t) (uintptr_t) &(acycs));
addlong((uintptr_t) delta);
addlong((uintptr_t) -delta);
}
}

View File

@@ -22,7 +22,7 @@ void codegen_accumulate(ir_data_t *ir, int acc_reg, int delta)
acc_regs[acc_reg].count += delta;
if (delta != 0) {
uop_ADD_IMM(ir, IREG_acycs, IREG_acycs, delta);
uop_ADD_IMM(ir, IREG_acycs, IREG_acycs, -delta);
}
}

View File

@@ -296,6 +296,7 @@ void update_tsc(void)
tsc += cycdiff;
} else {
/* TSC has not changed. */
if (cycdiff > 0)
tsc += cycdiff;
}