On 19/08/25 9:33 PM, Segher Boessenkool wrote:
> Hi!
> 
> On Mon, Dec 02, 2024 at 02:20:06PM +0530, Surya Kumari Jangala wrote:
>> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
>> index 02a2f1152db..d0c528f4d5f 100644
>> --- a/gcc/config/rs6000/rs6000.cc
>> +++ b/gcc/config/rs6000/rs6000.cc
>> @@ -6652,7 +6652,7 @@ vspltisw_vupkhsw_constant_p (rtx op, machine_mode 
>> mode, int *constant_ptr)
>>      return false;
>>  
>>    value = INTVAL (elt);
>> -  if (value == 0 || value == 1
>> +  if (value == 0 || value == -1
> 
> Was 1 incorrect here?  The email and the changelog don't say.

Yes, 1 is not correct here because returning false for 1 results in a load of
the constant from .rodata instead of generating the instructions vspltisw and
vupkhsw.

-Surya

> 
>> +++ b/gcc/testsuite/gcc.target/powerpc/pr107757-1.c
>> @@ -0,0 +1,14 @@
>> +/* { dg-do compile } */
> 
> That's the default.
> 
>> +/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
>> +/* { dg-require-effective-target powerpc_vsx } */
> 
> That is always true, see your -mcpu=.
> 
> Nothing here seems to want VSX at all anyway?
> 
>> --- /dev/null
>> +++ b/gcc/testsuite/gcc.target/powerpc/pr107757-2.c
>> @@ -0,0 +1,13 @@
>> +/* { dg-do compile } */
>> +/* { dg-options "-mdejagnu-cpu=power8 -O2" } */
>> +/* { dg-require-effective-target powerpc_vsx } */
> 
> Same here.
> 
> 
> Segher

Reply via email to