diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-02-15 23:06:19 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-02-15 23:06:19 +0000 |
commit | 3cc6237083cd40247e060c1fcf403a2d9ccbaf92 (patch) | |
tree | ffae14fb7d2721bb246cb21a44718f39b4ca6fcf /target-ppc/op_helper.c | |
parent | c4decf377c314c48795ddd3ead1ce3d2ea981ca0 (diff) |
ppc fixes (Jocelyn Mayer)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1297 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 433f6b1284..20aba8b6eb 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -188,10 +188,17 @@ void do_load_fpscr (void) } u; int i; - u.s.u[0] = 0; - u.s.u[1] = 0; +#ifdef WORDS_BIGENDIAN +#define WORD0 0 +#define WORD1 1 +#else +#define WORD0 1 +#define WORD1 0 +#endif + u.s.u[WORD0] = 0; + u.s.u[WORD1] = 0; for (i = 0; i < 8; i++) - u.s.u[1] |= env->fpscr[i] << (4 * i); + u.s.u[WORD1] |= env->fpscr[i] << (4 * i); FT0 = u.d; } @@ -210,10 +217,10 @@ void do_store_fpscr (uint32_t mask) u.d = FT0; if (mask & 0x80) - env->fpscr[0] = (env->fpscr[0] & 0x9) | ((u.s.u[1] >> 28) & ~0x9); + env->fpscr[0] = (env->fpscr[0] & 0x9) | ((u.s.u[WORD1] >> 28) & ~0x9); for (i = 1; i < 7; i++) { if (mask & (1 << (7 - i))) - env->fpscr[i] = (u.s.u[1] >> (4 * (7 - i))) & 0xF; + env->fpscr[i] = (u.s.u[WORD1] >> (4 * (7 - i))) & 0xF; } /* TODO: update FEX & VX */ /* Set rounding mode */ |