Move also DEBUG_PCALL (see r5085)
[qemu] / target-sparc / op_helper.c
index 1cafa67..64b56e3 100644 (file)
@@ -10,6 +10,7 @@
 //#define DEBUG_UNALIGNED
 //#define DEBUG_UNASSIGNED
 //#define DEBUG_ASI
+//#define DEBUG_PCALL
 
 #ifdef DEBUG_MMU
 #define DPRINTF_MMU(fmt, args...) \
@@ -106,10 +107,10 @@ F_BINOP(mul);
 F_BINOP(div);
 #undef F_BINOP
 
-void helper_fsmuld(void)
+void helper_fsmuld(float32 src1, float32 src2)
 {
-    DT0 = float64_mul(float32_to_float64(FT0, &env->fp_status),
-                      float32_to_float64(FT1, &env->fp_status),
+    DT0 = float64_mul(float32_to_float64(src1, &env->fp_status),
+                      float32_to_float64(src2, &env->fp_status),
                       &env->fp_status);
 }
 
@@ -143,9 +144,9 @@ float32 helper_fitos(int32_t src)
     return int32_to_float32(src, &env->fp_status);
 }
 
-F_HELPER(ito, d)
+void helper_fitod(int32_t src)
 {
-    DT0 = int32_to_float64(*((int32_t *)&FT1), &env->fp_status);
+    DT0 = int32_to_float64(src, &env->fp_status);
 }
 
 void helper_fitoq(int32_t src)
@@ -154,9 +155,9 @@ void helper_fitoq(int32_t src)
 }
 
 #ifdef TARGET_SPARC64
-F_HELPER(xto, s)
+float32 helper_fxtos(void)
 {
-    FT0 = int64_to_float32(*((int64_t *)&DT1), &env->fp_status);
+    return int64_to_float32(*((int64_t *)&DT1), &env->fp_status);
 }
 
 F_HELPER(xto, d)
@@ -172,14 +173,14 @@ F_HELPER(xto, q)
 #undef F_HELPER
 
 /* floating point conversion */
-void helper_fdtos(void)
+float32 helper_fdtos(void)
 {
-    FT0 = float64_to_float32(DT1, &env->fp_status);
+    return float64_to_float32(DT1, &env->fp_status);
 }
 
-void helper_fstod(void)
+void helper_fstod(float32 src)
 {
-    DT0 = float32_to_float64(FT1, &env->fp_status);
+    DT0 = float32_to_float64(src, &env->fp_status);
 }
 
 float32 helper_fqtos(void)
@@ -208,9 +209,9 @@ int32_t helper_fstoi(float32 src)
     return float32_to_int32_round_to_zero(src, &env->fp_status);
 }
 
-void helper_fdtoi(void)
+int32_t helper_fdtoi(void)
 {
-    *((int32_t *)&FT0) = float64_to_int32_round_to_zero(DT1, &env->fp_status);
+    return float64_to_int32_round_to_zero(DT1, &env->fp_status);
 }
 
 int32_t helper_fqtoi(void)
@@ -219,9 +220,9 @@ int32_t helper_fqtoi(void)
 }
 
 #ifdef TARGET_SPARC64
-void helper_fstox(void)
+void helper_fstox(float32 src)
 {
-    *((int64_t *)&DT0) = float32_to_int64_round_to_zero(FT1, &env->fp_status);
+    *((int64_t *)&DT0) = float32_to_int64_round_to_zero(src, &env->fp_status);
 }
 
 void helper_fdtox(void)
@@ -1061,7 +1062,7 @@ void helper_st_asi(target_ulong addr, uint64_t val, int asi, int size)
             break;
         case 0x01c00a04: /* MXCC control register */
             if (size == 4)
-                env->mxccregs[3] = (env->mxccregs[0xa] & 0xffffffff00000000ULL)
+                env->mxccregs[3] = (env->mxccregs[3] & 0xffffffff00000000ULL)
                     | val;
             else
                 DPRINTF_MXCC("%08x: unimplemented access size: %d\n", addr,
@@ -2199,11 +2200,11 @@ target_ulong helper_cas_asi(target_ulong addr, target_ulong val1,
 {
     target_ulong ret;
 
-    val1 &= 0xffffffffUL;
+    val2 &= 0xffffffffUL;
     ret = helper_ld_asi(addr, asi, 4, 0);
     ret &= 0xffffffffUL;
-    if (val1 == ret)
-        helper_st_asi(addr, val2 & 0xffffffffUL, asi, 4);
+    if (val2 == ret)
+        helper_st_asi(addr, val1 & 0xffffffffUL, asi, 4);
     return ret;
 }
 
@@ -2213,8 +2214,8 @@ target_ulong helper_casx_asi(target_ulong addr, target_ulong val1,
     target_ulong ret;
 
     ret = helper_ld_asi(addr, asi, 8, 0);
-    if (val1 == ret)
-        helper_st_asi(addr, val2, asi, 8);
+    if (val2 == ret)
+        helper_st_asi(addr, val1, asi, 8);
     return ret;
 }
 #endif /* TARGET_SPARC64 */
@@ -2281,11 +2282,6 @@ target_ulong helper_sdiv(target_ulong a, target_ulong b)
     }
 }
 
-uint64_t helper_pack64(target_ulong high, target_ulong low)
-{
-    return ((uint64_t)high << 32) | (uint64_t)(low & 0xffffffff);
-}
-
 void helper_stdf(target_ulong addr, int mem_idx)
 {
     helper_check_align(addr, 7);
@@ -2676,6 +2672,21 @@ void helper_retry(void)
     env->tl--;
     env->tsptr = &env->ts[env->tl & MAXTL_MASK];
 }
+
+void helper_set_softint(uint64_t value)
+{
+    env->softint |= (uint32_t)value;
+}
+
+void helper_clear_softint(uint64_t value)
+{
+    env->softint &= (uint32_t)~value;
+}
+
+void helper_write_softint(uint64_t value)
+{
+    env->softint = (uint32_t)value;
+}
 #endif
 
 void helper_flush(target_ulong addr)