public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [x86]Delete dead code in ix86_expand_sse_comi.[PR98612]
@ 2021-01-11 10:31 Hongtao Liu
  2021-01-11 11:54 ` Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: Hongtao Liu @ 2021-01-11 10:31 UTC (permalink / raw)
  To: Uros Bizjak, GCC Patches

Hi:
  d->flag is always 0 for builtins located in
BDESC_FIRST (comi,COMI,...)
...
BDESC_END (COMI, PCMPESTR)
  So the condition can be deleted, so did BUILTIN_DESC_SWAP_OPERANDS.

  Regtested and bootstrapped on x86_64-linux-gnu{-m32,}.

gcc/ChangeLog:
        PR target/98612
        * config/i386/i386-builtins.h (BUILTIN_DESC_SWAP_OPERANDS):
        Deleted.
        * config/i386/i386-expand.c (ix86_expand_sse_comi): Delete
        dead code.
---
 gcc/config/i386/i386-builtins.h | 4 ----
 gcc/config/i386/i386-expand.c   | 5 -----
 2 files changed, 9 deletions(-)

diff --git a/gcc/config/i386/i386-builtins.h b/gcc/config/i386/i386-builtins.h
index bb364458878..0641808c7a7 100644
--- a/gcc/config/i386/i386-builtins.h
+++ b/gcc/config/i386/i386-builtins.h
@@ -236,10 +236,6 @@ struct builtin_isa {

 /* Bits for builtin_description.flag.  */

-/* Set when we don't support the comparison natively, and should
-   swap_comparison in order to support it.  */
-#define BUILTIN_DESC_SWAP_OPERANDS     1
-
 struct builtin_description
 {
   const HOST_WIDE_INT mask;
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 85ea2605696..d793e5a5bce 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -8634,11 +8634,6 @@ ix86_expand_sse_comi (const struct
builtin_description *d, tree exp,
   if (VECTOR_MODE_P (mode1))
     op1 = safe_vector_operand (op1, mode1);

-  /* Swap operands if we have a comparison that isn't available in
-     hardware.  */
-  if (d->flag & BUILTIN_DESC_SWAP_OPERANDS)
-    std::swap (op0, op1);
-
   target = gen_reg_rtx (SImode);
   emit_move_insn (target, const0_rtx);
   target = gen_rtx_SUBREG (QImode, target, 0);
-- 
2.18.1

-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [x86]Delete dead code in ix86_expand_sse_comi.[PR98612]
  2021-01-11 10:31 [PATCH] [x86]Delete dead code in ix86_expand_sse_comi.[PR98612] Hongtao Liu
@ 2021-01-11 11:54 ` Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2021-01-11 11:54 UTC (permalink / raw)
  To: Hongtao Liu; +Cc: GCC Patches

On Mon, Jan 11, 2021 at 11:28 AM Hongtao Liu <crazylht@gmail.com> wrote:
>
> Hi:
>   d->flag is always 0 for builtins located in
> BDESC_FIRST (comi,COMI,...)
> ...
> BDESC_END (COMI, PCMPESTR)
>   So the condition can be deleted, so did BUILTIN_DESC_SWAP_OPERANDS.
>
>   Regtested and bootstrapped on x86_64-linux-gnu{-m32,}.
>
> gcc/ChangeLog:
>         PR target/98612
>         * config/i386/i386-builtins.h (BUILTIN_DESC_SWAP_OPERANDS):
>         Deleted.
>         * config/i386/i386-expand.c (ix86_expand_sse_comi): Delete
>         dead code.

OK.

Thanks,
Uros.

> ---
>  gcc/config/i386/i386-builtins.h | 4 ----
>  gcc/config/i386/i386-expand.c   | 5 -----
>  2 files changed, 9 deletions(-)
>
> diff --git a/gcc/config/i386/i386-builtins.h b/gcc/config/i386/i386-builtins.h
> index bb364458878..0641808c7a7 100644
> --- a/gcc/config/i386/i386-builtins.h
> +++ b/gcc/config/i386/i386-builtins.h
> @@ -236,10 +236,6 @@ struct builtin_isa {
>
>  /* Bits for builtin_description.flag.  */
>
> -/* Set when we don't support the comparison natively, and should
> -   swap_comparison in order to support it.  */
> -#define BUILTIN_DESC_SWAP_OPERANDS     1
> -
>  struct builtin_description
>  {
>    const HOST_WIDE_INT mask;
> diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
> index 85ea2605696..d793e5a5bce 100644
> --- a/gcc/config/i386/i386-expand.c
> +++ b/gcc/config/i386/i386-expand.c
> @@ -8634,11 +8634,6 @@ ix86_expand_sse_comi (const struct
> builtin_description *d, tree exp,
>    if (VECTOR_MODE_P (mode1))
>      op1 = safe_vector_operand (op1, mode1);
>
> -  /* Swap operands if we have a comparison that isn't available in
> -     hardware.  */
> -  if (d->flag & BUILTIN_DESC_SWAP_OPERANDS)
> -    std::swap (op0, op1);
> -
>    target = gen_reg_rtx (SImode);
>    emit_move_insn (target, const0_rtx);
>    target = gen_rtx_SUBREG (QImode, target, 0);
> --
> 2.18.1
>
> --
> BR,
> Hongtao

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-11 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 10:31 [PATCH] [x86]Delete dead code in ix86_expand_sse_comi.[PR98612] Hongtao Liu
2021-01-11 11:54 ` Uros Bizjak

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).