diff options
| author | j_mayer | 2007-10-27 19:18:49 +0200 |
|---|---|---|
| committer | j_mayer | 2007-10-27 19:18:49 +0200 |
| commit | 8378e71f136a021e795d41ceae64eedadcff291c (patch) | |
| tree | 3897ae371660bce17d18975a443e4e083042c373 | |
| parent | Add sharable clz/clo inline functions and use them for the mips target. (diff) | |
| download | qemu-8378e71f136a021e795d41ceae64eedadcff291c.tar.gz qemu-8378e71f136a021e795d41ceae64eedadcff291c.tar.xz qemu-8378e71f136a021e795d41ceae64eedadcff291c.zip | |
Fix endianness bug for PowerPC stfiwx instruction.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3456 c046a42c-6fe2-441c-8c8c-71466251a162
| -rw-r--r-- | target-ppc/op_mem.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/target-ppc/op_mem.h b/target-ppc/op_mem.h index ca48f5de0a..b1daf848d4 100644 --- a/target-ppc/op_mem.h +++ b/target-ppc/op_mem.h @@ -411,17 +411,26 @@ static always_inline void glue(stfs, MEMSUFFIX) (target_ulong EA, double d) glue(stfl, MEMSUFFIX)(EA, float64_to_float32(d, &env->fp_status)); } +#if defined(WORDS_BIGENDIAN) +#define WORD0 0 +#define WORD1 1 +#else +#define WORD0 1 +#define WORD1 0 +#endif static always_inline void glue(stfiwx, MEMSUFFIX) (target_ulong EA, double d) { union { double d; - uint64_t u; + uint32_t u[2]; } u; /* Store the low order 32 bits without any conversion */ u.d = d; - glue(stl, MEMSUFFIX)(EA, u.u); + glue(stl, MEMSUFFIX)(EA, u.u[WORD0]); } +#undef WORD0 +#undef WORD1 PPC_STF_OP(fd, stfq); PPC_STF_OP(fs, stfs); |
