On 11/11/26 11:18 AM, Jiawei wrote:
Reverse rotations with masked negative counts in the generic RTL
simplifier. Keep the count mask so the reversed count stays in range.

gcc/ChangeLog:

        * simplify-rtx.cc (simplify_context::simplify_binary_operation_1):
        Reverse rotations with masked negative counts.
        (selftest::test_masked_negative_rotate): New function.
        (selftest::test_scalar_int_ops): Call it.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/zbb-rol-ror-10.c: New test.
        * gcc.target/aarch64/rotate-neg-mask.c: Ditto.

---
Requires patch 1/2 of this series.
LGTM and no Sashiko issues on this patch.  So it's OK for the trunk.

Note that Sashiko did flag an issue on patch #1 of the series.  I don't know the aarch64 implementation well enough to know if it's a real problem or not.

https://gcc.sashiko.dev/#/patchset/20261111181853.3620972-1-jiawei%40iscas.ac.cn


Jeff

Reply via email to