aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/sfp-machine.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h
index da12ea79cb99..88af036b1fef 100644
--- a/arch/powerpc/include/asm/sfp-machine.h
+++ b/arch/powerpc/include/asm/sfp-machine.h
@@ -111,16 +111,24 @@
111#define FP_EX_DIVZERO (1 << (31 - 5)) 111#define FP_EX_DIVZERO (1 << (31 - 5))
112#define FP_EX_INEXACT (1 << (31 - 6)) 112#define FP_EX_INEXACT (1 << (31 - 6))
113 113
114/* This macro appears to be called when both X and Y are NaNs, and 114/*
115 * has to choose one and copy it to R. i386 goes for the larger of the 115 * If one NaN is signaling and the other is not,
116 * two, sparc64 just picks Y. I don't understand this at all so I'll 116 * we choose that one, otherwise we choose X.
117 * go with sparc64 because it's shorter :-> -- PMM
118 */ 117 */
119#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ 118#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
120 do { \ 119 do { \
121 R##_s = Y##_s; \ 120 if ((_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs) \
122 _FP_FRAC_COPY_##wc(R,Y); \ 121 && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \
123 R##_c = FP_CLS_NAN; \ 122 { \
123 R##_s = X##_s; \
124 _FP_FRAC_COPY_##wc(R,X); \
125 } \
126 else \
127 { \
128 R##_s = Y##_s; \
129 _FP_FRAC_COPY_##wc(R,Y); \
130 } \
131 R##_c = FP_CLS_NAN; \
124 } while (0) 132 } while (0)
125 133
126 134