On Fri, 5 Jun 2026 13:39:37 GMT, Andrew Haley <[email protected]> wrote:
>> src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp line 2908:
>>
>>> 2906: __ cmpl(step_opr->as_register(), 0);
>>> 2907: __ movl(step_opr->as_register(),
>>> InvocationCounter::count_increment * ProfileCaptureRatio);
>>> 2908: __ cmovl(Assembler::notEqual, dest,
>>> step_opr->as_register());
>>
>> Hold on. The intent is to max out `dest` when `step_opr == 0`, right? But as
>> it is written now, this thing sets `dest = MAX` when `step_opr != 0`?
>> Shouldn't it be `Assembler::equal`? Might be an issue on other platforms as
>> well?
>
> Good spot. I got confused because of confusion between the left-to-right
> three-operand LIR version and the right-to-left two-operand x86 vesion.
The others look OK:
a32:
__ cmp(step->as_register(), (u1)0);
__ mov(Rtemp, InvocationCounter::count_increment *
ProfileCaptureRatio);
__ mov(dest, Rtemp, eq);
a64:
__ cmp(step->as_register(), (u1)0);
__ mov(rscratch1, InvocationCounter::count_increment *
ProfileCaptureRatio);
__ csel(dest, dest, rscratch1, __ NE);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28541#discussion_r3363077283