From 6c759b61c6fd317627791ac7e773465b0b644641 Mon Sep 17 00:00:00 2001
From: liuhongt <hongtao.liu@intel.com>
Date: Thu, 5 Sep 2019 14:00:13 +0800
Subject: [PATCH] Extend pass rpad to handle avx512f vcvtusi2ss vcvtusi2ss
538.imagick_r improved by 4% with single copy run on SKYLAKE workstation.
gcc/
* config/i386/i386.md
("*floatuns<SWI48:mode><MODEF:mode>2_avx512"):
Add avx_partial_xmm_update.
gcc/testsuie
* gcc.target/i386/pr87007-3.c: New test.
---
gcc/config/i386/i386.md | 1 +
gcc/testsuite/gcc.target/i386/pr87007-3.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/i386/pr87007-3.c
@@ -5196,6 +5196,7 @@
"TARGET_AVX512F && TARGET_SSE_MATH"
"vcvtusi2<MODEF:ssemodesuffix><SWI48:rex64suffix>\t{%1, %0, %0|%0, %0, %1}"
[(set_attr "type" "sseicvt")
+ (set_attr "avx_partial_xmm_update" "true")
(set_attr "prefix" "evex")
(set_attr "mode" "<MODEF:MODE>")])
new file mode 100644
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=skylake-avx512 -mfpmath=sse" } */
+
+extern float f;
+extern double d;
+extern unsigned char c;
+
+void
+foo (int n, int k)
+{
+ for (int i = 0; i != n; i++)
+ if(i < k)
+ d = c;
+ else
+ f = c;
+}
+
+/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */
--
2.19.1