All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 03/11] target/arm: Avoid splitting Zregs across lines in dump
Date: Tue,  4 Jul 2023 17:36:26 +0100	[thread overview]
Message-ID: <20230704163634.3188465-4-peter.maydell@linaro.org> (raw)
In-Reply-To: <20230704163634.3188465-1-peter.maydell@linaro.org>

From: Richard Henderson <richard.henderson@linaro.org>

Allow the line length to extend to 548 columns.  While annoyingly wide,
it's still less confusing than the continuations we print.  Also, the
default VL used by Linux (and max for A64FX) uses only 140 columns.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230622151201.1578522-2-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/cpu.c | 36 ++++++++++++++----------------------
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index a1e77698ba2..f12c714bc43 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -955,7 +955,7 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
     ARMCPU *cpu = ARM_CPU(cs);
     CPUARMState *env = &cpu->env;
     uint32_t psr = pstate_read(env);
-    int i;
+    int i, j;
     int el = arm_current_el(env);
     const char *ns_status;
     bool sve;
@@ -1014,7 +1014,7 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
     }
 
     if (sve) {
-        int j, zcr_len = sve_vqm1_for_el(env, el);
+        int zcr_len = sve_vqm1_for_el(env, el);
 
         for (i = 0; i <= FFR_PRED_NUM; i++) {
             bool eol;
@@ -1054,32 +1054,24 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags)
             }
         }
 
-        for (i = 0; i < 32; i++) {
-            if (zcr_len == 0) {
+        if (zcr_len == 0) {
+            /*
+             * With vl=16, there are only 37 columns per register,
+             * so output two registers per line.
+             */
+            for (i = 0; i < 32; i++) {
                 qemu_fprintf(f, "Z%02d=%016" PRIx64 ":%016" PRIx64 "%s",
                              i, env->vfp.zregs[i].d[1],
                              env->vfp.zregs[i].d[0], i & 1 ? "\n" : " ");
-            } else if (zcr_len == 1) {
-                qemu_fprintf(f, "Z%02d=%016" PRIx64 ":%016" PRIx64
-                             ":%016" PRIx64 ":%016" PRIx64 "\n",
-                             i, env->vfp.zregs[i].d[3], env->vfp.zregs[i].d[2],
-                             env->vfp.zregs[i].d[1], env->vfp.zregs[i].d[0]);
-            } else {
+            }
+        } else {
+            for (i = 0; i < 32; i++) {
+                qemu_fprintf(f, "Z%02d=", i);
                 for (j = zcr_len; j >= 0; j--) {
-                    bool odd = (zcr_len - j) % 2 != 0;
-                    if (j == zcr_len) {
-                        qemu_fprintf(f, "Z%02d[%x-%x]=", i, j, j - 1);
-                    } else if (!odd) {
-                        if (j > 0) {
-                            qemu_fprintf(f, "   [%x-%x]=", j, j - 1);
-                        } else {
-                            qemu_fprintf(f, "     [%x]=", j);
-                        }
-                    }
                     qemu_fprintf(f, "%016" PRIx64 ":%016" PRIx64 "%s",
                                  env->vfp.zregs[i].d[j * 2 + 1],
-                                 env->vfp.zregs[i].d[j * 2],
-                                 odd || j == 0 ? "\n" : ":");
+                                 env->vfp.zregs[i].d[j * 2 + 0],
+                                 j ? ":" : "\n");
                 }
             }
         }
-- 
2.34.1



  parent reply	other threads:[~2023-07-04 16:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 16:36 [PULL 00/11] target-arm queue Peter Maydell
2023-07-04 16:36 ` [PULL 01/11] target/arm: Add raw_writes ops for register whose write induce TLB maintenance Peter Maydell
2023-07-04 16:36 ` [PULL 02/11] hw/arm/sbsa-ref: use XHCI to replace EHCI Peter Maydell
2023-07-04 16:36 ` Peter Maydell [this message]
2023-07-04 16:36 ` [PULL 04/11] target/arm: Dump ZA[] when active Peter Maydell
2023-07-04 16:36 ` [PULL 05/11] target/arm: Fix SME full tile indexing Peter Maydell
2023-07-04 16:36 ` [PULL 06/11] target/arm: Handle IC IVAU to improve compatibility with JITs Peter Maydell
2023-07-04 16:36 ` [PULL 07/11] tests/tcg/aarch64: Add testcases for IC IVAU and dual-mapped code Peter Maydell
2023-07-05  4:53   ` Richard Henderson
2023-07-05  9:25     ` Philippe Mathieu-Daudé
2023-07-05 13:36       ` Richard Henderson
2023-07-06 12:26       ` Peter Maydell
2023-07-06 12:45         ` John Högberg
2023-07-06 12:54           ` Peter Maydell
2023-07-07  7:50             ` John Högberg
2023-07-04 16:36 ` [PULL 08/11] tests/qtest: xlnx-canfd-test: Fix code coverity issues Peter Maydell
2023-07-04 16:36 ` [PULL 09/11] target/arm: gdbstub: Guard M-profile code with CONFIG_TCG Peter Maydell
2023-07-04 16:36 ` [PULL 10/11] hw: arm: allwinner-sramc: Set class_size Peter Maydell
2023-07-04 16:36 ` [PULL 11/11] target/xtensa: Assert that interrupt level is within bounds Peter Maydell
2023-07-05  4:57 ` [PULL 00/11] target-arm queue Richard Henderson
2023-07-05  5:04   ` Richard Henderson
2023-07-06 11:35     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230704163634.3188465-4-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.