Revision 5fafdf24 target-ppc/translate.c

b/target-ppc/translate.c
1 1
/*
2 2
 *  PowerPC emulation for qemu: main translation routines.
3
 * 
3
 *
4 4
 *  Copyright (c) 2003-2007 Jocelyn Mayer
5 5
 *
6 6
 * This library is free software; you can redistribute it and/or
......
1147 1147
GEN_HANDLER(rlwinm, 0x15, 0xFF, 0xFF, 0x00000000, PPC_INTEGER)
1148 1148
{
1149 1149
    uint32_t mb, me, sh;
1150
    
1150
   
1151 1151
    sh = SH(ctx->opcode);
1152 1152
    mb = MB(ctx->opcode);
1153 1153
    me = ME(ctx->opcode);
......
1676 1676
GEN_HANDLER(mtfsb0, 0x3F, 0x06, 0x02, 0x001FF800, PPC_FLOAT)
1677 1677
{
1678 1678
    uint8_t crb;
1679
    
1679
   
1680 1680
    if (unlikely(!ctx->fpu_enabled)) {
1681 1681
        RET_EXCP(ctx, EXCP_NO_FP, 0);
1682 1682
        return;
......
1693 1693
GEN_HANDLER(mtfsb1, 0x3F, 0x06, 0x01, 0x001FF800, PPC_FLOAT)
1694 1694
{
1695 1695
    uint8_t crb;
1696
    
1696
   
1697 1697
    if (unlikely(!ctx->fpu_enabled)) {
1698 1698
        RET_EXCP(ctx, EXCP_NO_FP, 0);
1699 1699
        return;
......
2287 2287
GEN_HANDLER(stswx, 0x1F, 0x15, 0x14, 0x00000001, PPC_INTEGER)
2288 2288
{
2289 2289
    /* NIP cannot be restored if the memory exception comes from an helper */
2290
    gen_update_nip(ctx, ctx->nip - 4); 
2290
    gen_update_nip(ctx, ctx->nip - 4);
2291 2291
    gen_addr_reg_index(ctx);
2292 2292
    gen_op_load_xer_bc();
2293 2293
    op_ldsts(stsw, rS(ctx->opcode));
......
2775 2775
                else
2776 2776
#endif
2777 2777
                    gen_op_test_ctr_false(mask);
2778
                break;                           
2778
                break;                          
2779 2779
            case 2:
2780 2780
#if defined(TARGET_PPC64)
2781 2781
                if (ctx->sf_mode)
......
2815 2815
}
2816 2816

  
2817 2817
GEN_HANDLER(bc, 0x10, 0xFF, 0xFF, 0x00000000, PPC_FLOW)
2818
{                     
2818
{                    
2819 2819
    gen_bcond(ctx, BCOND_IM);
2820 2820
}
2821 2821

  
2822 2822
GEN_HANDLER(bcctr, 0x13, 0x10, 0x10, 0x00000000, PPC_FLOW)
2823
{                    
2823
{                   
2824 2824
    gen_bcond(ctx, BCOND_CTR);
2825 2825
}
2826 2826

  
2827 2827
GEN_HANDLER(bclr, 0x13, 0x10, 0x00, 0x00000000, PPC_FLOW)
2828
{                     
2828
{                    
2829 2829
    gen_bcond(ctx, BCOND_LR);
2830 2830
}
2831 2831

  
......
2968 2968
GEN_HANDLER(mfcr, 0x1F, 0x13, 0x00, 0x00000801, PPC_MISC)
2969 2969
{
2970 2970
    uint32_t crm, crn;
2971
    
2971
   
2972 2972
    if (likely(ctx->opcode & 0x00100000)) {
2973 2973
        crm = CRM(ctx->opcode);
2974 2974
        if (likely((crm ^ (crm - 1)) == 0)) {
......
3058 3058
GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00000801, PPC_MISC)
3059 3059
{
3060 3060
    uint32_t crm, crn;
3061
    
3061
   
3062 3062
    gen_op_load_gpr_T0(rS(ctx->opcode));
3063 3063
    crm = CRM(ctx->opcode);
3064 3064
    if (likely((ctx->opcode & 0x00100000) || (crm ^ (crm - 1)) == 0)) {
......
5585 5585
        (xer_cmp << XER_CMP);
5586 5586
}
5587 5587

  
5588
void cpu_dump_state(CPUState *env, FILE *f, 
5588
void cpu_dump_state(CPUState *env, FILE *f,
5589 5589
                    int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
5590 5590
                    int flags)
5591 5591
{
......
5753 5753
        if (unlikely(env->nb_breakpoints > 0)) {
5754 5754
            for (j = 0; j < env->nb_breakpoints; j++) {
5755 5755
                if (env->breakpoints[j] == ctx.nip) {
5756
                    gen_update_nip(&ctx, ctx.nip); 
5756
                    gen_update_nip(&ctx, ctx.nip);
5757 5757
                    gen_op_debug();
5758 5758
                    break;
5759 5759
                }

Also available in: Unified diff