~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to debian/patches/arm64/0049-softfloat-Add-minNum-and-maxNum-functions-to-softflo.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 78a735b4ddae51f19cc32441d29625f864dfba78 Mon Sep 17 00:00:00 2001
2
 
From: Will Newton <will.newton@linaro.org>
3
 
Date: Fri, 6 Dec 2013 17:01:41 +0000
4
 
Subject: [PATCH 49/49] softfloat: Add minNum() and maxNum() functions to
5
 
 softfloat.
6
 
 
7
 
Add floatnn_minnum() and floatnn_maxnum() functions which are equivalent
8
 
to the minNum() and maxNum() functions from IEEE 754-2008. They are
9
 
similar to min() and max() but differ in the handling of QNaN arguments.
10
 
 
11
 
Signed-off-by: Will Newton <will.newton@linaro.org>
12
 
Message-id: 1386158099-9239-5-git-send-email-will.newton@linaro.org
13
 
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
 
---
15
 
 fpu/softfloat.c         | 32 +++++++++++++++++++++++++++++---
16
 
 include/fpu/softfloat.h |  4 ++++
17
 
 2 files changed, 33 insertions(+), 3 deletions(-)
18
 
 
19
 
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
20
 
index 7ba51b6..a3ca7e0 100644
21
 
--- a/fpu/softfloat.c
22
 
+++ b/fpu/softfloat.c
23
 
@@ -6705,10 +6705,17 @@ int float128_compare_quiet( float128 a, float128 b STATUS_PARAM )
24
 
 /* min() and max() functions. These can't be implemented as
25
 
  * 'compare and pick one input' because that would mishandle
26
 
  * NaNs and +0 vs -0.
27
 
+ *
28
 
+ * minnum() and maxnum() functions. These are similar to the min()
29
 
+ * and max() functions but if one of the arguments is a QNaN and
30
 
+ * the other is numerical then the numerical argument is returned.
31
 
+ * minnum() and maxnum correspond to the IEEE 754-2008 minNum()
32
 
+ * and maxNum() operations. min() and max() are the typical min/max
33
 
+ * semantics provided by many CPUs which predate that specification.
34
 
  */
35
 
 #define MINMAX(s, nan_exp)                                              \
36
 
 INLINE float ## s float ## s ## _minmax(float ## s a, float ## s b,     \
37
 
-                                        int ismin STATUS_PARAM )        \
38
 
+                                        int ismin, int isieee STATUS_PARAM) \
39
 
 {                                                                       \
40
 
     flag aSign, bSign;                                                  \
41
 
     uint ## s ## _t av, bv;                                             \
42
 
@@ -6716,6 +6723,15 @@ INLINE float ## s float ## s ## _minmax(float ## s a, float ## s b,     \
43
 
     b = float ## s ## _squash_input_denormal(b STATUS_VAR);             \
44
 
     if (float ## s ## _is_any_nan(a) ||                                 \
45
 
         float ## s ## _is_any_nan(b)) {                                 \
46
 
+        if (isieee) {                                                   \
47
 
+            if (float ## s ## _is_quiet_nan(a) &&                       \
48
 
+                !float ## s ##_is_any_nan(b)) {                         \
49
 
+                return b;                                               \
50
 
+            } else if (float ## s ## _is_quiet_nan(b) &&                \
51
 
+                       !float ## s ## _is_any_nan(a)) {                 \
52
 
+                return a;                                               \
53
 
+            }                                                           \
54
 
+        }                                                               \
55
 
         return propagateFloat ## s ## NaN(a, b STATUS_VAR);             \
56
 
     }                                                                   \
57
 
     aSign = extractFloat ## s ## Sign(a);                               \
58
 
@@ -6739,12 +6755,22 @@ INLINE float ## s float ## s ## _minmax(float ## s a, float ## s b,     \
59
 
                                                                         \
60
 
 float ## s float ## s ## _min(float ## s a, float ## s b STATUS_PARAM)  \
61
 
 {                                                                       \
62
 
-    return float ## s ## _minmax(a, b, 1 STATUS_VAR);                   \
63
 
+    return float ## s ## _minmax(a, b, 1, 0 STATUS_VAR);                \
64
 
 }                                                                       \
65
 
                                                                         \
66
 
 float ## s float ## s ## _max(float ## s a, float ## s b STATUS_PARAM)  \
67
 
 {                                                                       \
68
 
-    return float ## s ## _minmax(a, b, 0 STATUS_VAR);                   \
69
 
+    return float ## s ## _minmax(a, b, 0, 0 STATUS_VAR);                \
70
 
+}                                                                       \
71
 
+                                                                        \
72
 
+float ## s float ## s ## _minnum(float ## s a, float ## s b STATUS_PARAM) \
73
 
+{                                                                       \
74
 
+    return float ## s ## _minmax(a, b, 1, 1 STATUS_VAR);                \
75
 
+}                                                                       \
76
 
+                                                                        \
77
 
+float ## s float ## s ## _maxnum(float ## s a, float ## s b STATUS_PARAM) \
78
 
+{                                                                       \
79
 
+    return float ## s ## _minmax(a, b, 0, 1 STATUS_VAR);                \
80
 
 }
81
 
 
82
 
 MINMAX(32, 0xff)
83
 
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
84
 
index f3927e2..2365274 100644
85
 
--- a/include/fpu/softfloat.h
86
 
+++ b/include/fpu/softfloat.h
87
 
@@ -302,6 +302,8 @@ int float32_compare( float32, float32 STATUS_PARAM );
88
 
 int float32_compare_quiet( float32, float32 STATUS_PARAM );
89
 
 float32 float32_min(float32, float32 STATUS_PARAM);
90
 
 float32 float32_max(float32, float32 STATUS_PARAM);
91
 
+float32 float32_minnum(float32, float32 STATUS_PARAM);
92
 
+float32 float32_maxnum(float32, float32 STATUS_PARAM);
93
 
 int float32_is_quiet_nan( float32 );
94
 
 int float32_is_signaling_nan( float32 );
95
 
 float32 float32_maybe_silence_nan( float32 );
96
 
@@ -408,6 +410,8 @@ int float64_compare( float64, float64 STATUS_PARAM );
97
 
 int float64_compare_quiet( float64, float64 STATUS_PARAM );
98
 
 float64 float64_min(float64, float64 STATUS_PARAM);
99
 
 float64 float64_max(float64, float64 STATUS_PARAM);
100
 
+float64 float64_minnum(float64, float64 STATUS_PARAM);
101
 
+float64 float64_maxnum(float64, float64 STATUS_PARAM);
102
 
 int float64_is_quiet_nan( float64 a );
103
 
 int float64_is_signaling_nan( float64 );
104
 
 float64 float64_maybe_silence_nan( float64 );
105
 
1.8.5.2
106