aboutsummaryrefslogtreecommitdiff
path: root/target-sh4/op.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-25 13:53:11 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-25 13:53:11 +0000
commite04ea3dc1a6997aa0d2eb8b21170b81f9151d37d (patch)
tree60f7712489bedabee79fa8ba6ddacc4f45f58ed9 /target-sh4/op.c
parent0ae045ae439ad83692ad039a554f7d62acf9de5c (diff)
Handle endianness of double floats, by Magnus Damm.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3020 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sh4/op.c')
-rw-r--r--target-sh4/op.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/target-sh4/op.c b/target-sh4/op.c
index f45c2f4677..34e271524e 100644
--- a/target-sh4/op.c
+++ b/target-sh4/op.c
@@ -698,37 +698,49 @@ void OPPROTO op_movl_imm_rN(void)
void OPPROTO op_fmov_frN_FT0(void)
{
- FT0 = *(float32 *)&env->fregs[PARAM1];
+ FT0 = env->fregs[PARAM1];
RETURN();
}
void OPPROTO op_fmov_drN_DT0(void)
{
- DT0 = *(float64 *)&env->fregs[PARAM1];
+ CPU_DoubleU d;
+
+ d.l.upper = *(uint32_t *)&env->fregs[PARAM1];
+ d.l.lower = *(uint32_t *)&env->fregs[PARAM1 + 1];
+ DT0 = d.d;
RETURN();
}
void OPPROTO op_fmov_frN_FT1(void)
{
- FT1 = *(float32 *)&env->fregs[PARAM1];
+ FT1 = env->fregs[PARAM1];
RETURN();
}
void OPPROTO op_fmov_drN_DT1(void)
{
- DT1 = *(float64 *)&env->fregs[PARAM1];
+ CPU_DoubleU d;
+
+ d.l.upper = *(uint32_t *)&env->fregs[PARAM1];
+ d.l.lower = *(uint32_t *)&env->fregs[PARAM1 + 1];
+ DT1 = d.d;
RETURN();
}
void OPPROTO op_fmov_FT0_frN(void)
{
- *(float32 *)&env->fregs[PARAM1] = FT0;
+ env->fregs[PARAM1] = FT0;
RETURN();
}
void OPPROTO op_fmov_DT0_drN(void)
{
- *(float64 *)&env->fregs[PARAM1] = DT0;
+ CPU_DoubleU d;
+
+ d.d = DT0;
+ *(uint32_t *)&env->fregs[PARAM1] = d.l.upper;
+ *(uint32_t *)&env->fregs[PARAM1 + 1] = d.l.lower;
RETURN();
}