LoongArch: Remove the definition of the macro LOGICAL_OP_NON_SHORT_CIRCUIT under the architecture and use the default definition instead.

Message ID 20230413115126.1568212-1-chenglulu@loongson.cn
State Accepted
Headers
Series LoongArch: Remove the definition of the macro LOGICAL_OP_NON_SHORT_CIRCUIT under the architecture and use the default definition instead. |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

chenglulu April 13, 2023, 11:51 a.m. UTC
  In some cases, setting this macro as the default can reduce the number of conditional
branch instructions.

gcc/ChangeLog:

	* config/loongarch/loongarch.h (LOGICAL_OP_NON_SHORT_CIRCUIT): Remove the macro
	definition.
---
 gcc/config/loongarch/loongarch.h | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Xi Ruoyao April 13, 2023, 12:24 p.m. UTC | #1
On Thu, 2023-04-13 at 19:51 +0800, Lulu Cheng wrote:
> In some cases, setting this macro as the default can reduce the number of conditional
> branch instructions.
> 
> gcc/ChangeLog:
> 
>         * config/loongarch/loongarch.h (LOGICAL_OP_NON_SHORT_CIRCUIT): Remove the macro
>         definition.

I think it's OK for GCC 13.  At least the result is better for simple
cases like "x >= a && x < b". 

> ---
>  gcc/config/loongarch/loongarch.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
> index f8167875646..6b7dbecd3ff 100644
> --- a/gcc/config/loongarch/loongarch.h
> +++ b/gcc/config/loongarch/loongarch.h
> @@ -836,7 +836,6 @@ typedef struct {
>     1 is the default; other values are interpreted relative to that.  */
>  
>  #define BRANCH_COST(speed_p, predictable_p) loongarch_branch_cost
> -#define LOGICAL_OP_NON_SHORT_CIRCUIT 0
>  
>  /* Return the asm template for a conditional branch instruction.
>     OPCODE is the opcode's mnemonic and OPERANDS is the asm template for
  
chenglulu April 13, 2023, 12:30 p.m. UTC | #2
在 2023/4/13 下午8:24, Xi Ruoyao 写道:
> On Thu, 2023-04-13 at 19:51 +0800, Lulu Cheng wrote:
>> In some cases, setting this macro as the default can reduce the number of conditional
>> branch instructions.
>>
>> gcc/ChangeLog:
>>
>>          * config/loongarch/loongarch.h (LOGICAL_OP_NON_SHORT_CIRCUIT): Remove the macro
>>          definition.
> I think it's OK for GCC 13.  At least the result is better for simple
> cases like "x >= a && x < b".
I also want to merge to GCC13.:-D
>
>> ---
>>   gcc/config/loongarch/loongarch.h | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
>> index f8167875646..6b7dbecd3ff 100644
>> --- a/gcc/config/loongarch/loongarch.h
>> +++ b/gcc/config/loongarch/loongarch.h
>> @@ -836,7 +836,6 @@ typedef struct {
>>      1 is the default; other values are interpreted relative to that.  */
>>   
>>   #define BRANCH_COST(speed_p, predictable_p) loongarch_branch_cost
>> -#define LOGICAL_OP_NON_SHORT_CIRCUIT 0
>>   
>>   /* Return the asm template for a conditional branch instruction.
>>      OPCODE is the opcode's mnemonic and OPERANDS is the asm template for
  
chenglulu April 18, 2023, 1:54 a.m. UTC | #3
Pushed to r14-15.

Due to my reasons, this modification did not catch up with the creation 
of the releases/gcc-13 branch,

can I still submit this modification to releases/gcc-13?:-(


在 2023/4/13 下午8:24, Xi Ruoyao 写道:
> On Thu, 2023-04-13 at 19:51 +0800, Lulu Cheng wrote:
>> In some cases, setting this macro as the default can reduce the number of conditional
>> branch instructions.
>>
>> gcc/ChangeLog:
>>
>>          * config/loongarch/loongarch.h (LOGICAL_OP_NON_SHORT_CIRCUIT): Remove the macro
>>          definition.
> I think it's OK for GCC 13.  At least the result is better for simple
> cases like "x >= a && x < b".
>
>> ---
>>   gcc/config/loongarch/loongarch.h | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
>> index f8167875646..6b7dbecd3ff 100644
>> --- a/gcc/config/loongarch/loongarch.h
>> +++ b/gcc/config/loongarch/loongarch.h
>> @@ -836,7 +836,6 @@ typedef struct {
>>      1 is the default; other values are interpreted relative to that.  */
>>   
>>   #define BRANCH_COST(speed_p, predictable_p) loongarch_branch_cost
>> -#define LOGICAL_OP_NON_SHORT_CIRCUIT 0
>>   
>>   /* Return the asm template for a conditional branch instruction.
>>      OPCODE is the opcode's mnemonic and OPERANDS is the asm template for
  
Xi Ruoyao April 18, 2023, 6:35 a.m. UTC | #4
On Tue, 2023-04-18 at 09:54 +0800, Lulu Cheng wrote:
> Pushed to r14-15.
> 
> Due to my reasons, this modification did not catch up with the creation 
> of the releases/gcc-13 branch,
> 
> can I still submit this modification to releases/gcc-13?:-(

I guess we need a decision from Jakub.
  

Patch

diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index f8167875646..6b7dbecd3ff 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -836,7 +836,6 @@  typedef struct {
    1 is the default; other values are interpreted relative to that.  */
 
 #define BRANCH_COST(speed_p, predictable_p) loongarch_branch_cost
-#define LOGICAL_OP_NON_SHORT_CIRCUIT 0
 
 /* Return the asm template for a conditional branch instruction.
    OPCODE is the opcode's mnemonic and OPERANDS is the asm template for