qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6103] Fix VFP fixed point conversion routines.
@ 2008-12-19 13:02 Paul Brook
  0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2008-12-19 13:02 UTC (permalink / raw)
  To: qemu-devel

Revision: 6103
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6103
Author:   pbrook
Date:     2008-12-19 13:02:08 +0000 (Fri, 19 Dec 2008)

Log Message:
-----------
Fix VFP fixed point conversion routines.


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

Modified Paths:
--------------
    trunk/target-arm/helper.c
    trunk/target-arm/translate.c

Modified: trunk/target-arm/helper.c
===================================================================
--- trunk/target-arm/helper.c	2008-12-19 12:59:28 UTC (rev 6102)
+++ trunk/target-arm/helper.c	2008-12-19 13:02:08 UTC (rev 6103)
@@ -2522,7 +2522,7 @@
     ftype tmp; \
     tmp = sign##int32_to_##ftype ((itype)vfp_##p##toi(x), \
                                   &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) \
 { \

Modified: trunk/target-arm/translate.c
===================================================================
--- trunk/target-arm/translate.c	2008-12-19 12:59:28 UTC (rev 6102)
+++ trunk/target-arm/translate.c	2008-12-19 13:02:08 UTC (rev 6103)
@@ -3001,6 +3001,10 @@
                 case 21:
                 case 22:
                 case 23:
+                case 28:
+                case 29:
+                case 30:
+                case 31:
                     /* Source and destination the same.  */
                     gen_mov_F0_vreg(dp, rd);
                     break;
@@ -3120,22 +3124,22 @@
                     case 20: /* fshto */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_shto(dp, rm);
+                        gen_vfp_shto(dp, 16 - rm);
                         break;
                     case 21: /* fslto */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_slto(dp, rm);
+                        gen_vfp_slto(dp, 32 - rm);
                         break;
                     case 22: /* fuhto */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_uhto(dp, rm);
+                        gen_vfp_uhto(dp, 16 - rm);
                         break;
                     case 23: /* fulto */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_ulto(dp, rm);
+                        gen_vfp_ulto(dp, 32 - rm);
                         break;
                     case 24: /* ftoui */
                         gen_vfp_toui(dp);
@@ -3152,22 +3156,22 @@
                     case 28: /* ftosh */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_tosh(dp, rm);
+                        gen_vfp_tosh(dp, 16 - rm);
                         break;
                     case 29: /* ftosl */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_tosl(dp, rm);
+                        gen_vfp_tosl(dp, 32 - rm);
                         break;
                     case 30: /* ftouh */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_touh(dp, rm);
+                        gen_vfp_touh(dp, 16 - rm);
                         break;
                     case 31: /* ftoul */
                         if (!arm_feature(env, ARM_FEATURE_VFP3))
                           return 1;
-                        gen_vfp_toul(dp, rm);
+                        gen_vfp_toul(dp, 32 - rm);
                         break;
                     default: /* undefined */
                         printf ("rn:%d\n", rn);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-19 13:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-19 13:02 [Qemu-devel] [6103] Fix VFP fixed point conversion routines Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).