aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-13 19:19:16 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-13 19:19:16 +0000
commit0ca9d3807c8c429f7b21ffcac7f7acdd4d9659b0 (patch)
treec02e1af408f30d5564f048239336c75d62a67997 /target-ppc/op.c
parent6b59fc74b5b811664e4621e65b64e39c501249be (diff)
Use float32/64 instead of float/double
The patch below uses the float32 and float64 types instead of the float and double types in the PPC code. This doesn't change anything when using softfloat-native as the types are the same, but that helps compiling the PPC target with softfloat. It also defines a new union CPU_FloatU in addition to CPU_DoubleU, and use them instead of identical unions that are defined in numerous places. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4047 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op.c')
-rw-r--r--target-ppc/op.c85
1 files changed, 27 insertions, 58 deletions
diff --git a/target-ppc/op.c b/target-ppc/op.c
index 6cda0f0f64..972b8bc29d 100644
--- a/target-ppc/op.c
+++ b/target-ppc/op.c
@@ -580,47 +580,28 @@ void OPPROTO op_float_check_status (void)
}
#endif
-#if defined(WORDS_BIGENDIAN)
-#define WORD0 0
-#define WORD1 1
-#else
-#define WORD0 1
-#define WORD1 0
-#endif
void OPPROTO op_load_fpscr_FT0 (void)
{
/* The 32 MSB of the target fpr are undefined.
* They'll be zero...
*/
- union {
- float64 d;
- struct {
- uint32_t u[2];
- } s;
- } u;
-
- u.s.u[WORD0] = 0;
- u.s.u[WORD1] = env->fpscr;
+ CPU_DoubleU u;
+
+ u.l.upper = 0;
+ u.l.lower = env->fpscr;
FT0 = u.d;
RETURN();
}
void OPPROTO op_set_FT0 (void)
{
- union {
- float64 d;
- struct {
- uint32_t u[2];
- } s;
- } u;
+ CPU_DoubleU u;
- u.s.u[WORD0] = 0;
- u.s.u[WORD1] = PARAM1;
+ u.l.upper = 0;
+ u.l.lower = PARAM1;
FT0 = u.d;
RETURN();
}
-#undef WORD0
-#undef WORD1
void OPPROTO op_load_fpscr_T0 (void)
{
@@ -3226,27 +3207,21 @@ void OPPROTO op_efststeq (void)
void OPPROTO op_efdsub (void)
{
- union {
- uint64_t u;
- float64 f;
- } u1, u2;
- u1.u = T0_64;
- u2.u = T1_64;
- u1.f = float64_sub(u1.f, u2.f, &env->spe_status);
- T0_64 = u1.u;
+ CPU_DoubleU u1, u2;
+ u1.ll = T0_64;
+ u2.ll = T1_64;
+ u1.d = float64_sub(u1.d, u2.d, &env->spe_status);
+ T0_64 = u1.ll;
RETURN();
}
void OPPROTO op_efdadd (void)
{
- union {
- uint64_t u;
- float64 f;
- } u1, u2;
- u1.u = T0_64;
- u2.u = T1_64;
- u1.f = float64_add(u1.f, u2.f, &env->spe_status);
- T0_64 = u1.u;
+ CPU_DoubleU u1, u2;
+ u1.ll = T0_64;
+ u2.ll = T1_64;
+ u1.d = float64_add(u1.d, u2.d, &env->spe_status);
+ T0_64 = u1.ll;
RETURN();
}
@@ -3282,27 +3257,21 @@ void OPPROTO op_efdneg (void)
void OPPROTO op_efddiv (void)
{
- union {
- uint64_t u;
- float64 f;
- } u1, u2;
- u1.u = T0_64;
- u2.u = T1_64;
- u1.f = float64_div(u1.f, u2.f, &env->spe_status);
- T0_64 = u1.u;
+ CPU_DoubleU u1, u2;
+ u1.ll = T0_64;
+ u2.ll = T1_64;
+ u1.d = float64_div(u1.d, u2.d, &env->spe_status);
+ T0_64 = u1.ll;
RETURN();
}
void OPPROTO op_efdmul (void)
{
- union {
- uint64_t u;
- float64 f;
- } u1, u2;
- u1.u = T0_64;
- u2.u = T1_64;
- u1.f = float64_mul(u1.f, u2.f, &env->spe_status);
- T0_64 = u1.u;
+ CPU_DoubleU u1, u2;
+ u1.ll = T0_64;
+ u2.ll = T1_64;
+ u1.d = float64_mul(u1.d, u2.d, &env->spe_status);
+ T0_64 = u1.ll;
RETURN();
}