• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revision0d039ca235920da706083a7f8a36994e9e4e3dea (tree)
Time2020-02-24 23:09:50
AuthorRichard Henderson <richard.henderson@lina...>
CommiterYoshinori Sato

Log Message

target/rx: Emit all disassembly in one prt()

Many of the multi-part prints have been eliminated by previous
patches. Eliminate the rest of them.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Message-Id: <20190607091116.49044-22-ysato@users.sourceforge.jp>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Change Summary

Incremental Difference

--- a/target/rx/disas.c
+++ b/target/rx/disas.c
@@ -228,24 +228,21 @@ static bool trans_MOV_ra(DisasContext *ctx, arg_MOV_ra *a)
228228 /* mov.[bwl] rs,rd */
229229 static bool trans_MOV_mm(DisasContext *ctx, arg_MOV_mm *a)
230230 {
231- char dspd[8], dsps[8];
231+ char dspd[8], dsps[8], szc = size[a->sz];
232232
233- prt("mov.%c\t", size[a->sz]);
234233 if (a->lds == 3 && a->ldd == 3) {
235234 /* mov.[bwl] rs,rd */
236- prt("r%d, r%d", a->rs, a->rd);
237- return true;
238- }
239- if (a->lds == 3) {
235+ prt("mov.%c\tr%d, r%d", szc, a->rs, a->rd);
236+ } else if (a->lds == 3) {
240237 rx_index_addr(ctx, dspd, a->ldd, a->sz);
241- prt("r%d, %s[r%d]", a->rs, dspd, a->rd);
238+ prt("mov.%c\tr%d, %s[r%d]", szc, a->rs, dspd, a->rd);
242239 } else if (a->ldd == 3) {
243240 rx_index_addr(ctx, dsps, a->lds, a->sz);
244- prt("%s[r%d], r%d", dsps, a->rs, a->rd);
241+ prt("mov.%c\t%s[r%d], r%d", szc, dsps, a->rs, a->rd);
245242 } else {
246243 rx_index_addr(ctx, dsps, a->lds, a->sz);
247244 rx_index_addr(ctx, dspd, a->ldd, a->sz);
248- prt("%s[r%d], %s[r%d]", dsps, a->rs, dspd, a->rd);
245+ prt("mov.%c\t%s[r%d], %s[r%d]", szc, dsps, a->rs, dspd, a->rd);
249246 }
250247 return true;
251248 }
@@ -254,8 +251,11 @@ static bool trans_MOV_mm(DisasContext *ctx, arg_MOV_mm *a)
254251 /* mov.[bwl] rs,[-rd] */
255252 static bool trans_MOV_rp(DisasContext *ctx, arg_MOV_rp *a)
256253 {
257- prt("mov.%c\tr%d, ", size[a->sz], a->rs);
258- prt((a->ad == 0) ? "[r%d+]" : "[-r%d]", a->rd);
254+ if (a->ad) {
255+ prt("mov.%c\tr%d, [-r%d]", size[a->sz], a->rs, a->rd);
256+ } else {
257+ prt("mov.%c\tr%d, [r%d+]", size[a->sz], a->rs, a->rd);
258+ }
259259 return true;
260260 }
261261
@@ -263,9 +263,11 @@ static bool trans_MOV_rp(DisasContext *ctx, arg_MOV_rp *a)
263263 /* mov.[bwl] [-rd],rs */
264264 static bool trans_MOV_pr(DisasContext *ctx, arg_MOV_pr *a)
265265 {
266- prt("mov.%c\t", size[a->sz]);
267- prt((a->ad == 0) ? "[r%d+]" : "[-r%d]", a->rd);
268- prt(", r%d", a->rs);
266+ if (a->ad) {
267+ prt("mov.%c\t[-r%d], r%d", size[a->sz], a->rd, a->rs);
268+ } else {
269+ prt("mov.%c\t[r%d+], r%d", size[a->sz], a->rd, a->rs);
270+ }
269271 return true;
270272 }
271273
@@ -299,9 +301,11 @@ static bool trans_MOVU_ar(DisasContext *ctx, arg_MOVU_ar *a)
299301 /* movu.[bw] [-rs],rd */
300302 static bool trans_MOVU_pr(DisasContext *ctx, arg_MOVU_pr *a)
301303 {
302- prt("movu.%c\t", size[a->sz]);
303- prt((a->ad == 0) ? "[r%d+]" : "[-r%d]", a->rd);
304- prt(", r%d", a->rs);
304+ if (a->ad) {
305+ prt("movu.%c\t[-r%d], r%d", size[a->sz], a->rd, a->rs);
306+ } else {
307+ prt("movu.%c\t[r%d+], r%d", size[a->sz], a->rd, a->rs);
308+ }
305309 return true;
306310 }
307311
@@ -478,11 +482,11 @@ static bool trans_TST_mr(DisasContext *ctx, arg_TST_mr *a)
478482 /* not rs, rd */
479483 static bool trans_NOT_rr(DisasContext *ctx, arg_NOT_rr *a)
480484 {
481- prt("not\t");
482485 if (a->rs != a->rd) {
483- prt("r%d, ", a->rs);
486+ prt("not\tr%d, r%d", a->rs, a->rd);
487+ } else {
488+ prt("not\tr%d", a->rs);
484489 }
485- prt("r%d", a->rd);
486490 return true;
487491 }
488492
@@ -490,11 +494,11 @@ static bool trans_NOT_rr(DisasContext *ctx, arg_NOT_rr *a)
490494 /* neg rs, rd */
491495 static bool trans_NEG_rr(DisasContext *ctx, arg_NEG_rr *a)
492496 {
493- prt("neg\t");
494497 if (a->rs != a->rd) {
495- prt("r%d, ", a->rs);
498+ prt("neg\tr%d, r%d", a->rs, a->rd);
499+ } else {
500+ prt("neg\tr%d", a->rs);
496501 }
497- prt("r%d", a->rd);
498502 return true;
499503 }
500504
@@ -606,11 +610,10 @@ static bool trans_SBB_mr(DisasContext *ctx, arg_SBB_mr *a)
606610 /* abs rs, rd */
607611 static bool trans_ABS_rr(DisasContext *ctx, arg_ABS_rr *a)
608612 {
609- prt("abs\t");
610- if (a->rs == a->rd) {
611- prt("r%d", a->rd);
613+ if (a->rs != a->rd) {
614+ prt("abs\tr%d, r%d", a->rs, a->rd);
612615 } else {
613- prt("r%d, r%d", a->rs, a->rd);
616+ prt("abs\tr%d", a->rs);
614617 }
615618 return true;
616619 }
@@ -733,11 +736,11 @@ static bool trans_DIVU_mr(DisasContext *ctx, arg_DIVU_mr *a)
733736 /* shll #imm:5, rs, rd */
734737 static bool trans_SHLL_irr(DisasContext *ctx, arg_SHLL_irr *a)
735738 {
736- prt("shll\t#%d, ", a->imm);
737739 if (a->rs2 != a->rd) {
738- prt("r%d, ", a->rs2);
740+ prt("shll\t#%d, r%d, r%d", a->imm, a->rs2, a->rd);
741+ } else {
742+ prt("shll\t#%d, r%d", a->imm, a->rd);
739743 }
740- prt("r%d", a->rd);
741744 return true;
742745 }
743746
@@ -752,11 +755,11 @@ static bool trans_SHLL_rr(DisasContext *ctx, arg_SHLL_rr *a)
752755 /* shar #imm:5, rs, rd */
753756 static bool trans_SHAR_irr(DisasContext *ctx, arg_SHAR_irr *a)
754757 {
755- prt("shar\t#%d,", a->imm);
756758 if (a->rs2 != a->rd) {
757- prt("r%d, ", a->rs2);
759+ prt("shar\t#%d, r%d, r%d", a->imm, a->rs2, a->rd);
760+ } else {
761+ prt("shar\t#%d, r%d", a->imm, a->rd);
758762 }
759- prt("r%d", a->rd);
760763 return true;
761764 }
762765
@@ -771,11 +774,11 @@ static bool trans_SHAR_rr(DisasContext *ctx, arg_SHAR_rr *a)
771774 /* shlr #imm:5, rs, rd */
772775 static bool trans_SHLR_irr(DisasContext *ctx, arg_SHLR_irr *a)
773776 {
774- prt("shlr\t#%d, ", a->imm);
775777 if (a->rs2 != a->rd) {
776- prt("r%d, ", a->rs2);
778+ prt("shlr\t#%d, r%d, r%d", a->imm, a->rs2, a->rd);
779+ } else {
780+ prt("shlr\t#%d, r%d", a->imm, a->rd);
777781 }
778- prt("r%d", a->rd);
779782 return true;
780783 }
781784