From patchwork Fri May 31 13:43:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 165541 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp800019ili; Fri, 31 May 2019 07:06:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGLWOmvy3x1ojUnxyvJvIra+ganO2Nl0toG+kZjGqft7WB15t60QQmvtlN/dHIGytDLg1Y X-Received: by 2002:ad4:5426:: with SMTP id g6mr1761097qvt.132.1559311586462; Fri, 31 May 2019 07:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559311586; cv=none; d=google.com; s=arc-20160816; b=IuU+gAN+d97QR+LVzVQgSLYZmoWowEaTRODSKpGQAjo7HOVdQRJ1qXEE7ymVYBUyQY DteUq3iFWSCh2xs5oZ5uHIRjctAJ5NKojmOKMUWMzR8SKrqPmqSEUQuT7RTowdzZyPsl Clbc/nyQDTepJ9v+UOdvyuQoIrMXanEwo0jhUzYXt9AeuQtpBEAuS752qLO3m44irXyc /UQykZCXiF8YojTWe6QXXjScSii0Ws6WxfO46PajqEzfZjDoMN1v/goU6AZoaQ4r2NxB VSDs9+xGMtlu6LYmttBhZrclo+fLteMpgAimC2G5shI9qOOGgoY75F9kc6QTOH7Cu5aa 1MpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=VuLtbljmtAHf6MYsP7hDNZ9QyK490zrsemLZHTPIf9I=; b=GkTpKkYv1FXDPfEJw6rMtN3V3ajBkUCyNbmeDDpLh0k+K2PAx8uLWvRMYwmPXK8S8H ZIrI4OyEheWFPeh14SCjT7zu3U1Mig//oGjKzC/pK0AYJb0/uZz0M3Axk/WNpNenNVy2 waqQUKVf6+DRuTttdngky+pC4Xwu2mtbeXLGroDRmnENSVphhSBIbION5xt3aAUR76EK 5oS1m6MzfXZ4YhPrsvMT1eakxhdkaT8tDXbIH2XldnBHyrYrKXENNKp0RWpATtqSi9Lc WMXiZbfurQYOV29z0lqcnRmH0CV1y92MTcVMeaDhGALLL+CnjTtquK2v1UBc5DLIdUA+ hhHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RLq6dWbd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b44si1749131qvh.104.2019.05.31.07.06.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 31 May 2019 07:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RLq6dWbd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:44147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWiAs-0008GE-1G for patch@linaro.org; Fri, 31 May 2019 10:06:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWhp0-0007ga-TF for qemu-devel@nongnu.org; Fri, 31 May 2019 09:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWhoz-0000eW-Gw for qemu-devel@nongnu.org; Fri, 31 May 2019 09:43:50 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:36217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWhoz-0000e4-BU for qemu-devel@nongnu.org; Fri, 31 May 2019 09:43:49 -0400 Received: by mail-ot1-x342.google.com with SMTP id c3so9219666otr.3 for ; Fri, 31 May 2019 06:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VuLtbljmtAHf6MYsP7hDNZ9QyK490zrsemLZHTPIf9I=; b=RLq6dWbd2W44Nj8AkXt2M7/D/Z9L+MJ0Mfl+33VA1RF6gx4UzlZSr37aAemABvRRrK JDwOkn4G6gWhwO0L4iODGmdUFmAPn4/YmBhEvHRPxoQYrBbP8qSy970QpQljP/QQrzDR SFs2a+yA/Qqk0tIkytRuCijNroSNPIZT6dyUIbVWZkNSSRw8BaIoSJ0rD5Fy2HkRPRrg mjgPBEYIyuF97UaZuUACKMdjmmQ11A63svI7fL8T3SrCjh1ptWOX2mRSPbWsftaD2H+D N+4eeivgX8EwgnYMyXkiBFrXygem1zJyyGXSjwpg9J4QxTw+3yDh4aWaZpURNL3IFlKf HlwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VuLtbljmtAHf6MYsP7hDNZ9QyK490zrsemLZHTPIf9I=; b=atqnOxN6SS1N2mcUd7QDTaoaIOz4FXz4wGWa6qSEPUqsTOIr6I6Eic7P3Ndn4KAZGU U4PoIIXbxW3lZAdhLVG2YqS1m/pdpmLRhfSMliMeroUFo4zNmTiGUN5c5XPGbL+nELWc GXtSqIrOZGnJEXY/fysl5SL8for7ARgHm0e+zgTycxMYvWASr3FD1PAAc5h2Sq2OWvtY m8mPfmeQ0qOMp+H1H1EsUrSJNDIw25pUm4MZmSW3OJOitovL8TYqz8P7y9aAWu34dCO/ Z05fgTSB2vp6qh2mmkK+99YZwTYF0fERNIpDzQM4pa8YiuMGe/6PDiewbjhostoh5WLk 0GUQ== X-Gm-Message-State: APjAAAXXYTuDh9FzK+gAinH/FB8hd7wxChJJFVVRU5bv4g723tpMNyso qDrOmldUxYxZhWcrLsRt20+JVNL6crbTeg== X-Received: by 2002:a9d:5787:: with SMTP id q7mr1974171oth.230.1559310228556; Fri, 31 May 2019 06:43:48 -0700 (PDT) Received: from localhost.localdomain (168.189-204-159.bestelclientes.com.mx. [189.204.159.168]) by smtp.gmail.com with ESMTPSA id r23sm2391176otg.49.2019.05.31.06.43.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 06:43:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 08:43:13 -0500 Message-Id: <20190531134315.4109-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190531134315.4109-1-richard.henderson@linaro.org> References: <20190531134315.4109-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::342 Subject: [Qemu-devel] [PATCH v16 21/23] 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: philmd@redhat.com, ysato@users.sourceforge.jp Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Many of the multi-part prints have been eliminated by previous patches. Eliminate the rest of them. Reviewed-by: Yoshinori Sato Signed-off-by: Richard Henderson --- target/rx/disas.c | 75 ++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 36 deletions(-) -- 2.17.1 Reviewed-by: Philippe Mathieu-Daudé 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; }