aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2022-03-18 16:11:04 +0800
committerliuhongt <hongtao.liu@intel.com>2022-03-18 20:01:17 +0800
commit1f5c0e67393e8f67d66150eba8c64edfeb14e11b (patch)
tree1e59a5dd29c7e2725cc2936373d353acfcc34465
parentac73c944eac88f37db2767aa4acc7ff6f4983f21 (diff)
downloadgcc-1f5c0e67393e8f67d66150eba8c64edfeb14e11b.zip
gcc-1f5c0e67393e8f67d66150eba8c64edfeb14e11b.tar.gz
gcc-1f5c0e67393e8f67d66150eba8c64edfeb14e11b.tar.bz2
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.
-rw-r--r--gcc/config/i386/i386.md2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr104974.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 5b44c65..02f298c 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 0000000..d1f2b1a
--- /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;
+}