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 X-Patchwork-Id: 461501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CA0E31401AB for ; Wed, 15 Apr 2015 22:13:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=sourceware.org header.i=@sourceware.org header.b=ivcczcVo; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=n9z 9mo8KzCtNlokNNT84Kl6cd02pf7YzU+temQ/54GzCi/c0010yP20QVw3wjuM+56w UyY+ksZjDrk3m8J4KUURjwf7Q1Gmr2gPGpw9I6x9sMqLpAy/Co+OrIw45QpBRMk2 mfm+eOuo3qycdyCRMW2M5L5uI7SI79jZn95NXXDs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=X59GrsIDz F0shnBnkl1SV75eey8=; b=ivcczcVoWcB6P0GujdzFPCkgwvDfiMb1i7Q06BZYS Eup6qZHWQ+lndCl4iJB1rohxbzmL/W4CdUu+8aY21n7vbcslMWrM3+kajDcmZjgG 3FPbOkrTJFYVCaehkkDHBaYQyDBTNU7zNkuz9FO1p94T5tgXxWfxurPEC0YepzVK H0= 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 */