From patchwork Sun Mar 15 13:28:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 184559 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1698275ile; Sun, 15 Mar 2020 06:37:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvecVEg50eyYupJRJebFVjA75ZQtzo7oe8qGuRJ/CvcYLQ6BMUI0IV9JhtXVgVwMr5PXJA5 X-Received: by 2002:a37:27c1:: with SMTP id n184mr21460569qkn.67.1584279425550; Sun, 15 Mar 2020 06:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584279425; cv=none; d=google.com; s=arc-20160816; b=Ba+qY6vGYSSWMUrLsP8IQH/hngStRJbTpISVO5AShcU9IhBT205dPGnLNfenFcMuO/ g7olca4Ki8fxNBXzLupUVluhk/PoxWYSqr9gMbOrKRvdd4zawbQIE7o8+l+NlE4CdVhg P5pYeWtLhA7RWueXkS/6V5YXkKa7PII2tIsq/LL+HElSDPV9L9gHdtEGGUiaJ8R0pGN0 WPgL0YOQ1j+11k7oJ60Qf0wpX+f+tuRCgaOf/yU5fJwAxSWmvMOFmzAtYKFB4jTCmRaj nxg8dgTX/1fj2Z4TjpAM8mXeSYAYX4hxoTfIAne/1sjY/CIyJ32xR+wLxjTHAvHAxA2u 6x+Q== 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 :dkim-signature; bh=ljXAIEVRHrDp+LzUL6MHSEncF524g2j6WXSfjoxzCZE=; b=PjpF7USd5ZYmklOpDMjciyl0Ivnx1m9F0fardayrIxWpXhKHlUPAv10Q6xQdmE7xTq IuCq98psAdtDOHj8INr1DYmNnnPJZlyXuVsLtDPOJTb79Sxf+uVBrUicrdJYP3GJVqtQ kPTV+4PF1rGy/LxcZS5biMpT36deKCFSUzjHuDRWDKiS2z2xmodm3uAPCrw72Q+ePbEj ioI7RMCOZWDKfGQSDgRr+3WQ136EZisEqJJ3tNuIaJynJWuW4lG4VCpg+3NMtAewklMX kaJAc7xSqg5KcT+a4/f/+DpYeh4+ro8krxvw4wdMd9i05dZaNeZASS5INFm+uqYFbzTT qUpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=N+xjrqF7; 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=amsat.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d18si8095384qvo.25.2020.03.15.06.37.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 15 Mar 2020 06:37:05 -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=@gmail.com header.s=20161025 header.b=N+xjrqF7; 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=amsat.org Received: from localhost ([::1]:54040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDTRx-0006wj-0E for patch@linaro.org; Sun, 15 Mar 2020 09:37:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50860) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDTJk-00088D-HZ for qemu-devel@nongnu.org; Sun, 15 Mar 2020 09:28:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDTJh-0003Pt-Uu for qemu-devel@nongnu.org; Sun, 15 Mar 2020 09:28:36 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43914) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDTJg-0003Je-QI for qemu-devel@nongnu.org; Sun, 15 Mar 2020 09:28:33 -0400 Received: by mail-wr1-x443.google.com with SMTP id b2so11632303wrj.10 for ; Sun, 15 Mar 2020 06:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ljXAIEVRHrDp+LzUL6MHSEncF524g2j6WXSfjoxzCZE=; b=N+xjrqF7nf4ewrkD+xekj2yaK34XJLS/xpB/wV01dNeseNHOxL9MjNWBJWcJ2NYgb+ RkwvfZ7yhyNTdVHLjln/wDUxBUWrXsieWS0rfWT/MIew4k2JoszMR+VFf9lWsXork8gi L+DWuUiQluaS5uwHubQAIBymbfKBlrfv3VAWkJBwTbufh2kfKUDNiGkcA48MxekdcKhp h8Y3UApWONfT7VhEZ1VwDQCljXXJNNjl0+SDu8CuIq90vXtL5UI+8XztelZKB+uBjbBj 2BBQ39Fjbx+nVhux9pyZ5t7bpVin7UrjDkLGr47302DFZ6lh7D3Y7V/5iwPzH/nyGqLV rL9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ljXAIEVRHrDp+LzUL6MHSEncF524g2j6WXSfjoxzCZE=; b=SdTn1Um4OBvOlLQUzfyRpMxAFc/pKBoQoyy4CDFsSQeZvYNsPqodzQkR81pvSGfn68 Wp+3IjuEJNrI4heBOgXAz/V8Lb9trM30+iNdCjZZ6V2OWYTwoYuZumamfKDrDHQUJCMC IcvflqIaru3gi0cWh48HTjyXCXnuCwEEf7+ugJCnKVNZizGrxstDZYfV+4hTz5NI9SYn WbeRG+yjJo/lhICjahOyDWGFpwYME4TXgGmx1ulnk3T947hqNMY7XVNBOaDKNrGmwhyd 7Ly9wnuteRJbvih339vusjgQLillr1SYB4zbs/GhSa2YI5VBWMduHzgad6UJ99QNT64S KT4w== X-Gm-Message-State: ANhLgQ0dT86f0lUyFweATzt6wPEGUnwZX1hKTk247z+CFSAhikbdX+fq McZ9Y+RH53Dl3PdWNFNIL7zXRaRP X-Received: by 2002:a5d:4d51:: with SMTP id a17mr11906907wru.285.1584278910565; Sun, 15 Mar 2020 06:28:30 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id d15sm87590503wrp.37.2020.03.15.06.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 06:28:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 10/13] target/rx: Emit all disassembly in one prt() Date: Sun, 15 Mar 2020 14:28:06 +0100 Message-Id: <20200315132810.7022-11-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200315132810.7022-1-f4bug@amsat.org> References: <20200315132810.7022-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 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: Yoshinori Sato , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson 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 Tested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20190531134315.4109-22-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- target/rx/disas.c | 75 ++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 36 deletions(-) -- 2.21.1 diff --git a/target/rx/disas.c b/target/rx/disas.c index a0c444020c..814ef97480 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; }