From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTP id 8E4DD38708D4 for ; Mon, 19 Oct 2020 11:52:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8E4DD38708D4 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 55F18117E2B; Mon, 19 Oct 2020 07:52:49 -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 OPEvHb5PGRJI; Mon, 19 Oct 2020 07:52:49 -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 06907117DDA; Mon, 19 Oct 2020 07:52:48 -0400 (EDT) Received: from livre.home (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 09JBqJae088579 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Oct 2020 08:52:23 -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: Mon, 19 Oct 2020 08:52:18 -0300 In-Reply-To: <877drm4kfu.fsf@igel.home> (Andreas Schwab's message of "Mon, 19 Oct 2020 11:46:45 +0200") 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.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, 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: Mon, 19 Oct 2020 11:52:51 -0000 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. Here's a workaround, for aarch64-* and ppc*-linux-gnu, where I've observed the mismatch so far. I'm not sure whether we're going to use something like this, or a fix for the mismatch; I'm yet to figure out how to implement the latter. aarch64-* and ppc*-linux-gnu long long float/long double mismatch --- 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 2bc95db..6a83371e 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -1298,6 +1298,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