diff mbox series

[1/9] target/alpha: Honor CPU_DUMP_FPU

Message ID 20180511035240.4016-2-richard.henderson@linaro.org
State Superseded
Headers show
Series Honor CPU_DUMP_FPU | expand

Commit Message

Richard Henderson May 11, 2018, 3:52 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/alpha/helper.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

-- 
2.17.0

Comments

Philippe Mathieu-Daudé May 13, 2018, 12:48 a.m. UTC | #1
On 05/11/2018 12:52 AM, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/alpha/helper.c | 17 ++++++++---------

>  1 file changed, 8 insertions(+), 9 deletions(-)

> 

> diff --git a/target/alpha/helper.c b/target/alpha/helper.c

> index 8a6a948572..57e2c212b3 100644

> --- a/target/alpha/helper.c

> +++ b/target/alpha/helper.c

> @@ -442,20 +442,19 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,

>      cpu_fprintf(f, "     PC  " TARGET_FMT_lx "      PS  %02x\n",

>                  env->pc, extract32(env->flags, ENV_FLAG_PS_SHIFT, 8));

>      for (i = 0; i < 31; i++) {

> -        cpu_fprintf(f, "IR%02d %s " TARGET_FMT_lx " ", i,

> -                    linux_reg_names[i], cpu_alpha_load_gr(env, i));

> -        if ((i % 3) == 2)

> -            cpu_fprintf(f, "\n");

> +        cpu_fprintf(f, "IR%02d %s " TARGET_FMT_lx "%c", i,

> +                    linux_reg_names[i], cpu_alpha_load_gr(env, i),

> +                    (i % 3) == 2 ? '\n' : ' ');

>      }

>  

>      cpu_fprintf(f, "lock_a   " TARGET_FMT_lx " lock_v   " TARGET_FMT_lx "\n",

>                  env->lock_addr, env->lock_value);

>  

> -    for (i = 0; i < 31; i++) {

> -        cpu_fprintf(f, "FIR%02d    " TARGET_FMT_lx " ", i,

> -                    *((uint64_t *)(&env->fir[i])));

> -        if ((i % 3) == 2)

> -            cpu_fprintf(f, "\n");

> +    if (flags & CPU_DUMP_FPU) {

> +        for (i = 0; i < 31; i++) {

> +            cpu_fprintf(f, "FIR%02d    %016" PRIx64 "%c", i, env->fir[i],


Cleaner :)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> +                        (i % 3) == 2 ? '\n' : ' ');

> +        }

>      }

>      cpu_fprintf(f, "\n");

>  }

>
diff mbox series

Patch

diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 8a6a948572..57e2c212b3 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -442,20 +442,19 @@  void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
     cpu_fprintf(f, "     PC  " TARGET_FMT_lx "      PS  %02x\n",
                 env->pc, extract32(env->flags, ENV_FLAG_PS_SHIFT, 8));
     for (i = 0; i < 31; i++) {
-        cpu_fprintf(f, "IR%02d %s " TARGET_FMT_lx " ", i,
-                    linux_reg_names[i], cpu_alpha_load_gr(env, i));
-        if ((i % 3) == 2)
-            cpu_fprintf(f, "\n");
+        cpu_fprintf(f, "IR%02d %s " TARGET_FMT_lx "%c", i,
+                    linux_reg_names[i], cpu_alpha_load_gr(env, i),
+                    (i % 3) == 2 ? '\n' : ' ');
     }
 
     cpu_fprintf(f, "lock_a   " TARGET_FMT_lx " lock_v   " TARGET_FMT_lx "\n",
                 env->lock_addr, env->lock_value);
 
-    for (i = 0; i < 31; i++) {
-        cpu_fprintf(f, "FIR%02d    " TARGET_FMT_lx " ", i,
-                    *((uint64_t *)(&env->fir[i])));
-        if ((i % 3) == 2)
-            cpu_fprintf(f, "\n");
+    if (flags & CPU_DUMP_FPU) {
+        for (i = 0; i < 31; i++) {
+            cpu_fprintf(f, "FIR%02d    %016" PRIx64 "%c", i, env->fir[i],
+                        (i % 3) == 2 ? '\n' : ' ');
+        }
     }
     cpu_fprintf(f, "\n");
 }