Revision 651721b2 target-ppc/translate.c

b/target-ppc/translate.c
3859 3859
                            cpu_gpr[rD(ctx->opcode)], crn * 4);
3860 3860
        }
3861 3861
    } else {
3862
        gen_helper_load_cr(cpu_gpr[rD(ctx->opcode)]);
3862
        TCGv_i32 t0 = tcg_temp_new_i32();
3863
        tcg_gen_mov_i32(t0, cpu_crf[0]);
3864
        tcg_gen_shli_i32(t0, t0, 4);
3865
        tcg_gen_or_i32(t0, t0, cpu_crf[1]);
3866
        tcg_gen_shli_i32(t0, t0, 4);
3867
        tcg_gen_or_i32(t0, t0, cpu_crf[2]);
3868
        tcg_gen_shli_i32(t0, t0, 4);
3869
        tcg_gen_or_i32(t0, t0, cpu_crf[3]);
3870
        tcg_gen_shli_i32(t0, t0, 4);
3871
        tcg_gen_or_i32(t0, t0, cpu_crf[4]);
3872
        tcg_gen_shli_i32(t0, t0, 4);
3873
        tcg_gen_or_i32(t0, t0, cpu_crf[5]);
3874
        tcg_gen_shli_i32(t0, t0, 4);
3875
        tcg_gen_or_i32(t0, t0, cpu_crf[6]);
3876
        tcg_gen_shli_i32(t0, t0, 4);
3877
        tcg_gen_or_i32(t0, t0, cpu_crf[7]);
3878
        tcg_gen_extu_i32_tl(cpu_gpr[rD(ctx->opcode)], t0);
3879
        tcg_temp_free_i32(t0);
3863 3880
    }
3864 3881
}
3865 3882

  
......
3956 3973
            tcg_temp_free_i32(temp);
3957 3974
        }
3958 3975
    } else {
3959
        TCGv_i32 temp = tcg_const_i32(crm);
3960
        gen_helper_store_cr(cpu_gpr[rS(ctx->opcode)], temp);
3976
        TCGv_i32 temp = tcg_temp_new_i32();
3977
        tcg_gen_trunc_tl_i32(temp, cpu_gpr[rS(ctx->opcode)]);
3978
        for (crn = 0 ; crn < 8 ; crn++) {
3979
            if (crm & (1 << crn)) {
3980
                    tcg_gen_shri_i32(cpu_crf[7 - crn], temp, crn * 4);
3981
                    tcg_gen_andi_i32(cpu_crf[7 - crn], cpu_crf[7 - crn], 0xf);
3982
            }
3983
        }
3961 3984
        tcg_temp_free_i32(temp);
3962 3985
    }
3963 3986
}

Also available in: Unified diff