From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id 1A51F3857829 for ; Thu, 22 Oct 2020 05:13:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1A51F3857829 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oliva@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E5794116C8C; Thu, 22 Oct 2020 01:13:33 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wH10vTLu0dKH; Thu, 22 Oct 2020 01:13:33 -0400 (EDT) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 8177F116C8B; Thu, 22 Oct 2020 01:13:33 -0400 (EDT) Received: from livre.home (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 09M5DKOq202762 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 02:13:20 -0300 From: Alexandre Oliva To: Andreas Schwab Cc: gcc-patches@gcc.gnu.org Subject: Re: [Ada,FYI] revamp ada.numerics.aux Organization: Free thinker, does not speak for AdaCore References: <877drm4kfu.fsf@igel.home> Errors-To: aoliva@lxoliva.fsfla.org Date: Thu, 22 Oct 2020 02:13:20 -0300 In-Reply-To: (Alexandre Oliva's message of "Mon, 19 Oct 2020 08:52:18 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_ASCII_DIVIDERS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 05:13:35 -0000 On Oct 19, 2020, Alexandre Oliva wrote: > Hello, Andreas, > On Oct 19, 2020, Andreas Schwab wrote: >> -nostdinc a-nallfl.ads -o a-nallfl.o >> a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on return value >> a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on argument 1 >> a-nallfl.ads:48:13: warning: profile of "Sin" doesn't match the builtin it binds > Thanks for the report. Ada's Standard.Long_Long_Float is mapped to C > double rather than long double on this target. Long story short, we're keeping the mapping as is at least for now. For the curious, it's caused by the Max_HW_Digits cap in Set_Target.C_Type_For, in gcc/ada/set_targ.adb. So I'm going ahead and checking this in, approved by Eric Botcazou. (Rainer's followup patch is coming up separately but momentarily) aarch64-* and ppc*-linux-gnu long long float/long double mismatch From: Alexandre Oliva Some platforms have failed to build because long long float is mapped to double rather than long double, and then the attempts to import intrinsics for long double in Aux_Long_Long_Float raise warnings turned into errors. This patch is a work around for the mismatch, arranging for Aux_Long_Long_Float to map to Aux_Long_Float. for gcc/ada/ChangeLog * Makefile.rtl (LIBGNAT_TARGET_PAIRS): Use a-nallfl__wraplf.ads on aarch64-* and ppc*-linux-gnu targets. * libgnat/a-nallfl__wraplf.ads: New. --- gcc/ada/Makefile.rtl | 6 ++ gcc/ada/libgnat/a-nallfl__wraplf.ads | 87 ++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 gcc/ada/libgnat/a-nallfl__wraplf.ads diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 898eb5d..87ee3e9 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -1402,6 +1402,7 @@ ifeq ($(strip $(filter-out aarch64 arm% coff wrs vx%,$(target_cpu) $(target_vend VX=vxworks7 EH_MECHANISM=-gcc SIGTRAMP_OBJ=sigtramp-vxworks.o + LIBGNAT_TARGET_PAIRS += a-nallfl.ads. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides the basic computational interface for the +-- generic elementary functions. The functions in this unit are +-- wrappers for those in the Long Float package. + +with Ada.Numerics.Aux_Long_Float; + +package Ada.Numerics.Aux_Long_Long_Float is + pragma Pure; + + subtype T is Long_Long_Float; + package Aux renames Ada.Numerics.Aux_Long_Float; + subtype W is Aux.T; + + -- Use the Aux implementation. + + function Sin (X : T) return T + is (T (Aux.Sin (W (X)))); + + function Cos (X : T) return T + is (T (Aux.Cos (W (X)))); + + function Tan (X : T) return T + is (T (Aux.Tan (W (X)))); + + function Exp (X : T) return T + is (T (Aux.Exp (W (X)))); + + function Sqrt (X : T) return T + is (T (Aux.Sqrt (W (X)))); + + function Log (X : T) return T + is (T (Aux.Log (W (X)))); + + function Acos (X : T) return T + is (T (Aux.Acos (W (X)))); + + function Asin (X : T) return T + is (T (Aux.Asin (W (X)))); + + function Atan (X : T) return T + is (T (Aux.Atan (W (X)))); + + function Sinh (X : T) return T + is (T (Aux.Sinh (W (X)))); + + function Cosh (X : T) return T + is (T (Aux.Cosh (W (X)))); + + function Tanh (X : T) return T + is (T (Aux.Tanh (W (X)))); + + function Pow (X, Y : T) return T + is (T (Aux.Pow (W (X), W (Y)))); + +end Ada.Numerics.Aux_Long_Long_Float; -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer