[Bug tree-optimization/82854] more missing simplifcations
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82854 --- Comment #3 from Andrew Pinski --- (In reply to Andrew Pinski from comment #2) > /* 0 - (x & 0x8000) -> x & 0x8000 */ > LLVM does Actually RTL has done this since at least GCC 4.1.0, most likely before.
[Bug tree-optimization/82854] more missing simplifcations
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82854 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed||2021-08-07 --- Comment #2 from Andrew Pinski --- Summary of some of these /* x + (x & 0x8000) -> x & 0x7fff */ No one does /* (x | 0x8000) + 0x8000 -> x & 0x7FFF */ LLVM does /* x & (0x7FFF - x) -> x & 0x8000 */ No one does, ICC does (-x + 0x7FFF) & x /* x | (x + 0x8000) -> x | 0x8000 */ LLVM does /* x | (0x7FFF - x) -> x | 0x7FFF */ No one does, ICC does (-x + 0x7FFF) | x /* x | (x ^ y) -> x | y */ GCC and LLVM /* -x | 0xFFFE -> x | 0xFFFE */ LLVM does /* 0 - (x & 0x8000) -> x & 0x8000 */ LLVM does /* ~(x + c) -> ~c - x */ GCC and LLVM /* (x | c) - c -> x & ∼c */ GCC and LLVM /* 0x7FFF - (x ^ c) -> x ^ (0x7FFF - c) */ LLVM does
[Bug tree-optimization/82854] more missing simplifcations
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82854 Andrew Pinski changed: What|Removed |Added Keywords||missed-optimization Severity|normal |enhancement
[Bug tree-optimization/82854] more missing simplifcations
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82854 --- Comment #1 from Andi Kleen --- Also I suppose a lot of them could be generalized to 8/16/64bit.