Hi Joseph, I have updated the patch based on your review comments. I added the newly introduced builtin to extend.texi and mentioned the PR in the commit message. Could you please take another look when you have a moment?
Yuao ________________________________ From: Joseph Myers <josmy...@redhat.com> Sent: Thursday, May 15, 2025 0:47 To: Yuao Ma <c...@outlook.com> Cc: gcc-patc...@gcc.gnu.org <gcc-patc...@gcc.gnu.org>; fortran@gcc.gnu.org <fortran@gcc.gnu.org>; tbur...@baylibre.com <tbur...@baylibre.com> Subject: Re: [PATCH] gcc: add trigonometric pi-based functions as gcc builtins On Wed, 14 May 2025, Yuao Ma wrote: > Hi all, > > This patch adds trigonometric pi-based functions as gcc builtins: acospi, > asinpi, atan2pi, > atanpi, cospi, sinpi, and tanpi. Latest glibc already provides support for > these functions, which we plan to leverage in future gfortran implementations. > > The patch includes two test cases to verify both correct code generation and > function definition. > > If approved, I suggest committing this foundational change first. Constant > folding for these builtins will be addressed in subsequent patches. Note that either this change, or a subsequent one that makes the built-in functions do something useful, should also update extend.texi, "Library Builtins", to mention the new functions. (The text there doesn't distinguish existing C23 built-in functions, such as exp10 or roundeven, from those that are pure extensions, but addressing that is independent of adding new functions to the list. Also, I'm not sure these sentences with very long lists of functions are really the optimal way of presenting the information about such built-in functions; maybe Sandra has better ideas about how to document this, but again that's independent of adding new functions.) The commit message should reference PR c/118592 (it's not a full fix, but it's partial progress towards the full set of built-in functions / constant folding). -- Joseph S. Myers josmy...@redhat.com
0001-gcc-add-trigonometric-pi-based-functions-as-gcc-buil.patch
Description: 0001-gcc-add-trigonometric-pi-based-functions-as-gcc-buil.patch