[aarch64-port-dev ] RFR: JDK-8203041 : AArch64: fix overflow in immediate cmp/cmn instruction
Andrew Haley
aph at redhat.com
Mon May 21 11:45:02 UTC 2018
Hi,
On 05/21/2018 08:52 AM, Joshua Zhu wrote:
> Thanks for your review.
>
> In my patch I decided not to replace cmp with subs at callsite (in
> generate_large_array_equals()) because imm cmp has accidentally been
> misused for serval times such as
> https://bugs.openjdk.java.net/browse/JDK-8184900
> https://bugs.openjdk.java.net/browse/JDK-8161190
That's a fair point. I have made the same mistake myself.
> I added an assert to ensure that for large imm all callsites do not
> use rscratch1.
Does that help at all? rscratch1 might be live, even if it is not use
in the cmp instruction.
> But your suggestion makes sense. Rscratch1 may imports more
> confusion. Let's replace cmp with subs at callsite when this
> assertion failure happens. The only concern is that this depends on
> engineers be aware of immediate bits limitation for imm cmp
> instruction.
Well, yes. As far as I can see it's a limitation of the instruction
set. I can't see any reasonable way to fix it.
Andrew.
More information about the aarch64-port-dev
mailing list