Commit fe2b269a4ff4ed0b06c2dca5083fb2271da1c506
1 parent
f18cd223
target-alpha: misc fixes
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5355 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
41 additions
and
63 deletions
target-alpha/op.c
| ... | ... | @@ -25,15 +25,6 @@ |
| 25 | 25 | #include "host-utils.h" |
| 26 | 26 | #include "op_helper.h" |
| 27 | 27 | |
| 28 | -/* Debug stuff */ | |
| 29 | -void OPPROTO op_no_op (void) | |
| 30 | -{ | |
| 31 | -#if !defined (DEBUG_OP) | |
| 32 | - __asm__ __volatile__("nop" : : : "memory"); | |
| 33 | -#endif | |
| 34 | - RETURN(); | |
| 35 | -} | |
| 36 | - | |
| 37 | 28 | /* Load and stores */ |
| 38 | 29 | #define MEMSUFFIX _raw |
| 39 | 30 | #include "op_mem.h" | ... | ... |
target-alpha/op_helper.h
target-alpha/translate.c
| ... | ... | @@ -31,7 +31,6 @@ |
| 31 | 31 | #include "qemu-common.h" |
| 32 | 32 | |
| 33 | 33 | #define DO_SINGLE_STEP |
| 34 | -#define GENERATE_NOP | |
| 35 | 34 | #define ALPHA_DEBUG_DISAS |
| 36 | 35 | #define DO_TB_FLUSH |
| 37 | 36 | |
| ... | ... | @@ -104,13 +103,6 @@ static void alpha_translate_init(void) |
| 104 | 103 | done_init = 1; |
| 105 | 104 | } |
| 106 | 105 | |
| 107 | -static always_inline void gen_op_nop (void) | |
| 108 | -{ | |
| 109 | -#if defined(GENERATE_NOP) | |
| 110 | - gen_op_no_op(); | |
| 111 | -#endif | |
| 112 | -} | |
| 113 | - | |
| 114 | 106 | /* Memory moves */ |
| 115 | 107 | #if defined(CONFIG_USER_ONLY) |
| 116 | 108 | #define OP_LD_TABLE(width) \ |
| ... | ... | @@ -184,10 +176,7 @@ static always_inline void gen_load_mem_dyngen (DisasContext *ctx, |
| 184 | 176 | int ra, int rb, int32_t disp16, |
| 185 | 177 | int clear) |
| 186 | 178 | { |
| 187 | - if (ra == 31 && disp16 == 0) { | |
| 188 | - /* UNOP */ | |
| 189 | - gen_op_nop(); | |
| 190 | - } else { | |
| 179 | + if (ra != 31 || disp16 != 0) { | |
| 191 | 180 | if (rb != 31) |
| 192 | 181 | tcg_gen_addi_i64(cpu_T[0], cpu_ir[rb], disp16); |
| 193 | 182 | else |
| ... | ... | @@ -374,8 +363,7 @@ static always_inline void gen_fbcond (DisasContext *ctx, |
| 374 | 363 | gen_set_label(l2); |
| 375 | 364 | } |
| 376 | 365 | |
| 377 | -static always_inline void gen_cmov (DisasContext *ctx, | |
| 378 | - TCGCond inv_cond, | |
| 366 | +static always_inline void gen_cmov (TCGCond inv_cond, | |
| 379 | 367 | int ra, int rb, int rc, |
| 380 | 368 | int islit, uint8_t lit, int mask) |
| 381 | 369 | { |
| ... | ... | @@ -487,7 +475,7 @@ static always_inline void gen_ext_h(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1), |
| 487 | 475 | tcg_gen_shli_i64(cpu_ir[rc], cpu_ir[ra], 64 - ((lit & 7) * 8)); |
| 488 | 476 | else |
| 489 | 477 | tcg_gen_mov_i64(cpu_ir[rc], cpu_ir[ra]); |
| 490 | - } else { | |
| 478 | + } else { | |
| 491 | 479 | TCGv tmp1, tmp2; |
| 492 | 480 | tmp1 = tcg_temp_new(TCG_TYPE_I64); |
| 493 | 481 | tcg_gen_andi_i64(tmp1, cpu_ir[rb], 7); |
| ... | ... | @@ -521,7 +509,7 @@ static always_inline void gen_ext_l(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1), |
| 521 | 509 | tcg_gen_shli_i64(tmp, tmp, 3); |
| 522 | 510 | tcg_gen_shr_i64(cpu_ir[rc], cpu_ir[ra], tmp); |
| 523 | 511 | tcg_temp_free(tmp); |
| 524 | - } | |
| 512 | + } | |
| 525 | 513 | if (tcg_gen_ext_i64) |
| 526 | 514 | tcg_gen_ext_i64(cpu_ir[rc], cpu_ir[rc]); |
| 527 | 515 | } else |
| ... | ... | @@ -529,9 +517,9 @@ static always_inline void gen_ext_l(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1), |
| 529 | 517 | } |
| 530 | 518 | |
| 531 | 519 | /* Code to call arith3 helpers */ |
| 532 | -static always_inline void gen_arith3_helper(void *helper, | |
| 533 | - int ra, int rb, int rc, | |
| 534 | - int islit, uint8_t lit) | |
| 520 | +static always_inline void gen_arith3 (void *helper, | |
| 521 | + int ra, int rb, int rc, | |
| 522 | + int islit, uint8_t lit) | |
| 535 | 523 | { |
| 536 | 524 | if (unlikely(rc == 31)) |
| 537 | 525 | return; |
| ... | ... | @@ -792,7 +780,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 792 | 780 | break; |
| 793 | 781 | case 0x0F: |
| 794 | 782 | /* CMPBGE */ |
| 795 | - gen_arith3_helper(helper_cmpbge, ra, rb, rc, islit, lit); | |
| 783 | + gen_arith3(helper_cmpbge, ra, rb, rc, islit, lit); | |
| 796 | 784 | break; |
| 797 | 785 | case 0x12: |
| 798 | 786 | /* S8ADDL */ |
| ... | ... | @@ -958,11 +946,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 958 | 946 | break; |
| 959 | 947 | case 0x40: |
| 960 | 948 | /* ADDL/V */ |
| 961 | - gen_arith3_helper(helper_addlv, ra, rb, rc, islit, lit); | |
| 949 | + gen_arith3(helper_addlv, ra, rb, rc, islit, lit); | |
| 962 | 950 | break; |
| 963 | 951 | case 0x49: |
| 964 | 952 | /* SUBL/V */ |
| 965 | - gen_arith3_helper(helper_sublv, ra, rb, rc, islit, lit); | |
| 953 | + gen_arith3(helper_sublv, ra, rb, rc, islit, lit); | |
| 966 | 954 | break; |
| 967 | 955 | case 0x4D: |
| 968 | 956 | /* CMPLT */ |
| ... | ... | @@ -970,11 +958,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 970 | 958 | break; |
| 971 | 959 | case 0x60: |
| 972 | 960 | /* ADDQ/V */ |
| 973 | - gen_arith3_helper(helper_addqv, ra, rb, rc, islit, lit); | |
| 961 | + gen_arith3(helper_addqv, ra, rb, rc, islit, lit); | |
| 974 | 962 | break; |
| 975 | 963 | case 0x69: |
| 976 | 964 | /* SUBQ/V */ |
| 977 | - gen_arith3_helper(helper_subqv, ra, rb, rc, islit, lit); | |
| 965 | + gen_arith3(helper_subqv, ra, rb, rc, islit, lit); | |
| 978 | 966 | break; |
| 979 | 967 | case 0x6D: |
| 980 | 968 | /* CMPLE */ |
| ... | ... | @@ -1015,11 +1003,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1015 | 1003 | break; |
| 1016 | 1004 | case 0x14: |
| 1017 | 1005 | /* CMOVLBS */ |
| 1018 | - gen_cmov(ctx, TCG_COND_EQ, ra, rb, rc, islit, lit, 1); | |
| 1006 | + gen_cmov(TCG_COND_EQ, ra, rb, rc, islit, lit, 1); | |
| 1019 | 1007 | break; |
| 1020 | 1008 | case 0x16: |
| 1021 | 1009 | /* CMOVLBC */ |
| 1022 | - gen_cmov(ctx, TCG_COND_NE, ra, rb, rc, islit, lit, 1); | |
| 1010 | + gen_cmov(TCG_COND_NE, ra, rb, rc, islit, lit, 1); | |
| 1023 | 1011 | break; |
| 1024 | 1012 | case 0x20: |
| 1025 | 1013 | /* BIS */ |
| ... | ... | @@ -1027,7 +1015,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1027 | 1015 | if (ra != 31) { |
| 1028 | 1016 | if (islit) |
| 1029 | 1017 | tcg_gen_ori_i64(cpu_ir[rc], cpu_ir[ra], lit); |
| 1030 | - else | |
| 1018 | + else | |
| 1031 | 1019 | tcg_gen_or_i64(cpu_ir[rc], cpu_ir[ra], cpu_ir[rb]); |
| 1032 | 1020 | } else { |
| 1033 | 1021 | if (islit) |
| ... | ... | @@ -1039,11 +1027,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1039 | 1027 | break; |
| 1040 | 1028 | case 0x24: |
| 1041 | 1029 | /* CMOVEQ */ |
| 1042 | - gen_cmov(ctx, TCG_COND_NE, ra, rb, rc, islit, lit, 0); | |
| 1030 | + gen_cmov(TCG_COND_NE, ra, rb, rc, islit, lit, 0); | |
| 1043 | 1031 | break; |
| 1044 | 1032 | case 0x26: |
| 1045 | 1033 | /* CMOVNE */ |
| 1046 | - gen_cmov(ctx, TCG_COND_EQ, ra, rb, rc, islit, lit, 0); | |
| 1034 | + gen_cmov(TCG_COND_EQ, ra, rb, rc, islit, lit, 0); | |
| 1047 | 1035 | break; |
| 1048 | 1036 | case 0x28: |
| 1049 | 1037 | /* ORNOT */ |
| ... | ... | @@ -1083,11 +1071,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1083 | 1071 | break; |
| 1084 | 1072 | case 0x44: |
| 1085 | 1073 | /* CMOVLT */ |
| 1086 | - gen_cmov(ctx, TCG_COND_GE, ra, rb, rc, islit, lit, 0); | |
| 1074 | + gen_cmov(TCG_COND_GE, ra, rb, rc, islit, lit, 0); | |
| 1087 | 1075 | break; |
| 1088 | 1076 | case 0x46: |
| 1089 | 1077 | /* CMOVGE */ |
| 1090 | - gen_cmov(ctx, TCG_COND_LT, ra, rb, rc, islit, lit, 0); | |
| 1078 | + gen_cmov(TCG_COND_LT, ra, rb, rc, islit, lit, 0); | |
| 1091 | 1079 | break; |
| 1092 | 1080 | case 0x48: |
| 1093 | 1081 | /* EQV */ |
| ... | ... | @@ -1120,11 +1108,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1120 | 1108 | break; |
| 1121 | 1109 | case 0x64: |
| 1122 | 1110 | /* CMOVLE */ |
| 1123 | - gen_cmov(ctx, TCG_COND_GT, ra, rb, rc, islit, lit, 0); | |
| 1111 | + gen_cmov(TCG_COND_GT, ra, rb, rc, islit, lit, 0); | |
| 1124 | 1112 | break; |
| 1125 | 1113 | case 0x66: |
| 1126 | 1114 | /* CMOVGT */ |
| 1127 | - gen_cmov(ctx, TCG_COND_LE, ra, rb, rc, islit, lit, 0); | |
| 1115 | + gen_cmov(TCG_COND_LE, ra, rb, rc, islit, lit, 0); | |
| 1128 | 1116 | break; |
| 1129 | 1117 | case 0x6C: |
| 1130 | 1118 | /* IMPLVER */ |
| ... | ... | @@ -1139,7 +1127,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1139 | 1127 | switch (fn7) { |
| 1140 | 1128 | case 0x02: |
| 1141 | 1129 | /* MSKBL */ |
| 1142 | - gen_arith3_helper(helper_mskbl, ra, rb, rc, islit, lit); | |
| 1130 | + gen_arith3(helper_mskbl, ra, rb, rc, islit, lit); | |
| 1143 | 1131 | break; |
| 1144 | 1132 | case 0x06: |
| 1145 | 1133 | /* EXTBL */ |
| ... | ... | @@ -1147,11 +1135,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1147 | 1135 | break; |
| 1148 | 1136 | case 0x0B: |
| 1149 | 1137 | /* INSBL */ |
| 1150 | - gen_arith3_helper(helper_insbl, ra, rb, rc, islit, lit); | |
| 1138 | + gen_arith3(helper_insbl, ra, rb, rc, islit, lit); | |
| 1151 | 1139 | break; |
| 1152 | 1140 | case 0x12: |
| 1153 | 1141 | /* MSKWL */ |
| 1154 | - gen_arith3_helper(helper_mskwl, ra, rb, rc, islit, lit); | |
| 1142 | + gen_arith3(helper_mskwl, ra, rb, rc, islit, lit); | |
| 1155 | 1143 | break; |
| 1156 | 1144 | case 0x16: |
| 1157 | 1145 | /* EXTWL */ |
| ... | ... | @@ -1159,11 +1147,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1159 | 1147 | break; |
| 1160 | 1148 | case 0x1B: |
| 1161 | 1149 | /* INSWL */ |
| 1162 | - gen_arith3_helper(helper_inswl, ra, rb, rc, islit, lit); | |
| 1150 | + gen_arith3(helper_inswl, ra, rb, rc, islit, lit); | |
| 1163 | 1151 | break; |
| 1164 | 1152 | case 0x22: |
| 1165 | 1153 | /* MSKLL */ |
| 1166 | - gen_arith3_helper(helper_mskll, ra, rb, rc, islit, lit); | |
| 1154 | + gen_arith3(helper_mskll, ra, rb, rc, islit, lit); | |
| 1167 | 1155 | break; |
| 1168 | 1156 | case 0x26: |
| 1169 | 1157 | /* EXTLL */ |
| ... | ... | @@ -1171,19 +1159,19 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1171 | 1159 | break; |
| 1172 | 1160 | case 0x2B: |
| 1173 | 1161 | /* INSLL */ |
| 1174 | - gen_arith3_helper(helper_insll, ra, rb, rc, islit, lit); | |
| 1162 | + gen_arith3(helper_insll, ra, rb, rc, islit, lit); | |
| 1175 | 1163 | break; |
| 1176 | 1164 | case 0x30: |
| 1177 | 1165 | /* ZAP */ |
| 1178 | - gen_arith3_helper(helper_zap, ra, rb, rc, islit, lit); | |
| 1166 | + gen_arith3(helper_zap, ra, rb, rc, islit, lit); | |
| 1179 | 1167 | break; |
| 1180 | 1168 | case 0x31: |
| 1181 | 1169 | /* ZAPNOT */ |
| 1182 | - gen_arith3_helper(helper_zapnot, ra, rb, rc, islit, lit); | |
| 1170 | + gen_arith3(helper_zapnot, ra, rb, rc, islit, lit); | |
| 1183 | 1171 | break; |
| 1184 | 1172 | case 0x32: |
| 1185 | 1173 | /* MSKQL */ |
| 1186 | - gen_arith3_helper(helper_mskql, ra, rb, rc, islit, lit); | |
| 1174 | + gen_arith3(helper_mskql, ra, rb, rc, islit, lit); | |
| 1187 | 1175 | break; |
| 1188 | 1176 | case 0x34: |
| 1189 | 1177 | /* SRL */ |
| ... | ... | @@ -1223,7 +1211,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1223 | 1211 | break; |
| 1224 | 1212 | case 0x3B: |
| 1225 | 1213 | /* INSQL */ |
| 1226 | - gen_arith3_helper(helper_insql, ra, rb, rc, islit, lit); | |
| 1214 | + gen_arith3(helper_insql, ra, rb, rc, islit, lit); | |
| 1227 | 1215 | break; |
| 1228 | 1216 | case 0x3C: |
| 1229 | 1217 | /* SRA */ |
| ... | ... | @@ -1243,11 +1231,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1243 | 1231 | break; |
| 1244 | 1232 | case 0x52: |
| 1245 | 1233 | /* MSKWH */ |
| 1246 | - gen_arith3_helper(helper_mskwh, ra, rb, rc, islit, lit); | |
| 1234 | + gen_arith3(helper_mskwh, ra, rb, rc, islit, lit); | |
| 1247 | 1235 | break; |
| 1248 | 1236 | case 0x57: |
| 1249 | 1237 | /* INSWH */ |
| 1250 | - gen_arith3_helper(helper_inswh, ra, rb, rc, islit, lit); | |
| 1238 | + gen_arith3(helper_inswh, ra, rb, rc, islit, lit); | |
| 1251 | 1239 | break; |
| 1252 | 1240 | case 0x5A: |
| 1253 | 1241 | /* EXTWH */ |
| ... | ... | @@ -1255,11 +1243,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1255 | 1243 | break; |
| 1256 | 1244 | case 0x62: |
| 1257 | 1245 | /* MSKLH */ |
| 1258 | - gen_arith3_helper(helper_msklh, ra, rb, rc, islit, lit); | |
| 1246 | + gen_arith3(helper_msklh, ra, rb, rc, islit, lit); | |
| 1259 | 1247 | break; |
| 1260 | 1248 | case 0x67: |
| 1261 | 1249 | /* INSLH */ |
| 1262 | - gen_arith3_helper(helper_inslh, ra, rb, rc, islit, lit); | |
| 1250 | + gen_arith3(helper_inslh, ra, rb, rc, islit, lit); | |
| 1263 | 1251 | break; |
| 1264 | 1252 | case 0x6A: |
| 1265 | 1253 | /* EXTLH */ |
| ... | ... | @@ -1267,11 +1255,11 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1267 | 1255 | break; |
| 1268 | 1256 | case 0x72: |
| 1269 | 1257 | /* MSKQH */ |
| 1270 | - gen_arith3_helper(helper_mskqh, ra, rb, rc, islit, lit); | |
| 1258 | + gen_arith3(helper_mskqh, ra, rb, rc, islit, lit); | |
| 1271 | 1259 | break; |
| 1272 | 1260 | case 0x77: |
| 1273 | 1261 | /* INSQH */ |
| 1274 | - gen_arith3_helper(helper_insqh, ra, rb, rc, islit, lit); | |
| 1262 | + gen_arith3(helper_insqh, ra, rb, rc, islit, lit); | |
| 1275 | 1263 | break; |
| 1276 | 1264 | case 0x7A: |
| 1277 | 1265 | /* EXTQH */ |
| ... | ... | @@ -1310,15 +1298,15 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
| 1310 | 1298 | break; |
| 1311 | 1299 | case 0x30: |
| 1312 | 1300 | /* UMULH */ |
| 1313 | - gen_arith3_helper(helper_umulh, ra, rb, rc, islit, lit); | |
| 1301 | + gen_arith3(helper_umulh, ra, rb, rc, islit, lit); | |
| 1314 | 1302 | break; |
| 1315 | 1303 | case 0x40: |
| 1316 | 1304 | /* MULL/V */ |
| 1317 | - gen_arith3_helper(helper_mullv, ra, rb, rc, islit, lit); | |
| 1305 | + gen_arith3(helper_mullv, ra, rb, rc, islit, lit); | |
| 1318 | 1306 | break; |
| 1319 | 1307 | case 0x60: |
| 1320 | 1308 | /* MULQ/V */ |
| 1321 | - gen_arith3_helper(helper_mulqv, ra, rb, rc, islit, lit); | |
| 1309 | + gen_arith3(helper_mulqv, ra, rb, rc, islit, lit); | |
| 1322 | 1310 | break; |
| 1323 | 1311 | default: |
| 1324 | 1312 | goto invalid_opc; |
| ... | ... | @@ -2397,7 +2385,7 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, |
| 2397 | 2385 | } |
| 2398 | 2386 | if (loglevel & CPU_LOG_TB_IN_ASM) { |
| 2399 | 2387 | fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start)); |
| 2400 | - target_disas(logfile, pc_start, ctx.pc - pc_start, 1); | |
| 2388 | + target_disas(logfile, pc_start, ctx.pc - pc_start, 1); | |
| 2401 | 2389 | fprintf(logfile, "\n"); |
| 2402 | 2390 | } |
| 2403 | 2391 | #endif | ... | ... |