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

Hi!  This patch is broken out from the test case 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 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.

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/pr80315-1.c: Adjust error message.
	* gcc.target/powerpc/pr80315-2.c: Likewise.
	* gcc.target/powerpc/pr80315-3.c: Likewise.
	* gcc.target/powerpc/pr80315-4.c: Likewise.
	* gcc.target/powerpc/pr88100.c: Likewise.
---
 gcc/testsuite/gcc.target/powerpc/pr80315-1.c |  2 +-
 gcc/testsuite/gcc.target/powerpc/pr80315-2.c |  2 +-
 gcc/testsuite/gcc.target/powerpc/pr80315-3.c |  2 +-
 gcc/testsuite/gcc.target/powerpc/pr80315-4.c |  2 +-
 gcc/testsuite/gcc.target/powerpc/pr88100.c   | 12 ++++++------
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-1.c b/gcc/testsuite/gcc.target/powerpc/pr80315-1.c
index e2db0ff4b5f..f37f1f169a2 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr80315-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr80315-1.c
@@ -10,6 +10,6 @@ main()
   int mask;
 
   /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
-  res = __builtin_crypto_vshasigmaw (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
+  res = __builtin_crypto_vshasigmaw (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
   return 0;
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-2.c b/gcc/testsuite/gcc.target/powerpc/pr80315-2.c
index 144b705c012..0819a0511b7 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr80315-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr80315-2.c
@@ -10,6 +10,6 @@ main ()
   int mask;
 
   /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
-  res = __builtin_crypto_vshasigmad (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
+  res = __builtin_crypto_vshasigmad (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
   return 0;
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-3.c b/gcc/testsuite/gcc.target/powerpc/pr80315-3.c
index 99a3e24eadd..cc2e46cf5cb 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr80315-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr80315-3.c
@@ -12,6 +12,6 @@ main ()
   int mask;
 
   /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
-  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
+  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
   return res;
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-4.c b/gcc/testsuite/gcc.target/powerpc/pr80315-4.c
index 7f5f6f75029..ac12910741b 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr80315-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr80315-4.c
@@ -12,6 +12,6 @@ main ()
   int mask;
 
   /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
-  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
+  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
   return res;
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/pr88100.c b/gcc/testsuite/gcc.target/powerpc/pr88100.c
index 4452145ce95..764c897a497 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr88100.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr88100.c
@@ -10,35 +10,35 @@
 vector unsigned char
 splatu1 (void)
 {
-  return vec_splat_u8(0x100);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
+  return vec_splat_u8(0x100);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
 }
 
 vector unsigned short
 splatu2 (void)
 {
-  return vec_splat_u16(0x10000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
+  return vec_splat_u16(0x10000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
 }
 
 vector unsigned int
 splatu3 (void)
 {
-  return vec_splat_u32(0x10000000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
+  return vec_splat_u32(0x10000000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
 }
 
 vector signed char
 splats1 (void)
 {
-  return vec_splat_s8(0x100);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
+  return vec_splat_s8(0x100);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
 }
 
 vector signed short
 splats2 (void)
 {
-  return vec_splat_s16(0x10000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
+  return vec_splat_s16(0x10000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
 }
 
 vector signed int
 splats3 (void)
 {
-  return vec_splat_s32(0x10000000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
+  return vec_splat_s32(0x10000000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
 }
-- 
2.27.0



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

* [PATCH, PING] rs6000: Builtins test changes for pr80315-*.c, pr88100.c
  2021-11-18 16:15 [PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c Bill Schmidt
@ 2021-12-01 16:35 ` Bill Schmidt
  2021-12-01 22:29 ` [PATCH] " Segher Boessenkool
  1 sibling, 0 replies; 5+ messages in thread
From: Bill Schmidt @ 2021-12-01 16:35 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:15 AM, Bill Schmidt wrote:
> Hi!  This patch is broken out from the test case 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 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.
>
> 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/pr80315-1.c: Adjust error message.
> 	* gcc.target/powerpc/pr80315-2.c: Likewise.
> 	* gcc.target/powerpc/pr80315-3.c: Likewise.
> 	* gcc.target/powerpc/pr80315-4.c: Likewise.
> 	* gcc.target/powerpc/pr88100.c: Likewise.
> ---
>  gcc/testsuite/gcc.target/powerpc/pr80315-1.c |  2 +-
>  gcc/testsuite/gcc.target/powerpc/pr80315-2.c |  2 +-
>  gcc/testsuite/gcc.target/powerpc/pr80315-3.c |  2 +-
>  gcc/testsuite/gcc.target/powerpc/pr80315-4.c |  2 +-
>  gcc/testsuite/gcc.target/powerpc/pr88100.c   | 12 ++++++------
>  5 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-1.c b/gcc/testsuite/gcc.target/powerpc/pr80315-1.c
> index e2db0ff4b5f..f37f1f169a2 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr80315-1.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr80315-1.c
> @@ -10,6 +10,6 @@ main()
>    int mask;
>  
>    /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
> -  res = __builtin_crypto_vshasigmaw (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
> +  res = __builtin_crypto_vshasigmaw (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
>    return 0;
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-2.c b/gcc/testsuite/gcc.target/powerpc/pr80315-2.c
> index 144b705c012..0819a0511b7 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr80315-2.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr80315-2.c
> @@ -10,6 +10,6 @@ main ()
>    int mask;
>  
>    /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
> -  res = __builtin_crypto_vshasigmad (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
> +  res = __builtin_crypto_vshasigmad (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
>    return 0;
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-3.c b/gcc/testsuite/gcc.target/powerpc/pr80315-3.c
> index 99a3e24eadd..cc2e46cf5cb 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr80315-3.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr80315-3.c
> @@ -12,6 +12,6 @@ main ()
>    int mask;
>  
>    /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
> -  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
> +  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
>    return res;
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr80315-4.c b/gcc/testsuite/gcc.target/powerpc/pr80315-4.c
> index 7f5f6f75029..ac12910741b 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr80315-4.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr80315-4.c
> @@ -12,6 +12,6 @@ main ()
>    int mask;
>  
>    /* Argument 2 must be 0 or 1.  Argument 3 must be in range 0..15.  */
> -  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be in the range \[0, 15\]} } */
> +  res = vec_shasigma_be (test, 1, 0xff); /* { dg-error {argument 3 must be a 4-bit unsigned literal} } */
>    return res;
>  }
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr88100.c b/gcc/testsuite/gcc.target/powerpc/pr88100.c
> index 4452145ce95..764c897a497 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr88100.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr88100.c
> @@ -10,35 +10,35 @@
>  vector unsigned char
>  splatu1 (void)
>  {
> -  return vec_splat_u8(0x100);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
> +  return vec_splat_u8(0x100);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
>  }
>  
>  vector unsigned short
>  splatu2 (void)
>  {
> -  return vec_splat_u16(0x10000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
> +  return vec_splat_u16(0x10000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
>  }
>  
>  vector unsigned int
>  splatu3 (void)
>  {
> -  return vec_splat_u32(0x10000000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
> +  return vec_splat_u32(0x10000000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
>  }
>  
>  vector signed char
>  splats1 (void)
>  {
> -  return vec_splat_s8(0x100);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
> +  return vec_splat_s8(0x100);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
>  }
>  
>  vector signed short
>  splats2 (void)
>  {
> -  return vec_splat_s16(0x10000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
> +  return vec_splat_s16(0x10000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
>  }
>  
>  vector signed int
>  splats3 (void)
>  {
> -  return vec_splat_s32(0x10000000);/* { dg-error "argument 1 must be a 5-bit signed literal" } */
> +  return vec_splat_s32(0x10000000);/* { dg-error "argument 1 must be a literal between -16 and 15, inclusive" } */
>  }

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

* Re: [PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c
  2021-11-18 16:15 [PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c Bill Schmidt
  2021-12-01 16:35 ` [PATCH, PING] " Bill Schmidt
@ 2021-12-01 22:29 ` Segher Boessenkool
  2021-12-01 22:42   ` Bill Schmidt
  1 sibling, 1 reply; 5+ messages in thread
From: Segher Boessenkool @ 2021-12-01 22:29 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches, David Edelsohn

On Thu, Nov 18, 2021 at 10:15:21AM -0600, Bill Schmidt wrote:
> Hi!  This patch is broken out from the test case 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 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.
> 
> Tested on powerpc64le-linux-gnu and powerpc64-linux-gnu (-m32/-m64) with
> no regressions.  is this okay for trunk?

We should have opnly the middle two of those messages.  But, okay for
trunk if you put this on some to-do list.  Thanks!


Segher

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

* Re: [PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c
  2021-12-01 22:29 ` [PATCH] " Segher Boessenkool
@ 2021-12-01 22:42   ` Bill Schmidt
  2021-12-02  8:36     ` Segher Boessenkool
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Schmidt @ 2021-12-01 22:42 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches, David Edelsohn

Hi!

On 12/1/21 4:29 PM, Segher Boessenkool wrote:
> On Thu, Nov 18, 2021 at 10:15:21AM -0600, Bill Schmidt wrote:
>> Hi!  This patch is broken out from the test case 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 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.
>>
>> Tested on powerpc64le-linux-gnu and powerpc64-linux-gnu (-m32/-m64) with
>> no regressions.  is this okay for trunk?
> We should have opnly the middle two of those messages.  But, okay for
> trunk if you put this on some to-do list.  Thanks!

The last one is actually needed also, because we have at least one case 
where the two supported values aren't contiguous.  We can do without the
first one, but that will affect quite a number of test cases, so agree
that this should be done later.  (We already had a whole lot of tests
of this form.)

Thanks for the review!
Bill

>
> Segher

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

* Re: [PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c
  2021-12-01 22:42   ` Bill Schmidt
@ 2021-12-02  8:36     ` Segher Boessenkool
  0 siblings, 0 replies; 5+ messages in thread
From: Segher Boessenkool @ 2021-12-02  8:36 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches, David Edelsohn

On Wed, Dec 01, 2021 at 04:42:19PM -0600, Bill Schmidt wrote:
> On 12/1/21 4:29 PM, Segher Boessenkool wrote:
> > On Thu, Nov 18, 2021 at 10:15:21AM -0600, Bill Schmidt wrote:
> >> All 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.
> >>
> >> Tested on powerpc64le-linux-gnu and powerpc64-linux-gnu (-m32/-m64) with
> >> no regressions.  is this okay for trunk?
> > We should have opnly the middle two of those messages.  But, okay for
> > trunk if you put this on some to-do list.  Thanks!
> 
> The last one is actually needed also, because we have at least one case 
> where the two supported values aren't contiguous.

Ah okay.  Nasty :-)

> We can do without the
> first one, but that will affect quite a number of test cases, so agree
> that this should be done later.  (We already had a whole lot of tests
> of this form.)

We never say "must be a 5-bit signed literal", although we have
instructions like that (vspltis[bhw] for example).  We also don't say
"unsigned 2-bit literal" or "unsigned 3-bit literal" because those are
just silly (almost as bad as "unsigned 1-bit literal" :-) )  And saying
"unsigned" keeps promulgating the confusion about what "unsigned"
*means* in C.


Segher

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

end of thread, other threads:[~2021-12-02  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 16:15 [PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c Bill Schmidt
2021-12-01 16:35 ` [PATCH, PING] " Bill Schmidt
2021-12-01 22:29 ` [PATCH] " Segher Boessenkool
2021-12-01 22:42   ` Bill Schmidt
2021-12-02  8:36     ` Segher Boessenkool

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).