From patchwork Mon Feb 24 14:19:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yoshinori Sato X-Patchwork-Id: 183765 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp450255ile; Mon, 24 Feb 2020 06:21:00 -0800 (PST) X-Google-Smtp-Source: APXvYqySo5nq2xzI4OhH/eZfLVtlH+KeWDEBrxuNYt9FcEQV/XTlkS4ztq9aldR0beltRZ0xKhe3 X-Received: by 2002:ac8:405a:: with SMTP id j26mr48354496qtl.88.1582554059951; Mon, 24 Feb 2020 06:20:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582554059; cv=none; d=google.com; s=arc-20160816; b=XbB65ZIWLtXgUK3SgJUGLgJA0zjwcOhf6cWfMNBHmmDAmOrYXxaNrYlx0RcTUP/v8E LfY2epekHhBZXntPYKpUyCcOm+uUqLgBCo1Py28cvnxUy3I3R1BPU1taZDtg+6avIqjE cHWyaAvGfcDTl/zAGp4qh8fqyjw+ujZJabzdyFshJnAm3YtLG3JGbxPVO/l8sMhV5saB 8Fd4OA+gChrEOCJA/B/C3zl2FqvVdhC8TmaryZ5Ur5o6U8pG7ndA20bW67YssdYruJAs ev+3iYc0YI2WVuqcy3aFBvNVXcnoRxBzJU2Rj5280h9PaqiIhJKxvnSUX3Wd7y6BpyLC AcnA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=/s500mB5cnXJIsX9IKljur+jp56CjbsyHaOWGoXs1zo=; b=YZATNwKwwR4kMqa9Cavn0YQceh+QStfeU9potjeacMzGsfm/ZQFnU6jSqS5UVSKmJX NK9kv0n2egkdyz5cFufcO6HYQUunAQpVpT1fsEB2GvYEf6M/mlY8edFBSF0F4MTRBHZZ BgFsPbTOhDm1UkXfpewIjfKK8ftBOeGpiL/1Qdz5586n0ryfY4ywLuG2kMumkxYfevEJ oX9kJvARHGdxYWBNv1irO02pIu9uAvkqMlyTqGq9FwkAsBq0853ez8a2Qq0ss5PyQHW4 no44wtN2v98ST8rrD2kApWFg6F0x8ZsJAQ4w4aej2aEpOD8vOVVbyHDgdkBpLoElfCzy KjhQ== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n9si5383515qvg.36.2020.02.24.06.20.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 06:20:59 -0800 (PST) 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; 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" Received: from localhost ([::1]:37006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6EbT-0007p4-Ey for patch@linaro.org; Mon, 24 Feb 2020 09:20:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48317) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Ea5-0004Is-Qn for qemu-devel@nongnu.org; Mon, 24 Feb 2020 09:19:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6Ea4-0005pN-3n for qemu-devel@nongnu.org; Mon, 24 Feb 2020 09:19:33 -0500 Received: from mail01.asahi-net.or.jp ([202.224.55.13]:38688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j6Ea3-0005ov-Ru for qemu-devel@nongnu.org; Mon, 24 Feb 2020 09:19:32 -0500 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 34B9A558FA; Mon, 24 Feb 2020 23:19:31 +0900 (JST) Received: from yo-satoh-debian.localdomain (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id B981B24008E; Mon, 24 Feb 2020 23:19:30 +0900 (JST) From: Yoshinori Sato To: qemu-devel@nongnu.org Subject: [PATCH v32 11/22] target/rx: Emit all disassembly in one prt() Date: Mon, 24 Feb 2020 23:19:12 +0900 Message-Id: <20200224141923.82118-12-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224141923.82118-1-ysato@users.sourceforge.jp> References: <20200224141923.82118-1-ysato@users.sourceforge.jp> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.224.55.13 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, Richard Henderson , Yoshinori Sato Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Many of the multi-part prints have been eliminated by previous patches. Eliminate the rest of them. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Signed-off-by: Yoshinori Sato Message-Id: <20190607091116.49044-22-ysato@users.sourceforge.jp> Tested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/rx/disas.c | 75 ++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 36 deletions(-) -- 2.20.1 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; }