> Date: Sat, 29 Aug 2026 00:43:27 -0600 > Cc: [email protected] > From: Jeff Law <[email protected]>
> On 8/27/26 3:13 PM, Hans-Peter Nilsson wrote: > > Let's harmonize canonicalization for NOT-on-ROTATE and NOT-on-ROTATERT > > with that of BSWAP and BITREVERSE, and document the canonical > > form. Tested cross to cris-elf, native on x86_64-pc-linux-gnu. > > > > Ok to commit? > > > > brgds, H-P > > > > -- >8 -- > > Before this patch, the combine pass would match (bitreverse:SI (not:SI > > reg)) but not (rotate:SI (not:SI reg (const_int 16)))), instead > > requiring (not:SI (rotate:SI reg (const_int 16))) for the compound > > operation to be recognized. That looked inconsistent considering that > > both are bit-rearrangement operations commutative with bitwise negation. > > > > I was about to write "operations with which bitwise negation is > > commutative", but thought better list the operations explicitly. > > > > * doc/md.texi (Insn Canonicalizations): Document BITREVERSE, > > BSWAP, ROTATE, and ROTATERT as having the canonical form of > > NOT moved inside the first operand. > > * simplify-rtx.cc (simplify_context::simplify_unary_operation_1): > > Move a NOT to the inside of ROTATE and ROTATERT, like for BITREVERSE > > and BSWAP. > > * config/cris/cris.md (*rotsi2_16_not<setcc><setnz><setnzvc>): Adjust > > accordingly. > > OK Thanks! Unfortunately, there's fallout on aarch64-unknown-linux-gnu, as "[email protected]" informed me, so there'll be a v2, but just with an added aarch64 MD patch with a similar correction as with cris.md. brgds, H-P PS. there's a flaky test or set of tests in gcov they should filter out.
