Fix ICE for [PR target/98833].

And replace __builtin_ia32_pcmpeqb128 with operator == in libcpp.

gcc/ChangeLog:

	PR target/98833
	* config/i386/sse.md (sse2_gt<mode>3): Drop !TARGET_XOP in condition.
	(*sse2_eq<mode>3): Ditto.

gcc/testsuite/ChangeLog:

	PR target/98833
	* gcc.target/i386/pr98833.c: New test.

libcpp/

	PR target/98833
	* lex.c (search_line_sse2): Replace builtins with == operator.
This commit is contained in:
liuhongt 2021-01-27 13:22:36 +08:00
parent 6cf4343375
commit 530b1d6887
3 changed files with 15 additions and 6 deletions

View file

@ -13041,7 +13041,7 @@
(eq:VI124_128
(match_operand:VI124_128 1 "vector_operand" "%0,x")
(match_operand:VI124_128 2 "vector_operand" "xBm,xm")))]
"TARGET_SSE2 && !TARGET_XOP
"TARGET_SSE2
&& !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
pcmpeq<ssemodesuffix>\t{%2, %0|%0, %2}
@ -13143,7 +13143,7 @@
(gt:VI124_128
(match_operand:VI124_128 1 "register_operand" "0,x")
(match_operand:VI124_128 2 "vector_operand" "xBm,xm")))]
"TARGET_SSE2 && !TARGET_XOP"
"TARGET_SSE2"
"@
pcmpgt<ssemodesuffix>\t{%2, %0|%0, %2}
vpcmpgt<ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}"

View file

@ -0,0 +1,9 @@
/* PR target/98833 */
/* { dg-do compile } */
/* { dg-options "-mavx512vl -O2 -mxop" } */
int __attribute__((__vector_size__(4 * sizeof(int)))) * f5_p;
int __attribute__((__vector_size__(4 * sizeof(int)))) * f6_p;
void f5() { *f5_p = 0 == *f5_p; }
void f6() { *f5_p = *f6_p > *f5_p; }

View file

@ -391,10 +391,10 @@ search_line_sse2 (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
mask = -1;
start:
t = __builtin_ia32_pcmpeqb128(data, repl_nl);
t |= __builtin_ia32_pcmpeqb128(data, repl_cr);
t |= __builtin_ia32_pcmpeqb128(data, repl_bs);
t |= __builtin_ia32_pcmpeqb128(data, repl_qm);
t = data == repl_nl;
t |= data == repl_cr;
t |= data == repl_bs;
t |= data == repl_qm;
found = __builtin_ia32_pmovmskb128 (t);
found &= mask;
}