From patchwork Wed Apr 15 12:12:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 6226 Received: (qmail 39893 invoked by alias); 15 Apr 2015 12:13:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 39881 invoked by uid 89); 15 Apr 2015 12:13:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com From: "Wilco Dijkstra" To: Subject: [PATCH][AArch64] Add inlines for signbit Date: Wed, 15 Apr 2015 13:12:39 +0100 Message-ID: <000001d07775$77c71880$67554980$@com> MIME-Version: 1.0 X-MC-Unique: nHWHDkjEQriLj17gmgygjg-1 Add AArch64 inlines for __signbit, __signbitf and __signbitl which default to the GCC builtin functions. Is there a reason this couldn't be done by default in math.h similar to isgreater (unlike __builtin_isinf et al, GCC implements signbit efficiently and correctly). OK for commit? 2015-04-15 Wilco Dijkstra * sysdeps/aarch64/fpu/bits/mathinline.h: New file. (__signbit): New function, use __builtin_signbit. (__signbitf): Likewise. (__signbitl): Likewise. --- sysdeps/aarch64/fpu/bits/mathinline.h | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sysdeps/aarch64/fpu/bits/mathinline.h diff --git a/sysdeps/aarch64/fpu/bits/mathinline.h b/sysdeps/aarch64/fpu/bits/mathinline.h new file mode 100644 index 0000000..e3d6a3d --- /dev/null +++ b/sysdeps/aarch64/fpu/bits/mathinline.h @@ -0,0 +1,49 @@ +/* Inline math functions for AArch64. + Copyright (C) 2015 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + +#ifndef __extern_inline +# define __MATH_INLINE __inline +#else +# define __MATH_INLINE __extern_inline +#endif + +#ifdef __USE_ISOC99 + +__MATH_INLINE int +__NTH (__signbitf (float __x)) +{ + return __builtin_signbitf (__x); +} + +__MATH_INLINE int +__NTH (__signbit (double __x)) +{ + return __builtin_signbit (__x); +} + +__MATH_INLINE int +__NTH (__signbitl (long double __x)) +{ + return __builtin_signbitl (__x); +} + +#endif /* C99 */