Revision e924bbec
b/tcg/ppc64/tcg-target.c | ||
---|---|---|
34 | 34 |
|
35 | 35 |
#if TARGET_LONG_BITS == 32 |
36 | 36 |
#define LD_ADDR LWZU |
37 |
#define CMP_L 0 |
|
37 | 38 |
#else |
38 | 39 |
#define LD_ADDR LDU |
40 |
#define CMP_L (1<<21) |
|
39 | 41 |
#endif |
40 | 42 |
|
41 | 43 |
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { |
... | ... | |
588 | 590 |
tcg_out_tlb_read (s, r0, r1, r2, addr_reg, s_bits, |
589 | 591 |
offsetof (CPUState, tlb_table[mem_index][0].addr_read)); |
590 | 592 |
|
591 |
tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1)); |
|
593 |
tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L);
|
|
592 | 594 |
|
593 | 595 |
label1_ptr = s->code_ptr; |
594 | 596 |
#ifdef FAST_PATH |
... | ... | |
715 | 717 |
tcg_out_tlb_read (s, r0, r1, r2, addr_reg, opc, |
716 | 718 |
offsetof (CPUState, tlb_table[mem_index][0].addr_write)); |
717 | 719 |
|
718 |
tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1)); |
|
720 |
tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L);
|
|
719 | 721 |
|
720 | 722 |
label1_ptr = s->code_ptr; |
721 | 723 |
#ifdef FAST_PATH |
... | ... | |
882 | 884 |
} |
883 | 885 |
|
884 | 886 |
static void tcg_out_cmp (TCGContext *s, int cond, TCGArg arg1, TCGArg arg2, |
885 |
int const_arg2, int cr) |
|
887 |
int const_arg2, int cr, int arch64)
|
|
886 | 888 |
{ |
887 | 889 |
int imm; |
888 | 890 |
uint32_t op; |
... | ... | |
939 | 941 |
default: |
940 | 942 |
tcg_abort (); |
941 | 943 |
} |
942 |
op |= BF (cr); |
|
944 |
op |= BF (cr) | (arch64 << 21);
|
|
943 | 945 |
|
944 | 946 |
if (imm) |
945 | 947 |
tcg_out32 (s, op | RA (arg1) | (arg2 & 0xffff)); |
... | ... | |
971 | 973 |
|
972 | 974 |
static void tcg_out_brcond (TCGContext *s, int cond, |
973 | 975 |
TCGArg arg1, TCGArg arg2, int const_arg2, |
974 |
int label_index) |
|
976 |
int label_index, int arch64)
|
|
975 | 977 |
{ |
976 |
tcg_out_cmp (s, cond, arg1, arg2, const_arg2, 7); |
|
978 |
tcg_out_cmp (s, cond, arg1, arg2, const_arg2, 7, arch64);
|
|
977 | 979 |
tcg_out_bc (s, tcg_to_bc[cond], label_index); |
978 | 980 |
} |
979 | 981 |
|
... | ... | |
1245 | 1247 |
break; |
1246 | 1248 |
|
1247 | 1249 |
case INDEX_op_brcond_i32: |
1250 |
tcg_out_brcond (s, args[2], args[0], args[1], const_args[1], args[3], 0); |
|
1251 |
break; |
|
1252 |
|
|
1248 | 1253 |
case INDEX_op_brcond_i64: |
1249 |
tcg_out_brcond (s, args[2], args[0], args[1], const_args[1], args[3]); |
|
1254 |
tcg_out_brcond (s, args[2], args[0], args[1], const_args[1], args[3], 1);
|
|
1250 | 1255 |
break; |
1251 | 1256 |
|
1252 | 1257 |
case INDEX_op_neg_i32: |
Also available in: Unified diff