[PATCH v1] rtl: builtins: Fix builtins feclearexcept and feraiseexcept operand check [PR94193]

2022-01-26 Thread Raoni Fassina Firmino via Gcc-patches
Tested on top of master (e0b8716f53ed6455e9f18931940141692793068d) using --enable-checking=yes,rtl, on the following plataforms with no regression: - powerpc64le-linux-gnu (Power 9) - powerpc64le-linux-gnu (Power 8) - powerpc64-linux-gnu (Power 9, with 32 and 64 bits tests) I did not include

Re: [PATCH v9] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2022-01-25 Thread Raoni Fassina Firmino via Gcc-patches
On Mon, Jan 24, 2022 at 11:35:47PM +0100, AL gcc-patches wrote: > On Mon, Jan 24, 2022 at 06:24:11PM -0300, Raoni Fassina Firmino wrote: > > On Mon, Jan 24, 2022 at 02:29:39PM -0600, Bill Schmidt wrote: > > > Adding the patch author for his information. > > > > Thanks Bill. > > > > > On 1/24/22 2

Re: [PATCH v9] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2022-01-24 Thread Raoni Fassina Firmino via Gcc-patches
On Mon, Jan 24, 2022 at 02:29:39PM -0600, Bill Schmidt wrote: > Adding the patch author for his information. Thanks Bill. > On 1/24/22 2:26 PM, Jakub Jelinek via Gcc-patches wrote: > > expand_builtin_feclear_feraise_except doesn't check if op0 matches > > the predicate of operands[1], the backend

[PATCH v9] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2022-01-13 Thread Raoni Fassina Firmino via Gcc-patches
Changes since v8[8]: - Refactored and expanded builtin-feclearexcept-feraiseexcept-2.c testcase: + Use a macro to avoid extended repetition of the core test code. + Expanded the test code to check builtins return code. + Added more tests to test all valid (standard) exceptions inp

[PATCH v8] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-12-24 Thread Raoni Fassina Firmino via Gcc-patches
Changes since v7[7]: - Fixed an array indexing bug on fegeround testcase. - Fixed typos and spelling mistakes spread trouout the added comments. - Reworded header comment/description for fegetround expander. - Fixed changelog in the commit message. After taking a look to add support for FE

Re: [PATCH v7] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-12-23 Thread Raoni Fassina Firmino via Gcc-patches
Sorry, sent an incomplete email. it was missing this part: On Thu, Nov 25, 2021 at 03:12:32PM -0600, Segher Boessenkool wrote: > > +;; int fegetround(void) > > +;; > > +;; This expansion for the C99 function only expands for compatible > > +;; target libcs. Because it needs to return one of FE_DOW

Re: [PATCH v7] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-12-23 Thread Raoni Fassina Firmino via Gcc-patches
Hi Segher, On Thu, Nov 25, 2021 at 03:12:32PM -0600, Segher Boessenkool wrote: > Hi! > > On Wed, Nov 24, 2021 at 08:48:47PM -0300, Raoni Fassina Firmino wrote: > > gcc/ChangeLog: > > * builtins.c (expand_builtin_fegetround): New function. > > (expand_builtin_feclear_feraise_except

[PATCH v7] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-11-24 Thread Raoni Fassina Firmino via Gcc-patches
Changes since v6[6] and v5[5]: - Based this version on the v5 one. - Reworked all builtins back to the way they are in v5 and added the following changes: + Added a test to target libc, only expanding with glibc as the target libc. + Updated all three expanders header comment

Re: [PATCH v6] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-11-24 Thread Raoni Fassina Firmino via Gcc-patches
Hi Joseph, Thanks for the detailed review and explanations. On Mon, Oct 18, 2021 at 03:54:53PM +, Joseph Myers wrote: > However, it's better to get things right automatically without needing any > macros or other header additions at all. That is, define feclearexcept as > a built-in functi

[PATCH v6] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-10-16 Thread Raoni Fassina Firmino via Gcc-patches
Changes since v5[5]: - Reworked all builtins to accept the FE_* macros as parameters and so be agnostic to libc implementations. Largely based of fpclassify. To that end, there is some new files changed: + Change the argument list for the builtins declarations in builtins.def

Re: [PATCH v5] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-01-07 Thread Raoni Fassina Firmino via Gcc-patches
ross compile, so a configure test may not do what we  > need.  In fact, ISTM that there is no reliable configure or compile time > check we can do since the constants are part of the runtime and can > change independently of the compiler. >From other subthreads Joseph and segher mentio

Re: [PATCH v5] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2021-01-07 Thread Raoni Fassina Firmino via Gcc-patches
12:31 AM, Richard Biener wrote: > > On Tue, 17 Nov 2020, Jeff Law wrote: > > > >> > >> On 11/4/20 8:10 AM, Raoni Fassina Firmino via Gcc-patches wrote: > >>> On Wed, Nov 04, 2020 at 10:35:03AM +0100, Richard Biener wrote: > >>>&g

Re: [PATCH v5] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-11-04 Thread Raoni Fassina Firmino via Gcc-patches
On Wed, Nov 04, 2020 at 10:35:03AM +0100, Richard Biener wrote: > > +/* Expand call EXP to the fegetround builtin (from C99 fenv.h), returning > > the > > + result and setting it in TARGET. Otherwise return NULL_RTX on failure. > > */ > > +static rtx > > +expand_builtin_fegetround (tree exp,

[PATCH v5] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-11-03 Thread Raoni Fassina Firmino via Gcc-patches
I am repeating the "changelog" from v3 and v4 here because v4 and v5 have just minor changes since v3. Changes since v4[1]: - Fixed more spelling and code style. - Add more clarification on comments for feraiseexcept and feclearexcept expands; Changes since v3[2]: - Fixed fegetround bu

Re: [PATCH v4] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-11-03 Thread Raoni Fassina Firmino via Gcc-patches
On Wed, Oct 28, 2020 at 12:03:33PM -0500, Segher Boessenkool wrote: > For raising invalid we could perhaps set VXSOFT, but is that okay for > other libcs than just glibc? So that can be a future improvement if it > turns out to be useful, as we discussed elsewhere. Yeap. > With those tweaks, the

[PATCH v4] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-10-28 Thread Raoni Fassina Firmino via Gcc-patches
I am repeating the "changelog" from v3 here because v4 is just one bugfix. I also tested on BE systems for v4. Changes since v3[1]: - Fixed fegetround bug on powerpc64 (big endian) that Segher spotted; Changes since v2[2]: - Added documentation for the new optabs; - Remove use of non po

[PATCH v3] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-10-26 Thread Raoni Fassina Firmino via Gcc-patches
Changes since v2[1]: - Added documentation for the new optabs; - Remove use of non portable __builtin_clz; - Changed feclearexcept and feraiseexcept to accept all 4 valid flags at the same time and added more test for that case; - Extended feclearexcept and feraiseexcept testcases to ma

Re: [PATCH v2] builtins: rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-10-26 Thread Raoni Fassina Firmino via Gcc-patches
On Mon, Sep 28, 2020 at 11:42:13AM -0500, will schmidt wrote: > > +/* Expand call EXP to either feclearexcept or feraiseexcept builtins (from > > C99 > > +fenv.h), returning the result and setting it in TARGET. Otherwise > > return > > +NULL_RTX on failure. */ > > +static rtx > > +expan

Re: [PATCH v2] builtins: rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-10-26 Thread Raoni Fassina Firmino via Gcc-patches
On Mon, Oct 05, 2020 at 10:36:22AM -0500, Segher Boessenkool wrote: > Should this pattern not allow setting more than one exception bit at > once, btw? Turns out allowing more than one bit was no problem at all. On Mon, Oct 05, 2020 at 10:36:22AM -0500, Segher Boessenkool wrote: > On Sun, Oct 04,

Re: [PATCH v2] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-10-26 Thread Raoni Fassina Firmino via Gcc-patches
On Thu, Oct 01, 2020 at 03:08:19PM -0500, Segher Boessenkool wrote: > On Thu, Oct 01, 2020 at 08:08:01AM +0200, Richard Biener wrote: > > On Wed, 30 Sep 2020, Segher Boessenkool wrote: > > > It's going to be challenging to find a reasonable spot in there. > > > Oh well. > > > > Put it next to fmin

Re: [PATCH v2] builtins: rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-09-28 Thread Raoni Fassina Firmino via Gcc-patches
Ping.

Re: [PATCH v2] builtins: rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-09-18 Thread Raoni Fassina Firmino via Gcc-patches
Ping.

[PATCH v2] builtins: rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-09-04 Thread Raoni Fassina Firmino via Gcc-patches
Changes since v1[1]: - Fixed english spelling; - Fixed code-style; - Changed match operand predicate in feclearexcept and feraiseexcept; - Changed testcase options; - Minor changes in test code to be C90 compatible; - Other minor changes sugested by Segher; - Changed subject line tag

Re: [PATCH] rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-09-04 Thread Raoni Fassina Firmino via Gcc-patches
Hi, I am about to sent a v2, but thought to reply here as well. On Tue, Aug 18, 2020 at 07:09:21PM -0500, Segher Boessenkool wrote: > Hi! > > On Fri, Aug 14, 2020 at 07:54:23PM -0300, Raoni Fassina Firmino via > Gcc-patches wrote: > > So, this patch adds new rs6000 expand

[PATCH] rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-08-14 Thread Raoni Fassina Firmino via Gcc-patches
Hi All, I sent an initial RFC of this patch[1] some time ago. I believe it is now in a complete state, with added the test cases for the builtins. The builtin optimizations presented here were originally in glibc, but were removed and suggested that they were a good fit as gcc builtins[2]. So,

[RFC] rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-06-26 Thread Raoni Fassina Firmino via Gcc-patches
Hi all, This is an early draft I'm working on to add fegetround , feclearexcept and feraiseexcept as builtins on rs6000. This is my first patch so I welcome any and all feedback. Foremost I have some questions to ask as I got stuck on some problems. Q1) How to implement a target specific buil