2843
}
2844
#endif
2845
2846
-/* mfmsr */
2847
-static void gen_mfmsr(DisasContext *ctx)
2848
-{
2849
- CHK_SV(ctx);
2850
- tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_msr);
2851
-}
2852
-
2846
/* mfspr */
2847
static inline void gen_op_mfspr(DisasContext *ctx)
2848
{
2916
gen_op_mfspr(ctx);
2917
}
2918
2926
-/* mtmsr */
2927
-#if defined(TARGET_PPC64)
2928
-static void gen_mtmsrd(DisasContext *ctx)
2929
-{
2930
- if (unlikely(!is_book3s_arch2x(ctx))) {
2931
- gen_invalid(ctx);
2932
- return;
2933
- }
2934
-
2935
- CHK_SV(ctx);
2936
-
2937
-#if !defined(CONFIG_USER_ONLY)
2938
- TCGv t0, t1;
2939
- target_ulong mask;
2940
-
2941
- t0 = tcg_temp_new();
2942
- t1 = tcg_temp_new();
2943
-
2944
- translator_io_start(&ctx->base);
2945
-
2946
- if (ctx->opcode & 0x00010000) {
2947
- /* L=1 form only updates EE and RI */
2948
- mask = (1ULL << MSR_RI) | (1ULL << MSR_EE);
2949
- } else {
2950
- /* mtmsrd does not alter HV, S, ME, or LE */
2951
- mask = ~((1ULL << MSR_LE) | (1ULL << MSR_ME) | (1ULL << MSR_S) |
2952
- (1ULL << MSR_HV));
2953
- /*
2954
- * XXX: we need to update nip before the store if we enter
2955
- * power saving mode, we will exit the loop directly from
2956
- * ppc_store_msr
2957
- */
2958
- gen_update_nip(ctx, ctx->base.pc_next);
2959
- }
2960
-
2961
- tcg_gen_andi_tl(t0, cpu_gpr[rS(ctx->opcode)], mask);
2962
- tcg_gen_andi_tl(t1, cpu_msr, ~mask);
2963
- tcg_gen_or_tl(t0, t0, t1);
2964
-
2965
- gen_helper_store_msr(tcg_env, t0);
2966
-
2967
- /* Must stop the translation as machine state (may have) changed */
2968
- ctx->base.is_jmp = DISAS_EXIT_UPDATE;
2969
-#endif /* !defined(CONFIG_USER_ONLY) */
2970
-}
2971
-#endif /* defined(TARGET_PPC64) */
2972
-
2973
-static void gen_mtmsr(DisasContext *ctx)
2974
-{
2975
- CHK_SV(ctx);
2976
-
2977
-#if !defined(CONFIG_USER_ONLY)
2978
- TCGv t0, t1;
2979
- target_ulong mask = 0xFFFFFFFF;
2980
-
2981
- t0 = tcg_temp_new();
2982
- t1 = tcg_temp_new();
2983
-
2984
- translator_io_start(&ctx->base);
2985
- if (ctx->opcode & 0x00010000) {
2986
- /* L=1 form only updates EE and RI */
2987
- mask &= (1ULL << MSR_RI) | (1ULL << MSR_EE);
2988
- } else {
2989
- if (likely(!(ctx->insns_flags2 & PPC2_PPE42))) {
2990
- /* mtmsr does not alter S, ME, or LE */
2991
- mask &= ~((1ULL << MSR_LE) | (1ULL << MSR_ME) | (1ULL << MSR_S));
2992
- }
2993
-
2994
- /*
2995
- * XXX: we need to update nip before the store if we enter
2996
- * power saving mode, we will exit the loop directly from
2997
- * ppc_store_msr
2998
- */
2999
- gen_update_nip(ctx, ctx->base.pc_next);
3000
- }
3001
-
3002
- tcg_gen_andi_tl(t0, cpu_gpr[rS(ctx->opcode)], mask);
3003
- tcg_gen_andi_tl(t1, cpu_msr, ~mask);
3004
- tcg_gen_or_tl(t0, t0, t1);
3005
-
3006
- gen_helper_store_msr(tcg_env, t0);
3007
-
3008
- /* Must stop the translation as machine state (may have) changed */
3009
- ctx->base.is_jmp = DISAS_EXIT_UPDATE;
3010
-#endif
3011
-}
3012
-
2919
/* mtspr */
2920
static void gen_mtspr(DisasContext *ctx)
2921
{
4580
GEN_HANDLER(sc, 0x11, 0x11, 0xFF, 0x03FFF01D, PPC_FLOW),
4581
GEN_HANDLER(sc, 0x11, 0x01, 0xFF, 0x03FFF01D, PPC_FLOW),
4582
GEN_HANDLER(mcrxr, 0x1F, 0x00, 0x10, 0x007FF801, PPC_MISC),
4677
-GEN_HANDLER(mfmsr, 0x1F, 0x13, 0x02, 0x001FF801, PPC_MISC),
4583
GEN_HANDLER(mfspr, 0x1F, 0x13, 0x0A, 0x00000001, PPC_MISC),
4584
GEN_HANDLER(mftb, 0x1F, 0x13, 0x0B, 0x00000001, PPC_MFTB),
4585
#if defined(TARGET_PPC64)
4681
-GEN_HANDLER(mtmsrd, 0x1F, 0x12, 0x05, 0x001EF801, PPC_64B),
4586
GEN_HANDLER_E(setb, 0x1F, 0x00, 0x04, 0x0003F801, PPC_NONE, PPC2_ISA300),
4587
GEN_HANDLER_E(mcrxrx, 0x1F, 0x00, 0x12, 0x007FF801, PPC_NONE, PPC2_ISA300),
4588
#endif
4685
-GEN_HANDLER(mtmsr, 0x1F, 0x12, 0x04, 0x001EF801, PPC_MISC),
4589
GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x00000000, PPC_MISC),
4590
GEN_HANDLER(dcbz, 0x1F, 0x16, 0x1F, 0x03C00001, PPC_CACHE_DCBZ),
4591
GEN_HANDLER_E(dcbzep, 0x1F, 0x1F, 0x1F, 0x03C00001, PPC_NONE, PPC2_BOOKE206),