[aarch64-port-dev ] RFR(XS): 8221995: AARCH64: problems with CAS instructions encoding

Andrew Haley aph at redhat.com
Fri Apr 5 16:12:38 UTC 2019


Hi,

On 4/5/19 3:03 PM, Dmitrij Pochepko wrote:

> please review small patch for JDK-8221995: AARCH64: problems with CAS 
> instructions encoding
> webrev: http://cr.openjdk.java.net/~dpochepk/8221995/webrev/
> 
> Patch fix 3 problems:
> - specification allows addressing register to be SP, while current 
> hotspot encoding implementation hits assert in this case
>
> - specification allows data register(s) to be ZR, while current hotspot 
> encoding implementation hits assert in this case
> - all pair CAS instructions  (CASP*) are encoded incorrectly in bit 23, 
> which leads to another instructions generation instead (CAS*B and CAS*H)
> 
> Current code shape doesn't generate CAS* instructions using affected 
> cases. That is why these problems wasn't found before.
> 
> Testing:
> 
> I generated code with CAS and CASP with and without patch. Patched 
> version hits no asserts while using zr and sp registers. And casp* 
> instruction now generated correctly.
> CR: https://bugs.openjdk.java.net/browse/JDK-8221995

It's hard to find a use case for CAS into the stack. I guess that ZR
as a compare register is reasonable enough, but I think we never
generate it. I don't think we use CASP at all.

So, I think this makes no difference to the VM, but it's a decent
cleanup. OK.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the aarch64-port-dev mailing list