Re: [PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY.

2023-01-01 Thread ro...@nextmovesoftware.com
The motivation for the current design (requiring the result and the operand to have the same mode) was from PR middle-end/50161. The challenge there is that when the RTL optimizers can determine that the operand is a constant, simplify_rtx sees just a CONST_INT with VOIDmode and therefore does

Re: [PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY.

2023-01-02 Thread ro...@nextmovesoftware.com
Hi Jeff, > On 2 Jan 2023, at 15:45, Jeff Law wrote: > On 1/1/23 08:55, Roger Sayle wrote: >> In 2011, the rtl.texi documentation was updated to reflect that the >> modes of the RTX unary operations FFS, POPCOUNT and PARITY must >> match those of their operands. Unfortunately, some of the trans

[JAVA PATCH] Enable more array bounds check elimination

2016-02-22 Thread ro...@nextmovesoftware.com
It has been a while since my last contribution. The following patch allows GCC's optimizers to more aggressively eliminate and optimize java array bounds checks. The results are quite impressive, for example producing a 26% performance improvement on the sieve.java benchmark given at http://k

[JAVA PATCH] Builtin support for popcount* and bswap* functions

2016-02-22 Thread ro...@nextmovesoftware.com
The following patch provides builtin support for byte swapping and bit counting. On suitable hardware, these generate the x86 popcount instructions, as also generated by the SUN HotSpot JIT/JVM for these method calls. java.lang.Integer.bitCount -> __builtin_popcount java.lang.Long.bitCount -> __b