RFR: JDK-8323497: On x64, use 32-bit immediate moves for narrow klass base if possible

Quan Anh Mai qamai at openjdk.org
Tue Jan 30 11:51:50 UTC 2024


On Wed, 10 Jan 2024 18:29:29 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> I think it would be better to move to `movptr` here and start testing it. I suspect there are a few places in Hotspot where we count the actual instruction _size_ for some stuff, and even the `mov64` -> `movptr` rewrite without `movl` optimization would highlight it. I agree the final version should be tested when JDK-8323503 is in.
>
>> FYI the logic for immediate matching is:
> 
> @merykitty, could you point me where that logic is? Cannot find it in current Hotspot sources, and would like to reference it in my PR.

@shipilev It is just the code representation of the matching, the corresponding nodes are `loadConUL32`, `loadConL32` and `loadConL` and the matcher uses node costs to sort out the priority.

https://github.com/openjdk/jdk/blob/c1282b57f50002edd08c93aed784390cca83b9b8/src/hotspot/cpu/x86/x86_64.ad#L4807

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17340#discussion_r1447785611


More information about the hotspot-dev mailing list