diff mbox series

[target/87007] Extend rpad to handle AVX512F vcvtusi2ss/vcvtusi2sd

Message ID CAMZc-bwWotuGHnWi59mnGFQ-pPSUF0cb3HkbC22m4ULad-7hmw@mail.gmail.com
State New
Headers show
Series [target/87007] Extend rpad to handle AVX512F vcvtusi2ss/vcvtusi2sd | expand

Commit Message

Hongtao Liu Sept. 18, 2019, 3:31 a.m. UTC
Hi Uros:
  This patch extend pass rpad to handle AVX512F vcvtusi2ss/vcvtusi2sd.
  538.image_r would be improved by 4% with single copy run on skylake
workstation.

  Bootstrap ok. regression test for i386/x86 backend ok.
  Ok for trunk?

Changelog

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.

Comments

Uros Bizjak Sept. 18, 2019, 6:24 a.m. UTC | #1
On Wed, Sep 18, 2019 at 5:29 AM Hongtao Liu <crazylht@gmail.com> wrote:
>
> Hi Uros:
>   This patch extend pass rpad to handle AVX512F vcvtusi2ss/vcvtusi2sd.
>   538.image_r would be improved by 4% with single copy run on skylake
> workstation.
>
>   Bootstrap ok. regression test for i386/x86 backend ok.
>   Ok for trunk?
>
> Changelog
>
> 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.

OK.

Thanks,
Uros.
diff mbox series

Patch

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

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 7ad97882419..b7e7d126da2 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -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>")])
 
diff --git a/gcc/testsuite/gcc.target/i386/pr87007-3.c b/gcc/testsuite/gcc.target/i386/pr87007-3.c
new file mode 100644
index 00000000000..59324fd1a45
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr87007-3.c
@@ -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