summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.c
diff options
context:
space:
mode:
authoriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-21 14:32:38 +0000
committeriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-21 14:32:38 +0000
commit49763db6f71429c61da1fda88f614585c3df6245 (patch)
treeb924121c2319170fff3ebaf0994fb98c6c11bdb2 /gcc/config/i386/i386.c
parentada61167d8e79b9a6f86faad584256ebe427102a (diff)
downloadgcc-49763db6f71429c61da1fda88f614585c3df6245.tar.gz
[AVX-512ER] vrcp28ps auto generation
gcc/ * config/i386/i386.c (ix86_emit_swdivsf): Emit vrcp28ps. gcc/testsuite/ * gcc.target/i386/avx512er-vrcp28ps-3.c: New test. * gcc.target/i386/avx512er-vrcp28ps-4.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237648 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r--gcc/config/i386/i386.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 17664ff9f17..8139807512b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -48726,8 +48726,19 @@ void ix86_emit_swdivsf (rtx res, rtx a, rtx b, machine_mode mode)
/* x0 = rcp(b) estimate */
if (mode == V16SFmode || mode == V8DFmode)
- emit_insn (gen_rtx_SET (x0, gen_rtx_UNSPEC (mode, gen_rtvec (1, b),
- UNSPEC_RCP14)));
+ {
+ if (TARGET_AVX512ER)
+ {
+ emit_insn (gen_rtx_SET (x0, gen_rtx_UNSPEC (mode, gen_rtvec (1, b),
+ UNSPEC_RCP28)));
+ /* res = a * x0 */
+ emit_insn (gen_rtx_SET (res, gen_rtx_MULT (mode, a, x0)));
+ return;
+ }
+ else
+ emit_insn (gen_rtx_SET (x0, gen_rtx_UNSPEC (mode, gen_rtvec (1, b),
+ UNSPEC_RCP14)));
+ }
else
emit_insn (gen_rtx_SET (x0, gen_rtx_UNSPEC (mode, gen_rtvec (1, b),
UNSPEC_RCP)));