qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [4802] Remove unnecessary helper arguments, and fix some ty


From: Thiemo Seufer
Subject: [Qemu-devel] [4802] Remove unnecessary helper arguments, and fix some typos.
Date: Sun, 29 Jun 2008 14:53:12 +0000

Revision: 4802
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4802
Author:   ths
Date:     2008-06-29 14:53:11 +0000 (Sun, 29 Jun 2008)

Log Message:
-----------
Remove unnecessary helper arguments, and fix some typos.

Modified Paths:
--------------
    trunk/target-mips/helper.h
    trunk/target-mips/op_helper.c
    trunk/target-mips/translate.c

Modified: trunk/target-mips/helper.h
===================================================================
--- trunk/target-mips/helper.h  2008-06-29 12:29:56 UTC (rev 4801)
+++ trunk/target-mips/helper.h  2008-06-29 14:53:11 UTC (rev 4802)
@@ -251,12 +251,12 @@
 DEF_HELPER(void, do_wait, (void))
 
 /* Bitfield operations. */
-DEF_HELPER(target_ulong, do_ext, (target_ulong t0, target_ulong t1, uint32_t 
pos, uint32_t size))
+DEF_HELPER(target_ulong, do_ext, (target_ulong t1, uint32_t pos, uint32_t 
size))
 DEF_HELPER(target_ulong, do_ins, (target_ulong t0, target_ulong t1, uint32_t 
pos, uint32_t size))
-DEF_HELPER(target_ulong, do_wsbh, (target_ulong t0, target_ulong t1))
+DEF_HELPER(target_ulong, do_wsbh, (target_ulong t1))
 #ifdef TARGET_MIPS64
-DEF_HELPER(target_ulong, do_dext, (target_ulong t0, target_ulong t1, uint32_t 
pos, uint32_t size))
+DEF_HELPER(target_ulong, do_dext, (target_ulong t1, uint32_t pos, uint32_t 
size))
 DEF_HELPER(target_ulong, do_dins, (target_ulong t0, target_ulong t1, uint32_t 
pos, uint32_t size))
-DEF_HELPER(target_ulong, do_dsbh, (target_ulong t0, target_ulong t1))
-DEF_HELPER(target_ulong, do_dshd, (target_ulong t0, target_ulong t1))
+DEF_HELPER(target_ulong, do_dsbh, (target_ulong t1))
+DEF_HELPER(target_ulong, do_dshd, (target_ulong t1))
 #endif

Modified: trunk/target-mips/op_helper.c
===================================================================
--- trunk/target-mips/op_helper.c       2008-06-29 12:29:56 UTC (rev 4801)
+++ trunk/target-mips/op_helper.c       2008-06-29 14:53:11 UTC (rev 4802)
@@ -1867,7 +1867,7 @@
 }
 
 /* Bitfield operations. */
-target_ulong do_ext(target_ulong t0, target_ulong t1, uint32_t pos, uint32_t 
size)
+target_ulong do_ext(target_ulong t1, uint32_t pos, uint32_t size)
 {
     return (int32_t)((t1 >> pos) & ((size < 32) ? ((1 << size) - 1) : ~0));
 }
@@ -1879,13 +1879,13 @@
     return (int32_t)((t0 & ~mask) | ((t1 << pos) & mask));
 }
 
-target_ulong do_wsbh(target_ulong t0, target_ulong t1)
+target_ulong do_wsbh(target_ulong t1)
 {
     return (int32_t)(((t1 << 8) & ~0x00FF00FF) | ((t1 >> 8) & 0x00FF00FF));
 }
 
 #if defined(TARGET_MIPS64)
-target_ulong do_dext(target_ulong t0, target_ulong t1, uint32_t pos, uint32_t 
size)
+target_ulong do_dext(target_ulong t1, uint32_t pos, uint32_t size)
 {
     return (t1 >> pos) & ((size < 64) ? ((1ULL << size) - 1) : ~0ULL);
 }
@@ -1897,12 +1897,12 @@
     return (t0 & ~mask) | ((t1 << pos) & mask);
 }
 
-target_ulong do_dsbh(target_ulong t0, target_ulong t1)
+target_ulong do_dsbh(target_ulong t1)
 {
     return ((t1 << 8) & ~0x00FF00FF00FF00FFULL) | ((t1 >> 8) & 
0x00FF00FF00FF00FFULL);
 }
 
-target_ulong do_dshd(target_ulong t0, target_ulong t1)
+target_ulong do_dshd(target_ulong t1)
 {
     t1 = ((t1 << 16) & ~0x0000FFFF0000FFFFULL) | ((t1 >> 16) & 
0x0000FFFF0000FFFFULL);
     return (t1 << 32) | (t1 >> 32);

Modified: trunk/target-mips/translate.c
===================================================================
--- trunk/target-mips/translate.c       2008-06-29 12:29:56 UTC (rev 4801)
+++ trunk/target-mips/translate.c       2008-06-29 14:53:11 UTC (rev 4802)
@@ -464,12 +464,12 @@
     tcg_temp_free(tmp);
 }
 
-static inline void tcg_gen_helper_0_2ii(void *func, TCGv arg1, TCGv arg2, TCGv 
arg3, TCGv arg4)
+static inline void tcg_gen_helper_0_1ii(void *func, TCGv arg1, TCGv arg2, TCGv 
arg3)
 {
-    TCGv tmp1 = tcg_const_i32(arg3);
+    TCGv tmp1 = tcg_const_i32(arg2);
     TCGv tmp2 = tcg_const_i32(arg3);
 
-    tcg_gen_helper_0_4(func, arg1, arg2, tmp1, tmp2);
+    tcg_gen_helper_0_3(func, arg1, tmp1, tmp2);
     tcg_temp_free(tmp1);
     tcg_temp_free(tmp2);
 }
@@ -490,6 +490,16 @@
     tcg_temp_free(tmp);
 }
 
+static inline void tcg_gen_helper_1_1ii(void *func, TCGv ret, TCGv arg1, TCGv 
arg2, TCGv arg3)
+{
+    TCGv tmp1 = tcg_const_i32(arg2);
+    TCGv tmp2 = tcg_const_i32(arg3);
+
+    tcg_gen_helper_1_3(func, ret, arg1, tmp1, tmp2);
+    tcg_temp_free(tmp1);
+    tcg_temp_free(tmp2);
+}
+
 static inline void tcg_gen_helper_1_2i(void *func, TCGv ret, TCGv arg1, TCGv 
arg2, TCGv arg3)
 {
     TCGv tmp = tcg_const_i32(arg3);
@@ -501,7 +511,7 @@
 static inline void tcg_gen_helper_1_2ii(void *func, TCGv ret, TCGv arg1, TCGv 
arg2, TCGv arg3, TCGv arg4)
 {
     TCGv tmp1 = tcg_const_i32(arg3);
-    TCGv tmp2 = tcg_const_i32(arg3);
+    TCGv tmp2 = tcg_const_i32(arg4);
 
     tcg_gen_helper_1_4(func, ret, arg1, arg2, tmp1, tmp2);
     tcg_temp_free(tmp1);
@@ -2748,23 +2758,23 @@
     case OPC_EXT:
         if (lsb + msb > 31)
             goto fail;
-        tcg_gen_helper_1_2ii(do_ext, t0, t0, t1, lsb, msb + 1);
+        tcg_gen_helper_1_1ii(do_ext, t0, t1, lsb, msb + 1);
         break;
 #if defined(TARGET_MIPS64)
     case OPC_DEXTM:
         if (lsb + msb > 63)
             goto fail;
-        tcg_gen_helper_1_2ii(do_dext, t0, t0, t1, lsb, msb + 1 + 32);
+        tcg_gen_helper_1_1ii(do_dext, t0, t1, lsb, msb + 1 + 32);
         break;
     case OPC_DEXTU:
         if (lsb + msb > 63)
             goto fail;
-        tcg_gen_helper_1_2ii(do_dext, t0, t0, t1, lsb + 32, msb + 1);
+        tcg_gen_helper_1_1ii(do_dext, t0, t1, lsb + 32, msb + 1);
         break;
     case OPC_DEXT:
         if (lsb + msb > 63)
             goto fail;
-        tcg_gen_helper_1_2ii(do_dext, t0, t0, t1, lsb, msb + 1);
+        tcg_gen_helper_1_1ii(do_dext, t0, t1, lsb, msb + 1);
         break;
 #endif
     case OPC_INS:
@@ -7388,7 +7398,7 @@
                 switch (op2) {
                 case OPC_WSBH:
                     gen_load_gpr(t1, rt);
-                    tcg_gen_helper_1_2(do_wsbh, t0, t0, t1);
+                    tcg_gen_helper_1_1(do_wsbh, t0, t1);
                     gen_store_gpr(t0, rd);
                     break;
                 case OPC_SEB:
@@ -7490,11 +7500,11 @@
                 switch (op2) {
                 case OPC_DSBH:
                     gen_load_gpr(t1, rt);
-                    tcg_gen_helper_1_2(do_dsbh, t0, t0, t1);
+                    tcg_gen_helper_1_1(do_dsbh, t0, t1);
                     break;
                 case OPC_DSHD:
                     gen_load_gpr(t1, rt);
-                    tcg_gen_helper_1_2(do_dshd, t0, t0, t1);
+                    tcg_gen_helper_1_1(do_dshd, t0, t1);
                     break;
                 default:            /* Invalid */
                     MIPS_INVAL("dbshfl");






reply via email to

[Prev in Thread] Current Thread [Next in Thread]