aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/op_helper.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-22 19:05:18 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-22 19:05:18 +0000
commit4e14008f3a1d8418d3d4b0164018df49c34a3a22 (patch)
tree70156fe8b4ed9de3faa90b3328a79599ef86e0a6 /target-sparc/op_helper.c
parent4595fca99c92cbd0b3d11b017972d0ff6c1a5f97 (diff)
Revert the previous patch
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4236 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/op_helper.c')
-rw-r--r--target-sparc/op_helper.c108
1 files changed, 108 insertions, 0 deletions
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 406ff5fee1..bc9bb179d6 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -58,6 +58,21 @@ void helper_check_align(target_ulong addr, uint32_t align)
#define F_HELPER(name, p) void helper_f##name##p(void)
+#if defined(CONFIG_USER_ONLY)
+#define F_BINOP(name) \
+ F_HELPER(name, s) \
+ { \
+ FT0 = float32_ ## name (FT0, FT1, &env->fp_status); \
+ } \
+ F_HELPER(name, d) \
+ { \
+ DT0 = float64_ ## name (DT0, DT1, &env->fp_status); \
+ } \
+ F_HELPER(name, q) \
+ { \
+ QT0 = float128_ ## name (QT0, QT1, &env->fp_status); \
+ }
+#else
#define F_BINOP(name) \
F_HELPER(name, s) \
{ \
@@ -67,6 +82,7 @@ void helper_check_align(target_ulong addr, uint32_t align)
{ \
DT0 = float64_ ## name (DT0, DT1, &env->fp_status); \
}
+#endif
F_BINOP(add);
F_BINOP(sub);
@@ -81,6 +97,15 @@ void helper_fsmuld(void)
&env->fp_status);
}
+#if defined(CONFIG_USER_ONLY)
+void helper_fdmulq(void)
+{
+ QT0 = float128_mul(float64_to_float128(DT0, &env->fp_status),
+ float64_to_float128(DT1, &env->fp_status),
+ &env->fp_status);
+}
+#endif
+
F_HELPER(neg, s)
{
FT0 = float32_chs(FT1);
@@ -91,6 +116,13 @@ F_HELPER(neg, d)
{
DT0 = float64_chs(DT1);
}
+
+#if defined(CONFIG_USER_ONLY)
+F_HELPER(neg, q)
+{
+ QT0 = float128_chs(QT1);
+}
+#endif
#endif
/* Integer to float conversion. */
@@ -104,6 +136,13 @@ F_HELPER(ito, d)
DT0 = int32_to_float64(*((int32_t *)&FT1), &env->fp_status);
}
+#if defined(CONFIG_USER_ONLY)
+F_HELPER(ito, q)
+{
+ QT0 = int32_to_float128(*((int32_t *)&FT1), &env->fp_status);
+}
+#endif
+
#ifdef TARGET_SPARC64
F_HELPER(xto, s)
{
@@ -114,6 +153,12 @@ F_HELPER(xto, d)
{
DT0 = int64_to_float64(*((int64_t *)&DT1), &env->fp_status);
}
+#if defined(CONFIG_USER_ONLY)
+F_HELPER(xto, q)
+{
+ QT0 = int64_to_float128(*((int64_t *)&DT1), &env->fp_status);
+}
+#endif
#endif
#undef F_HELPER
@@ -128,6 +173,28 @@ void helper_fstod(void)
DT0 = float32_to_float64(FT1, &env->fp_status);
}
+#if defined(CONFIG_USER_ONLY)
+void helper_fqtos(void)
+{
+ FT0 = float128_to_float32(QT1, &env->fp_status);
+}
+
+void helper_fstoq(void)
+{
+ QT0 = float32_to_float128(FT1, &env->fp_status);
+}
+
+void helper_fqtod(void)
+{
+ DT0 = float128_to_float64(QT1, &env->fp_status);
+}
+
+void helper_fdtoq(void)
+{
+ QT0 = float64_to_float128(DT1, &env->fp_status);
+}
+#endif
+
/* Float to integer conversion. */
void helper_fstoi(void)
{
@@ -139,6 +206,13 @@ void helper_fdtoi(void)
*((int32_t *)&FT0) = float64_to_int32_round_to_zero(DT1, &env->fp_status);
}
+#if defined(CONFIG_USER_ONLY)
+void helper_fqtoi(void)
+{
+ *((int32_t *)&FT0) = float128_to_int32_round_to_zero(QT1, &env->fp_status);
+}
+#endif
+
#ifdef TARGET_SPARC64
void helper_fstox(void)
{
@@ -150,6 +224,13 @@ void helper_fdtox(void)
*((int64_t *)&DT0) = float64_to_int64_round_to_zero(DT1, &env->fp_status);
}
+#if defined(CONFIG_USER_ONLY)
+void helper_fqtox(void)
+{
+ *((int64_t *)&DT0) = float128_to_int64_round_to_zero(QT1, &env->fp_status);
+}
+#endif
+
void helper_faligndata(void)
{
uint64_t tmp;
@@ -637,6 +718,13 @@ void helper_fabsd(void)
{
DT0 = float64_abs(DT1);
}
+
+#if defined(CONFIG_USER_ONLY)
+void helper_fabsq(void)
+{
+ QT0 = float128_abs(QT1);
+}
+#endif
#endif
void helper_fsqrts(void)
@@ -649,6 +737,13 @@ void helper_fsqrtd(void)
DT0 = float64_sqrt(DT1, &env->fp_status);
}
+#if defined(CONFIG_USER_ONLY)
+void helper_fsqrtq(void)
+{
+ QT0 = float128_sqrt(QT1, &env->fp_status);
+}
+#endif
+
#define GEN_FCMP(name, size, reg1, reg2, FS, TRAP) \
void glue(helper_, name) (void) \
{ \
@@ -686,6 +781,11 @@ GEN_FCMP(fcmpd, float64, DT0, DT1, 0, 0);
GEN_FCMP(fcmpes, float32, FT0, FT1, 0, 1);
GEN_FCMP(fcmped, float64, DT0, DT1, 0, 1);
+#ifdef CONFIG_USER_ONLY
+GEN_FCMP(fcmpq, float128, QT0, QT1, 0, 0);
+GEN_FCMP(fcmpeq, float128, QT0, QT1, 0, 1);
+#endif
+
#ifdef TARGET_SPARC64
GEN_FCMP(fcmps_fcc1, float32, FT0, FT1, 22, 0);
GEN_FCMP(fcmpd_fcc1, float64, DT0, DT1, 22, 0);
@@ -704,6 +804,14 @@ GEN_FCMP(fcmped_fcc2, float64, DT0, DT1, 24, 1);
GEN_FCMP(fcmpes_fcc3, float32, FT0, FT1, 26, 1);
GEN_FCMP(fcmped_fcc3, float64, DT0, DT1, 26, 1);
+#ifdef CONFIG_USER_ONLY
+GEN_FCMP(fcmpq_fcc1, float128, QT0, QT1, 22, 0);
+GEN_FCMP(fcmpq_fcc2, float128, QT0, QT1, 24, 0);
+GEN_FCMP(fcmpq_fcc3, float128, QT0, QT1, 26, 0);
+GEN_FCMP(fcmpeq_fcc1, float128, QT0, QT1, 22, 1);
+GEN_FCMP(fcmpeq_fcc2, float128, QT0, QT1, 24, 1);
+GEN_FCMP(fcmpeq_fcc3, float128, QT0, QT1, 26, 1);
+#endif
#endif
#if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) && defined(DEBUG_MXCC)