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

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.
---
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  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  9:44 Jan Beulich [this message]
2023-07-14 10:10 ` Uros Bizjak
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=28de2fc1-79e6-6fef-400c-2991b25d13e1@suse.com \
    --to=jbeulich@suse.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=hubicka@ucw.cz \
    --cc=kirill.yukhin@gmail.com \
    --cc=ubizjak@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).