aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op.c
diff options
context:
space:
mode:
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();
}