From: Richard Henderson <rth@twiddle.net>
To: libc-ports@sourceware.org
Subject: [PATCH 2/7] alpha: Remove some __GNUC_PREREQs that are too old
Date: Fri, 15 Jun 2012 19:21:00 -0000 [thread overview]
Message-ID: <1339788037-29519-3-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1339788037-29519-1-git-send-email-rth@twiddle.net>
---
sysdeps/alpha/fpu/cfloat-compat.h | 21 +++------------------
sysdeps/alpha/fpu/s_fabs.c | 7 +------
sysdeps/alpha/fpu/s_fabsf.c | 7 +------
sysdeps/unix/sysv/linux/alpha/sysconf.c | 28 ++--------------------------
4 files changed, 7 insertions(+), 56 deletions(-)
diff --git a/sysdeps/alpha/fpu/cfloat-compat.h b/sysdeps/alpha/fpu/cfloat-compat.h
index f75bb9b..35542e6 100644
--- a/sysdeps/alpha/fpu/cfloat-compat.h
+++ b/sysdeps/alpha/fpu/cfloat-compat.h
@@ -1,5 +1,5 @@
/* Compatibility macros for old and new Alpha complex float ABI.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,35 +25,20 @@
follow the official Tru64 ABI, which passes the components of a complex
as separate parameters. */
-#if __GNUC_PREREQ(3,4)
- typedef union { double d; _Complex float cf; } c1_compat;
+typedef union { double d; _Complex float cf; } c1_compat;
# define c1_cfloat_decl(x) double x
# define c1_cfloat_real(x) __real__ c1_cfloat_value (x)
# define c1_cfloat_imag(x) __imag__ c1_cfloat_value (x)
# define c1_cfloat_value(x) (((c1_compat *)(void *)&x)->cf)
# define c1_cfloat_rettype double
# define c1_cfloat_return(x) ({ c1_compat _; _.cf = (x); _.d; })
+
# define c2_cfloat_decl(x) _Complex float x
# define c2_cfloat_real(x) __real__ x
# define c2_cfloat_imag(x) __imag__ x
# define c2_cfloat_value(x) x
# define c2_cfloat_rettype _Complex float
# define c2_cfloat_return(x) x
-#else
-# define c1_cfloat_decl(x) _Complex float x
-# define c1_cfloat_real(x) __real__ x
-# define c1_cfloat_imag(x) __imag__ x
-# define c1_cfloat_value(x) x
-# define c1_cfloat_rettype _Complex float
-# define c1_cfloat_return(x) x
-# define c2_cfloat_decl(x) float x ## r, float x ## i
-# define c2_cfloat_real(x) x ## r
-# define c2_cfloat_imag(x) x ## i
-# define c2_cfloat_value(x) \
- ({ _Complex float _; __real__ _ = x##r; __imag__ _ = x##i; _; })
-# define c2_cfloat_rettype double _Complex
-# define c2_cfloat_return(x) x
-#endif
/* Get the proper symbol versions defined for each function. */
diff --git a/sysdeps/alpha/fpu/s_fabs.c b/sysdeps/alpha/fpu/s_fabs.c
index 0105162..f970acd 100644
--- a/sysdeps/alpha/fpu/s_fabs.c
+++ b/sysdeps/alpha/fpu/s_fabs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -22,12 +22,7 @@
double
__fabs (double x)
{
-#if __GNUC_PREREQ (2, 8)
return __builtin_fabs (x);
-#else
- __asm ("cpys $f31, %1, %0" : "=f" (x) : "f" (x));
- return x;
-#endif
}
weak_alias (__fabs, fabs)
diff --git a/sysdeps/alpha/fpu/s_fabsf.c b/sysdeps/alpha/fpu/s_fabsf.c
index 05f776e..5c80ae8 100644
--- a/sysdeps/alpha/fpu/s_fabsf.c
+++ b/sysdeps/alpha/fpu/s_fabsf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -21,12 +21,7 @@
float
__fabsf (float x)
{
-#if __GNUC_PREREQ (2, 8)
return __builtin_fabsf (x);
-#else
- __asm ("cpys $f31, %1, %0" : "=f" (x) : "f" (x));
- return x;
-#endif
}
weak_alias (__fabsf, fabsf)
diff --git a/sysdeps/unix/sysv/linux/alpha/sysconf.c b/sysdeps/unix/sysv/linux/alpha/sysconf.c
index afb7aa6..603157e 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysconf.c
+++ b/sysdeps/unix/sysv/linux/alpha/sysconf.c
@@ -28,30 +28,6 @@ static long int linux_sysconf (int name);
extern long __libc_alpha_cache_shape[4];
-static inline unsigned long
-implver (void)
-{
- unsigned long i;
-#if __GNUC_PREREQ(3,3)
- i = __builtin_alpha_implver ();
-#else
- asm ("implver %0" : "=r" (i));
-#endif
- return i;
-}
-
-static inline unsigned long
-amask (unsigned long x)
-{
- unsigned long r;
-#if __GNUC_PREREQ(3,3)
- r = __builtin_alpha_amask (x);
-#else
- asm ("amask %1,%0" : "=r"(r) : "Ir"(x));
-#endif
- return r;
-}
-
/* Get the value of the system variable NAME. */
long int
__sysconf (int name)
@@ -79,7 +55,7 @@ __sysconf (int name)
pages or have the kernel do the timings from KSEG. Fortunately,
kernels beginning with 2.6.5 will pass us this info in auxvec. */
- switch (implver())
+ switch (__builtin_alpha_implver ())
{
case 0: /* EV4 */
/* EV4/LCA45 had 8k L1 caches; EV45 had 16k L1 caches. */
@@ -89,7 +65,7 @@ __sysconf (int name)
break;
case 1: /* EV5 */
- if (amask (1 << 8))
+ if (__builtin_alpha_amask (1 << 8))
{
/* MAX insns not present; either EV5 or EV56. */
shape_l1i = shape_l1d = CSHAPE(8*1024, 5, 1);
--
1.7.7.6
next prev parent reply other threads:[~2012-06-15 19:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 19:20 [PATCH 0/7] Fixes for alpha problems Joseph noticed Richard Henderson
2012-06-15 19:21 ` [PATCH 4/7] alpha: Fix protection on UTIME_NOW Richard Henderson
2012-06-15 19:21 ` [PATCH 1/7] alpha: Fix float_t in bits/mathdef.h Richard Henderson
2012-06-15 19:21 ` [PATCH 3/7] alpha: Add missing definitions in resource.h, shm.h Richard Henderson
2012-06-15 19:21 ` Richard Henderson [this message]
2012-06-15 19:21 ` [PATCH 5/7] alpha: Use builtins for copysign Richard Henderson
2012-06-15 19:27 ` [PATCH 6/7] [BZ #13848] alpha: Fix s_nearbyint implementation Richard Henderson
2012-06-15 19:28 ` [PATCH 7/7] alpha: Always handle inexact in rint implementations Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339788037-29519-3-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=libc-ports@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).