From patchwork Tue Dec 5 17:01:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 844856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-87835-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="yVpUTaU7"; 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 3yrp250NNGz9tB5 for ; Wed, 6 Dec 2017 04:02:04 +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:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=FNL2zQq/YvSF0aTY3t3buRMvy5qOO F/ASDh+lGtKZMF2GX2qqIsrse6k+66sLyF050u8v+DjArRWIn3MAFQfmHX5KtBrY tWc1J+m3W74x85crZl25vA73JniuNGH0koSx7hzSUXV+2mBLKKMcb70AK5LLlPzx 4Iv5WKN8yw4uBs= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=WIxiNK8qdoy1dtULgqCaU6xYAcI=; b=yVp UTaU7I7LsSorL0W8japZSsrZUWn9RITiYSNGcV7g8wVs4p1khFLKpgs2R6ePMUYq eTqMHeD5D9Vq/GHl0nX4i+u3arOSAbe7f/CwjQQ5YssAoMlNpCMKM5LTlcF6KkD+ NMW5JsaT5IB6obp6OyebE4dwDDir3sdVaHY2/s0c= Received: (qmail 99525 invoked by alias); 5 Dec 2017 17:01:55 -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 99455 invoked by uid 89); 5 Dec 2017 17:01:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Tue, 5 Dec 2017 17:01:46 +0000 From: Joseph Myers To: Subject: Support _Float64, _Float32x in libm_alias_double [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) This patch makes the libm_alias_double macros support creating _Float64 and _Float32x aliases, in preparation for enabling glibc support for those types. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float64 / _Float32x changes. Committed. 2017-12-05 Joseph Myers * sysdeps/generic/libm-alias-double.h: Include . (libm_alias_double_other_r_f64): New macro. (libm_alias_double_other_r_f32x): Likewise. (libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and libm_alias_double_other_r_f32x. (libm_alias_double_r): Use semicolon before call to libm_alias_double_other_r. * sysdeps/ieee754/ldbl-opt/libm-alias-double.h: Include . (libm_alias_double_other_r_f64): New macro. (libm_alias_double_other_r_f32x): Likewise. (libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and libm_alias_double_other_r_f32x. diff --git a/sysdeps/generic/libm-alias-double.h b/sysdeps/generic/libm-alias-double.h index 0593ad9..f222cf8 100644 --- a/sysdeps/generic/libm-alias-double.h +++ b/sysdeps/generic/libm-alias-double.h @@ -19,11 +19,29 @@ #ifndef _LIBM_ALIAS_DOUBLE_H #define _LIBM_ALIAS_DOUBLE_H +#include + +#if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64 +# define libm_alias_double_other_r_f64(from, to, r) \ + weak_alias (from ## r, to ## f64 ## r) +#else +# define libm_alias_double_other_r_f64(from, to, r) +#endif + +#if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X +# define libm_alias_double_other_r_f32x(from, to, r) \ + weak_alias (from ## r, to ## f32x ## r) +#else +# define libm_alias_double_other_r_f32x(from, to, r) +#endif + /* Define _FloatN / _FloatNx aliases for a double libm function that has internal name FROM ## R and public names TO ## suffix ## R for each suffix of a supported _FloatN / _FloatNx floating-point type with the same format as double. */ -#define libm_alias_double_other_r(from, to, r) +#define libm_alias_double_other_r(from, to, r) \ + libm_alias_double_other_r_f64 (from, to, r); \ + libm_alias_double_other_r_f32x (from, to, r) /* Likewise, but without the R suffix. */ #define libm_alias_double_other(from, to) \ @@ -40,11 +58,11 @@ # define libm_alias_double_r(from, to, r) \ weak_alias (from ## r, to ## r) \ strong_alias (from ## r, from ## l ## r) \ - weak_alias (from ## r, to ## l ## r) \ + weak_alias (from ## r, to ## l ## r); \ libm_alias_double_other_r (from, to, r) #else # define libm_alias_double_r(from, to, r) \ - weak_alias (from ## r, to ## r) \ + weak_alias (from ## r, to ## r); \ libm_alias_double_other_r (from, to, r) #endif diff --git a/sysdeps/ieee754/ldbl-opt/libm-alias-double.h b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h index f98e9d5..37ef612 100644 --- a/sysdeps/ieee754/ldbl-opt/libm-alias-double.h +++ b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h @@ -19,15 +19,32 @@ #ifndef _LIBM_ALIAS_DOUBLE_H #define _LIBM_ALIAS_DOUBLE_H +#include #include #include #include +#if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64 +# define libm_alias_double_other_r_f64(from, to, r) \ + weak_alias (from ## r, to ## f64 ## r) +#else +# define libm_alias_double_other_r_f64(from, to, r) +#endif + +#if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X +# define libm_alias_double_other_r_f32x(from, to, r) \ + weak_alias (from ## r, to ## f32x ## r) +#else +# define libm_alias_double_other_r_f32x(from, to, r) +#endif + /* Define _FloatN / _FloatNx aliases for a double libm function that has internal name FROM ## R and public names TO ## suffix ## R for each suffix of a supported _FloatN / _FloatNx floating-point type with the same format as double. */ -#define libm_alias_double_other_r(from, to, r) +#define libm_alias_double_other_r(from, to, r) \ + libm_alias_double_other_r_f64 (from, to, r); \ + libm_alias_double_other_r_f32x (from, to, r) /* Likewise, but without the R suffix. */ #define libm_alias_double_other(from, to) \