From patchwork Mon Mar 4 19:13:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 777787 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp94523wrs; Mon, 4 Mar 2024 11:14:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV8q2sghBHourIL91JieOZrdGaxt3v06mb6qZWqtNIRzDbFVdnRYHnxOsi5oFLei9XSX9jlNui/Du39pYNhUe/5 X-Google-Smtp-Source: AGHT+IGW4kfG/j657CF/PaE5L0r7ylku6s3Ixnxis24dtaj0eBmRWNoDHwNun6pDgLKVbkdkLTaL X-Received: by 2002:ac8:58ce:0:b0:42e:f1ae:9e10 with SMTP id u14-20020ac858ce000000b0042ef1ae9e10mr3989076qta.57.1709579697945; Mon, 04 Mar 2024 11:14:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709579697; cv=none; d=google.com; s=arc-20160816; b=Ov2ex3tzEi7Aknuka4Qec7wJFY4ed17zBtR0gHbll8ugjZPLbyFsXCUnROz3ykOh5k 0PqC4W2NpwKtDTfiIIRlqxcRLdoSKkYo9k5Eo6MgFOz4/w3VoTZ6dBWHUQcqkxnEj3w7 PObPDH+59usdSXGgb15swFyvPoZqly2fNb544YYAueo4HuX5jOz11k3rOt6FWDbB0C7D wlqaqOa+IwIvoUhlJqwparoDjQuM5CdQjn7BVzRp13YkZe2kaJD4T/zydHeNQ6cqhE+0 nBjJq4QQZTxqRDaaGj9C4kLByfudSAcPOF7c8fQzT6g4aVtj1mo6obBjoNxx2vd0qwGY /+Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Pa44yMkxqpNsvSncvi7ekLjG5ubx8BtC53IgoytJ5A4=; fh=b/fM3Azt1fJndKkBUw6/kyP4UN6WY/kGpFR2FNJIEXM=; b=EBOfR8RzTC+7oBb2Q7cBHtRtl8pYl48e/fy7oBgDtgsOAiFtEBFVUCQ1QGGQUEo9Qb REewqnd6kr0M0tD0ckpiEHNoLO2NSN/6E+xxekB6m+/gT+4hEpi1yoW4+W/wJzXMt53D 37ezq0lbzq6RRQX/566cEijT84O8kLMUsGC5l/oP8ARZE3eFI0Sp/5g3lVz8g8kaAhLf ZGdjwHTle2V5fw0FMO8Ti+4Fn4WzQsokbK0oRNRQ3FvwDDB93wmCI5JJcylZJzgRDnjf m8U4U5RLaAPuZQ0r5FcCYQ+lL3Vg4hf4TJ6fZD7yeiGJD4PpXL5VIn3wOG02H9kfzNlO RvWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s0FuxQtb; 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=pass (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 j13-20020ac85f8d000000b0042ee0844badsi5069437qta.330.2024.03.04.11.14.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2024 11:14:57 -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; dkim=pass header.i=@linaro.org header.s=google header.b=s0FuxQtb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Palmer Dabbelt , Richard Henderson , qemu-riscv@nongnu.org, Song Gao , =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This makes the output suitable when used for plugins. Signed-off-by: Alex Bennée --- 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"; } -#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__); \ + } \ } #include "decode-insns.c.inc"