* config/cpu/sparc/sparc64/bits/atomicity.h (__exchange_and_add):
Use extended word instructions to match 64bit _Atomic_word.
(__atomic_add): Likewise.
* math/clog10l.c (clog10l): Use M_PIl if defined.
* math/c_logl.c (c_logl): Likewise.
* math/signbitl.c (__signbitl): Adapt for IEEE quad long doubles.
* math/mathconf.h (ieee_quad_double_shape_type): New type.
(GET_LDOUBLE_MSW64): New define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35166
138bc75d-0d04-0410-961f-
82ee72b054a4
{
_Atomic_word __tmp1, __tmp2;
- __asm__ __volatile__("1: lduw [%2], %0\n\t"
+ __asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
- " cas [%2], %0, %1\n\t"
+ " casx [%2], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
{
_Atomic_word __tmp1, __tmp2;
- __asm__ __volatile__("1: lduw [%2], %0\n\t"
+ __asm__ __volatile__("1: ldx [%2], %0\n\t"
" add %0, %3, %1\n\t"
- " cas [%2], %0, %1\n\t"
+ " casx [%2], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
the GNU General Public License. */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
#include <math.h>
#include "mathconf.h"
+#ifndef M_PIl
+#define M_PIl M_PI
+#endif
/* Thanks to SGI we have to trick here. At least Irix 6.2 provides hypotl,
but it has a wrong prototype. Grrr. */
if (x == 0.0)
{
/* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
+ __imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
__imag__ result = copysignl (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsl (__real__ x);
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
#include <math.h>
#include "mathconf.h"
+#ifndef M_PIl
+#define M_PIl M_PI
+#endif
/* Thanks to SGI we have to trick here. At least Irix 6.2 provides hypotl,
but it has a wrong prototype. Grrr. */
if (x == 0.0)
{
/* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
+ __imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
__imag__ result = copysignl (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsl (__real__ x);
typedef unsigned int U_int32_t __attribute ((mode (SI)));
typedef int Int32_t __attribute ((mode (SI)));
+typedef unsigned int U_int64_t __attribute ((mode (DI)));
+typedef int Uint64_t __attribute ((mode (DI)));
#ifdef _GLIBCPP_HAVE_NAN_H
# include <nan.h>
(exp) = ge_u.parts.sign_exponent; \
} while (0)
+#if BYTE_ORDER == BIG_ENDIAN
+typedef union
+{
+ long double value;
+ struct
+ {
+ U_int64_t msw;
+ U_int64_t lsw;
+ } parts64;
+ struct
+ {
+ U_int32_t w0, w1, w2, w3;
+ } parts32;
+} ieee_quad_double_shape_type;
+#endif
+#if BYTE_ORDER == LITTLE_ENDIAN
+typedef union
+{
+ long double value;
+ struct
+ {
+ U_int64_t lsw;
+ U_int64_t msw;
+ } parts64;
+ struct
+ {
+ U_int32_t w3, w2, w1, w0;
+ } parts32;
+} ieee_quad_double_shape_type;
+#endif
+/* Get most significant 64 bit int from a quad long double. */
+#define GET_LDOUBLE_MSW64(msw,d) \
+do { \
+ ieee_quad_double_shape_type qw_u; \
+ qw_u.value = (d); \
+ (ix0) = qw_u.parts64.msw; \
+} while (0)
+
/* Replacement for non-existing float functions. */
#if !defined(_GLIBCPP_HAVE_FABSF) && !defined(_GLIBCPP_HAVE___BUILTIN_FABSF)
invalidate any other reasons why the executable file might be covered by
the GNU General Public License. */
+#include <float.h>
#include <math.h>
#include "mathconf.h"
int
__signbitl (long double x)
{
+#if LDBL_MANT_DIG == 113
+ Int64_t msw;
+
+ GET_LDOUBLE_MSW64 (msw, x);
+ return msw < 0;
+#else
Int32_t e;
GET_LDOUBLE_EXP (e, x);
return e & 0x8000;
+#endif
}