public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c
@ 2021-11-18 16:36 Bill Schmidt
  2021-12-01 16:36 ` [PATCH, PING] " Bill Schmidt
  2021-12-01 23:00 ` [PATCH] " Segher Boessenkool
  0 siblings, 2 replies; 6+ messages in thread
From: Bill Schmidt @ 2021-11-18 16:36 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, David Edelsohn

Hi!  This is the last patch broken out of the previous test suite patch
for the new builtins support.

One advantage of the new builtins support is uniform error messages for
arguments with restricted values.  Previously this was done in many places
in an ad hoc manner, with little uniformity.  This patch adjusts the
expected error messages accordingly.

All such error messages are now one of the following:
  "argument %d must be a %d-bit unsigned literal"
  "argument %d must be a literal between %d and %d, inclusive"
  "argument %d must be a variable or a literal between %d and %d, inclusive"
  "argument %d must be either a literal %d or a literal %d"

These messages were chosen to require the fewest changes from previous
messages while still introducing uniformity.  This patch adjusts error
messages for some cases where this produces changed messages.  In
particular, some messages are improved because previously they did not
admit the possibility that an argument could hold a variable.

Tested on powerpc64le-linux-gnu and powerpc64-linux-gnu (-m32/-m64)
with no regressions.  Is this okay for trunk?

Thanks!
Bill


2021-11-17  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/testsuite/
	* gcc.target/powerpc/test_fpscr_drn_builtin_error.c: Adjust error
	messages.
	* gcc.target/powerpc/test_fpscr_rn_builtin_error.c: Likewise.
---
 .../powerpc/test_fpscr_drn_builtin_error.c           |  4 ++--
 .../gcc.target/powerpc/test_fpscr_rn_builtin_error.c | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c
index 028ab0b6d66..4f9d9e08e8a 100644
--- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c
+++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c
@@ -9,8 +9,8 @@ int main ()
      __builtin_set_fpscr_drn() also support a variable as an argument but
      can't test variable value at compile time.  */
 
-  __builtin_set_fpscr_drn(-1);  /* { dg-error "Argument must be a value between 0 and 7" } */ 
-  __builtin_set_fpscr_drn(8);   /* { dg-error "Argument must be a value between 0 and 7" } */ 
+  __builtin_set_fpscr_drn(-1);  /* { dg-error "argument 1 must be a variable or a literal between 0 and 7, inclusive" } */ 
+  __builtin_set_fpscr_drn(8);   /* { dg-error "argument 1 must be a variable or a literal between 0 and 7, inclusive" } */ 
 
 }
 
diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c
index aea65091b0c..10391b71008 100644
--- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c
+++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c
@@ -8,13 +8,13 @@ int main ()
      int arguments.  The builtins __builtin_set_fpscr_rn() also supports a
      variable as an argument but can't test variable value at compile time.  */
 
-  __builtin_mtfsb0(-1);  /* { dg-error "Argument must be a constant between 0 and 31" } */
-  __builtin_mtfsb0(32);  /* { dg-error "Argument must be a constant between 0 and 31" } */
+  __builtin_mtfsb0(-1);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */
+  __builtin_mtfsb0(32);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */
 
-  __builtin_mtfsb1(-1);  /* { dg-error "Argument must be a constant between 0 and 31" } */
-  __builtin_mtfsb1(32);  /* { dg-error "Argument must be a constant between 0 and 31" } */ 
+  __builtin_mtfsb1(-1);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */
+  __builtin_mtfsb1(32);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */ 
 
-  __builtin_set_fpscr_rn(-1);  /* { dg-error "Argument must be a value between 0 and 3" } */ 
-  __builtin_set_fpscr_rn(4);   /* { dg-error "Argument must be a value between 0 and 3" } */ 
+  __builtin_set_fpscr_rn(-1);  /* { dg-error "argument 1 must be a variable or a literal between 0 and 3, inclusive" } */ 
+  __builtin_set_fpscr_rn(4);   /* { dg-error "argument 1 must be a variable or a literal between 0 and 3, inclusive" } */ 
 }
 
-- 
2.27.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH, PING] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c
  2021-11-18 16:36 [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c Bill Schmidt
@ 2021-12-01 16:36 ` Bill Schmidt
  2021-12-01 23:00 ` [PATCH] " Segher Boessenkool
  1 sibling, 0 replies; 6+ messages in thread
From: Bill Schmidt @ 2021-12-01 16:36 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, David Edelsohn

Hi!  I'd like to ping this patch.

Thanks!
Bill

On 11/18/21 10:36 AM, Bill Schmidt wrote:
> Hi!  This is the last patch broken out of the previous test suite patch
> for the new builtins support.
>
> One advantage of the new builtins support is uniform error messages for
> arguments with restricted values.  Previously this was done in many places
> in an ad hoc manner, with little uniformity.  This patch adjusts the
> expected error messages accordingly.
>
> All such error messages are now one of the following:
>   "argument %d must be a %d-bit unsigned literal"
>   "argument %d must be a literal between %d and %d, inclusive"
>   "argument %d must be a variable or a literal between %d and %d, inclusive"
>   "argument %d must be either a literal %d or a literal %d"
>
> These messages were chosen to require the fewest changes from previous
> messages while still introducing uniformity.  This patch adjusts error
> messages for some cases where this produces changed messages.  In
> particular, some messages are improved because previously they did not
> admit the possibility that an argument could hold a variable.
>
> Tested on powerpc64le-linux-gnu and powerpc64-linux-gnu (-m32/-m64)
> with no regressions.  Is this okay for trunk?
>
> Thanks!
> Bill
>
>
> 2021-11-17  Bill Schmidt  <wschmidt@linux.ibm.com>
>
> gcc/testsuite/
> 	* gcc.target/powerpc/test_fpscr_drn_builtin_error.c: Adjust error
> 	messages.
> 	* gcc.target/powerpc/test_fpscr_rn_builtin_error.c: Likewise.
> ---
>  .../powerpc/test_fpscr_drn_builtin_error.c           |  4 ++--
>  .../gcc.target/powerpc/test_fpscr_rn_builtin_error.c | 12 ++++++------
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c
> index 028ab0b6d66..4f9d9e08e8a 100644
> --- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c
> +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c
> @@ -9,8 +9,8 @@ int main ()
>       __builtin_set_fpscr_drn() also support a variable as an argument but
>       can't test variable value at compile time.  */
>  
> -  __builtin_set_fpscr_drn(-1);  /* { dg-error "Argument must be a value between 0 and 7" } */ 
> -  __builtin_set_fpscr_drn(8);   /* { dg-error "Argument must be a value between 0 and 7" } */ 
> +  __builtin_set_fpscr_drn(-1);  /* { dg-error "argument 1 must be a variable or a literal between 0 and 7, inclusive" } */ 
> +  __builtin_set_fpscr_drn(8);   /* { dg-error "argument 1 must be a variable or a literal between 0 and 7, inclusive" } */ 
>  
>  }
>  
> diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c
> index aea65091b0c..10391b71008 100644
> --- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c
> +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c
> @@ -8,13 +8,13 @@ int main ()
>       int arguments.  The builtins __builtin_set_fpscr_rn() also supports a
>       variable as an argument but can't test variable value at compile time.  */
>  
> -  __builtin_mtfsb0(-1);  /* { dg-error "Argument must be a constant between 0 and 31" } */
> -  __builtin_mtfsb0(32);  /* { dg-error "Argument must be a constant between 0 and 31" } */
> +  __builtin_mtfsb0(-1);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */
> +  __builtin_mtfsb0(32);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */
>  
> -  __builtin_mtfsb1(-1);  /* { dg-error "Argument must be a constant between 0 and 31" } */
> -  __builtin_mtfsb1(32);  /* { dg-error "Argument must be a constant between 0 and 31" } */ 
> +  __builtin_mtfsb1(-1);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */
> +  __builtin_mtfsb1(32);  /* { dg-error "argument 1 must be a 5-bit unsigned literal" } */ 
>  
> -  __builtin_set_fpscr_rn(-1);  /* { dg-error "Argument must be a value between 0 and 3" } */ 
> -  __builtin_set_fpscr_rn(4);   /* { dg-error "Argument must be a value between 0 and 3" } */ 
> +  __builtin_set_fpscr_rn(-1);  /* { dg-error "argument 1 must be a variable or a literal between 0 and 3, inclusive" } */ 
> +  __builtin_set_fpscr_rn(4);   /* { dg-error "argument 1 must be a variable or a literal between 0 and 3, inclusive" } */ 
>  }
>  

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c
  2021-11-18 16:36 [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c Bill Schmidt
  2021-12-01 16:36 ` [PATCH, PING] " Bill Schmidt
@ 2021-12-01 23:00 ` Segher Boessenkool
  2021-12-02 16:43   ` Bill Schmidt
  1 sibling, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2021-12-01 23:00 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches, David Edelsohn

On Thu, Nov 18, 2021 at 10:36:52AM -0600, Bill Schmidt wrote:
> Hi!  This is the last patch broken out of the previous test suite patch
> for the new builtins support.

Whew :-)

> One advantage of the new builtins support is uniform error messages for
> arguments with restricted values.  Previously this was done in many places
> in an ad hoc manner, with little uniformity.  This patch adjusts the
> expected error messages accordingly.
> 
> All such error messages are now one of the following:
>   "argument %d must be a %d-bit unsigned literal"
>   "argument %d must be a literal between %d and %d, inclusive"
>   "argument %d must be a variable or a literal between %d and %d, inclusive"
>   "argument %d must be either a literal %d or a literal %d"
> 
> These messages were chosen to require the fewest changes from previous
> messages while still introducing uniformity.  This patch adjusts error
> messages for some cases where this produces changed messages.  In
> particular, some messages are improved because previously they did not
> admit the possibility that an argument could hold a variable.

Same comment as on the previous patch.  But, okay for trunk.  Thanks!


Segher

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c
  2021-12-01 23:00 ` [PATCH] " Segher Boessenkool
@ 2021-12-02 16:43   ` Bill Schmidt
  2021-12-02 22:24     ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: Bill Schmidt @ 2021-12-02 16:43 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches, David Edelsohn

Hi!

On 12/1/21 5:00 PM, Segher Boessenkool wrote:
> On Thu, Nov 18, 2021 at 10:36:52AM -0600, Bill Schmidt wrote:
>> Hi!  This is the last patch broken out of the previous test suite patch
>> for the new builtins support.
> Whew :-)
>
>> One advantage of the new builtins support is uniform error messages for
>> arguments with restricted values.  Previously this was done in many places
>> in an ad hoc manner, with little uniformity.  This patch adjusts the
>> expected error messages accordingly.
>>
>> All such error messages are now one of the following:
>>   "argument %d must be a %d-bit unsigned literal"
>>   "argument %d must be a literal between %d and %d, inclusive"
>>   "argument %d must be a variable or a literal between %d and %d, inclusive"
>>   "argument %d must be either a literal %d or a literal %d"
>>
>> These messages were chosen to require the fewest changes from previous
>> messages while still introducing uniformity.  This patch adjusts error
>> messages for some cases where this produces changed messages.  In
>> particular, some messages are improved because previously they did not
>> admit the possibility that an argument could hold a variable.
> Same comment as on the previous patch.  But, okay for trunk.  Thanks!

Thank you for all of the reviews!  I combined recent patches that need to go
upstream together to avoid bisect problems, and pushed them as r12-5752.
The new built-in infrastructure is now enabled!

I'll start working on a patch series to remove all the no longer needed code.

Thanks again for all of your help in getting this work reviewed, and for
all the improvements as a result!

Bill

>
>
> Segher

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c
  2021-12-02 16:43   ` Bill Schmidt
@ 2021-12-02 22:24     ` Segher Boessenkool
  2021-12-03 23:32       ` Peter Bergner
  0 siblings, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2021-12-02 22:24 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches, David Edelsohn

On Thu, Dec 02, 2021 at 10:43:24AM -0600, Bill Schmidt wrote:
> The new built-in infrastructure is now enabled!

Congratulations, and thanks for all the work!


Segher

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c
  2021-12-02 22:24     ` Segher Boessenkool
@ 2021-12-03 23:32       ` Peter Bergner
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Bergner @ 2021-12-03 23:32 UTC (permalink / raw)
  To: Segher Boessenkool, Bill Schmidt; +Cc: GCC Patches, David Edelsohn

On 12/2/21 4:24 PM, Segher Boessenkool wrote:
> On Thu, Dec 02, 2021 at 10:43:24AM -0600, Bill Schmidt wrote:
>> The new built-in infrastructure is now enabled!
> 
> Congratulations, and thanks for all the work!

A big +1!

Peter




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-03 23:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 16:36 [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c Bill Schmidt
2021-12-01 16:36 ` [PATCH, PING] " Bill Schmidt
2021-12-01 23:00 ` [PATCH] " Segher Boessenkool
2021-12-02 16:43   ` Bill Schmidt
2021-12-02 22:24     ` Segher Boessenkool
2021-12-03 23:32       ` Peter Bergner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).