From: Chenghui Pan <panchenghui@loongson.cn>
To: gcc-patches@gcc.gnu.org
Cc: xry111@xry111.site, i@xen0n.name, chenglulu@loongson.cn,
xuchenghua@loongson.cn, Chenghui Pan <panchenghui@loongson.cn>
Subject: [PATCH v2 2/3] LoongArch: Change loongarch_expand_vec_cmp()'s return type from bool to void.
Date: Fri, 15 Mar 2024 09:30:26 +0800 [thread overview]
Message-ID: <20240315013027.183888-3-panchenghui@loongson.cn> (raw)
In-Reply-To: <20240315013027.183888-1-panchenghui@loongson.cn>
This function is always return true at the end of function implementation,
so the return value is useless.
gcc/ChangeLog:
* config/loongarch/lasx.md (vec_cmp<mode><mode256_i>): Remove checking
of loongarch_expand_vec_cmp()'s return value.
(vec_cmpu<ILASX:mode><mode256_i>): Ditto.
* config/loongarch/lsx.md (vec_cmp<mode><mode_i>): Ditto.
(vec_cmpu<ILSX:mode><mode_i>): Ditto.
* config/loongarch/loongarch-protos.h
(loongarch_expand_vec_cmp): Change loongarch_expand_vec_cmp()'s return
type from bool to void.
* config/loongarch/loongarch.cc (loongarch_expand_vec_cmp): Ditto.
---
gcc/config/loongarch/lasx.md | 6 ++----
gcc/config/loongarch/loongarch-protos.h | 2 +-
gcc/config/loongarch/loongarch.cc | 3 +--
gcc/config/loongarch/lsx.md | 6 ++----
4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/gcc/config/loongarch/lasx.md b/gcc/config/loongarch/lasx.md
index ac84db7f0ce..8d4c6b4ec35 100644
--- a/gcc/config/loongarch/lasx.md
+++ b/gcc/config/loongarch/lasx.md
@@ -1383,8 +1383,7 @@ (define_expand "vec_cmp<mode><mode256_i>"
(match_operand:LASX 3 "register_operand")]))]
"ISA_HAS_LASX"
{
- bool ok = loongarch_expand_vec_cmp (operands);
- gcc_assert (ok);
+ loongarch_expand_vec_cmp (operands);
DONE;
})
@@ -1395,8 +1394,7 @@ (define_expand "vec_cmpu<ILASX:mode><mode256_i>"
(match_operand:ILASX 3 "register_operand")]))]
"ISA_HAS_LASX"
{
- bool ok = loongarch_expand_vec_cmp (operands);
- gcc_assert (ok);
+ loongarch_expand_vec_cmp (operands);
DONE;
})
diff --git a/gcc/config/loongarch/loongarch-protos.h b/gcc/config/loongarch/loongarch-protos.h
index 871544f760c..e3ed2b912a5 100644
--- a/gcc/config/loongarch/loongarch-protos.h
+++ b/gcc/config/loongarch/loongarch-protos.h
@@ -95,7 +95,7 @@ extern void loongarch_split_lsx_fill_d (rtx, rtx);
extern const char *loongarch_output_move (rtx, rtx);
#ifdef RTX_CODE
extern void loongarch_expand_scc (rtx *);
-extern bool loongarch_expand_vec_cmp (rtx *);
+extern void loongarch_expand_vec_cmp (rtx *);
extern void loongarch_expand_conditional_branch (rtx *);
extern void loongarch_expand_conditional_move (rtx *);
extern void loongarch_expand_conditional_trap (rtx);
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
index b25624c9406..7ef04329668 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -10801,13 +10801,12 @@ loongarch_expand_vec_cond_mask_expr (machine_mode mode, machine_mode vimode,
}
/* Expand integer vector comparison */
-bool
+void
loongarch_expand_vec_cmp (rtx operands[])
{
rtx_code code = GET_CODE (operands[1]);
loongarch_expand_lsx_cmp (operands[0], code, operands[2], operands[3]);
- return true;
}
/* Implement TARGET_PROMOTE_FUNCTION_MODE. */
diff --git a/gcc/config/loongarch/lsx.md b/gcc/config/loongarch/lsx.md
index b9b94b9079c..87d3e7c5d9f 100644
--- a/gcc/config/loongarch/lsx.md
+++ b/gcc/config/loongarch/lsx.md
@@ -518,8 +518,7 @@ (define_expand "vec_cmp<mode><mode_i>"
(match_operand:LSX 3 "register_operand")]))]
"ISA_HAS_LSX"
{
- bool ok = loongarch_expand_vec_cmp (operands);
- gcc_assert (ok);
+ loongarch_expand_vec_cmp (operands);
DONE;
})
@@ -530,8 +529,7 @@ (define_expand "vec_cmpu<ILSX:mode><mode_i>"
(match_operand:ILSX 3 "register_operand")]))]
"ISA_HAS_LSX"
{
- bool ok = loongarch_expand_vec_cmp (operands);
- gcc_assert (ok);
+ loongarch_expand_vec_cmp (operands);
DONE;
})
--
2.39.3
next prev parent reply other threads:[~2024-03-15 1:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 1:30 [PATCH v2 0/3] LoongArch: Cleanup unused/redundant codes Chenghui Pan
2024-03-15 1:30 ` [PATCH v2 1/3] LoongArch: Remove unused/useless definitions Chenghui Pan
2024-03-15 1:30 ` Chenghui Pan [this message]
2024-03-15 1:30 ` [PATCH v2 3/3] LoongArch: Combine UNITS_PER_FP_REG and UNITS_PER_FPREG macros Chenghui Pan
2024-03-20 2:29 ` [pushed][PATCH v2 0/3] LoongArch: Cleanup unused/redundant codes chenglulu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240315013027.183888-3-panchenghui@loongson.cn \
--to=panchenghui@loongson.cn \
--cc=chenglulu@loongson.cn \
--cc=gcc-patches@gcc.gnu.org \
--cc=i@xen0n.name \
--cc=xry111@xry111.site \
--cc=xuchenghua@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).