Révision | b0fb81a12ef004998a205ab7252d98588d8cbd92 (tree) |
---|---|
l'heure | 2020-03-16 00:12:48 |
Auteur | Richard Henderson <richard.henderson@lina...> |
Commiter | Yoshinori Sato |
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>
@@ -228,24 +228,21 @@ static bool trans_MOV_ra(DisasContext *ctx, arg_MOV_ra *a) | ||
228 | 228 | /* mov.[bwl] rs,rd */ |
229 | 229 | static bool trans_MOV_mm(DisasContext *ctx, arg_MOV_mm *a) |
230 | 230 | { |
231 | - char dspd[8], dsps[8]; | |
231 | + char dspd[8], dsps[8], szc = size[a->sz]; | |
232 | 232 | |
233 | - prt("mov.%c\t", size[a->sz]); | |
234 | 233 | if (a->lds == 3 && a->ldd == 3) { |
235 | 234 | /* 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) { | |
240 | 237 | 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); | |
242 | 239 | } else if (a->ldd == 3) { |
243 | 240 | 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); | |
245 | 242 | } else { |
246 | 243 | rx_index_addr(ctx, dsps, a->lds, a->sz); |
247 | 244 | 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); | |
249 | 246 | } |
250 | 247 | return true; |
251 | 248 | } |
@@ -254,8 +251,11 @@ static bool trans_MOV_mm(DisasContext *ctx, arg_MOV_mm *a) | ||
254 | 251 | /* mov.[bwl] rs,[-rd] */ |
255 | 252 | static bool trans_MOV_rp(DisasContext *ctx, arg_MOV_rp *a) |
256 | 253 | { |
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 | + } | |
259 | 259 | return true; |
260 | 260 | } |
261 | 261 |
@@ -263,9 +263,11 @@ static bool trans_MOV_rp(DisasContext *ctx, arg_MOV_rp *a) | ||
263 | 263 | /* mov.[bwl] [-rd],rs */ |
264 | 264 | static bool trans_MOV_pr(DisasContext *ctx, arg_MOV_pr *a) |
265 | 265 | { |
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 | + } | |
269 | 271 | return true; |
270 | 272 | } |
271 | 273 |
@@ -299,9 +301,11 @@ static bool trans_MOVU_ar(DisasContext *ctx, arg_MOVU_ar *a) | ||
299 | 301 | /* movu.[bw] [-rs],rd */ |
300 | 302 | static bool trans_MOVU_pr(DisasContext *ctx, arg_MOVU_pr *a) |
301 | 303 | { |
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 | + } | |
305 | 309 | return true; |
306 | 310 | } |
307 | 311 |
@@ -478,11 +482,11 @@ static bool trans_TST_mr(DisasContext *ctx, arg_TST_mr *a) | ||
478 | 482 | /* not rs, rd */ |
479 | 483 | static bool trans_NOT_rr(DisasContext *ctx, arg_NOT_rr *a) |
480 | 484 | { |
481 | - prt("not\t"); | |
482 | 485 | 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); | |
484 | 489 | } |
485 | - prt("r%d", a->rd); | |
486 | 490 | return true; |
487 | 491 | } |
488 | 492 |
@@ -490,11 +494,11 @@ static bool trans_NOT_rr(DisasContext *ctx, arg_NOT_rr *a) | ||
490 | 494 | /* neg rs, rd */ |
491 | 495 | static bool trans_NEG_rr(DisasContext *ctx, arg_NEG_rr *a) |
492 | 496 | { |
493 | - prt("neg\t"); | |
494 | 497 | 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); | |
496 | 501 | } |
497 | - prt("r%d", a->rd); | |
498 | 502 | return true; |
499 | 503 | } |
500 | 504 |
@@ -606,11 +610,10 @@ static bool trans_SBB_mr(DisasContext *ctx, arg_SBB_mr *a) | ||
606 | 610 | /* abs rs, rd */ |
607 | 611 | static bool trans_ABS_rr(DisasContext *ctx, arg_ABS_rr *a) |
608 | 612 | { |
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); | |
612 | 615 | } else { |
613 | - prt("r%d, r%d", a->rs, a->rd); | |
616 | + prt("abs\tr%d", a->rs); | |
614 | 617 | } |
615 | 618 | return true; |
616 | 619 | } |
@@ -733,11 +736,11 @@ static bool trans_DIVU_mr(DisasContext *ctx, arg_DIVU_mr *a) | ||
733 | 736 | /* shll #imm:5, rs, rd */ |
734 | 737 | static bool trans_SHLL_irr(DisasContext *ctx, arg_SHLL_irr *a) |
735 | 738 | { |
736 | - prt("shll\t#%d, ", a->imm); | |
737 | 739 | 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); | |
739 | 743 | } |
740 | - prt("r%d", a->rd); | |
741 | 744 | return true; |
742 | 745 | } |
743 | 746 |
@@ -752,11 +755,11 @@ static bool trans_SHLL_rr(DisasContext *ctx, arg_SHLL_rr *a) | ||
752 | 755 | /* shar #imm:5, rs, rd */ |
753 | 756 | static bool trans_SHAR_irr(DisasContext *ctx, arg_SHAR_irr *a) |
754 | 757 | { |
755 | - prt("shar\t#%d,", a->imm); | |
756 | 758 | 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); | |
758 | 762 | } |
759 | - prt("r%d", a->rd); | |
760 | 763 | return true; |
761 | 764 | } |
762 | 765 |
@@ -771,11 +774,11 @@ static bool trans_SHAR_rr(DisasContext *ctx, arg_SHAR_rr *a) | ||
771 | 774 | /* shlr #imm:5, rs, rd */ |
772 | 775 | static bool trans_SHLR_irr(DisasContext *ctx, arg_SHLR_irr *a) |
773 | 776 | { |
774 | - prt("shlr\t#%d, ", a->imm); | |
775 | 777 | 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); | |
777 | 781 | } |
778 | - prt("r%d", a->rd); | |
779 | 782 | return true; |
780 | 783 | } |
781 | 784 |