i386: Do not emit mask compares for mode sizes < 16 [PR100445]

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.
This commit is contained in:
Uros Bizjak 2021-05-07 11:15:07 +02:00
parent 323b18d54b
commit 92f372f009
2 changed files with 10 additions and 1 deletions

View File

@ -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. */

View File

@ -0,0 +1,5 @@
/* PR target/100445 */
/* { dg-do compile } */
/* { dg-options "-O3 -mavx512vl" } */
#include "pr96827.c"