public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7700] Refine HImode movement for "v" to "v".
@ 2022-03-18 12:01 hongtao Liu
  0 siblings, 0 replies; only message in thread
From: hongtao Liu @ 2022-03-18 12:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1f5c0e67393e8f67d66150eba8c64edfeb14e11b

commit r12-7700-g1f5c0e67393e8f67d66150eba8c64edfeb14e11b
Author: liuhongt <hongtao.liu@intel.com>
Date:   Fri Mar 18 16:11:04 2022 +0800

    Refine HImode movement for "v" to "v".
    
    Set attr from HImode to HFmode which uses vmovsh instead of vmovw for
    movment between sse registers.
    
    gcc/ChangeLog:
    
            PR target/104974
            * config/i386/i386.md (*movhi_internal): Set attr type from HI
            to HF for alternative 12 under TARGET_AVX512FP16.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr104974.c: New test.

Diff:
---
 gcc/config/i386/i386.md                  |  2 +-
 gcc/testsuite/gcc.target/i386/pr104974.c | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 5b44c65afff..02f298c2846 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2658,7 +2658,7 @@
 		    (const_string "TI"))
 	    (eq_attr "alternative" "12")
 	      (cond [(match_test "TARGET_AVX512FP16")
-		       (const_string "HI")
+		       (const_string "HF")
 		     (match_test "TARGET_AVX")
 		       (const_string "TI")
 		     (ior (not (match_test "TARGET_SSE2"))
diff --git a/gcc/testsuite/gcc.target/i386/pr104974.c b/gcc/testsuite/gcc.target/i386/pr104974.c
new file mode 100644
index 00000000000..d1f2b1a9722
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr104974.c
@@ -0,0 +1,12 @@
+/* { dg-do assemble { target avx512fp16 } } */
+/* { dg-options "-mavx512fp16 -O2" } */
+
+short
+foo (short a)
+{
+  register short b __asm ("%xmm1") = a;
+  asm volatile ("": "+v" (b));
+  register short c __asm ("%xmm2") = b;
+  asm volatile ("": "+v" (c));
+  return a;
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-18 12:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 12:01 [gcc r12-7700] Refine HImode movement for "v" to "v" hongtao Liu

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