}
/* Generate exceptions */
-PPC_OP(queue_exception_err)
+PPC_OP(raise_exception_err)
{
- do_queue_exception_err(PARAM(1), PARAM(2));
+ do_raise_exception_err(PARAM(1), PARAM(2));
}
-PPC_OP(queue_exception)
+PPC_OP(raise_exception)
{
- do_queue_exception(PARAM(1));
+ do_raise_exception(PARAM(1));
}
-PPC_OP(process_exceptions)
+PPC_OP(update_nip)
{
env->nip = PARAM(1);
- if (env->exceptions != 0) {
- do_check_exception_state();
- }
}
PPC_OP(debug)
{
env->nip = PARAM(1);
- env->brkstate = 1;
#if defined (DEBUG_OP)
dump_state();
#endif
- do_queue_exception(EXCP_DEBUG);
+ do_raise_exception(EXCP_DEBUG);
RETURN();
}
PPC_OP(store_srin)
{
-#if defined (DEBUG_OP)
- dump_store_sr(T1 >> 28);
-#endif
- regs->sr[T1 >> 28] = T0;
+ do_store_sr(T1 >> 28);
RETURN();
}
RETURN();
}
-/* Update time base */
-PPC_OP(update_tb)
+PPC_OP(load_tbl)
{
- T0 = regs->tb[0];
- T1 = T0;
- T0 += PARAM(1);
-#if defined (DEBUG_OP)
- dump_update_tb(PARAM(1));
-#endif
- if (T0 < T1) {
- T1 = regs->tb[1] + 1;
- regs->tb[1] = T1;
- }
- regs->tb[0] = T0;
+ T0 = cpu_ppc_load_tbl(regs);
RETURN();
}
-PPC_OP(load_tb)
+PPC_OP(load_tbu)
{
- T0 = regs->tb[PARAM(1)];
+ T0 = cpu_ppc_load_tbu(regs);
RETURN();
}
-PPC_OP(store_tb)
+PPC_OP(store_tbl)
{
- regs->tb[PARAM(1)] = T0;
-#if defined (DEBUG_OP)
- dump_store_tb(PARAM(1));
-#endif
+ cpu_ppc_store_tbl(regs, T0);
RETURN();
}
-/* Update decrementer */
-PPC_OP(update_decr)
+PPC_OP(store_tbu)
{
- T0 = regs->decr;
- T1 = T0;
- T0 -= PARAM(1);
- regs->decr = T0;
- if (PARAM(1) > T1) {
- do_queue_exception(EXCP_DECR);
- }
+ cpu_ppc_store_tbu(regs, T0);
RETURN();
}
-PPC_OP(store_decr)
+PPC_OP(load_decr)
{
- T1 = regs->decr;
- regs->decr = T0;
- if (Ts0 < 0 && Ts1 > 0) {
- do_queue_exception(EXCP_DECR);
+ T0 = cpu_ppc_load_decr(regs);
}
+
+PPC_OP(store_decr)
+{
+ cpu_ppc_store_decr(regs, T0);
RETURN();
}
PPC_OP(store_ibat)
{
-#if defined (DEBUG_OP)
- dump_store_ibat(PARAM(1), PARAM(2));
-#endif
- regs->IBAT[PARAM(1)][PARAM(2)] = T0;
+ do_store_ibat(PARAM(1), PARAM(2));
}
PPC_OP(load_dbat)
PPC_OP(store_dbat)
{
-#if defined (DEBUG_OP)
- dump_store_dbat(PARAM(1), PARAM(2));
-#endif
- regs->DBAT[PARAM(1)][PARAM(2)] = T0;
+ do_store_dbat(PARAM(1), PARAM(2));
}
/* FPSCR */
/* fnmadd - fnmadd. - fnmadds - fnmadds. */
PPC_OP(fnmadd)
{
- FT0 *= FT1;
- FT0 += FT2;
- FT0 = -FT0;
+ do_fnmadd();
RETURN();
}
/* fnmsub - fnmsub. */
PPC_OP(fnmsub)
{
- FT0 *= FT1;
- FT0 -= FT2;
- FT0 = -FT0;
+ do_fnmsub();
RETURN();
}
#include "op_mem.h"
#endif
+/* Special op to check and maybe clear reservation */
+PPC_OP(check_reservation)
+{
+ do_check_reservation();
+ RETURN();
+}
+
/* Return from interrupt */
PPC_OP(rfi)
{
+ regs->nip = regs->spr[SRR0] & ~0x00000003;
+#if 1 // TRY
+ T0 = regs->spr[SRR1] & ~0xFFF00000;
+#else
T0 = regs->spr[SRR1] & ~0xFFFF0000;
+#endif
do_store_msr();
- do_tlbia();
#if defined (DEBUG_OP)
dump_rfi();
#endif
- regs->nip = regs->spr[SRR0] & ~0x00000003;
- do_queue_exception(EXCP_RFI);
- if (env->exceptions != 0) {
- do_check_exception_state();
- }
+ // do_tlbia();
+ do_raise_exception(EXCP_RFI);
RETURN();
}
(Ts0 == Ts1 && (PARAM(1) & 0x04)) ||
(T0 < T1 && (PARAM(1) & 0x02)) ||
(T0 > T1 && (PARAM(1) & 0x01)))
- do_queue_exception_err(EXCP_PROGRAM, EXCP_TRAP);
+ do_raise_exception_err(EXCP_PROGRAM, EXCP_TRAP);
RETURN();
}
(Ts0 == SPARAM(1) && (PARAM(2) & 0x04)) ||
(T0 < (uint32_t)SPARAM(1) && (PARAM(2) & 0x02)) ||
(T0 > (uint32_t)SPARAM(1) && (PARAM(2) & 0x01)))
- do_queue_exception_err(EXCP_PROGRAM, EXCP_TRAP);
+ do_raise_exception_err(EXCP_PROGRAM, EXCP_TRAP);
RETURN();
}