Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 463a8c01 authored by Liu Yu's avatar Liu Yu Committed by Kumar Gala
Browse files

powerpc/math-emu: Adopt new version of _FP_CHOOSENAN



Move to using the same macro definition for _FP_CHOOSENAN as s390,
sh, sparc32/64.  The original author didn't understand this and
matched what sparc64 was doing and they have updated to this definition.

Signed-off-by: default avatarLiu Yu <yu.liu@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent cf030336
Loading
Loading
Loading
Loading
+17 −9
Original line number Original line Diff line number Diff line
@@ -111,15 +111,23 @@
#define FP_EX_DIVZERO         (1 << (31 - 5))
#define FP_EX_DIVZERO         (1 << (31 - 5))
#define FP_EX_INEXACT         (1 << (31 - 6))
#define FP_EX_INEXACT         (1 << (31 - 6))


/* This macro appears to be called when both X and Y are NaNs, and
/*
 * has to choose one and copy it to R. i386 goes for the larger of the
 * If one NaN is signaling and the other is not,
 * two, sparc64 just picks Y. I don't understand this at all so I'll
 * we choose that one, otherwise we choose X.
 * go with sparc64 because it's shorter :->   -- PMM
 */
 */
#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
  do {								\
  do {								\
    if ((_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)		\
	&& !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))	\
      {								\
	R##_s = X##_s;						\
	_FP_FRAC_COPY_##wc(R,X);				\
      }								\
    else							\
      {								\
	R##_s = Y##_s;						\
	R##_s = Y##_s;						\
	_FP_FRAC_COPY_##wc(R,Y);				\
	_FP_FRAC_COPY_##wc(R,Y);				\
      }								\
    R##_c = FP_CLS_NAN;						\
    R##_c = FP_CLS_NAN;						\
  } while (0)
  } while (0)