~ubuntu-branches/ubuntu/vivid/qemu/vivid

« back to all changes in this revision

Viewing changes to debian/patches/ubuntu/arm64/0102-target-arm-Prepare-VFP_CONV_FIX-helpers-for-A64-uses.patch

  • Committer: Package Import Robot
  • Author(s): dann frazier
  • Date: 2014-02-11 15:41:53 UTC
  • Revision ID: package-import@ubuntu.com-20140211154153-2d001tf0ium08u81
Tags: 1.7.0+dfsg-3ubuntu2
* Backport changes to enable qemu-user-static support for aarch64
* debian/control: add ppc64el to Architectures
* debian/rules: only install qemu-system-aarch64 on arm64.
  Fixes a FTBFS  when built twice in a row on non-arm64 due to a stale
  debian/qemu-system-aarch64 directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 2b72a5ecbd70249e50c8b6458e8e4acbc8f93071 Mon Sep 17 00:00:00 2001
 
2
From: Will Newton <will.newton@linaro.org>
 
3
Date: Tue, 7 Jan 2014 17:19:13 +0000
 
4
Subject: [PATCH 102/158] target-arm: Prepare VFP_CONV_FIX helpers for A64 uses
 
5
 
 
6
Make the VFP_CONV_FIX helpers a little more flexible in
 
7
preparation for the A64 uses. This requires two changes:
 
8
 * use the correct softfloat conversion function based on itype
 
9
   rather than always the int32 one; this is possible now that
 
10
   softfloat provides int16 versions and necessary for the
 
11
   future conversion-to-int64 A64 variants. This also allows
 
12
   us to drop the awkward 'sign' macro argument.
 
13
 * split the 'fsz' argument which currently controls both
 
14
   width of the input float type and width of the output
 
15
   integer type into two; this will allow us to specify the
 
16
   A64 64-bit-int-to-single conversion function, where the
 
17
   two widths are different.
 
18
 
 
19
We can also drop the (itype##_t) cast now that softfloat
 
20
guarantees that all the itype##_to_float* functions take
 
21
an integer argument of exactly the correct type.
 
22
 
 
23
Signed-off-by: Will Newton <will.newton@linaro.org>
 
24
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 
25
Reviewed-by: Richard Henderson <rth@twiddle.net>
 
26
---
 
27
 target-arm/helper.c | 28 ++++++++++++++--------------
 
28
 1 file changed, 14 insertions(+), 14 deletions(-)
 
29
 
 
30
diff --git a/target-arm/helper.c b/target-arm/helper.c
 
31
index 12d995d..d0754e0 100644
 
32
--- a/target-arm/helper.c
 
33
+++ b/target-arm/helper.c
 
34
@@ -4011,17 +4011,17 @@ float32 VFP_HELPER(fcvts, d)(float64 x, CPUARMState *env)
 
35
 }
 
36
 
 
37
 /* VFP3 fixed point conversion.  */
 
38
-#define VFP_CONV_FIX(name, p, fsz, itype, sign) \
 
39
-float##fsz HELPER(vfp_##name##to##p)(uint##fsz##_t  x, uint32_t shift, \
 
40
-                                    void *fpstp) \
 
41
+#define VFP_CONV_FIX(name, p, fsz, isz, itype)                         \
 
42
+float##fsz HELPER(vfp_##name##to##p)(uint##isz##_t  x, uint32_t shift, \
 
43
+                                     void *fpstp) \
 
44
 { \
 
45
     float_status *fpst = fpstp; \
 
46
     float##fsz tmp; \
 
47
-    tmp = sign##int32_to_##float##fsz((itype##_t)x, fpst); \
 
48
+    tmp = itype##_to_##float##fsz(x, fpst); \
 
49
     return float##fsz##_scalbn(tmp, -(int)shift, fpst); \
 
50
 } \
 
51
-uint##fsz##_t HELPER(vfp_to##name##p)(float##fsz x, uint32_t shift, \
 
52
-                                       void *fpstp) \
 
53
+uint##isz##_t HELPER(vfp_to##name##p)(float##fsz x, uint32_t shift, \
 
54
+                                      void *fpstp) \
 
55
 { \
 
56
     float_status *fpst = fpstp; \
 
57
     float##fsz tmp; \
 
58
@@ -4033,14 +4033,14 @@ uint##fsz##_t HELPER(vfp_to##name##p)(float##fsz x, uint32_t shift, \
 
59
     return float##fsz##_to_##itype##_round_to_zero(tmp, fpst); \
 
60
 }
 
61
 
 
62
-VFP_CONV_FIX(sh, d, 64, int16, )
 
63
-VFP_CONV_FIX(sl, d, 64, int32, )
 
64
-VFP_CONV_FIX(uh, d, 64, uint16, u)
 
65
-VFP_CONV_FIX(ul, d, 64, uint32, u)
 
66
-VFP_CONV_FIX(sh, s, 32, int16, )
 
67
-VFP_CONV_FIX(sl, s, 32, int32, )
 
68
-VFP_CONV_FIX(uh, s, 32, uint16, u)
 
69
-VFP_CONV_FIX(ul, s, 32, uint32, u)
 
70
+VFP_CONV_FIX(sh, d, 64, 64, int16)
 
71
+VFP_CONV_FIX(sl, d, 64, 64, int32)
 
72
+VFP_CONV_FIX(uh, d, 64, 64, uint16)
 
73
+VFP_CONV_FIX(ul, d, 64, 64, uint32)
 
74
+VFP_CONV_FIX(sh, s, 32, 32, int16)
 
75
+VFP_CONV_FIX(sl, s, 32, 32, int32)
 
76
+VFP_CONV_FIX(uh, s, 32, 32, uint16)
 
77
+VFP_CONV_FIX(ul, s, 32, 32, uint32)
 
78
 #undef VFP_CONV_FIX
 
79
 
 
80
 /* Half precision conversions.  */
 
81
-- 
 
82
1.9.rc1
 
83