diff mbox series

[rs6000] Add const_vector into any_operand predicate

Message ID b2807986-8680-4290-830a-3713209d4670@linux.ibm.com
State New
Headers show
Series [rs6000] Add const_vector into any_operand predicate | expand

Commit Message

HAO CHEN GUI July 25, 2024, 3:34 a.m. UTC
Hi,
  This patch add const_vector into any_operand predicate. From my
understanding, any_operand should include all kinds of operands.
The const_vector should be included. As emit_move_insn doesn't check
the predicate, the const_vector is actually supported by vector mode
move expand. So it should be added into any_operand in case other gen
function (for instance, maybe_gen_insn) checks the predicate.

  Bootstrapped and tested on x86 and powerpc64-linux BE and LE with no
regressions. Is it OK for trunk?

Thanks
Gui Haochen

ChangeLog
rs6000: Add const_vector into any_operand predicate

gcc/
	* config/rs6000/predicates.md (any_operand): Add const_vector.

patch.diff

Comments

Kewen.Lin July 31, 2024, 9:10 a.m. UTC | #1
Hi Haochen,

on 2024/7/25 11:34, HAO CHEN GUI wrote:
> Hi,
>   This patch add const_vector into any_operand predicate. From my
> understanding, any_operand should include all kinds of operands.
> The const_vector should be included. As emit_move_insn doesn't check
> the predicate, the const_vector is actually supported by vector mode
> move expand. So it should be added into any_operand in case other gen
> function (for instance, maybe_gen_insn) checks the predicate.
> 
>   Bootstrapped and tested on x86 and powerpc64-linux BE and LE with no
> regressions. Is it OK for trunk?> 
> Thanks
> Gui Haochen
> 
> ChangeLog
> rs6000: Add const_vector into any_operand predicate
> 
> gcc/
> 	* config/rs6000/predicates.md (any_operand): Add const_vector.
> 
> patch.diff
> diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
> index d23ce9a77a3..12600368c43 100644
> --- a/gcc/config/rs6000/predicates.md
> +++ b/gcc/config/rs6000/predicates.md
> @@ -19,7 +19,7 @@
> 
>  ;; Return 1 for anything except PARALLEL.
>  (define_predicate "any_operand"
> -  (match_code "const_int,const_double,const_wide_int,const,symbol_ref,label_ref,subreg,reg,mem"))
> +  (match_code "const_int,const_double,const_wide_int,const,symbol_ref,label_ref,subreg,reg,mem,const_vector"))

CC Mike since he added mov<VEC_M:mode> and movmisalign<VEC_N:mode>.

From the name, its associated comments and what it currently consists of,
this seemed to be an oversight and looks reasonable to fix.  Maybe it's
read better to put "const_vector" after "const_wide_int", OK for trunk
with this tweaked, but please give others two days or so to chime in,
thanks!

BR,
Kewen
HAO CHEN GUI Aug. 6, 2024, 6:19 a.m. UTC | #2
Thanks for reviewing the patch. Committed as r15-2740.

在 2024/7/31 17:10, Kewen.Lin 写道:
> Hi Haochen,
> 
> on 2024/7/25 11:34, HAO CHEN GUI wrote:
>> Hi,
>>   This patch add const_vector into any_operand predicate. From my
>> understanding, any_operand should include all kinds of operands.
>> The const_vector should be included. As emit_move_insn doesn't check
>> the predicate, the const_vector is actually supported by vector mode
>> move expand. So it should be added into any_operand in case other gen
>> function (for instance, maybe_gen_insn) checks the predicate.
>>
>>   Bootstrapped and tested on x86 and powerpc64-linux BE and LE with no
>> regressions. Is it OK for trunk?> 
>> Thanks
>> Gui Haochen
>>
>> ChangeLog
>> rs6000: Add const_vector into any_operand predicate
>>
>> gcc/
>> 	* config/rs6000/predicates.md (any_operand): Add const_vector.
>>
>> patch.diff
>> diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
>> index d23ce9a77a3..12600368c43 100644
>> --- a/gcc/config/rs6000/predicates.md
>> +++ b/gcc/config/rs6000/predicates.md
>> @@ -19,7 +19,7 @@
>>
>>  ;; Return 1 for anything except PARALLEL.
>>  (define_predicate "any_operand"
>> -  (match_code "const_int,const_double,const_wide_int,const,symbol_ref,label_ref,subreg,reg,mem"))
>> +  (match_code "const_int,const_double,const_wide_int,const,symbol_ref,label_ref,subreg,reg,mem,const_vector"))
> 
> CC Mike since he added mov<VEC_M:mode> and movmisalign<VEC_N:mode>.
> 
>>From the name, its associated comments and what it currently consists of,
> this seemed to be an oversight and looks reasonable to fix.  Maybe it's
> read better to put "const_vector" after "const_wide_int", OK for trunk
> with this tweaked, but please give others two days or so to chime in,
> thanks!
> 
> BR,
> Kewen
>
diff mbox series

Patch

diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index d23ce9a77a3..12600368c43 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -19,7 +19,7 @@ 

 ;; Return 1 for anything except PARALLEL.
 (define_predicate "any_operand"
-  (match_code "const_int,const_double,const_wide_int,const,symbol_ref,label_ref,subreg,reg,mem"))
+  (match_code "const_int,const_double,const_wide_int,const,symbol_ref,label_ref,subreg,reg,mem,const_vector"))

 ;; Return 1 for any PARALLEL.
 (define_predicate "any_parallel_operand"