qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-mips: fix mft* helpers/call
@ 2008-11-07  8:00 Aurelien Jarno
  2008-11-11  8:00 ` [Qemu-devel] " Thiemo Seufer
  0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Jarno @ 2008-11-07  8:00 UTC (permalink / raw)
  To: qemu-devel

    This patch attempts to fix mft* helpers and the associated TCG calls.
    mft* helpers do not take a register in argument, however:
    - some helpers are called with an argument while they do not take one.
    - some helpers are declared with an argument they don't use.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

diff --git a/target-mips/helper.h b/target-mips/helper.h
index ab62a1f..525ccbb 100644
--- a/target-mips/helper.h
+++ b/target-mips/helper.h
@@ -137,11 +137,11 @@ DEF_HELPER(void, do_mtc0_taghi, (target_ulong t0))
 DEF_HELPER(void, do_mtc0_datahi, (target_ulong t0))
 
 /* MIPS MT functions */
-DEF_HELPER(target_ulong, do_mftgpr, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mftlo, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mfthi, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mftacx, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mftdsp, (target_ulong t0))
+DEF_HELPER(target_ulong, do_mftgpr, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mftlo, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mfthi, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mftacx, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mftdsp, (void))
 DEF_HELPER(void, do_mttgpr, (target_ulong t0, uint32_t sel))
 DEF_HELPER(void, do_mttlo, (target_ulong t0, uint32_t sel))
 DEF_HELPER(void, do_mtthi, (target_ulong t0, uint32_t sel))
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 9e9c425..3744728 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -1358,7 +1358,7 @@ void do_mtc0_status_irqraise_debug(void)
 #endif /* !CONFIG_USER_ONLY */
 
 /* MIPS MT functions */
-target_ulong do_mftgpr(target_ulong t0, uint32_t sel)
+target_ulong do_mftgpr(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1368,7 +1368,7 @@ target_ulong do_mftgpr(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].gpr[sel];
 }
 
-target_ulong do_mftlo(target_ulong t0, uint32_t sel)
+target_ulong do_mftlo(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1378,7 +1378,7 @@ target_ulong do_mftlo(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].LO[sel];
 }
 
-target_ulong do_mfthi(target_ulong t0, uint32_t sel)
+target_ulong do_mfthi(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1388,7 +1388,7 @@ target_ulong do_mfthi(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].HI[sel];
 }
 
-target_ulong do_mftacx(target_ulong t0, uint32_t sel)
+target_ulong do_mftacx(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1398,7 +1398,7 @@ target_ulong do_mftacx(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].ACX[sel];
 }
 
-target_ulong do_mftdsp(target_ulong t0)
+target_ulong do_mftdsp(void)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 210b9e9..8835d04 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -5171,25 +5171,25 @@ static void gen_mftr(CPUState *env, DisasContext *ctx, int rt, int rd,
         case 2:
             switch (sel) {
             case 1:
-                tcg_gen_helper_1_1(do_mftc0_tcstatus, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_tcstatus, t0);
                 break;
             case 2:
-                tcg_gen_helper_1_1(do_mftc0_tcbind, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_tcbind, t0);
                 break;
             case 3:
-                tcg_gen_helper_1_1(do_mftc0_tcrestart, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_tcrestart, t0);
                 break;
             case 4:
-                tcg_gen_helper_1_1(do_mftc0_tchalt, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_tchalt, t0);
                 break;
             case 5:
-                tcg_gen_helper_1_1(do_mftc0_tccontext, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_tccontext, t0);
                 break;
             case 6:
-                tcg_gen_helper_1_1(do_mftc0_tcschedule, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_tcschedule, t0);
                 break;
             case 7:
-                tcg_gen_helper_1_1(do_mftc0_tcschefback, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_tcschefback, t0);
                 break;
             default:
                 gen_mfc0(env, ctx, t0, rt, sel);
@@ -5199,7 +5199,7 @@ static void gen_mftr(CPUState *env, DisasContext *ctx, int rt, int rd,
         case 10:
             switch (sel) {
             case 0:
-                tcg_gen_helper_1_1(do_mftc0_entryhi, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_entryhi, t0);
                 break;
             default:
                 gen_mfc0(env, ctx, t0, rt, sel);
@@ -5208,7 +5208,7 @@ static void gen_mftr(CPUState *env, DisasContext *ctx, int rt, int rd,
         case 12:
             switch (sel) {
             case 0:
-                tcg_gen_helper_1_1(do_mftc0_status, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_status, t0);
                 break;
             default:
                 gen_mfc0(env, ctx, t0, rt, sel);
@@ -5217,7 +5217,7 @@ static void gen_mftr(CPUState *env, DisasContext *ctx, int rt, int rd,
         case 23:
             switch (sel) {
             case 0:
-                tcg_gen_helper_1_1(do_mftc0_debug, t0, t0);
+                tcg_gen_helper_1_0(do_mftc0_debug, t0);
                 break;
             default:
                 gen_mfc0(env, ctx, t0, rt, sel);
@@ -5230,49 +5230,49 @@ static void gen_mftr(CPUState *env, DisasContext *ctx, int rt, int rd,
     } else switch (sel) {
     /* GPR registers. */
     case 0:
-        tcg_gen_helper_1_1i(do_mftgpr, t0, t0, rt);
+        tcg_gen_helper_1_i(do_mftgpr, t0, rt);
         break;
     /* Auxiliary CPU registers */
     case 1:
         switch (rt) {
         case 0:
-            tcg_gen_helper_1_1i(do_mftlo, t0, t0, 0);
+            tcg_gen_helper_1_i(do_mftlo, t0, 0);
             break;
         case 1:
-            tcg_gen_helper_1_1i(do_mfthi, t0, t0, 0);
+            tcg_gen_helper_1_i(do_mfthi, t0, 0);
             break;
         case 2:
-            tcg_gen_helper_1_1i(do_mftacx, t0, t0, 0);
+            tcg_gen_helper_1_i(do_mftacx, t0, 0);
             break;
         case 4:
-            tcg_gen_helper_1_1i(do_mftlo, t0, t0, 1);
+            tcg_gen_helper_1_i(do_mftlo, t0, 1);
             break;
         case 5:
-            tcg_gen_helper_1_1i(do_mfthi, t0, t0, 1);
+            tcg_gen_helper_1_i(do_mfthi, t0, 1);
             break;
         case 6:
-            tcg_gen_helper_1_1i(do_mftacx, t0, t0, 1);
+            tcg_gen_helper_1_i(do_mftacx, t0, 1);
             break;
         case 8:
-            tcg_gen_helper_1_1i(do_mftlo, t0, t0, 2);
+            tcg_gen_helper_1_i(do_mftlo, t0, 2);
             break;
         case 9:
-            tcg_gen_helper_1_1i(do_mfthi, t0, t0, 2);
+            tcg_gen_helper_1_i(do_mfthi, t0, 2);
             break;
         case 10:
-            tcg_gen_helper_1_1i(do_mftacx, t0, t0, 2);
+            tcg_gen_helper_1_i(do_mftacx, t0, 2);
             break;
         case 12:
-            tcg_gen_helper_1_1i(do_mftlo, t0, t0, 3);
+            tcg_gen_helper_1_i(do_mftlo, t0, 3);
             break;
         case 13:
-            tcg_gen_helper_1_1i(do_mfthi, t0, t0, 3);
+            tcg_gen_helper_1_i(do_mfthi, t0, 3);
             break;
         case 14:
-            tcg_gen_helper_1_1i(do_mftacx, t0, t0, 3);
+            tcg_gen_helper_1_i(do_mftacx, t0, 3);
             break;
         case 16:
-            tcg_gen_helper_1_1(do_mftdsp, t0, t0);
+            tcg_gen_helper_1_0(do_mftdsp, t0);
             break;
         default:
             goto die;

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: [PATCH] target-mips: fix mft* helpers/call
  2008-11-07  8:00 [Qemu-devel] [PATCH] target-mips: fix mft* helpers/call Aurelien Jarno
@ 2008-11-11  8:00 ` Thiemo Seufer
  0 siblings, 0 replies; 2+ messages in thread
From: Thiemo Seufer @ 2008-11-11  8:00 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: qemu-devel

Aurelien Jarno wrote:
>     This patch attempts to fix mft* helpers and the associated TCG calls.
>     mft* helpers do not take a register in argument, however:
>     - some helpers are called with an argument while they do not take one.
>     - some helpers are declared with an argument they don't use.

Strange, I vaguely remember I wrote a similiar patch some months ago,
IIRC triggered by a bug report from Stefan Weil. Anyway...

>     Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Acked-by: Thiemo Seufer <ths@networkno.de>


Thiemo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-11  8:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07  8:00 [Qemu-devel] [PATCH] target-mips: fix mft* helpers/call Aurelien Jarno
2008-11-11  8:00 ` [Qemu-devel] " Thiemo Seufer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).