• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision848335e268e3b528627c92a63438a0caf1645e47 (tree)
Zeit2019-07-17 22:43:47
AutorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

h8300: fix some issue.

Ändern Zusammenfassung

Diff

--- a/target/h8300/insns.decode
+++ b/target/h8300/insns.decode
@@ -510,7 +510,7 @@ MULXU 0101 0010 .... .... @b2_rs_erd sz=1
510510 # NEG.[BWL] Rd
511511 NEG 0001 0111 10.. .... @b2_r
512512 # NOP
513-NOP 0000 0000
513+NOP 0000 0000 0000 0000
514514 # NOT.[BWL] Rd
515515 NOT 0001 0111 00.. .... @b2_r
516516 # OR.B #xx:8,Rd
--- a/target/h8300/translate.c
+++ b/target/h8300/translate.c
@@ -193,6 +193,8 @@ static int b6_bop_op(DisasContext *ctx, int imm)
193193 CPUH8300State *env = ctx->env;
194194 uint32_t addr = ctx->pc + 4;
195195 uint32_t inv = extract32(cpu_ldub_code(env, addr + 1), 7, 1);
196+
197+ ctx->base.pc_next = ctx->pc + 6;
196198 return (inv << 8) | cpu_ldub_code(env, addr);
197199 }
198200
@@ -210,6 +212,7 @@ static int b8_bop_op(DisasContext *ctx, int imm)
210212 uint32_t addr = ctx->pc + 6;
211213
212214 uint32_t inv = extract32(cpu_ldub_code(env, addr + 1), 7, 1);
215+ ctx->base.pc_next = ctx->pc + 8;
213216 return (inv << 8) | cpu_ldub_code(env, addr);
214217 }
215218
@@ -1325,7 +1328,12 @@ static bool trans_SHAR(DisasContext *ctx, arg_SHAR *a)
13251328 reg = h8300_reg_ld(a->sz, a->r, temp);
13261329 s = 8 * (1 << a->sz) - 1 ;
13271330 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);
13291337 tcg_gen_shri_i32(reg, reg, a->s + 1);
13301338 tcg_gen_or_i32(reg, reg, cpu_ccr_v);
13311339 h8300_reg_st(a->sz, a->r, reg);
@@ -1386,7 +1394,7 @@ static bool trans_ROTL(DisasContext *ctx, arg_ROTL *a)
13861394 temp = tcg_temp_new();
13871395 reg = h8300_reg_ld(a->sz, a->r, temp);
13881396 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);
13901398 tcg_gen_shli_i32(reg, reg, a->s + 1);
13911399 tcg_gen_or_i32(reg, reg, cpu_ccr_c);
13921400 h8300_reg_st(a->sz, a->r, reg);