summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386-expand.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2021-05-07 11:15:07 +0200
committerUros Bizjak <ubizjak@gmail.com>2021-05-07 11:16:34 +0200
commit92f372f00936a549de2cb9764eee722bb07959ba (patch)
treeb2b7c6433508db45f3138429165edcfb22d3f933 /gcc/config/i386/i386-expand.c
parent323b18d54b960d3ef64f60ad20838ef958334dc0 (diff)
downloadgcc-92f372f00936a549de2cb9764eee722bb07959ba.tar.gz
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.
Diffstat (limited to 'gcc/config/i386/i386-expand.c')
-rw-r--r--gcc/config/i386/i386-expand.c6
1 files changed, 5 insertions, 1 deletions
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. */