public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Don't emit AVX512DQ insns for -mavx512vl -mno-avx512dq (PR target/70927)
@ 2016-05-03 18:23 Jakub Jelinek
  2016-05-09 16:44 ` [PATCH] Don't emit AVX512DQ insns for -mavx512vl -mno-avx512dq (PR target/70927, take 2) Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2016-05-03 18:23 UTC (permalink / raw)
  To: Uros Bizjak, Kirill Yukhin; +Cc: gcc-patches

Hi!

While working on a patch I'm going to post momentarily, I've noticed that
we sometimes emit AVX512DQ specific instructions even when avx512dq is not
enabled (in particular, EVEX andnps and andnpd are AVX512DQ plus if
they have 128-bit or 256-bit arguments, also AVX512VL).

I'm not 100% happy about the patch, because (pre-existing issue)
get_attr_mode doesn't reflect that the insn is in that not a vector float
insn, but perhaps we'd need to use another alternative and some ugly
conditionals in mode attribute for that case.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk and
after a while 6.2, or do you prefer some other fix?

2016-05-03  Jakub Jelinek  <jakub@redhat.com>

	PR target/70927
	* config/i386/sse.md (<sse>_andnot<mode>3<mask_name>),
	*<code><mode>3<mask_name>): For !TARGET_AVX512DQ, use vp*[dq]
	instead of v*p[sd] instructions even if !<mask_applied> and
	128-bit/256-bit vectors, if any operand is EXT_REX_SSE_REG_P.

--- gcc/config/i386/sse.md.jj	2016-05-03 13:34:09.946986488 +0200
+++ gcc/config/i386/sse.md	2016-05-03 17:38:02.486935094 +0200
@@ -2817,7 +2817,11 @@ (define_insn "<sse>_andnot<mode>3<mask_n
     }
 
   /* There is no vandnp[sd] in avx512f.  Use vpandn[qd].  */
-  if (<mask_applied> && !TARGET_AVX512DQ)
+  if (!TARGET_AVX512DQ
+      && (<mask_applied>
+	  || EXT_REX_SSE_REG_P (operands[0])
+	  || EXT_REX_SSE_REG_P (operands[1])
+	  || EXT_REX_SSE_REG_P (operands[2])))
     {
       suffix = GET_MODE_INNER (<MODE>mode) == DFmode ? "q" : "d";
       ops = "vpandn%s\t{%%2, %%1, %%0<mask_operand3_1>|%%0<mask_operand3_1>, %%1, %%2}";
@@ -2923,7 +2927,11 @@ (define_insn "*<code><mode>3<mask_name>"
     }
 
   /* There is no v<logic>p[sd] in avx512f.  Use vp<logic>[dq].  */
-  if (<mask_applied> && !TARGET_AVX512DQ)
+  if (!TARGET_AVX512DQ
+      && (<mask_applied>
+	  || EXT_REX_SSE_REG_P (operands[0])
+	  || EXT_REX_SSE_REG_P (operands[1])
+	  || EXT_REX_SSE_REG_P (operands[2])))
     {
       suffix = GET_MODE_INNER (<MODE>mode) == DFmode ? "q" : "d";
       ops = "vp<logic>%s\t{%%2, %%1, %%0<mask_operand3_1>|%%0<mask_operand3_1>, %%1, %%2}";
@@ -2961,7 +2969,12 @@ (define_insn "*<code><mode>3<mask_name>"
   ops = "";
 
   /* There is no v<logic>p[sd] in avx512f.  Use vp<logic>[dq].  */
-  if ((<MODE_SIZE> == 64 || <mask_applied>) && !TARGET_AVX512DQ)
+  if (!TARGET_AVX512DQ
+      && (<mask_applied>
+	  || <MODE_SIZE> == 64
+	  || EXT_REX_SSE_REG_P (operands[0])
+	  || EXT_REX_SSE_REG_P (operands[1])
+	  || EXT_REX_SSE_REG_P (operands[2])))
     {
       suffix = GET_MODE_INNER (<MODE>mode) == DFmode ? "q" : "d";
       ops = "p";

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-10 11:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-03 18:23 [PATCH] Don't emit AVX512DQ insns for -mavx512vl -mno-avx512dq (PR target/70927) Jakub Jelinek
2016-05-09 16:44 ` [PATCH] Don't emit AVX512DQ insns for -mavx512vl -mno-avx512dq (PR target/70927, take 2) Jakub Jelinek
2016-05-10 11:40   ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).