From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7500FC04AB3 for ; Mon, 27 May 2019 15:41:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E45220665 for ; Mon, 27 May 2019 15:41:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E45220665 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:47335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVHki-0001zu-BS for qemu-devel@archiver.kernel.org; Mon, 27 May 2019 11:41:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVHin-0000ZC-4T for qemu-devel@nongnu.org; Mon, 27 May 2019 11:39:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVHil-0007Ne-LA for qemu-devel@nongnu.org; Mon, 27 May 2019 11:39:33 -0400 Received: from mail01.asahi-net.or.jp ([202.224.55.13]:38021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVHil-0007Cb-9i for qemu-devel@nongnu.org; Mon, 27 May 2019 11:39:31 -0400 Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.ablenetvps.ne.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail01.asahi-net.or.jp (Postfix) with ESMTPA id B4388121327; Tue, 28 May 2019 00:39:27 +0900 (JST) Received: from yo-satoh-debian.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id 8917D240085; Tue, 28 May 2019 00:39:27 +0900 (JST) Date: Tue, 28 May 2019 00:31:20 +0900 Message-ID: <87zhn76hiv.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Richard Henderson In-Reply-To: <20190523150803.31504-5-richard.henderson@linaro.org> References: <20190523150803.31504-1-richard.henderson@linaro.org> <20190523150803.31504-5-richard.henderson@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.224.55.13 Subject: Re: [Qemu-devel] [PATCH 4/6] target/rx: Emit all disassembly in one prt() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, 24 May 2019 00:08:01 +0900, Richard Henderson wrote: > > Many of the multi-part prints have been eliminated by previous > patches. Eliminate the rest of them. > > Signed-off-by: Richard Henderson Reviewed-by: Yoshinori Sato > --- > target/rx/disas.c | 75 ++++++++++++++++++++++++----------------------- > 1 file changed, 39 insertions(+), 36 deletions(-) > > diff --git a/target/rx/disas.c b/target/rx/disas.c > index db10385fd0..ebc1a44249 100644 > --- 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) > /* mov.[bwl] rs,rd */ > static bool trans_MOV_mm(DisasContext *ctx, arg_MOV_mm *a) > { > - char dspd[8], dsps[8]; > + char dspd[8], dsps[8], szc = size[a->sz]; > > - prt("mov.%c\t", size[a->sz]); > if (a->lds == 3 && a->ldd == 3) { > /* mov.[bwl] rs,rd */ > - prt("r%d, r%d", a->rs, a->rd); > - return true; > - } > - if (a->lds == 3) { > + prt("mov.%c\tr%d, r%d", szc, a->rs, a->rd); > + } else if (a->lds == 3) { > rx_index_addr(ctx, dspd, a->ldd, a->sz); > - prt("r%d, %s[r%d]", a->rs, dspd, a->rd); > + prt("mov.%c\tr%d, %s[r%d]", szc, a->rs, dspd, a->rd); > } else if (a->ldd == 3) { > rx_index_addr(ctx, dsps, a->lds, a->sz); > - prt("%s[r%d], r%d", dsps, a->rs, a->rd); > + prt("mov.%c\t%s[r%d], r%d", szc, dsps, a->rs, a->rd); > } else { > rx_index_addr(ctx, dsps, a->lds, a->sz); > rx_index_addr(ctx, dspd, a->ldd, a->sz); > - prt("%s[r%d], %s[r%d]", dsps, a->rs, dspd, a->rd); > + prt("mov.%c\t%s[r%d], %s[r%d]", szc, dsps, a->rs, dspd, a->rd); > } > return true; > } > @@ -254,8 +251,11 @@ static bool trans_MOV_mm(DisasContext *ctx, arg_MOV_mm *a) > /* mov.[bwl] rs,[-rd] */ > static bool trans_MOV_rp(DisasContext *ctx, arg_MOV_rp *a) > { > - prt("mov.%c\tr%d, ", size[a->sz], a->rs); > - prt((a->ad == 0) ? "[r%d+]" : "[-r%d]", a->rd); > + if (a->ad) { > + prt("mov.%c\tr%d, [-r%d]", size[a->sz], a->rs, a->rd); > + } else { > + prt("mov.%c\tr%d, [r%d+]", size[a->sz], a->rs, a->rd); > + } > return true; > } > > @@ -263,9 +263,11 @@ static bool trans_MOV_rp(DisasContext *ctx, arg_MOV_rp *a) > /* mov.[bwl] [-rd],rs */ > static bool trans_MOV_pr(DisasContext *ctx, arg_MOV_pr *a) > { > - prt("mov.%c\t", size[a->sz]); > - prt((a->ad == 0) ? "[r%d+]" : "[-r%d]", a->rd); > - prt(", r%d", a->rs); > + if (a->ad) { > + prt("mov.%c\t[-r%d], r%d", size[a->sz], a->rd, a->rs); > + } else { > + prt("mov.%c\t[r%d+], r%d", size[a->sz], a->rd, a->rs); > + } > return true; > } > > @@ -299,9 +301,11 @@ static bool trans_MOVU_ar(DisasContext *ctx, arg_MOVU_ar *a) > /* movu.[bw] [-rs],rd */ > static bool trans_MOVU_pr(DisasContext *ctx, arg_MOVU_pr *a) > { > - prt("movu.%c\t", size[a->sz]); > - prt((a->ad == 0) ? "[r%d+]" : "[-r%d]", a->rd); > - prt(", r%d", a->rs); > + if (a->ad) { > + prt("movu.%c\t[-r%d], r%d", size[a->sz], a->rd, a->rs); > + } else { > + prt("movu.%c\t[r%d+], r%d", size[a->sz], a->rd, a->rs); > + } > return true; > } > > @@ -478,11 +482,11 @@ static bool trans_TST_mr(DisasContext *ctx, arg_TST_mr *a) > /* not rs, rd */ > static bool trans_NOT_rr(DisasContext *ctx, arg_NOT_rr *a) > { > - prt("not\t"); > if (a->rs != a->rd) { > - prt("r%d, ", a->rs); > + prt("not\tr%d, r%d", a->rs, a->rd); > + } else { > + prt("not\tr%d", a->rs); > } > - prt("r%d", a->rd); > return true; > } > > @@ -490,11 +494,11 @@ static bool trans_NOT_rr(DisasContext *ctx, arg_NOT_rr *a) > /* neg rs, rd */ > static bool trans_NEG_rr(DisasContext *ctx, arg_NEG_rr *a) > { > - prt("neg\t"); > if (a->rs != a->rd) { > - prt("r%d, ", a->rs); > + prt("neg\tr%d, r%d", a->rs, a->rd); > + } else { > + prt("neg\tr%d", a->rs); > } > - prt("r%d", a->rd); > return true; > } > > @@ -606,11 +610,10 @@ static bool trans_SBB_mr(DisasContext *ctx, arg_SBB_mr *a) > /* abs rs, rd */ > static bool trans_ABS_rr(DisasContext *ctx, arg_ABS_rr *a) > { > - prt("abs\t"); > - if (a->rs == a->rd) { > - prt("r%d", a->rd); > + if (a->rs != a->rd) { > + prt("abs\tr%d, r%d", a->rs, a->rd); > } else { > - prt("r%d, r%d", a->rs, a->rd); > + prt("abs\tr%d", a->rs); > } > return true; > } > @@ -733,11 +736,11 @@ static bool trans_DIVU_mr(DisasContext *ctx, arg_DIVU_mr *a) > /* shll #imm:5, rs, rd */ > static bool trans_SHLL_irr(DisasContext *ctx, arg_SHLL_irr *a) > { > - prt("shll\t#%d, ", a->imm); > if (a->rs2 != a->rd) { > - prt("r%d, ", a->rs2); > + prt("shll\t#%d, r%d, r%d", a->imm, a->rs2, a->rd); > + } else { > + prt("shll\t#%d, r%d", a->imm, a->rd); > } > - prt("r%d", a->rd); > return true; > } > > @@ -752,11 +755,11 @@ static bool trans_SHLL_rr(DisasContext *ctx, arg_SHLL_rr *a) > /* shar #imm:5, rs, rd */ > static bool trans_SHAR_irr(DisasContext *ctx, arg_SHAR_irr *a) > { > - prt("shar\t#%d,", a->imm); > if (a->rs2 != a->rd) { > - prt("r%d, ", a->rs2); > + prt("shar\t#%d, r%d, r%d", a->imm, a->rs2, a->rd); > + } else { > + prt("shar\t#%d, r%d", a->imm, a->rd); > } > - prt("r%d", a->rd); > return true; > } > > @@ -771,11 +774,11 @@ static bool trans_SHAR_rr(DisasContext *ctx, arg_SHAR_rr *a) > /* shlr #imm:5, rs, rd */ > static bool trans_SHLR_irr(DisasContext *ctx, arg_SHLR_irr *a) > { > - prt("shlr\t#%d, ", a->imm); > if (a->rs2 != a->rd) { > - prt("r%d, ", a->rs2); > + prt("shlr\t#%d, r%d, r%d", a->imm, a->rs2, a->rd); > + } else { > + prt("shlr\t#%d, r%d", a->imm, a->rd); > } > - prt("r%d", a->rd); > return true; > } > > -- > 2.17.1 >