diff mbox series

[v2,32/76] target/microblaze: Remove empty D macros

Message ID 20200828141929.77854-33-richard.henderson@linaro.org
State Superseded
Headers show
Series target/microblaze improvements | expand

Commit Message

Richard Henderson Aug. 28, 2020, 2:18 p.m. UTC
This is never used in op_helper.c and translate.c.  There are
two trivial uses in helper.c which can be improved by always
logging MMU_EXCP to CPU_LOG_INT.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/microblaze/helper.c    | 11 ++++-------
 target/microblaze/op_helper.c |  2 --
 target/microblaze/translate.c |  2 --
 3 files changed, 4 insertions(+), 11 deletions(-)

-- 
2.25.1

Comments

Philippe Mathieu-Daudé Aug. 31, 2020, 9:14 p.m. UTC | #1
Le ven. 28 août 2020 16:32, Richard Henderson <richard.henderson@linaro.org>
a écrit :

> This is never used in op_helper.c and translate.c.  There are

> two trivial uses in helper.c which can be improved by always

> logging MMU_EXCP to CPU_LOG_INT.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

>


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


---
>  target/microblaze/helper.c    | 11 ++++-------

>  target/microblaze/op_helper.c |  2 --

>  target/microblaze/translate.c |  2 --

>  3 files changed, 4 insertions(+), 11 deletions(-)

>

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

> index 9a95456401..f8e2ca12a9 100644

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

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

> @@ -24,8 +24,6 @@

>  #include "qemu/host-utils.h"

>  #include "exec/log.h"

>

> -#define D(x)

> -

>  #if defined(CONFIG_USER_ONLY)

>

>  void mb_cpu_do_interrupt(CPUState *cs)

> @@ -155,10 +153,13 @@ void mb_cpu_do_interrupt(CPUState *cs)

>          case EXCP_MMU:

>              env->regs[17] = env->pc;

>

> +            qemu_log_mask(CPU_LOG_INT,

> +                          "MMU exception at pc=%x iflags=%x ear=%" PRIx64

> "\n",

> +                          env->pc, env->iflags, env->ear);

> +

>              env->esr &= ~(1 << 12);

>              /* Exception breaks branch + dslot sequence?  */

>              if (env->iflags & D_FLAG) {

> -                D(qemu_log("D_FLAG set at exception bimm=%d\n",

> env->bimm));

>                  env->esr |= 1 << 12 ;

>                  env->btr = env->btarget;

>

> @@ -166,14 +167,10 @@ void mb_cpu_do_interrupt(CPUState *cs)

>                  env->regs[17] -= 4;

>                  /* was the branch immprefixed?.  */

>                  if (env->bimm) {

> -                    qemu_log_mask(CPU_LOG_INT,

> -                                  "bimm exception at pc=%x iflags=%x\n",

> -                                  env->pc, env->iflags);

>                      env->regs[17] -= 4;

>                      log_cpu_state_mask(CPU_LOG_INT, cs, 0);

>                  }

>              } else if (env->iflags & IMM_FLAG) {

> -                D(qemu_log("IMM_FLAG set at exception\n"));

>                  env->regs[17] -= 4;

>              }

>

> diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c

> index d79202c3f8..decdca0fd8 100644

> --- a/target/microblaze/op_helper.c

> +++ b/target/microblaze/op_helper.c

> @@ -26,8 +26,6 @@

>  #include "exec/cpu_ldst.h"

>  #include "fpu/softfloat.h"

>

> -#define D(x)

> -

>  void helper_put(uint32_t id, uint32_t ctrl, uint32_t data)

>  {

>      int test = ctrl & STREAM_TEST;

> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c

> index 6757720776..860859324a 100644

> --- a/target/microblaze/translate.c

> +++ b/target/microblaze/translate.c

> @@ -41,8 +41,6 @@

>  #  define LOG_DIS(...) do { } while (0)

>  #endif

>

> -#define D(x)

> -

>  #define EXTRACT_FIELD(src, start, end) \

>              (((src) >> start) & ((1 << (end - start + 1)) - 1))

>

> --

> 2.25.1

>

>

>
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 28 août 2020 16:32, Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org">richard.henderson@linaro.org</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is never used in op_helper.c and translate.c.  There are<br>
two trivial uses in helper.c which can be improved by always<br>
logging MMU_EXCP to CPU_LOG_INT.<br>
<br>
Signed-off-by: Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org" target="_blank" rel="noreferrer">richard.henderson@linaro.org</a>&gt;<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif;font-size:13.696px">Reviewed-by: Philippe Mathieu-Daudé &lt;</span><a href="mailto:f4bug@amsat.org" style="text-decoration:none;color:rgb(66,133,244);font-family:sans-serif;font-size:13.696px">f4bug@amsat.org</a><span style="font-family:sans-serif;font-size:13.696px">&gt;</span><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

---<br>
 target/microblaze/helper.c    | 11 ++++-------<br>
 target/microblaze/op_helper.c |  2 --<br>
 target/microblaze/translate.c |  2 --<br>
 3 files changed, 4 insertions(+), 11 deletions(-)<br>
<br>
diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c<br>
index 9a95456401..f8e2ca12a9 100644<br>
--- a/target/microblaze/helper.c<br>
+++ b/target/microblaze/helper.c<br>
@@ -24,8 +24,6 @@<br>
 #include &quot;qemu/host-utils.h&quot;<br>
 #include &quot;exec/log.h&quot;<br>
<br>
-#define D(x)<br>
-<br>
 #if defined(CONFIG_USER_ONLY)<br>
<br>
 void mb_cpu_do_interrupt(CPUState *cs)<br>
@@ -155,10 +153,13 @@ void mb_cpu_do_interrupt(CPUState *cs)<br>
         case EXCP_MMU:<br>
             env-&gt;regs[17] = env-&gt;pc;<br>
<br>
+            qemu_log_mask(CPU_LOG_INT,<br>
+                          &quot;MMU exception at pc=%x iflags=%x ear=%&quot; PRIx64 &quot;\n&quot;,<br>
+                          env-&gt;pc, env-&gt;iflags, env-&gt;ear);<br>
+<br>
             env-&gt;esr &amp;= ~(1 &lt;&lt; 12);<br>
             /* Exception breaks branch + dslot sequence?  */<br>
             if (env-&gt;iflags &amp; D_FLAG) {<br>
-                D(qemu_log(&quot;D_FLAG set at exception bimm=%d\n&quot;, env-&gt;bimm));<br>
                 env-&gt;esr |= 1 &lt;&lt; 12 ;<br>
                 env-&gt;btr = env-&gt;btarget;<br>
<br>
@@ -166,14 +167,10 @@ void mb_cpu_do_interrupt(CPUState *cs)<br>
                 env-&gt;regs[17] -= 4;<br>
                 /* was the branch immprefixed?.  */<br>
                 if (env-&gt;bimm) {<br>
-                    qemu_log_mask(CPU_LOG_INT,<br>
-                                  &quot;bimm exception at pc=%x iflags=%x\n&quot;,<br>
-                                  env-&gt;pc, env-&gt;iflags);<br>
                     env-&gt;regs[17] -= 4;<br>
                     log_cpu_state_mask(CPU_LOG_INT, cs, 0);<br>
                 }<br>
             } else if (env-&gt;iflags &amp; IMM_FLAG) {<br>
-                D(qemu_log(&quot;IMM_FLAG set at exception\n&quot;));<br>
                 env-&gt;regs[17] -= 4;<br>
             }<br>
<br>
diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c<br>
index d79202c3f8..decdca0fd8 100644<br>
--- a/target/microblaze/op_helper.c<br>
+++ b/target/microblaze/op_helper.c<br>
@@ -26,8 +26,6 @@<br>
 #include &quot;exec/cpu_ldst.h&quot;<br>
 #include &quot;fpu/softfloat.h&quot;<br>
<br>
-#define D(x)<br>
-<br>
 void helper_put(uint32_t id, uint32_t ctrl, uint32_t data)<br>
 {<br>
     int test = ctrl &amp; STREAM_TEST;<br>
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c<br>
index 6757720776..860859324a 100644<br>
--- a/target/microblaze/translate.c<br>
+++ b/target/microblaze/translate.c<br>
@@ -41,8 +41,6 @@<br>
 #  define LOG_DIS(...) do { } while (0)<br>
 #endif<br>
<br>
-#define D(x)<br>
-<br>
 #define EXTRACT_FIELD(src, start, end) \<br>
             (((src) &gt;&gt; start) &amp; ((1 &lt;&lt; (end - start + 1)) - 1))<br>
<br>
-- <br>
2.25.1<br>
<br>
<br>
</blockquote></div></div></div>
diff mbox series

Patch

diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c
index 9a95456401..f8e2ca12a9 100644
--- a/target/microblaze/helper.c
+++ b/target/microblaze/helper.c
@@ -24,8 +24,6 @@ 
 #include "qemu/host-utils.h"
 #include "exec/log.h"
 
-#define D(x)
-
 #if defined(CONFIG_USER_ONLY)
 
 void mb_cpu_do_interrupt(CPUState *cs)
@@ -155,10 +153,13 @@  void mb_cpu_do_interrupt(CPUState *cs)
         case EXCP_MMU:
             env->regs[17] = env->pc;
 
+            qemu_log_mask(CPU_LOG_INT,
+                          "MMU exception at pc=%x iflags=%x ear=%" PRIx64 "\n",
+                          env->pc, env->iflags, env->ear);
+
             env->esr &= ~(1 << 12);
             /* Exception breaks branch + dslot sequence?  */
             if (env->iflags & D_FLAG) {
-                D(qemu_log("D_FLAG set at exception bimm=%d\n", env->bimm));
                 env->esr |= 1 << 12 ;
                 env->btr = env->btarget;
 
@@ -166,14 +167,10 @@  void mb_cpu_do_interrupt(CPUState *cs)
                 env->regs[17] -= 4;
                 /* was the branch immprefixed?.  */
                 if (env->bimm) {
-                    qemu_log_mask(CPU_LOG_INT,
-                                  "bimm exception at pc=%x iflags=%x\n",
-                                  env->pc, env->iflags);
                     env->regs[17] -= 4;
                     log_cpu_state_mask(CPU_LOG_INT, cs, 0);
                 }
             } else if (env->iflags & IMM_FLAG) {
-                D(qemu_log("IMM_FLAG set at exception\n"));
                 env->regs[17] -= 4;
             }
 
diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c
index d79202c3f8..decdca0fd8 100644
--- a/target/microblaze/op_helper.c
+++ b/target/microblaze/op_helper.c
@@ -26,8 +26,6 @@ 
 #include "exec/cpu_ldst.h"
 #include "fpu/softfloat.h"
 
-#define D(x)
-
 void helper_put(uint32_t id, uint32_t ctrl, uint32_t data)
 {
     int test = ctrl & STREAM_TEST;
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 6757720776..860859324a 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -41,8 +41,6 @@ 
 #  define LOG_DIS(...) do { } while (0)
 #endif
 
-#define D(x)
-
 #define EXTRACT_FIELD(src, start, end) \
             (((src) >> start) & ((1 << (end - start + 1)) - 1))