PR libgcc/67624
libgcc:
* config/arm/fp16.c (__gnu_f2h_internal): Handle infinity correctly.
gcc/testsuite:
* gcc.target/arm/fp16-inf.c: New test.
From-SVN: r228082
+2015-09-24 Richard Earnshaw <rearnsha@arm.com>
+
+ PR libgcc/67624
+ * gcc.target/arm/fp16-inf.c: New test.
+
2015-09-24 Kirill Yukhin <kirill.yukhin@intel.com>
* gcc.target/i386/avx512vbmi-check.h (main): Fix register
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O -mfp16-format=ieee" } */
+
+/* Conversion of infinity to __fp16 and back again should preserve the
+ value. */
+volatile float f = __builtin_inf ();
+
+int main ()
+{
+ __fp16 h = f;
+ if (h != __builtin_inf ())
+ __builtin_abort ();
+ return 0;
+}
+2015-09-24 Richard Earnshaw <rearnsha@arm.com>
+
+ PR libgcc/67624
+ * config/arm/fp16.c (__gnu_f2h_internal): Handle infinity correctly.
+
2015-09-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config.host (*-*-solaris2*): Add t-crtstuff-pic to tmake_file.
{
if (!ieee)
return sign;
+ if (mantissa == 0)
+ return sign | 0x7c00; /* Infinity. */
+ /* Remaining cases are NaNs. Convert SNaN to QNaN. */
return sign | 0x7e00 | (mantissa >> 13);
}
-
+
if (aexp == 0 && mantissa == 0)
return sign;
{
mask = 0x00ffffff;
if (aexp >= -25)
- mask >>= 25 + aexp;
+ mask >>= 25 + aexp;
}
else
mask = 0x00001fff;