Revision 508b43ea target-alpha/translate.c

b/target-alpha/translate.c
2876 2876
        break;
2877 2877
#endif
2878 2878
    case 0x1E:
2879
        /* HW_REI (PALcode) */
2879
        /* HW_RET (PALcode) */
2880 2880
#if defined (CONFIG_USER_ONLY)
2881 2881
        goto invalid_opc;
2882 2882
#else
2883 2883
        if (!ctx->pal_mode)
2884 2884
            goto invalid_opc;
2885 2885
        if (rb == 31) {
2886
            /* "Old" alpha */
2887
            gen_helper_hw_rei();
2888
        } else {
2889
            TCGv tmp;
2890

  
2891
            if (ra != 31) {
2892
                tmp = tcg_temp_new();
2893
                tcg_gen_addi_i64(tmp, cpu_ir[rb], (((int64_t)insn << 51) >> 51));
2894
            } else
2895
                tmp = tcg_const_i64(((int64_t)insn << 51) >> 51);
2886
            /* Pre-EV6 CPUs interpreted this as HW_REI, loading the return
2887
               address from EXC_ADDR.  This turns out to be useful for our
2888
               emulation PALcode, so continue to accept it.  */
2889
            TCGv tmp = tcg_temp_new();
2890
            tcg_gen_ld_i64(tmp, cpu_env, offsetof(CPUState, ipr[IPR_EXC_ADDR]));
2896 2891
            gen_helper_hw_ret(tmp);
2897 2892
            tcg_temp_free(tmp);
2893
        } else {
2894
            gen_helper_hw_ret(cpu_ir[rb]);
2898 2895
        }
2899 2896
        ret = EXIT_PC_UPDATED;
2900 2897
        break;

Also available in: Unified diff