[PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-07 Thread Yuao Ma
Hi all, This patch has been updated to conditionally fold the specified math functions only when using MPFR version 4.2.0 or newer. To accompany this change, the test case now utilizes `__builtin_constant_p` to determine whether to execute the tests against the folded functions. Let me know if t

[PATCH] fortran: add intrinsic doc for trig functions with half-revolutions

2025-06-06 Thread Yuao Ma
Hi all, This patch is a follow-up to commit r16-938-ge8fdd55ec90749. In this patch, we add intrinsic documentation for the newly added trig functions with half-revolutions. We also reorder the documentation for `atand` to place it in correct alphabetical order. BR, Yuao 0001-fortran-add-intrin

[PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-02 Thread Yuao Ma
Hi Joseph, > I don't see tests for the various special cases from Annex F (for example, > "tanpi(n) returns +0, for positive even and negative odd integers n." and > "tanpi(n) returns -0, for positive odd and negative even integers n."). > In such cases the sign of zero would need to be checked sp

[PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-01 Thread Yuao Ma
Hello world, This patch partially handled PR118592. This patch builds upon r16-710-g591d3d02664c7b and r16-711-g89935d56f768b4. It introduces middle-end optimizations, such as constant folding, for our trigonometric pi-based function built-ins. For MPFR versions older than 4.2.0, we've included

[Patch] Fortran: gfc_simplify_{cospi,sinpi} - fix for MPFR < 4.2.0 (was: [PATCH] fortran: add constant input support for trig functions with half-revolutions)

2025-05-28 Thread Yuao Ma
Hi Tobias and Harald, I sincerely apologize for the breakage! I did test both preprocessor branches, but I tested against the same MPFR version (4.2.2, which is the latest on Arch Linux). Going forward, I will test against versions both above and below 4.2.0 to ensure this type of breakage doesn't

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-28 Thread Yuao Ma
Hi Tobias, > you will notice that the PR is not recognized. The format as mentioned before > is "PR component/number". Namely: Thanks for the reminder! I'll use `-p` to double-check PR numbers going forward. > The second part is not what you are doing, you are actually changing the > call from

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-27 Thread Yuao Ma
Hi all, I've reverted the recent format changes, as three reviewers indicated they caused more harm than good. Are there any functional problems I need to address? Thanks, Yuao 0001-fortran-add-constant-input-support-for-trig-function.patch Description: 0001-fortran-add-constant-input-support

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-26 Thread Yuao Ma
Hi Steve, > I looked at the patch in a bit more detail, and > I am not thrilled with large-scale whitespace > changes mingled with functional changes. It makes > the patch harder to read and review. I'm not sure which file you're referring to. If it's mathbuiltins.def, I'll need to add extra spa

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-24 Thread Yuao Ma
Hi Steve, Thanks for your review! I've updated the patch. > this range_check() is unneeded. Done. > As a side note, the error message is slightly misleading > (although it will not be issued). Technically, x = -1 or 1 > are allowed values, and neither is **between** -1 and 1. You're right, th

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-23 Thread Yuao Ma
Hi Tobias, The patch has been updated. Could you please take a look when you have a chance? > Can you add the PR number to the commit log ("PR fortran/113152")? Done. > Can you also update the documentation – as you already did for ATAND? I think that's quite a lot of wording... Hoping to tack

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-21 Thread Yuao Ma
Hi Tobias, Thanks for the thorough code review! I'm pretty swamped for the next couple of days, and I'll get the patch updated as you requested this weekend. > I don't understand this change. First, I don't see any reason why this > should get modified. And by modifying it, a simple "git blame" w

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-20 Thread Yuao Ma
Sorry, the previous patch had some issues with the test case. Please refer to the updated version, which resolves the problem. From: Yuao Ma Sent: Tuesday, May 20, 2025 23:54 To: gcc-patc...@gcc.gnu.org ; GCC Fortran ; tbur...@baylibre.com Subject: [PATCH

[PATCH] fortran: add constant input support for trig functions with half-revolutions

2025-05-20 Thread Yuao Ma
Hi all, This patch introduces constant input support for trigonometric functions, including those involving half-revolutions. Both valid and invalid inputs have been thoroughly tested, as have mpfr versions greater than or equal to 4.2 and less than 4.2. Inspired by Steve's previous work, this pa

Re: [PATCH] gcc: add trigonometric pi-based functions as gcc builtins

2025-05-18 Thread Yuao Ma
From: Jakub Jelinek Sent: Saturday, May 17, 2025 22:11 To: Yuao Ma Cc: gcc-patc...@gcc.gnu.org ; fortran@gcc.gnu.org ; tbur...@baylibre.com ; j...@polyomino.org.uk Subject: Re: [PATCH] gcc: add trigonometric pi-based functions as gcc builtins On Wed, May 14, 2025 at 02:22:23PM +

[PATCH] gcc: add trigonometric pi-based functions as gcc builtins

2025-05-14 Thread Yuao Ma
, May 15, 2025 0:47 To: Yuao Ma Cc: gcc-patc...@gcc.gnu.org ; fortran@gcc.gnu.org ; 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 functio

[PATCH] gcc: add trigonometric pi-based functions as gcc builtins

2025-05-14 Thread Yuao Ma
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

[PATCH] fortran: map atand(y, x) to atan2d(y, x) [PR113413]

2025-05-12 Thread Yuao Ma
Hi Tobias, Following up on your review comments, I have updated the patch. Specifically, I have: * Added the PR number to the subject line. * Used the -b and -p options when running git gcc-commit-mklog. * Updated the intrinsic documentation as requested. Could you please take another look when yo

[PATCH] fortran: map atand(y, x) to atan2d(y, x)

2025-05-11 Thread Yuao Ma
Hi all, According to the Fortran standard, atand(y, x) is equivalent to atan2d(y, x). However, the current atand(y, x) function produces an error. This patch includes the necessary intrinsic mapping, related test, and intrinsic documentation. The minor comment change in intrinsic.cc is cherry-pick

[PATCH, fortran] Fix simple typo in libgfortran

2025-05-10 Thread Yuao Ma
Hi Tobias, Thanks for your time and guidance on this GSOC project. > * This is a trivial patch but for larger patches, you need >grant the right to use your patch. There are two ways of doing so: >(a) The simple one, called "Developer Certificate of Origin" (DCO). >This requires a "Si

[PATCH, fortran] Fix simple typo in libgfortran

2025-05-10 Thread Yuao Ma
Hi Thomas, Thanks for your quick response. > There should be a ChangeLog entry. You can generate a template by > running your patch through contrib/mklog.py, which you can then fill > out with the details. I think the ChangeLog entry is already in the patch. I used git gcc-commit-mklog, and it p

[PATCH, fortran] Fix simple typo in libgfortran

2025-05-10 Thread Yuao Ma
Hi GCC Maintainers, I'm writing to express my sincere gratitude for the opportunity to participate in Google Summer of Code with GCC this year. I am very enthusiastic about this program and fully committed to making a valuable contribution and fulfilling my responsibilities. As I am relatively ne

GSoC 2025 - Draft Proposal for Fortran 2018/202x - RFC

2025-04-05 Thread Yuao Ma
Dear gfortran developers, I have uploaded a draft proposal for the 'Fortran – 2018/202x' project to the platform. You can also find a PDF version at this Google Drive link: https://drive.google.com/file/d/1cSRPuWpXWHMwHdNItQluEYspLfylqZcU. Could you please review the proposal and provide feedback

GSoC Draft Proposal Submission: Fortran 2018/202x

2025-04-05 Thread Yuao Ma
Hi GCC developers, I'm sharing the draft proposal for my GSoC project titled "Fortran 2018/202x". It has already been posted on the Fortran mailing list, where I received valuable feedback from gfortran developers. As mentioned on the GCC GSoC page, proposals should also be shared on the GCC mail

GSoC 2025 - Updated Proposal for Fortran 2018/202x - RFC

2025-04-01 Thread Yuao Ma
Hi Steve, Thank you for your prompt feedback on my initial proposal. I understand that it lacked sufficient detail regarding the implementation approach. I have since updated the proposal with a more comprehensive explanation. When you have a moment, I would greatly appreciate it if you could take

Re: GSoC Fortran – 2018/202x – Inquiry About Project Scope

2025-03-28 Thread Yuao Ma
Hi Steve, Thank you sincerely for explaining the implementation and project details. I will draft the proposal shortly and would appreciate discussing refinements with you before the deadline. Yuao From: Steve Kargl Sent: Friday, March 28, 2025 1:35 To: Yuao Ma

Re: GSoC Fortran – 2018/202x – Inquiry About Project Scope

2025-03-27 Thread Yuao Ma
available to mentor this project? Thanks! Yuao From: Steve Kargl Sent: Thursday, March 27, 2025 2:15 To: Yuao Ma Cc: fortran@gcc.gnu.org Subject: Re: GSoC Fortran – 2018/202x – Inquiry About Project Scope Yuao, I do not intend to be a mentor. I will however answer

Re: GSoC Fortran – 2018/202x – Inquiry About Project Scope

2025-03-26 Thread Yuao Ma
: Yuao Ma Cc: fortran@gcc.gnu.org Subject: Re: GSoC Fortran – 2018/202x – Inquiry About Project Scope I've already written a prototype of the half-cycle trig functions. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113152 There are two issues that need to be address. First, some oper

GSoC Fortran – 2018/202x – Inquiry About Project Scope

2025-03-24 Thread Yuao Ma
Hello GCC Community, I hope this message finds you well. My name is Yuao, and I’m excited to express my interest in the "Fortran – 2018/202x" project for Google Summer of Code. I’m writing to clarify the scope of this project and gather any recommendations you may have. >From the project document

GSOC 2025 - Fortran - 2018/202x

2025-03-23 Thread Yuao Ma
Hello GCC Community, My name is Yuao, and I’m excited to express my interest in the “Fortran – 2018/202x” project for Google Summer of Code. I am majoring in Cyber Science and Engineering, with a solid background in computer science that I believe will help me contribute effectively to this projec

GSOC 2025 - Fortran - 2018/202x

2025-03-19 Thread Yuao Ma
Hello GCC Community, My name is Yuao, and I’m excited to express my interest in the “Fortran – 2018/202x” project for Google Summer of Code. I am majoring in Cyber Science and Engineering, with a solid background in computer science that I believe will help me contribute effectively to this pro