提交 8378e71f 编写于 作者: J j_mayer

Fix endianness bug for PowerPC stfiwx instruction.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3456 c046a42c-6fe2-441c-8c8c-71466251a162
上级 05f778c8
...@@ -411,17 +411,26 @@ static always_inline void glue(stfs, MEMSUFFIX) (target_ulong EA, double d) ...@@ -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)); 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) static always_inline void glue(stfiwx, MEMSUFFIX) (target_ulong EA, double d)
{ {
union { union {
double d; double d;
uint64_t u; uint32_t u[2];
} u; } u;
/* Store the low order 32 bits without any conversion */ /* Store the low order 32 bits without any conversion */
u.d = d; 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(fd, stfq);
PPC_STF_OP(fs, stfs); PPC_STF_OP(fs, stfs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册