提交 644ad806 编写于 作者: P pbrook

Fix VFP fixed point conversion routines.

Signed-off-by: NPaul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6103 c046a42c-6fe2-441c-8c8c-71466251a162
上级 69397542
...@@ -2522,7 +2522,7 @@ ftype VFP_HELPER(name##to, p)(ftype x, uint32_t shift, CPUState *env) \ ...@@ -2522,7 +2522,7 @@ ftype VFP_HELPER(name##to, p)(ftype x, uint32_t shift, CPUState *env) \
ftype tmp; \ ftype tmp; \
tmp = sign##int32_to_##ftype ((itype)vfp_##p##toi(x), \ tmp = sign##int32_to_##ftype ((itype)vfp_##p##toi(x), \
&env->vfp.fp_status); \ &env->vfp.fp_status); \
return ftype##_scalbn(tmp, shift, &env->vfp.fp_status); \ return ftype##_scalbn(tmp, -(int)shift, &env->vfp.fp_status); \
} \ } \
ftype VFP_HELPER(to##name, p)(ftype x, uint32_t shift, CPUState *env) \ ftype VFP_HELPER(to##name, p)(ftype x, uint32_t shift, CPUState *env) \
{ \ { \
......
...@@ -3001,6 +3001,10 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn) ...@@ -3001,6 +3001,10 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
case 21: case 21:
case 22: case 22:
case 23: case 23:
case 28:
case 29:
case 30:
case 31:
/* Source and destination the same. */ /* Source and destination the same. */
gen_mov_F0_vreg(dp, rd); gen_mov_F0_vreg(dp, rd);
break; break;
...@@ -3120,22 +3124,22 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn) ...@@ -3120,22 +3124,22 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
case 20: /* fshto */ case 20: /* fshto */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_shto(dp, rm); gen_vfp_shto(dp, 16 - rm);
break; break;
case 21: /* fslto */ case 21: /* fslto */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_slto(dp, rm); gen_vfp_slto(dp, 32 - rm);
break; break;
case 22: /* fuhto */ case 22: /* fuhto */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_uhto(dp, rm); gen_vfp_uhto(dp, 16 - rm);
break; break;
case 23: /* fulto */ case 23: /* fulto */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_ulto(dp, rm); gen_vfp_ulto(dp, 32 - rm);
break; break;
case 24: /* ftoui */ case 24: /* ftoui */
gen_vfp_toui(dp); gen_vfp_toui(dp);
...@@ -3152,22 +3156,22 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn) ...@@ -3152,22 +3156,22 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn)
case 28: /* ftosh */ case 28: /* ftosh */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_tosh(dp, rm); gen_vfp_tosh(dp, 16 - rm);
break; break;
case 29: /* ftosl */ case 29: /* ftosl */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_tosl(dp, rm); gen_vfp_tosl(dp, 32 - rm);
break; break;
case 30: /* ftouh */ case 30: /* ftouh */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_touh(dp, rm); gen_vfp_touh(dp, 16 - rm);
break; break;
case 31: /* ftoul */ case 31: /* ftoul */
if (!arm_feature(env, ARM_FEATURE_VFP3)) if (!arm_feature(env, ARM_FEATURE_VFP3))
return 1; return 1;
gen_vfp_toul(dp, rm); gen_vfp_toul(dp, 32 - rm);
break; break;
default: /* undefined */ default: /* undefined */
printf ("rn:%d\n", rn); printf ("rn:%d\n", rn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册