LoongArch: Remove constraint z from movsi_internal

Message ID 20231215125727.308264-1-xry111@xry111.site
State Unresolved
Headers
Series LoongArch: Remove constraint z from movsi_internal |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Xi Ruoyao Dec. 15, 2023, 12:56 p.m. UTC
  We don't allow SImode in FCC, so constraint z is never really used
here.

gcc/ChangeLog:

	* config/loongarch/loongarch.md (movsi_internal): Remove
	constraint z.
---

Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?

 gcc/config/loongarch/loongarch.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Xi Ruoyao Jan. 16, 2024, 5:34 a.m. UTC | #1
Ping.

On Fri, 2023-12-15 at 20:56 +0800, Xi Ruoyao wrote:
> We don't allow SImode in FCC, so constraint z is never really used
> here.
> 
> gcc/ChangeLog:
> 
> 	* config/loongarch/loongarch.md (movsi_internal): Remove
> 	constraint z.
> ---
> 
> Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?
> 
>  gcc/config/loongarch/loongarch.md | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
> index a5d0dcd65fe..404a663c1a6 100644
> --- a/gcc/config/loongarch/loongarch.md
> +++ b/gcc/config/loongarch/loongarch.md
> @@ -2108,8 +2108,8 @@ (define_expand "movsi"
>  })
>  
>  (define_insn_and_split "*movsi_internal"
> -  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m,*r,*z")
> -	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f,*z,*r"))]
> +  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m")
> +	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f"))]
>    "(register_operand (operands[0], SImode)
>      || reg_or_0_operand (operands[1], SImode))"
>    { return loongarch_output_move (operands[0], operands[1]); }
> @@ -2122,7 +2122,7 @@ (define_insn_and_split "*movsi_internal"
>    DONE;
>  }
>    "
> -  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore,mftg,mgtf")
> +  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore")
>     (set_attr "mode" "SI")])
>  
>  ;; 16-bit Integer moves
  
chenglulu Jan. 16, 2024, 6:16 a.m. UTC | #2
在 2024/1/16 下午1:34, Xi Ruoyao 写道:
> Ping.
>
> On Fri, 2023-12-15 at 20:56 +0800, Xi Ruoyao wrote:
>> We don't allow SImode in FCC, so constraint z is never really used
>> here.
>>
>> gcc/ChangeLog:
>>
>> 	* config/loongarch/loongarch.md (movsi_internal): Remove
>> 	constraint z.
>> ---
>>
>> Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?
>>
>>   gcc/config/loongarch/loongarch.md | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
>> index a5d0dcd65fe..404a663c1a6 100644
>> --- a/gcc/config/loongarch/loongarch.md
>> +++ b/gcc/config/loongarch/loongarch.md
>> @@ -2108,8 +2108,8 @@ (define_expand "movsi"
>>   })
>>   
>>   (define_insn_and_split "*movsi_internal"
>> -  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m,*r,*z")
>> -	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f,*z,*r"))]
>> +  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m")
>> +	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f"))]
>>     "(register_operand (operands[0], SImode)
>>       || reg_or_0_operand (operands[1], SImode))"
>>     { return loongarch_output_move (operands[0], operands[1]); }
>> @@ -2122,7 +2122,7 @@ (define_insn_and_split "*movsi_internal"
>>     DONE;
>>   }
>>     "
>> -  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore,mftg,mgtf")
>> +  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore")
>>      (set_attr "mode" "SI")])
>>   
Sorry, I have a question. If this place is removed, is movgr2fr in the 
loongarch_output_move function no longer needed?

>>   ;; 16-bit Integer moves
  
Xi Ruoyao Jan. 16, 2024, 6:20 a.m. UTC | #3
On Tue, 2024-01-16 at 14:16 +0800, chenglulu wrote:
> 
> 
> 在 2024/1/16 下午1:34, Xi Ruoyao 写道:
> > Ping.
> > 
> > On Fri, 2023-12-15 at 20:56 +0800, Xi Ruoyao wrote:
> > > We don't allow SImode in FCC, so constraint z is never really used
> > > here.
> > > 
> > > gcc/ChangeLog:
> > > 
> > > 	* config/loongarch/loongarch.md (movsi_internal): Remove
> > > 	constraint z.
> > > ---
> > > 
> > > Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?
> > > 
> > >   gcc/config/loongarch/loongarch.md | 6 +++---
> > >   1 file changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
> > > index a5d0dcd65fe..404a663c1a6 100644
> > > --- a/gcc/config/loongarch/loongarch.md
> > > +++ b/gcc/config/loongarch/loongarch.md
> > > @@ -2108,8 +2108,8 @@ (define_expand "movsi"
> > >   })
> > >   
> > >   (define_insn_and_split "*movsi_internal"
> > > -  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m,*r,*z")
> > > -	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f,*z,*r"))]
> > > +  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m")
> > > +	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f"))]
> > >     "(register_operand (operands[0], SImode)
> > >       || reg_or_0_operand (operands[1], SImode))"
> > >     { return loongarch_output_move (operands[0], operands[1]); }
> > > @@ -2122,7 +2122,7 @@ (define_insn_and_split "*movsi_internal"
> > >     DONE;
> > >   }
> > >     "
> > > -  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore,mftg,mgtf")
> > > +  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore")
> > >      (set_attr "mode" "SI")])
> > >   
> Sorry, I have a question. If this place is removed, is movgr2fr in the
> loongarch_output_move function no longer needed?

It's needed for moving SImode into FPR.  "z" is FCC_REGS, not FP_REGS. 
I cannot see movgr2cf or movfr2cf in loongarch_output_move.
  
chenglulu Jan. 16, 2024, 6:23 a.m. UTC | #4
在 2024/1/16 下午2:20, Xi Ruoyao 写道:
> On Tue, 2024-01-16 at 14:16 +0800, chenglulu wrote:
>>
>> 在 2024/1/16 下午1:34, Xi Ruoyao 写道:
>>> Ping.
>>>
>>> On Fri, 2023-12-15 at 20:56 +0800, Xi Ruoyao wrote:
>>>> We don't allow SImode in FCC, so constraint z is never really used
>>>> here.
>>>>
>>>> gcc/ChangeLog:
>>>>
>>>> 	* config/loongarch/loongarch.md (movsi_internal): Remove
>>>> 	constraint z.
>>>> ---
>>>>
>>>> Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?
>>>>
>>>>    gcc/config/loongarch/loongarch.md | 6 +++---
>>>>    1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
>>>> index a5d0dcd65fe..404a663c1a6 100644
>>>> --- a/gcc/config/loongarch/loongarch.md
>>>> +++ b/gcc/config/loongarch/loongarch.md
>>>> @@ -2108,8 +2108,8 @@ (define_expand "movsi"
>>>>    })
>>>>    
>>>>    (define_insn_and_split "*movsi_internal"
>>>> -  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m,*r,*z")
>>>> -	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f,*z,*r"))]
>>>> +  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m")
>>>> +	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f"))]
>>>>      "(register_operand (operands[0], SImode)
>>>>        || reg_or_0_operand (operands[1], SImode))"
>>>>      { return loongarch_output_move (operands[0], operands[1]); }
>>>> @@ -2122,7 +2122,7 @@ (define_insn_and_split "*movsi_internal"
>>>>      DONE;
>>>>    }
>>>>      "
>>>> -  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore,mftg,mgtf")
>>>> +  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore")
>>>>       (set_attr "mode" "SI")])
>>>>    
>> Sorry, I have a question. If this place is removed, is movgr2fr in the
>> loongarch_output_move function no longer needed?
> It's needed for moving SImode into FPR.  "z" is FCC_REGS, not FP_REGS.
> I cannot see movgr2cf or movfr2cf in loongarch_output_move.

Well, I saw it wrong, I have no other questions.

Thanks!
  

Patch

diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
index a5d0dcd65fe..404a663c1a6 100644
--- a/gcc/config/loongarch/loongarch.md
+++ b/gcc/config/loongarch/loongarch.md
@@ -2108,8 +2108,8 @@  (define_expand "movsi"
 })
 
 (define_insn_and_split "*movsi_internal"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m,*r,*z")
-	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f,*z,*r"))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,w,*f,f,*r,*m")
+	(match_operand:SI 1 "move_operand" "r,Yd,w,rJ,*r*J,m,*f,*f"))]
   "(register_operand (operands[0], SImode)
     || reg_or_0_operand (operands[1], SImode))"
   { return loongarch_output_move (operands[0], operands[1]); }
@@ -2122,7 +2122,7 @@  (define_insn_and_split "*movsi_internal"
   DONE;
 }
   "
-  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore,mftg,mgtf")
+  [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore")
    (set_attr "mode" "SI")])
 
 ;; 16-bit Integer moves