diff --git a/target-ppc/helper.h b/target-ppc/helper.h index c3c11fbc2a..f52cfce87d 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -6,6 +6,18 @@ DEF_HELPER_3(tw, void, tl, tl, i32) #if defined(TARGET_PPC64) DEF_HELPER_3(td, void, tl, tl, i32) #endif +#if !defined(CONFIG_USER_ONLY) +DEF_HELPER_0(rfi, void) +DEF_HELPER_0(rfsvc, void) +DEF_HELPER_0(40x_rfci, void) +DEF_HELPER_0(rfci, void) +DEF_HELPER_0(rfdi, void) +DEF_HELPER_0(rfmci, void) +#if defined(TARGET_PPC64) +DEF_HELPER_0(rfid, void) +DEF_HELPER_0(hrfid, void) +#endif +#endif DEF_HELPER_2(lmw, void, tl, i32) DEF_HELPER_2(stmw, void, tl, i32) @@ -17,10 +29,6 @@ DEF_HELPER_1(dcbz_970, void, tl) DEF_HELPER_1(icbi, void, tl) DEF_HELPER_4(lscbx, tl, tl, i32, i32, i32) - -DEF_HELPER_2(fcmpo, i32, i64, i64) -DEF_HELPER_2(fcmpu, i32, i64, i64) - DEF_HELPER_0(load_cr, tl) DEF_HELPER_2(store_cr, void, tl, i32) @@ -53,6 +61,9 @@ DEF_HELPER_1(fpscr_setbit, void, i32) DEF_HELPER_1(float64_to_float32, i32, i64) DEF_HELPER_1(float32_to_float64, i64, i32) +DEF_HELPER_2(fcmpo, i32, i64, i64) +DEF_HELPER_2(fcmpu, i32, i64, i64) + DEF_HELPER_1(fctiw, i64, i64) DEF_HELPER_1(fctiwz, i64, i64) #if defined(TARGET_PPC64) diff --git a/target-ppc/op.c b/target-ppc/op.c index 00b9903ad7..6be8777768 100644 --- a/target-ppc/op.c +++ b/target-ppc/op.c @@ -259,26 +259,6 @@ void OPPROTO op_srli_T1 (void) /* Return from interrupt */ #if !defined(CONFIG_USER_ONLY) -void OPPROTO op_rfi (void) -{ - do_rfi(); - RETURN(); -} - -#if defined(TARGET_PPC64) -void OPPROTO op_rfid (void) -{ - do_rfid(); - RETURN(); -} - -void OPPROTO op_hrfid (void) -{ - do_hrfid(); - RETURN(); -} -#endif - /* Exception vectors */ void OPPROTO op_store_excp_prefix (void) { @@ -637,12 +617,6 @@ void OPPROTO op_POWER_rac (void) do_POWER_rac(); RETURN(); } - -void OPPROTO op_POWER_rfsvc (void) -{ - do_POWER_rfsvc(); - RETURN(); -} #endif /* PowerPC 4xx specific micro-ops */ @@ -659,33 +633,6 @@ void OPPROTO op_store_dcr (void) } #if !defined(CONFIG_USER_ONLY) -/* Return from critical interrupt : - * same as rfi, except nip & MSR are loaded from SRR2/3 instead of SRR0/1 - */ -void OPPROTO op_40x_rfci (void) -{ - do_40x_rfci(); - RETURN(); -} - -void OPPROTO op_rfci (void) -{ - do_rfci(); - RETURN(); -} - -void OPPROTO op_rfdi (void) -{ - do_rfdi(); - RETURN(); -} - -void OPPROTO op_rfmci (void) -{ - do_rfmci(); - RETURN(); -} - void OPPROTO op_wrte (void) { /* We don't call do_store_msr here as we won't trigger diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index d0a78b98b0..a5bd9737f2 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -1618,7 +1618,7 @@ void do_store_msr (void) } } -static always_inline void __do_rfi (target_ulong nip, target_ulong msr, +static always_inline void do_rfi (target_ulong nip, target_ulong msr, target_ulong msrm, int keep_msrh) { #if defined(TARGET_PPC64) @@ -1647,23 +1647,23 @@ static always_inline void __do_rfi (target_ulong nip, target_ulong msr, env->interrupt_request |= CPU_INTERRUPT_EXITTB; } -void do_rfi (void) +void helper_rfi (void) { - __do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1], - ~((target_ulong)0xFFFF0000), 1); + do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1], + ~((target_ulong)0xFFFF0000), 1); } #if defined(TARGET_PPC64) -void do_rfid (void) +void helper_rfid (void) { - __do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1], - ~((target_ulong)0xFFFF0000), 0); + do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1], + ~((target_ulong)0xFFFF0000), 0); } -void do_hrfid (void) +void helper_hrfid (void) { - __do_rfi(env->spr[SPR_HSRR0], env->spr[SPR_HSRR1], - ~((target_ulong)0xFFFF0000), 0); + do_rfi(env->spr[SPR_HSRR0], env->spr[SPR_HSRR1], + ~((target_ulong)0xFFFF0000), 0); } #endif #endif @@ -1859,9 +1859,9 @@ void do_POWER_rac (void) env->nb_BATs = nb_BATs; } -void do_POWER_rfsvc (void) +void helper_rfsvc (void) { - __do_rfi(env->lr, env->ctr, 0x0000FFFF, 0); + do_rfi(env->lr, env->ctr, 0x0000FFFF, 0); } void do_store_hid0_601 (void) @@ -1959,28 +1959,28 @@ void do_store_dcr (void) } #if !defined(CONFIG_USER_ONLY) -void do_40x_rfci (void) +void helper_40x_rfci (void) { - __do_rfi(env->spr[SPR_40x_SRR2], env->spr[SPR_40x_SRR3], - ~((target_ulong)0xFFFF0000), 0); + do_rfi(env->spr[SPR_40x_SRR2], env->spr[SPR_40x_SRR3], + ~((target_ulong)0xFFFF0000), 0); } -void do_rfci (void) +void helper_rfci (void) { - __do_rfi(env->spr[SPR_BOOKE_CSRR0], SPR_BOOKE_CSRR1, - ~((target_ulong)0x3FFF0000), 0); + do_rfi(env->spr[SPR_BOOKE_CSRR0], SPR_BOOKE_CSRR1, + ~((target_ulong)0x3FFF0000), 0); } -void do_rfdi (void) +void helper_rfdi (void) { - __do_rfi(env->spr[SPR_BOOKE_DSRR0], SPR_BOOKE_DSRR1, - ~((target_ulong)0x3FFF0000), 0); + do_rfi(env->spr[SPR_BOOKE_DSRR0], SPR_BOOKE_DSRR1, + ~((target_ulong)0x3FFF0000), 0); } -void do_rfmci (void) +void helper_rfmci (void) { - __do_rfi(env->spr[SPR_BOOKE_MCSRR0], SPR_BOOKE_MCSRR1, - ~((target_ulong)0x3FFF0000), 0); + do_rfi(env->spr[SPR_BOOKE_MCSRR0], SPR_BOOKE_MCSRR1, + ~((target_ulong)0x3FFF0000), 0); } void do_load_403_pb (int num) diff --git a/target-ppc/op_helper.h b/target-ppc/op_helper.h index b942391038..4318f9afa0 100644 --- a/target-ppc/op_helper.h +++ b/target-ppc/op_helper.h @@ -21,8 +21,6 @@ void do_print_mem_EA (target_ulong EA); /* Registers load and stores */ -void do_load_cr (void); -void do_store_cr (uint32_t mask); #if defined(TARGET_PPC64) void do_store_pri (int prio); #endif @@ -32,11 +30,6 @@ void ppc_store_dump_spr (int sprn, target_ulong val); /* Misc */ #if !defined(CONFIG_USER_ONLY) void do_store_msr (void); -void do_rfi (void); -#if defined(TARGET_PPC64) -void do_rfid (void); -void do_hrfid (void); -#endif #endif /* POWER / PowerPC 601 specific helpers */ @@ -51,7 +44,6 @@ void do_POWER_maskg (void); void do_POWER_mulo (void); #if !defined(CONFIG_USER_ONLY) void do_POWER_rac (void); -void do_POWER_rfsvc (void); void do_store_hid0_601 (void); #endif @@ -65,10 +57,6 @@ void do_440_tlbwe (int word); void do_load_dcr (void); void do_store_dcr (void); #if !defined(CONFIG_USER_ONLY) -void do_40x_rfci (void); -void do_rfci (void); -void do_rfdi (void); -void do_rfmci (void); void do_4xx_tlbre_lo (void); void do_4xx_tlbre_hi (void); void do_4xx_tlbwe_lo (void); diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 3f39431a10..fe58d7acd1 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -3732,7 +3732,7 @@ GEN_HANDLER(rfi, 0x13, 0x12, 0x01, 0x03FF8001, PPC_FLOW) GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_rfi(); + gen_helper_rfi(); GEN_SYNC(ctx); #endif } @@ -3748,7 +3748,7 @@ GEN_HANDLER(rfid, 0x13, 0x12, 0x00, 0x03FF8001, PPC_64B) GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_rfid(); + gen_helper_rfid(); GEN_SYNC(ctx); #endif } @@ -3763,7 +3763,7 @@ GEN_HANDLER(hrfid, 0x13, 0x12, 0x08, 0x03FF8001, PPC_64H) GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_hrfid(); + gen_helper_hrfid(); GEN_SYNC(ctx); #endif } @@ -4964,7 +4964,7 @@ GEN_HANDLER(rfsvc, 0x13, 0x12, 0x02, 0x03FFF0001, PPC_POWER) GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_POWER_rfsvc(); + gen_helper_rfsvc(); GEN_SYNC(ctx); #endif } @@ -5508,7 +5508,7 @@ GEN_HANDLER2(rfci_40x, "rfci", 0x13, 0x13, 0x01, 0x03FF8001, PPC_40x_EXCP) return; } /* Restore CPU state */ - gen_op_40x_rfci(); + gen_helper_40x_rfci(); GEN_SYNC(ctx); #endif } @@ -5523,7 +5523,7 @@ GEN_HANDLER(rfci, 0x13, 0x13, 0x01, 0x03FF8001, PPC_BOOKE) return; } /* Restore CPU state */ - gen_op_rfci(); + gen_helper_rfci(); GEN_SYNC(ctx); #endif } @@ -5540,7 +5540,7 @@ GEN_HANDLER(rfdi, 0x13, 0x07, 0x01, 0x03FF8001, PPC_RFDI) return; } /* Restore CPU state */ - gen_op_rfdi(); + gen_helper_rfdi(); GEN_SYNC(ctx); #endif } @@ -5556,7 +5556,7 @@ GEN_HANDLER(rfmci, 0x13, 0x06, 0x01, 0x03FF8001, PPC_RFMCI) return; } /* Restore CPU state */ - gen_op_rfmci(); + gen_helper_rfmci(); GEN_SYNC(ctx); #endif }