#if TARGET_LONG_BITS == 32
#define LD_ADDR LWZU
+#define CMP_L 0
#else
#define LD_ADDR LDU
+#define CMP_L (1<<21)
#endif
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
tcg_out_tlb_read (s, r0, r1, r2, addr_reg, s_bits,
offsetof (CPUState, tlb_table[mem_index][0].addr_read));
- tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1));
+ tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L);
label1_ptr = s->code_ptr;
#ifdef FAST_PATH
tcg_out_tlb_read (s, r0, r1, r2, addr_reg, opc,
offsetof (CPUState, tlb_table[mem_index][0].addr_write));
- tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1));
+ tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L);
label1_ptr = s->code_ptr;
#ifdef FAST_PATH
}
static void tcg_out_cmp (TCGContext *s, int cond, TCGArg arg1, TCGArg arg2,
- int const_arg2, int cr)
+ int const_arg2, int cr, int arch64)
{
int imm;
uint32_t op;
default:
tcg_abort ();
}
- op |= BF (cr);
+ op |= BF (cr) | (arch64 << 21);
if (imm)
tcg_out32 (s, op | RA (arg1) | (arg2 & 0xffff));
static void tcg_out_brcond (TCGContext *s, int cond,
TCGArg arg1, TCGArg arg2, int const_arg2,
- int label_index)
+ int label_index, int arch64)
{
- tcg_out_cmp (s, cond, arg1, arg2, const_arg2, 7);
+ tcg_out_cmp (s, cond, arg1, arg2, const_arg2, 7, arch64);
tcg_out_bc (s, tcg_to_bc[cond], label_index);
}
break;
case INDEX_op_brcond_i32:
+ tcg_out_brcond (s, args[2], args[0], args[1], const_args[1], args[3], 0);
+ break;
+
case INDEX_op_brcond_i64:
- tcg_out_brcond (s, args[2], args[0], args[1], const_args[1], args[3]);
+ tcg_out_brcond (s, args[2], args[0], args[1], const_args[1], args[3], 1);
break;
case INDEX_op_neg_i32: