public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Hongtao Liu <hongtao.liu@intel.com>,
	 Kirill Yukhin <kirill.yukhin@gmail.com>,
	Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] x86: replace "extendhfdf2" expander
Date: Fri, 14 Jul 2023 12:10:23 +0200	[thread overview]
Message-ID: <CAFULd4YAmBkOu6MetFy1=ruUca6vWatWhbJG4G6SnW4LGEF3_Q@mail.gmail.com> (raw)
In-Reply-To: <28de2fc1-79e6-6fef-400c-2991b25d13e1@suse.com>

On Fri, Jul 14, 2023 at 11:44 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> The corresponding insn serves this purpose quite fine, and leads to
> slightly less (generated) code. All we need is the insn to not have a
> leading * in its name, while retaining that * for "extendhfsf2".
> Introduce a mode attribute in exchange to achieve that.
>
> gcc/
>
>         * config/i386/i386.md (extendhfdf2): Delete expander.
>         (extendhf): New mode attribute.
>         (*extendhf<mode>2): Use it.

No, please leave the expander, it is there due to extendhfsf2 that
prevents effective macroization.

FYI, there is no less generated code when the named pattern is used,
the same code is generated from the named pattern as from the
expander. Source code can be shrinked, but in this particular case,
forced macroization complicates things more.

Uros.

> ---
> Of course the mode attribute could as well supply the full names.
>
> --- a/gcc/config/i386/i386.md
> +++ b/gcc/config/i386/i386.md
> @@ -5221,13 +5221,9 @@
>      }
>  })
>
> -(define_expand "extendhfdf2"
> -  [(set (match_operand:DF 0 "register_operand")
> -       (float_extend:DF
> -         (match_operand:HF 1 "nonimmediate_operand")))]
> -  "TARGET_AVX512FP16")
> +(define_mode_attr extendhf [(SF "*") (DF "")])
>
> -(define_insn "*extendhf<mode>2"
> +(define_insn "<extendhf>extendhf<mode>2"
>    [(set (match_operand:MODEF 0 "register_operand" "=v")
>          (float_extend:MODEF
>           (match_operand:HF 1 "nonimmediate_operand" "vm")))]

  reply	other threads:[~2023-07-14 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  9:44 Jan Beulich
2023-07-14 10:10 ` Uros Bizjak [this message]
2023-07-14 10:40   ` Jan Beulich

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='CAFULd4YAmBkOu6MetFy1=ruUca6vWatWhbJG4G6SnW4LGEF3_Q@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=hubicka@ucw.cz \
    --cc=jbeulich@suse.com \
    --cc=kirill.yukhin@gmail.com \
    /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).