Combine
and (vector_shuffle<Z,...,Z>
(insert_vector_elt undef, (xor X, -1), Z), undef), Y
->
andnp (vector_shuffle<Z,...,Z>
(insert_vector_elt undef, X, Z), undef), Y Differential D138521
[X86] Support ANDNP combine through vector_shuffle Authored by e-kud on Nov 22 2022, 1:45 PM.
Details Combine and (vector_shuffle<Z,...,Z>
(insert_vector_elt undef, (xor X, -1), Z), undef), Y
->
andnp (vector_shuffle<Z,...,Z>
(insert_vector_elt undef, X, Z), undef), Y
Diff Detail
Unit Tests Event Timeline
Comment Actions Unfortunately, no. I only tested locally with 256 bits. I found out that the generic approach has a problem. If we have a 256 or 512 bit vector, then we can't generate ANDNP with SSE because there is no type for 256 bits. But after type-legalizer we have several ISD::AND that can be combined into ANDNP. I think about and (shuffle(not)) -> and(not(shuffle)) reordering before type-legalization and then after legalization we combine them into ANDNP. However I'm not sure about such two-step combine. What do you think? Comment Actions LGTM with one minor comment - cheers
| |||||||||||||||||||||||||||||||||||||||||||||||||||
Did you look at matching a generic ShuffleSDNode with a broadcast mask instead of PSHUFD?