From nobody Tue Nov 26 06:38:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709579698; cv=none; d=zohomail.com; s=zohoarc; b=MFrq+IW184yRDQ8+kNcTbZyynDsoGrZWZ36+jo0NFZAGro+zuVs+zbkox+w6sFQFCSfxDApjV6THsxhzJAf3OLvrb2LpLeKhXjR4enzm4FVLABU46yi1UXP1C3x5NbHJ9mjASkpXAzkOBSh97H8yRWPC4Nk0MwerE1+mC3Cq270= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709579698; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pa44yMkxqpNsvSncvi7ekLjG5ubx8BtC53IgoytJ5A4=; b=gKfxlQ1xLhF/cO+Za2HMK6Np5cfFZ39iEbzOOxm4sYB1XqI1kkdJeNyezqHQ8sdW86Jg7smqBlimpuRHe5C+puhmEfM+x70MmIi0nbfyKOxSvY/Zs59L3AAx57sMa1g8zZZnWmDmoLzkoCcvNhyaKIJ0qdM6tUyNcsjlVOQ0SU4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709579698686215.64689075240335; Mon, 4 Mar 2024 11:14:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhDkt-00038i-0N; Mon, 04 Mar 2024 14:13:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhDkr-00036h-Iq for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:41 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhDkq-0001ax-0B for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:41 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-33e2268ed96so2781611f8f.3 for ; Mon, 04 Mar 2024 11:13:39 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p3-20020a5d4583000000b0033b47ee01f1sm12866317wrq.49.2024.03.04.11.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 11:13:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5B6575F950; Mon, 4 Mar 2024 19:13:37 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709579618; x=1710184418; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pa44yMkxqpNsvSncvi7ekLjG5ubx8BtC53IgoytJ5A4=; b=s0FuxQtbhvpcHrrH7J0hi1jHaoo0D+IzAYFqHhI7UsncwwrGyySba9VtiyJzBbh6I9 LR92LN5GfRd0ItAHXJq+ApNtmmZ/Yq3HqEmjK35tY16+1aN3vRX6zx0tBMbzFb1UJZJJ WhUileUo2pjr8HfBG3vAwxwhKDKFU1KpRkfPL0JtOj7/BlIsPNnlnOUZdiwz3K9+dgk4 NOPU4js2ejLezU9b4IU0E2nmtMbBofHX8rHxKLU93iA9IVDG+wnPMPOhTLBIa8FtWPLR zx5Vnbz1+tOfsfqiNR7ylSPA4+zOkXU8v8i41aeXSVBp8ktC7jlNp23+p5oA71hps4W6 qNqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709579618; x=1710184418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pa44yMkxqpNsvSncvi7ekLjG5ubx8BtC53IgoytJ5A4=; b=KRdRa0GpdwKMVl/fO0FCwUBWxveyE2WO0wZW6St5lFJevYjxJY8Tw4NyzNGBV4QcwY LK2WRRKLHc5Jw1Pv5sMzosQtXRp3Cf8cc/mu1q90DITYSGkQUFCnMMTWQGS+3RMhsHgJ fUYJ7puWxLy7z+QWa4jmi8/5w/mUMoXnx9U2Q/dms9A6O8N8rvmOotWr33g+pBoimxCO b4BInQLOMqf9UHJkeC3+BaDzrvs7R0wJ4wSWy+h+rHikejIlJ9YtoR5/nJdGapwKakKY aupgYBEu24EBEmdpc2Kh3rC/X6+lPHOibsyv9GQeuTHg7W8Jmg+kO/3fhCr8ucWNfC1Q f9cQ== X-Gm-Message-State: AOJu0YwDzb70/+zIp9bfhfpkuagM3n6WG6pBw/0rhGZr2WYfzUX585ww kcqHZ7rHQDEgN8zFcBPivsuAdaN72G3jORTzZylyBvMMh41obcHw0jITSTx5NOc= X-Google-Smtp-Source: AGHT+IH5qLvyj5YPNh5svGC1WUH+wF54sm2uSzbfzbZ3d3/vOjONZDP+JD8yUni4QOrpnvO4DrAkaQ== X-Received: by 2002:adf:9d83:0:b0:33d:eda5:bef7 with SMTP id p3-20020adf9d83000000b0033deda5bef7mr6977181wre.59.1709579618381; Mon, 04 Mar 2024 11:13:38 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Palmer Dabbelt , Richard Henderson , qemu-riscv@nongnu.org, Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 3/4] target/loongarch: honour no_raw_bytes when disassembling Date: Mon, 4 Mar 2024 19:13:36 +0000 Message-Id: <20240304191337.3101411-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240304191337.3101411-1-alex.bennee@linaro.org> References: <20240304191337.3101411-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709579700123100003 This makes the output suitable when used for plugins. Signed-off-by: Alex Benn=C3=A9e --- target/loongarch/disas.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/target/loongarch/disas.c b/target/loongarch/disas.c index 2040f3e44db..b9118878d97 100644 --- a/target/loongarch/disas.c +++ b/target/loongarch/disas.c @@ -120,10 +120,15 @@ static const char *get_csr_name(unsigned num) csr_names[num] : "Undefined CSR"; } =20 -#define output(C, INSN, FMT, ...) \ -{ \ - (C)->info->fprintf_func((C)->info->stream, "%08x %-9s\t" FMT, \ - (C)->insn, INSN, ##__VA_ARGS__); \ +#define output(C, INSN, FMT, ...) \ + { \ + if ((C)->info->no_raw_bytes) { \ + (C)->info->fprintf_func((C)->info->stream, "%-9s\t" FMT, \ + INSN, ##__VA_ARGS__); \ + } else { \ + (C)->info->fprintf_func((C)->info->stream, "%08x %-9s\t" FMT,\ + (C)->insn, INSN, ##__VA_ARGS__); \ + } \ } =20 #include "decode-insns.c.inc" --=20 2.39.2