• 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

Revisionefb40d49549762309a1a2b6efc70165c9c298b77 (tree)
Zeit2019-12-21 22:42:42
AutorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

Fix instructions

Ändern Zusammenfassung

Diff

--- a/target/h8300/insns.decode
+++ b/target/h8300/insns.decode
@@ -146,6 +146,14 @@ BAND_r 0111 0110 0... .... @b2_bop_r
146146 BAND_m 0111 1100 .... 0000 0111 0110 0 ... 0000 @b4_bop_m
147147 # BAND #xx:3,@aa:8
148148 BAND_a 0111 1110 .... .... 0111 0110 0 ... 0000 @b4_bop_a
149+# BCLR #xx:3,@aa:16
150+# BCLR Rn,@aa:16
151+# BNOT #xx:3,@aa:16
152+# BNOT Rn,@aa:16
153+# BTST #xx:3,@aa:16
154+# BTST Rn,@aa:16
155+# BSET #xx:3,@aa:16
156+# BSET Rn,@aa:16
149157 # BAND #xx:3,@aa:16
150158 # BIAND #xx:3,@aa:16
151159 # BILD #xx:3,@aa:16
@@ -157,6 +165,14 @@ BAND_a 0111 1110 .... .... 0111 0110 0 ... 0000 @b4_bop_a
157165 # BST #xx:3,@aa:16
158166 # BXOR #xx:3,@aa:16
159167 BOP1 0110 1010 0001 0000 .... .... .... .... @b6_bop
168+# BCLR #xx:3,@aa:32
169+# BCLR Rn,@aa:32
170+# BNOT #xx:3,@aa:32
171+# BNOT Rn,@aa:32
172+# BTST #xx:3,@aa:32
173+# BTST Rn,@aa:32
174+# BSET #xx:3,@aa:32
175+# BSET Rn,@aa:32
160176 # BAND #xx:3,@aa:32
161177 # BIAND #xx:3,@aa:32
162178 # BILD #xx:3,@aa:32
--- a/target/h8300/translate.c
+++ b/target/h8300/translate.c
@@ -1920,6 +1920,14 @@ static bool trans_BXOR_a(DisasContext *ctx, arg_BXOR_a *a)
19201920
19211921 static bool trans_BOP1(DisasContext *ctx, arg_BOP1 *a)
19221922 {
1923+ arg_BCLR_ia bclr_i;
1924+ arg_BCLR_ra bclr_r;
1925+ arg_BNOT_ia bnot_i;
1926+ arg_BNOT_ra bnot_r;
1927+ arg_BTST_ia btst_i;
1928+ arg_BTST_ra btst_r;
1929+ arg_BSET_ia bset_i;
1930+ arg_BSET_ra bset_r;
19231931 arg_BAND_a band_a;
19241932 arg_BIAND_a biand_a;
19251933 arg_BLD_a bld_a;
@@ -1932,6 +1940,38 @@ static bool trans_BOP1(DisasContext *ctx, arg_BOP1 *a)
19321940 arg_BIXOR_a bixor_a;
19331941
19341942 switch(a->op) {
1943+ case 0x70:
1944+ bset_i.imm = a->ir;
1945+ bset_i.abs = a->abs;
1946+ return trans_BSET_ia(ctx, &bset_i);
1947+ case 0x60:
1948+ bset_r.rn = a->ir;
1949+ bset_r.abs = a->abs;
1950+ return trans_BSET_ra(ctx, &bset_r);
1951+ case 0x71:
1952+ bnot_i.imm = a->ir;
1953+ bnot_i.abs = a->abs;
1954+ return trans_BNOT_ia(ctx, &bnot_i);
1955+ case 0x61:
1956+ bnot_r.rn = a->ir;
1957+ bnot_r.abs = a->abs;
1958+ return trans_BNOT_ra(ctx, &bnot_r);
1959+ case 0x72:
1960+ bclr_i.imm = a->ir;
1961+ bclr_i.abs = a->abs;
1962+ return trans_BCLR_ia(ctx, &bclr_i);
1963+ case 0x62:
1964+ bclr_r.rn = a->ir;
1965+ bclr_r.abs = a->abs;
1966+ return trans_BCLR_ra(ctx, &bclr_r);
1967+ case 0x73:
1968+ btst_i.imm = a->ir;
1969+ btst_i.abs = a->abs;
1970+ return trans_BTST_ia(ctx, &btst_i);
1971+ case 0x63:
1972+ btst_r.rn = a->ir;
1973+ btst_r.abs = a->abs;
1974+ return trans_BTST_ra(ctx, &btst_r);
19351975 case 0x76:
19361976 band_a.imm = a->ir;
19371977 band_a.abs = a->abs;
@@ -2492,23 +2532,26 @@ static bool trans_RTS(DisasContext *ctx, arg_RTS *a)
24922532
24932533 static bool trans_RTE(DisasContext *ctx, arg_RTE *a)
24942534 {
2495- TCGv ccr, reg;
2496- ccr = tcg_temp_new();
2535+ TCGv temp1, temp2, reg;
2536+ temp1 = tcg_temp_new();
2537+ temp2 = tcg_temp_new();
24972538 reg = tcg_temp_new();
24982539 if (ctx->base.tb->flags == 2) {
2499- tcg_gen_qemu_ld_i32(ccr, cpu_sp, 0, MO_16 | MO_TE);
2540+ tcg_gen_qemu_ld_i32(temp1, cpu_sp, 0, MO_16 | MO_TE);
25002541 tcg_gen_addi_i32(cpu_sp, cpu_sp, 2);
2501- tcg_gen_extract_i32(ccr, ccr, 8, 8);
2542+ tcg_gen_extract_i32(temp2, temp1, 8, 8);
25022543 tcg_gen_movi_i32(reg, 1);
2503- gen_helper_set_ccr(cpu_env, reg, ccr);
2544+ gen_helper_set_ccr(cpu_env, reg, temp2);
25042545 }
2505- tcg_gen_qemu_ld_i32(ccr, cpu_sp, 0, MO_32 | MO_TE);
2546+ tcg_gen_qemu_ld_i32(temp1, cpu_sp, 0, MO_32 | MO_TE);
25062547 tcg_gen_addi_i32(cpu_sp, cpu_sp, 4);
2507- tcg_gen_extract_i32(cpu_pc, ccr, 0, 24);
2508- tcg_gen_extract_i32(ccr, ccr, 24, 8);
2509- gen_helper_set_ccr(cpu_env, reg, ccr);
2548+ tcg_gen_extract_i32(cpu_pc, temp1, 0, 24);
2549+ tcg_gen_extract_i32(temp2, temp1, 24, 8);
2550+ tcg_gen_movi_i32(reg, 0);
2551+ gen_helper_set_ccr(cpu_env, reg, temp2);
25102552 ctx->base.is_jmp = DISAS_EXIT;
2511- tcg_temp_free(ccr);
2553+ tcg_temp_free(temp1);
2554+ tcg_temp_free(temp2);
25122555 tcg_temp_free(reg);
25132556 return true;
25142557 }