Revision | 848335e268e3b528627c92a63438a0caf1645e47 (tree) |
---|---|
Zeit | 2019-07-17 22:43:47 |
Autor | Yoshinori Sato <ysato@user...> |
Commiter | Yoshinori Sato |
h8300: fix some issue.
@@ -510,7 +510,7 @@ MULXU 0101 0010 .... .... @b2_rs_erd sz=1 | ||
510 | 510 | # NEG.[BWL] Rd |
511 | 511 | NEG 0001 0111 10.. .... @b2_r |
512 | 512 | # NOP |
513 | -NOP 0000 0000 | |
513 | +NOP 0000 0000 0000 0000 | |
514 | 514 | # NOT.[BWL] Rd |
515 | 515 | NOT 0001 0111 00.. .... @b2_r |
516 | 516 | # OR.B #xx:8,Rd |
@@ -193,6 +193,8 @@ static int b6_bop_op(DisasContext *ctx, int imm) | ||
193 | 193 | CPUH8300State *env = ctx->env; |
194 | 194 | uint32_t addr = ctx->pc + 4; |
195 | 195 | uint32_t inv = extract32(cpu_ldub_code(env, addr + 1), 7, 1); |
196 | + | |
197 | + ctx->base.pc_next = ctx->pc + 6; | |
196 | 198 | return (inv << 8) | cpu_ldub_code(env, addr); |
197 | 199 | } |
198 | 200 |
@@ -210,6 +212,7 @@ static int b8_bop_op(DisasContext *ctx, int imm) | ||
210 | 212 | uint32_t addr = ctx->pc + 6; |
211 | 213 | |
212 | 214 | uint32_t inv = extract32(cpu_ldub_code(env, addr + 1), 7, 1); |
215 | + ctx->base.pc_next = ctx->pc + 8; | |
213 | 216 | return (inv << 8) | cpu_ldub_code(env, addr); |
214 | 217 | } |
215 | 218 |
@@ -1325,7 +1328,12 @@ static bool trans_SHAR(DisasContext *ctx, arg_SHAR *a) | ||
1325 | 1328 | reg = h8300_reg_ld(a->sz, a->r, temp); |
1326 | 1329 | s = 8 * (1 << a->sz) - 1 ; |
1327 | 1330 | tcg_gen_extract_i32(cpu_ccr_c, reg, a->s, 1); |
1328 | - tcg_gen_andi_i32(cpu_ccr_v, reg, 1 << (s - a->s)); | |
1331 | + tcg_gen_extract_i32(cpu_ccr_v, reg, s, 1); | |
1332 | + tcg_gen_deposit_i32(cpu_ccr_v, cpu_ccr_v, cpu_ccr_v, s, 1); | |
1333 | + if (a->s == 1) { | |
1334 | + tcg_gen_deposit_i32(cpu_ccr_v, cpu_ccr_v, cpu_ccr_v, s - 1, 1); | |
1335 | + } | |
1336 | + tcg_gen_andi_i32(cpu_ccr_v, cpu_ccr_v, 0xfffffffe); | |
1329 | 1337 | tcg_gen_shri_i32(reg, reg, a->s + 1); |
1330 | 1338 | tcg_gen_or_i32(reg, reg, cpu_ccr_v); |
1331 | 1339 | h8300_reg_st(a->sz, a->r, reg); |
@@ -1386,7 +1394,7 @@ static bool trans_ROTL(DisasContext *ctx, arg_ROTL *a) | ||
1386 | 1394 | temp = tcg_temp_new(); |
1387 | 1395 | reg = h8300_reg_ld(a->sz, a->r, temp); |
1388 | 1396 | s = 8 * (1 << a->sz) - 1 ; |
1389 | - tcg_gen_extract_i32(cpu_ccr_c, reg, s - a->s, a->s + 2); | |
1397 | + tcg_gen_extract_i32(cpu_ccr_c, reg, s - a->s, a->s + 1); | |
1390 | 1398 | tcg_gen_shli_i32(reg, reg, a->s + 1); |
1391 | 1399 | tcg_gen_or_i32(reg, reg, cpu_ccr_c); |
1392 | 1400 | h8300_reg_st(a->sz, a->r, reg); |