From patchwork Wed May 18 08:43:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 54124 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 856943858002 for ; Wed, 18 May 2022 08:45:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 856943858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652863546; bh=FvquNShnGH80LNM2axZ+ir2exWPhJvgBjYFTJPg7CdQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=xM/nxE37YS7xJ2wazRbk0DPHhg1OhDtU237ICCHHdBfZ/ZimxxJsazm3ewnG+CDPN 0x3BlwQQg7ShSBAmtfL+QILjyVZ3AUy5GQiCIi5cF8cJzj2b+G9SMuuEwGextAZ4it wwUlogTy/KN/zrkwVFt06vXv0A/3mfhJ8lhT82Sw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 024FC3857815 for ; Wed, 18 May 2022 08:43:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 024FC3857815 Received: by mail-wm1-x32c.google.com with SMTP id k126-20020a1ca184000000b003943fd07180so635079wme.3 for ; Wed, 18 May 2022 01:43:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=FvquNShnGH80LNM2axZ+ir2exWPhJvgBjYFTJPg7CdQ=; b=0vYj9MhPpvhLZIg/jfc4fPgMxhiWkq9eHyHsz+DD+3KTY4Wb8shdb7wX7NDeeEqETR CU8gYu1XMYX0rcKibWBTSaLD+iuw1xNWlkXvC0iNSVgy0vs1gVvUZrkrx/Ep5CGr9hE9 LLYaaVqy5JmpVljAYPTPgK+fQUWwwUd12QOQsQHQYo1FhmS8wPvxoAnUJOSPkfnMd5H+ f7twS9ffxMBfuwve50Ka1sm0kBG5Icl5UtYdtdSjCip1BMFGix1dHT1KE+i/lkbt4LHU rkl4laKs4uJp/bRJahVnVG85e9IKFh/u4JVogEZrPsfkeSNnzmH0bxFaUyJgAk+JSu0I daiQ== X-Gm-Message-State: AOAM531WFu6VLP11MSL30Ajms0cmdpdFvprzy8H1CK0DR2VmRoYEkoG3 RAC5H7LRnDzsAF6XMeJSAmMxsm4UZsW+hA== X-Google-Smtp-Source: ABdhPJw21xAe0UFRgUiqGD74TEeLZE42lFcZOoFC5dleIEThyeGBfKfvwh9+UH7AiPGSFyDmBZsNyQ== X-Received: by 2002:a05:600c:3641:b0:38e:4b2f:330 with SMTP id y1-20020a05600c364100b0038e4b2f0330mr35426257wmq.180.1652863382721; Wed, 18 May 2022 01:43:02 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id q9-20020adf9dc9000000b0020d02ddf4d5sm1372489wre.5.2022.05.18.01.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 01:43:02 -0700 (PDT) Date: Wed, 18 May 2022 08:43:01 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Ada.Numerics.Aux.*: Mention more Intrinsic and less C Math Library Message-ID: <20220518084301.GA3289604@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Alexandre Oliva Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Since we import the elemental math functions as intrinsics, it's not accurate to state we're drawing them in from the C math library. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-nagefl.ads: Replace mentions of C/unix math library with intrinsics. * libgnat/a-nallfl.ads: Likewise. State compatibility requirements. * libgnat/a-nalofl.ads: Likewise. * libgnat/a-nuaufl.ads: Likewise. diff --git a/gcc/ada/libgnat/a-nagefl.ads b/gcc/ada/libgnat/a-nagefl.ads --- a/gcc/ada/libgnat/a-nagefl.ads +++ b/gcc/ada/libgnat/a-nagefl.ads @@ -31,10 +31,10 @@ ------------------------------------------------------------------------------ -- This package provides the basic computational interface for the generic --- elementary functions. The C library version interfaces with the routines --- in the C mathematical library. +-- elementary functions. --- This version here is for use with normal Unix math functions. +-- This version here delegates to interfaces that typically import as +-- intrinsics the expected math functions. with Ada.Numerics.Aux_Long_Long_Float; with Ada.Numerics.Aux_Long_Float; diff --git a/gcc/ada/libgnat/a-nallfl.ads b/gcc/ada/libgnat/a-nallfl.ads --- a/gcc/ada/libgnat/a-nallfl.ads +++ b/gcc/ada/libgnat/a-nallfl.ads @@ -5,7 +5,7 @@ -- A D A . N U M E R I C S . A U X . L O N G _ L O N G _ F L O A T -- -- -- -- S p e c -- --- (C Math Library Version, Long Long Float) -- +-- (Instrinsic Version, Long Long Float) -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- @@ -30,9 +30,12 @@ -- -- ------------------------------------------------------------------------------ --- This package provides the basic computational interface for the generic --- elementary functions. The C library version interfaces with the routines --- in the C mathematical library, and is thus quite portable. +-- This package provides the basic computational interface for the +-- generic elementary functions. With the intrinsic version, the +-- compiler can use its knowledge of the functions to select the most +-- suitable implementation. It is thus quite portable. These +-- interfaces are suitable for cases in which Long Long Float and C's +-- long double share the same representation. with Ada.Numerics.Aux_Linker_Options; pragma Warnings (Off, Ada.Numerics.Aux_Linker_Options); @@ -42,7 +45,7 @@ package Ada.Numerics.Aux_Long_Long_Float is subtype T is Long_Long_Float; - -- We import these functions directly from C. Note that we label them + -- We import these functions as intrinsics. Note that we label them -- all as pure functions, because indeed all of them are in fact pure. function Sin (X : T) return T with diff --git a/gcc/ada/libgnat/a-nalofl.ads b/gcc/ada/libgnat/a-nalofl.ads --- a/gcc/ada/libgnat/a-nalofl.ads +++ b/gcc/ada/libgnat/a-nalofl.ads @@ -5,7 +5,7 @@ -- A D A . N U M E R I C S . A U X _ L O N G _ F L O A T -- -- -- -- S p e c -- --- (C Math Library Version, Long Float) -- +-- (Intrinsic Version, Long Float) -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- @@ -30,9 +30,12 @@ -- -- ------------------------------------------------------------------------------ --- This package provides the basic computational interface for the generic --- elementary functions. The C library version interfaces with the routines --- in the C mathematical library, and is thus quite portable. +-- This package provides the basic computational interface for the +-- generic elementary functions. With the intrinsic version, the +-- compiler can use its knowledge of the functions to select the most +-- suitable implementation. It is thus quite portable. These +-- interfaces are suitable for cases in which Long Float and C's +-- double share the same representation. with Ada.Numerics.Aux_Linker_Options; pragma Warnings (Off, Ada.Numerics.Aux_Linker_Options); @@ -42,7 +45,7 @@ package Ada.Numerics.Aux_Long_Float is subtype T is Long_Float; - -- We import these functions directly from C. Note that we label them + -- We import these functions as intrinsics. Note that we label them -- all as pure functions, because indeed all of them are in fact pure. function Sin (X : T) return T with diff --git a/gcc/ada/libgnat/a-nuaufl.ads b/gcc/ada/libgnat/a-nuaufl.ads --- a/gcc/ada/libgnat/a-nuaufl.ads +++ b/gcc/ada/libgnat/a-nuaufl.ads @@ -5,7 +5,7 @@ -- A D A . N U M E R I C S . A U X _ F L O A T -- -- -- -- S p e c -- --- (C Math Library Version, Float) -- +-- (Intrinsic Version, Float) -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- @@ -30,9 +30,12 @@ -- -- ------------------------------------------------------------------------------ --- This package provides the basic computational interface for the generic --- elementary functions. The C library version interfaces with the routines --- in the C mathematical library, and is thus quite portable. +-- This package provides the basic computational interface for the +-- generic elementary functions. With the intrinsic version, the +-- compiler can use its knowledge of the functions to select the most +-- suitable implementation. It is thus quite portable. These +-- interfaces are suitable for cases in which Float and C's float +-- share the same representation. with Ada.Numerics.Aux_Linker_Options; pragma Warnings (Off, Ada.Numerics.Aux_Linker_Options); @@ -42,7 +45,7 @@ package Ada.Numerics.Aux_Float is subtype T is Float; - -- We import these functions directly from C. Note that we label them + -- We import these functions as intrinsics. Note that we label them -- all as pure functions, because indeed all of them are in fact pure. function Sin (X : T) return T with