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.
(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"))
--- /dev/null
+/* { 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;
+}