]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add boolean pattern for bitwise ops
authorRichard Biener <rguenther@suse.de>
Tue, 7 Oct 2025 13:38:57 +0000 (15:38 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 8 Oct 2025 11:39:05 +0000 (13:39 +0200)
commit055c6cc038ef6bba311eee2abdafaadb532ddd5b
tree22babef4dad8e45d023118a42a0154e48dbcc9ed
parent94f203a3695d9779b84f41e36a295a90e7ba2f16
Add boolean pattern for bitwise ops

As we consider bitwise operations possible mask operations we have
to consider the case of only one operand arriving as mask.  The
following compensates for this by creating mask from the other operand
and insert possibly required mask conversions.

PR tree-optimization/110223
PR tree-optimization/122128
* tree-vect-patterns.cc (vect_recog_bool_pattern): Add
compensation for mixed mask/data bitwise operations.

* gcc.dg/vect/vect-bool-2.c: New testcase.
* gcc.dg/vect/vect-bool-cmp-3.c: Likewise.
* gcc.dg/vect/vect-bool-cmp-4.c: Likewise.
gcc/testsuite/gcc.dg/vect/vect-bool-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-bool-cmp-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-bool-cmp-4.c [new file with mode: 0644]
gcc/tree-vect-patterns.cc