diff mbox series

[v2] LoongArch: Fix inconsistent description in *sge<u>_<X:mode><GPR:mode>

Message ID 20240305080509.16418-1-guojie@loongson.cn
State New
Headers show
Series [v2] LoongArch: Fix inconsistent description in *sge<u>_<X:mode><GPR:mode> | expand

Commit Message

Guo Jie March 5, 2024, 8:05 a.m. UTC
The constraint of op[1] is inconsistent with the output template.

gcc/ChangeLog:

	* config/loongarch/loongarch.md
	(define_insn "*sge<u>_<X:mode><GPR:mode>"): Fix inconsistency
	error.

---
Update in v2:
    Remove useless support for op[1] is const_imm12_operand.

---
 gcc/config/loongarch/loongarch.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xi Ruoyao March 5, 2024, 9:45 a.m. UTC | #1
On Tue, 2024-03-05 at 16:05 +0800, Guo Jie wrote:
> The constraint of op[1] is inconsistent with the output template.
> 
> gcc/ChangeLog:
> 
> 	* config/loongarch/loongarch.md
> 	(define_insn "*sge<u>_<X:mode><GPR:mode>"): Fix inconsistency
> 	error.
> 
> ---
> Update in v2:
>     Remove useless support for op[1] is const_imm12_operand.
> 
> ---
>  gcc/config/loongarch/loongarch.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
> index f3b5c641fce..e35a001e0ed 100644
> --- a/gcc/config/loongarch/loongarch.md
> +++ b/gcc/config/loongarch/loongarch.md
> @@ -3360,7 +3360,7 @@ (define_insn "*sge<u>_<X:mode><GPR:mode>"
>  	(any_ge:GPR (match_operand:X 1 "register_operand" "r")
>  		     (const_int 1)))]
>    ""
> -  "slt<u>i\t%0,%.,%1"
> +  "slt<u>\t%0,%.,%1"
>    [(set_attr "type" "slt")
>     (set_attr "mode" "<X:MODE>")])

Hmm, this define_insn seems never really used or it would generate
something like "sltui $r4,$r0,$r4" and trigger an assembler failure. 
The generic path seems already converting "x >= 1" to "x > 0".

So it seems we should just remove this define_insn?
diff mbox series

Patch

diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
index f3b5c641fce..e35a001e0ed 100644
--- a/gcc/config/loongarch/loongarch.md
+++ b/gcc/config/loongarch/loongarch.md
@@ -3360,7 +3360,7 @@  (define_insn "*sge<u>_<X:mode><GPR:mode>"
 	(any_ge:GPR (match_operand:X 1 "register_operand" "r")
 		     (const_int 1)))]
   ""
-  "slt<u>i\t%0,%.,%1"
+  "slt<u>\t%0,%.,%1"
   [(set_attr "type" "slt")
    (set_attr "mode" "<X:MODE>")])