Revision 056401ea target-ppc/translate.c

b/target-ppc/translate.c
6801 6801
    opc_handler_t **table, *handler;
6802 6802
    target_ulong pc_start;
6803 6803
    uint16_t *gen_opc_end;
6804
    int supervisor;
6804
    int supervisor, little_endian;
6805 6805
    int single_step, branch_step;
6806 6806
    int j, lj = -1;
6807 6807

  
......
6821 6821
#if !defined(CONFIG_USER_ONLY)
6822 6822
    ctx.supervisor = supervisor;
6823 6823
#endif
6824
    little_endian = env->hflags & (1 << MSR_LE) ? 1 : 0;
6824 6825
#if defined(TARGET_PPC64)
6825 6826
    ctx.sf_mode = msr_sf;
6826
    ctx.mem_idx = (supervisor << 2) | (msr_sf << 1) | msr_le;
6827
    ctx.mem_idx = (supervisor << 2) | (msr_sf << 1) | little_endian;
6827 6828
#else
6828
    ctx.mem_idx = (supervisor << 1) | msr_le;
6829
    ctx.mem_idx = (supervisor << 1) | little_endian;
6829 6830
#endif
6830 6831
    ctx.dcache_line_size = env->dcache_line_size;
6831 6832
    ctx.fpu_enabled = msr_fp;
......
6880 6881
                    ctx.nip, supervisor, (int)msr_ir);
6881 6882
        }
6882 6883
#endif
6883
        ctx.opcode = ldl_code(ctx.nip);
6884
        if (msr_le) {
6885
            ctx.opcode = ((ctx.opcode & 0xFF000000) >> 24) |
6886
                ((ctx.opcode & 0x00FF0000) >> 8) |
6887
                ((ctx.opcode & 0x0000FF00) << 8) |
6888
                ((ctx.opcode & 0x000000FF) << 24);
6884
        if (unlikely(little_endian)) {
6885
            ctx.opcode = bswap32(ldl_code(ctx.nip));
6886
        } else {
6887
            ctx.opcode = ldl_code(ctx.nip);
6889 6888
        }
6890 6889
#if defined PPC_DEBUG_DISAS
6891 6890
        if (loglevel & CPU_LOG_TB_IN_ASM) {
6892 6891
            fprintf(logfile, "translate opcode %08x (%02x %02x %02x) (%s)\n",
6893 6892
                    ctx.opcode, opc1(ctx.opcode), opc2(ctx.opcode),
6894
                    opc3(ctx.opcode), msr_le ? "little" : "big");
6893
                    opc3(ctx.opcode), little_endian ? "little" : "big");
6895 6894
        }
6896 6895
#endif
6897 6896
        ctx.nip += 4;
......
6986 6985
    if (loglevel & CPU_LOG_TB_IN_ASM) {
6987 6986
        int flags;
6988 6987
        flags = env->bfd_mach;
6989
        flags |= msr_le << 16;
6988
        flags |= little_endian << 16;
6990 6989
        fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start));
6991 6990
        target_disas(logfile, pc_start, ctx.nip - pc_start, flags);
6992 6991
        fprintf(logfile, "\n");

Also available in: Unified diff