From patchwork Mon Dec 2 14:46:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1203185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107595-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="UFSND2kV"; dkim-atps=neutral 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 47RScw2ljFz9sPT for ; Tue, 3 Dec 2019 01:47:12 +1100 (AEDT) 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:cc:subject:date:message-id; q=dns; s= default; b=soO5eq3/2dB9tnUzaqsp3QFxf0X5Kkj1NdfKbfhAngE4qxbeS7DbW qleyUI17e1YHdcQ96gngky/UD91gLC5ZbCBTq0eZ4KZ6aLpc99KdKEeZlFwhgV33 lJqWfBDQnwYTQP03j2cC08QIU53QYwGu6vu9IrlfnYjseowclQX5yo= 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:cc:subject:date:message-id; s=default; bh=g9k5oRH81wNQqQne9OaSL56L07g=; b=UFSND2kV+2+yGK1HsqEukiFSDaMf 3aN+o/Po91PZbbiR7MAyqdGDJ6zjKFA1BEOp+KrMq7HCoepEsAsfrMPLPqymQ3VT t2BoUjUKNfOtLXCQyaWHgx7/EKwz7SvKltqsxvulmagDuCjwDkeYZFkUzoNjuwwi gCiX4DOHD4a3Ncg= Received: (qmail 57348 invoked by alias); 2 Dec 2019 14:46:40 -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 57283 invoked by uid 89); 2 Dec 2019 14:46:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:www.sourceware.org, www.sourceware.org, sk:www.sou, wwwsourcewareorg X-HELO: mx0a-001b2d01.pphosted.com From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH 00/13] Use GCC builtins for some math functions if desired. Date: Mon, 2 Dec 2019 15:46:04 +0100 x-cbid: 19120214-0028-0000-0000-000003C37306 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19120214-0029-0000-0000-0000248688EF Message-Id: <1575297977-2589-1-git-send-email-stli@linux.ibm.com> Hi, this patch-series moves the nearbyint, rint, floor, ceil, trunc and round implementation from sysdeps/ieee754/dbl-64/wordsize-64 to sysdeps/ieee754/dbl-64/ as proposed by Adhemerval: ttps://www.sourceware.org/ml/libc-alpha/2019-11/msg00085.html It also introduces the math-use-builtins.h header with __USE__BUILTIN macros which allows to just use GCC __builtin_ instead of the current common-code implementation. There is a float, double, long double and _Float128 version of this macro for each . The generic math-use-builtins.h header is defining all those macros to 0 in order to use the current common-code implenetation. If an architecture wants to use the builtins, an architecture specific math-use-builtins.h needs to be created (e.g. done for s390) where those macros are defined to 1. Bye, Stefan Stefan Liebler (13): Always use wordsize-64 version of s_nearbyint.c. Always use wordsize-64 version of s_rint.c. Always use wordsize-64 version of s_floor.c. Always use wordsize-64 version of s_ceil.c. Always use wordsize-64 version of s_trunc.c. Always use wordsize-64 version of s_round.c. Use GCC builtins for nearbyint functions if desired. Use GCC builtins for rint functions if desired. Use GCC builtins for floor functions if desired. Use GCC builtins for ceil functions if desired. Use GCC builtins for trunc functions if desired. Use GCC builtins for round functions if desired. Use GCC builtins for copysign functions if desired. sysdeps/generic/math-use-builtins.h | 59 +++++++++++ sysdeps/ieee754/dbl-64/s_ceil.c | 64 +++++------- sysdeps/ieee754/dbl-64/s_copysign.c | 8 +- sysdeps/ieee754/dbl-64/s_floor.c | 98 +++++++++---------- sysdeps/ieee754/dbl-64/s_nearbyint.c | 46 ++++----- sysdeps/ieee754/dbl-64/s_rint.c | 39 +++++--- sysdeps/ieee754/dbl-64/s_round.c | 45 ++++----- sysdeps/ieee754/dbl-64/s_trunc.c | 31 +++--- sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c | 52 ---------- sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c | 72 -------------- .../ieee754/dbl-64/wordsize-64/s_nearbyint.c | 65 ------------ sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c | 58 ----------- sysdeps/ieee754/dbl-64/wordsize-64/s_round.c | 66 ------------- sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c | 55 ----------- sysdeps/ieee754/float128/float128_private.h | 22 +++++ sysdeps/ieee754/flt-32/s_ceilf.c | 60 +++++++----- sysdeps/ieee754/flt-32/s_copysignf.c | 21 ++-- sysdeps/ieee754/flt-32/s_floorf.c | 60 +++++++----- sysdeps/ieee754/flt-32/s_nearbyintf.c | 74 ++++++++------ sysdeps/ieee754/flt-32/s_rintf.c | 57 ++++++----- sysdeps/ieee754/flt-32/s_roundf.c | 6 +- sysdeps/ieee754/flt-32/s_truncf.c | 6 +- sysdeps/ieee754/ldbl-128/s_ceill.c | 97 ++++++++++++------ sysdeps/ieee754/ldbl-128/s_copysignl.c | 23 +++-- sysdeps/ieee754/ldbl-128/s_floorl.c | 97 +++++++++++------- sysdeps/ieee754/ldbl-128/s_nearbyintl.c | 76 ++++++++------ sysdeps/ieee754/ldbl-128/s_rintl.c | 63 +++++++----- sysdeps/ieee754/ldbl-128/s_roundl.c | 6 +- sysdeps/ieee754/ldbl-128/s_truncl.c | 6 +- sysdeps/s390/fpu/math-use-builtins.h | 84 ++++++++++++++++ .../sparc64/fpu/multiarch/s_ceil-generic.c | 2 +- .../sparc/sparc64/fpu/multiarch/s_ceil-vis3.c | 2 +- .../sparc64/fpu/multiarch/s_floor-generic.c | 2 +- .../sparc64/fpu/multiarch/s_floor-vis3.c | 2 +- .../sparc64/fpu/multiarch/s_trunc-generic.c | 2 +- .../sparc64/fpu/multiarch/s_trunc-vis3.c | 2 +- sysdeps/x86_64/fpu/multiarch/s_ceil-c.c | 2 +- sysdeps/x86_64/fpu/multiarch/s_floor-c.c | 2 +- sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c | 2 +- sysdeps/x86_64/fpu/multiarch/s_rint-c.c | 2 +- sysdeps/x86_64/fpu/multiarch/s_trunc-c.c | 2 +- 41 files changed, 750 insertions(+), 788 deletions(-) create mode 100644 sysdeps/generic/math-use-builtins.h delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_round.c delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c create mode 100644 sysdeps/s390/fpu/math-use-builtins.h