diff mbox series

rs6000: Don't turn off VSX for P9 VECTOR when TARGET_AVOID_XFORM set

Message ID 8552a3a2-60ff-dd2d-1053-e2a4d5e72af3@linux.ibm.com
State New
Headers show
Series rs6000: Don't turn off VSX for P9 VECTOR when TARGET_AVOID_XFORM set | expand

Commit Message

Kewen.Lin Dec. 29, 2021, 9:36 a.m. UTC
Hi,

When TARGET_AVOID_XFORM is set, we turn off VSX.  But at least from
ISA3.0 (Power9), we support DQ form vector load/store.  This patch
is to make it not clear VSX when P9 VECTOR supported, it also checks
some flags which P9 VECTOR relies on, otherwise those flags could
disable P9 VECTOR later.

Bootstrapped and regtested on powerpc64le-linux-gnu P9 and
powerpc64-linux-gnu P8.

Is it ok for trunk?

BR,
Kewen
-----
gcc/ChangeLog:

	* config/rs6000/rs6000.c (rs6000_option_override_internal): Consider
	P9 VECTOR when determining to disable VSX for TARGET_AVOID_XFORM.
---
 gcc/config/rs6000/rs6000.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--
2.27.0

Comments

Kewen.Lin Jan. 13, 2022, 2:03 a.m. UTC | #1
Gentle ping:

https://gcc.gnu.org/pipermail/gcc-patches/2021-December/587449.html

on 2021/12/29 下午5:36, Kewen.Lin via Gcc-patches wrote:
> Hi,
> 
> When TARGET_AVOID_XFORM is set, we turn off VSX.  But at least from
> ISA3.0 (Power9), we support DQ form vector load/store.  This patch
> is to make it not clear VSX when P9 VECTOR supported, it also checks
> some flags which P9 VECTOR relies on, otherwise those flags could
> disable P9 VECTOR later.
> 
> Bootstrapped and regtested on powerpc64le-linux-gnu P9 and
> powerpc64-linux-gnu P8.
> 
> Is it ok for trunk?
> 
> BR,
> Kewen
> -----
> gcc/ChangeLog:
> 
> 	* config/rs6000/rs6000.c (rs6000_option_override_internal): Consider
> 	P9 VECTOR when determining to disable VSX for TARGET_AVOID_XFORM.
> ---
>  gcc/config/rs6000/rs6000.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> index 66b01e589b0..c020947abc8 100644
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -3865,7 +3865,10 @@ rs6000_option_override_internal (bool global_init_p)
>  	      rs6000_isa_flags_explicit |= OPTION_MASK_VSX;
>  	    }
>  	}
> -      else if (TARGET_AVOID_XFORM > 0)
> +      else if (TARGET_AVOID_XFORM > 0
> +	       /* Exclude P9 VECTOR which supports DQ form, but need to check
> +		  some flags which are able to disable it as well.  */
> +	       && !(TARGET_ALTIVEC && TARGET_P8_VECTOR && TARGET_P9_VECTOR))
>  	msg = N_("%<-mvsx%> needs indexed addressing");
>        else if (!TARGET_ALTIVEC && (rs6000_isa_flags_explicit
>  				   & OPTION_MASK_ALTIVEC))
> --
> 2.27.0
>
Kewen.Lin Jan. 26, 2022, 2:17 a.m. UTC | #2
Gentle ping:

https://gcc.gnu.org/pipermail/gcc-patches/2021-December/587449.html

BR,
Kewen

> on 2021/12/29 下午5:36, Kewen.Lin via Gcc-patches wrote:
>> Hi,
>>
>> When TARGET_AVOID_XFORM is set, we turn off VSX.  But at least from
>> ISA3.0 (Power9), we support DQ form vector load/store.  This patch
>> is to make it not clear VSX when P9 VECTOR supported, it also checks
>> some flags which P9 VECTOR relies on, otherwise those flags could
>> disable P9 VECTOR later.
>>
>> Bootstrapped and regtested on powerpc64le-linux-gnu P9 and
>> powerpc64-linux-gnu P8.
>>
>> Is it ok for trunk?
>>
>> BR,
>> Kewen
>> -----
>> gcc/ChangeLog:
>>
>> 	* config/rs6000/rs6000.c (rs6000_option_override_internal): Consider
>> 	P9 VECTOR when determining to disable VSX for TARGET_AVOID_XFORM.
>> ---
>>  gcc/config/rs6000/rs6000.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
>> index 66b01e589b0..c020947abc8 100644
>> --- a/gcc/config/rs6000/rs6000.c
>> +++ b/gcc/config/rs6000/rs6000.c
>> @@ -3865,7 +3865,10 @@ rs6000_option_override_internal (bool global_init_p)
>>  	      rs6000_isa_flags_explicit |= OPTION_MASK_VSX;
>>  	    }
>>  	}
>> -      else if (TARGET_AVOID_XFORM > 0)
>> +      else if (TARGET_AVOID_XFORM > 0
>> +	       /* Exclude P9 VECTOR which supports DQ form, but need to check
>> +		  some flags which are able to disable it as well.  */
>> +	       && !(TARGET_ALTIVEC && TARGET_P8_VECTOR && TARGET_P9_VECTOR))
>>  	msg = N_("%<-mvsx%> needs indexed addressing");
>>        else if (!TARGET_ALTIVEC && (rs6000_isa_flags_explicit
>>  				   & OPTION_MASK_ALTIVEC))
>> --
>> 2.27.0
>>
>
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 66b01e589b0..c020947abc8 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -3865,7 +3865,10 @@  rs6000_option_override_internal (bool global_init_p)
 	      rs6000_isa_flags_explicit |= OPTION_MASK_VSX;
 	    }
 	}
-      else if (TARGET_AVOID_XFORM > 0)
+      else if (TARGET_AVOID_XFORM > 0
+	       /* Exclude P9 VECTOR which supports DQ form, but need to check
+		  some flags which are able to disable it as well.  */
+	       && !(TARGET_ALTIVEC && TARGET_P8_VECTOR && TARGET_P9_VECTOR))
 	msg = N_("%<-mvsx%> needs indexed addressing");
       else if (!TARGET_ALTIVEC && (rs6000_isa_flags_explicit
 				   & OPTION_MASK_ALTIVEC))