translate.c (f7a66e3a8602b0498d340e5de959fbcf738a19b6) translate.c (d89b86e9129a7c21a453fc495fc52b062708e8dc)
1/*
2 * Xilinx MicroBlaze emulation for qemu: main translation routines.
3 *
4 * Copyright (c) 2009 Edgar E. Iglesias.
5 * Copyright (c) 2009-2012 PetaLogix Qld Pty Ltd.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public

--- 1131 unchanged lines hidden (view full) ---

1140 }
1141
1142 tcg_temp_free(addr);
1143}
1144
1145static inline void eval_cc(DisasContext *dc, unsigned int cc,
1146 TCGv_i32 d, TCGv_i32 a, TCGv_i32 b)
1147{
1/*
2 * Xilinx MicroBlaze emulation for qemu: main translation routines.
3 *
4 * Copyright (c) 2009 Edgar E. Iglesias.
5 * Copyright (c) 2009-2012 PetaLogix Qld Pty Ltd.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public

--- 1131 unchanged lines hidden (view full) ---

1140 }
1141
1142 tcg_temp_free(addr);
1143}
1144
1145static inline void eval_cc(DisasContext *dc, unsigned int cc,
1146 TCGv_i32 d, TCGv_i32 a, TCGv_i32 b)
1147{
1148 static const int mb_to_tcg_cc[] = {
1149 [CC_EQ] = TCG_COND_EQ,
1150 [CC_NE] = TCG_COND_NE,
1151 [CC_LT] = TCG_COND_LT,
1152 [CC_LE] = TCG_COND_LE,
1153 [CC_GE] = TCG_COND_GE,
1154 [CC_GT] = TCG_COND_GT,
1155 };
1156
1148 switch (cc) {
1157 switch (cc) {
1149 case CC_EQ:
1150 tcg_gen_setcond_i32(TCG_COND_EQ, d, a, b);
1151 break;
1152 case CC_NE:
1153 tcg_gen_setcond_i32(TCG_COND_NE, d, a, b);
1154 break;
1155 case CC_LT:
1156 tcg_gen_setcond_i32(TCG_COND_LT, d, a, b);
1157 break;
1158 case CC_LE:
1159 tcg_gen_setcond_i32(TCG_COND_LE, d, a, b);
1160 break;
1161 case CC_GE:
1162 tcg_gen_setcond_i32(TCG_COND_GE, d, a, b);
1163 break;
1164 case CC_GT:
1165 tcg_gen_setcond_i32(TCG_COND_GT, d, a, b);
1166 break;
1167 default:
1168 cpu_abort(CPU(dc->cpu), "Unknown condition code %x.\n", cc);
1169 break;
1158 case CC_EQ:
1159 case CC_NE:
1160 case CC_LT:
1161 case CC_LE:
1162 case CC_GE:
1163 case CC_GT:
1164 tcg_gen_setcond_i32(mb_to_tcg_cc[cc], d, a, b);
1165 break;
1166 default:
1167 cpu_abort(CPU(dc->cpu), "Unknown condition code %x.\n", cc);
1168 break;
1170 }
1171}
1172
1173static void eval_cond_jmp(DisasContext *dc, TCGv_i32 pc_true, TCGv_i64 pc_false)
1174{
1175 TCGLabel *l1 = gen_new_label();
1176 /* Conditional jmp. */
1177 tcg_gen_mov_i64(cpu_SR[SR_PC], pc_false);

--- 678 unchanged lines hidden ---
1169 }
1170}
1171
1172static void eval_cond_jmp(DisasContext *dc, TCGv_i32 pc_true, TCGv_i64 pc_false)
1173{
1174 TCGLabel *l1 = gen_new_label();
1175 /* Conditional jmp. */
1176 tcg_gen_mov_i64(cpu_SR[SR_PC], pc_false);

--- 678 unchanged lines hidden ---