From: H.J. Lu Date: Mon, 13 Jul 2020 16:07:00 +0000 (-0700) Subject: x86: Rename VF_AVX512VL_VF1_128_256 to VF1_AVX512ER_128_256 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=737355072af4cd0c24a4a8967e1485c1f3a80bfe;p=gcc.git x86: Rename VF_AVX512VL_VF1_128_256 to VF1_AVX512ER_128_256 Since ix86_emit_swsqrtsf shouldn't be called with DF vector modes, rename VF_AVX512VL_VF1_128_256 to VF1_AVX512ER_128_256 and drop DF vector modes. gcc/ PR target/96186 PR target/88713 * config/i386/sse.md (VF_AVX512VL_VF1_128_256): Renamed to ... (VF1_AVX512ER_128_256): This. Drop DF vector modes. (rsqrt2): Replace VF_AVX512VL_VF1_128_256 with VF1_AVX512ER_128_256. gcc/testsuite/ PR target/96186 PR target/88713 * gcc.target/i386/pr88713-3.c: New test. --- diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index d3ad5833e1f..b6348de67cb 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -326,11 +326,9 @@ [V16SF (V8SF "TARGET_AVX512VL") (V4SF "TARGET_AVX512VL") V8DF (V4DF "TARGET_AVX512VL") (V2DF "TARGET_AVX512VL")]) -;; AVX512VL SF/DF plus 128- and 256-bit SF vector modes -(define_mode_iterator VF_AVX512VL_VF1_128_256 - [(V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF - (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX512VL") - (V2DF "TARGET_AVX512VL")]) +;; AVX512ER SF plus 128- and 256-bit SF vector modes +(define_mode_iterator VF1_AVX512ER_128_256 + [(V16SF "TARGET_AVX512ER") (V8SF "TARGET_AVX") V4SF]) (define_mode_iterator VF2_AVX512VL [V8DF (V4DF "TARGET_AVX512VL") (V2DF "TARGET_AVX512VL")]) @@ -2076,9 +2074,9 @@ (set_attr "mode" "")]) (define_expand "rsqrt2" - [(set (match_operand:VF_AVX512VL_VF1_128_256 0 "register_operand") - (unspec:VF_AVX512VL_VF1_128_256 - [(match_operand:VF_AVX512VL_VF1_128_256 1 "vector_operand")] + [(set (match_operand:VF1_AVX512ER_128_256 0 "register_operand") + (unspec:VF1_AVX512ER_128_256 + [(match_operand:VF1_AVX512ER_128_256 1 "vector_operand")] UNSPEC_RSQRT))] "TARGET_SSE && TARGET_SSE_MATH" { diff --git a/gcc/testsuite/gcc.target/i386/pr88713-3.c b/gcc/testsuite/gcc.target/i386/pr88713-3.c new file mode 100644 index 00000000000..85b6cf87a02 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr88713-3.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mno-avx512er -march=skylake-avx512" } */ + +#include + +double square(double d[3], double rad) +{ + double res[3]; + + for (int i = 0; i < 3; i++) + { + res[i] = d[i] * d[i]; + res[i] *= rad/sqrt(res[i]); + } + + return res[0]; +}