public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Do not emit mask compares for mode sizes < 16 [PR100445]
@ 2021-05-07  9:18 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2021-05-07  9:18 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

Recent addition of v*cond* patterns for MMXMODEI modes allows 64bit MMX
modes to enter ix86_expand_sse_cmp. ix86_use_mask_cmp_p was not prepared
to reject mode sizes < 16, resulting in ICE due to unavailability of 64bit
masked PCOM instructions.

2021-05-07  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
    PR target/100445
    * config/i386/i386-expand.c (ix86_use_mask_cmp_p):
    Return false for mode sizes < 16.

gcc/testsuite/

    PR target/100445
    * gcc.target/i386/pr100445-1.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Pushed to master.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 911 bytes --]

diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 4dfe7d6c282..61b2f921f41 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -3490,7 +3490,11 @@ static bool
 ix86_use_mask_cmp_p (machine_mode mode, machine_mode cmp_mode,
 		     rtx op_true, rtx op_false)
 {
-  if (GET_MODE_SIZE (mode) == 64)
+  int vector_size = GET_MODE_SIZE (mode);
+
+  if (vector_size < 16)
+    return false;
+  else if (vector_size == 64)
     return true;
 
   /* When op_true is NULL, op_false must be NULL, or vice versa.  */
diff --git a/gcc/testsuite/gcc.target/i386/pr100445-1.c b/gcc/testsuite/gcc.target/i386/pr100445-1.c
new file mode 100644
index 00000000000..a1c18aff0f9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr100445-1.c
@@ -0,0 +1,5 @@
+/* PR target/100445 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx512vl" } */
+
+#include "pr96827.c"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-07  9:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  9:18 [PATCH] i386: Do not emit mask compares for mode sizes < 16 [PR100445] Uros Bizjak

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).