RFR: JDK-8323497: On x64, use 32-bit immediate moves for narrow klass base if possible
Thomas Stuefe
stuefe at openjdk.org
Tue Jan 30 11:51:50 UTC 2024
On Wed, 10 Jan 2024 09:49:25 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> God you are fast.
>>
>> movptr looks suitable. Why did you name it "ptr" if its not for pointers?
>
> I haven't changed the name of the method. `movptr` means "move something of the width of the machine pointer", like everywhere else in assembler code. That fits your case, I think?
Hmm, movptr only works its magic if the input is smaller than signed int max (2gb), and it needs one byte more than my variant.
base < 2g:
35 ;; decode_klass_not_null
36 0x00007efdcc9e51c4: mov $0x27000000,%r11
37 0x00007efdcc9e51cb: add %r11,%r10
base > 2g:
35 ;; decode_klass_not_null
36 0x00007ff7a89e51c4: movabs $0x82000000,%r11
37 0x00007ff7a89e51ce: add %r11,%r10
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17340#discussion_r1447140322
More information about the hotspot-dev
mailing list