float128-ifunc.c: Don't include auxv.h.

libgcc/
	* config/rs6000/float128-ifunc.c: Don't include auxv.h.
	(have_ieee_hw_p): Delete function.
	(SW_OR_HW) Use __builtin_cpu_supports().

From-SVN: r250061
This commit is contained in:
Peter Bergner 2017-07-07 16:08:42 -05:00
parent 738f7c2e12
commit d4391a62cb
2 changed files with 8 additions and 42 deletions

View File

@ -1,10 +1,16 @@
2017-07-07 Peter Bergner <bergner@vnet.ibm.com>
* config/rs6000/float128-ifunc.c: Don't include auxv.h.
(have_ieee_hw_p): Delete function.
(SW_OR_HW) Use __builtin_cpu_supports().
2017-07-06 Thomas Preud'homme <thomas.preudhomme@arm.com> 2017-07-06 Thomas Preud'homme <thomas.preudhomme@arm.com>
* config/arm/lib1funcs.S: Defined __ARM_ARCH__ to 8 for ARMv8-R. * config/arm/lib1funcs.S: Defined __ARM_ARCH__ to 8 for ARMv8-R.
2017-07-03 Olivier Hainque <hainque@adacore.com> 2017-07-03 Olivier Hainque <hainque@adacore.com>
* config/t-vxworks7: New file, really. * config/t-vxworks7: New file, really.
2017-06-28 Joseph Myers <joseph@codesourcery.com> 2017-06-28 Joseph Myers <joseph@codesourcery.com>

View File

@ -45,47 +45,7 @@
#error "This module must not be compiled with IEEE 128-bit hardware support" #error "This module must not be compiled with IEEE 128-bit hardware support"
#endif #endif
#include <sys/auxv.h> #define SW_OR_HW(SW, HW) (__builtin_cpu_supports ("ieee128") ? HW : SW)
/* Use the namespace clean version of getauxval. However, not all versions of
sys/auxv.h declare it, so declare it here. This code is intended to be
temporary until a suitable version of __builtin_cpu_supports is added that
allows us to tell quickly if the machine supports IEEE 128-bit hardware. */
extern unsigned long __getauxval (unsigned long);
static int
have_ieee_hw_p (void)
{
static int ieee_hw_p = -1;
if (ieee_hw_p < 0)
{
char *p = (char *) __getauxval (AT_PLATFORM);
ieee_hw_p = 0;
/* Don't use atoi/strtol/strncmp/etc. These may require the normal
environment to be setup to set errno to 0, and the ifunc resolvers run
before the whole glibc environment is initialized. */
if (p && p[0] == 'p' && p[1] == 'o' && p[2] == 'w' && p[3] == 'e'
&& p[4] == 'r')
{
long n = 0;
char ch;
p += 5;
while ((ch = *p++) >= '0' && (ch <= '9'))
n = (n * 10) + (ch - '0');
if (n >= 9)
ieee_hw_p = 1;
}
}
return ieee_hw_p;
}
#define SW_OR_HW(SW, HW) (have_ieee_hw_p () ? HW : SW)
/* Resolvers. */ /* Resolvers. */