From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 89B45385800C; Tue, 23 Jan 2024 09:08:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 89B45385800C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 89B45385800C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706000941; cv=none; b=SKleu2OhprMuk/10g5h3NW23x1Kd1UbK4rBJJ5ZVqal7sC2knzKGGVirbw99OjhREA8nUg4Oez5mAh6gMI0E/psW3VCqJ5xSC1TWvZ1k2iKz/yWUMrhzTYPNQ5Nel/D/6I849HuAdLtHx9wpPe8suhglySvzmEEpD51o7KpcmV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706000941; c=relaxed/simple; bh=gh/IDQfdedfbRnA7RXsrvDYwTy4iml+bB6FZEULnhas=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=Ec8i17Dj0JExCDHQs3NboSa913KQxhUKUBdy4BOg3uAKNrn+d+LrPpaCAZuDk/po3YI/aYneM35ZDOLbeLEFn36gFaC5upOOXQYbmwOleBaG6eMxqpLXKMgyTRDirhuSasgmfvtWTvvnVx2uyQ4OJ/qM2jzyUYAeIBlfre1vP/w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40e544fac26so10378765e9.1; Tue, 23 Jan 2024 01:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706000935; x=1706605735; darn=gcc.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gh/IDQfdedfbRnA7RXsrvDYwTy4iml+bB6FZEULnhas=; b=SO2CntZT8G/TPtNE3b9+14ppWjPn7wrbns1CZbAKMbNrqPGteuxjNhf7P4+GmL51Ai gbNBWXa8DEupZDXveimJ5SV3GHzBVZIAnLdTDmn0+SEsj4ytcpT0XRQgj7fzH1wYKzUh u7FNCFDjwz6lDEzY9+eAMiQslp7GF/62wTTRJqIihauROgsYCy6JRoeqmNbmcokMAfOo DE+Vk2weR2X/uqlASl/vZXj3hSpzIOpJ8HFj+qOfzSsRVYe9VGB3ke7fm6dOjJ9Ea67M eWPK32safGFG0hU9QrGupBsPe93xpKVQJLg6QViPGeUlhJFrAwHGiyHtvmkw6Pkr0nEA gPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706000935; x=1706605735; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gh/IDQfdedfbRnA7RXsrvDYwTy4iml+bB6FZEULnhas=; b=i9uA4GzIigi3ZJUnNcywdKeX14OkhQgdJGN33ew0ZNazhZm2qLcsaVeP7eDc/+opHu nQhr5ZnXYoWANGEgBbsreQPNqzxDrL05tNgHJml71l/Rqdk5eeBJ/Bvfu7WOHykA5uOx Oq3+6m9T74LEFmxtE2g8K3PY5JZtNNVtSAXg79cswVW7IgK2pkkOZ06aX9d0l9RmKHEo zJ0Lb0PxswQjGHq+eM/O6Uy98I+UMCznJCfqhKolhwpheSXQ+Ofku3dRwEvXxkpOgPhs p3ll9IZ3hNFTkaLLVSmn+B0O2fHl0N5OoPhFZOKGE6jOzVnlffXBz40npBCdcx+77/y4 nIGQ== X-Gm-Message-State: AOJu0Yxw0ncAf4br2zKr0nji1B4WHcT/g4DPMygFtVOjiLuCeinP6LWq lH5hVRTIn5IgWzPM+nlamHhLrW9wxfK5rz921sLsiD/jVD6jOpHS4m8iMZ1W X-Google-Smtp-Source: AGHT+IHugOHmEdro3fUw5LkwtAckwkv1mrVIRjm75ytICnPuCJROwLnyEav/x5kDWqr/jpmx4Br1eg== X-Received: by 2002:a05:600c:510b:b0:40e:433c:5627 with SMTP id o11-20020a05600c510b00b0040e433c5627mr7887688wms.2.1706000934974; Tue, 23 Jan 2024 01:08:54 -0800 (PST) Received: from smtpclient.apple ([2a01:e34:ec28:8cb0:30f7:6211:515a:f187]) by smtp.gmail.com with ESMTPSA id hn33-20020a05600ca3a100b0040e621feca9sm39289302wmb.17.2024.01.23.01.08.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2024 01:08:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: Re: [Fortran] half-cycle trig functions and atan[d] fixes From: FX Coudert In-Reply-To: Date: Tue, 23 Jan 2024 10:08:43 +0100 Cc: fortran , gcc-patches@gcc.gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Steve Kargl X-Mailer: Apple Mail (2.3774.400.31) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 List-Id: Hi Steve, Thanks for the patch. I=E2=80=99ll take time to do a proper review, but = after a first read I had the following questions: - "an OS's libm may/will contain cospi(), etc.=E2=80=9D: do those = functions conform to any standard? Are there plans to implement them = outside FreeBSD at this point? - On systems where libquadmath is used for _Float128, does libquadmath = contain the implementation of the q() variants for those functions? - If I get this right, to take one example, the Fortran front-end will = emit a call to gfortran_acospi_r4(), libgfortran provides this as a = wrapper calling acospif(), which is called either from libm or from = libgfortran. This is different from other math library functions, like = ACOS() where the acosf() call is generated directly from the front-end = (and then the implementation comes either from libm or from = libgfortran). Why not follow our usual way of doing things? - On most targets, cospi() and friends are not available. Therefore, we = end up doing the fallback (with limited precision as you noted) but with = a lot of indirection. We could generate that code directly in the = front-end, couldn=E2=80=99t we? Best, FX=