RFR(M): 8027754: Enable loop optimizations for loops with MathExact inside

Florian Weimer fweimer at redhat.com
Fri Jan 24 01:09:13 PST 2014

On 01/23/2014 12:27 PM, Rickard Bäckman wrote:

> In the end we generate assembly like:
> mov rdx, rdi
> add rdx, rsi
> ...
> mov rax, rdi
> add rax, rsi
> jo <overflow label>
> With one add instruction for the data and one for flags. Future
> improvements could be to try to match the Overflow and the math
> operation and remove one of them.

You could use cmp instead of sub on x86 for the overflow case, which 
should be beneficial because the cmp instruction preserves both inputs 
and only updates the flags.  Unfortunately, there is no similar 
companion instruction in the other cases, so I'm not sure if that's 
worth the effort.

The mulofI_rReg_imm pattern definitions in x86_32.ad and x86_64.ad do 
not include the immediate operand in the format string.

Florian Weimer / Red Hat Product Security Team

More information about the hotspot-compiler-dev mailing list