Integrated: 8255838: Use 32-bit immediate movslq in macro assembler if 64-bit value fits in 32 bits on x86_64
Jorn Vernee
jvernee at openjdk.java.net
Wed Nov 4 18:12:57 UTC 2020
On Tue, 3 Nov 2020 15:12:50 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Currently, Macro::Assembler(Address dst, intprt_t src) on x64 uses an intermediate scratch register to store the 64-bit immediate.
>
> void MacroAssembler::movptr(Address dst, intptr_t src) {
> mov64(rscratch1, src);
> movq(dst, rscratch1);
> }
>
> But, if the value fits into 32-bits, we can also explicitly use the 32-bit immediate overload, which saves an instruction and a register use, by using movslq/movabs instead (sig extended move).
>
> This ends up saving about 90k instructions on hello world. It also reduces the size of the interpreter by about 4k.
>
> Special thanks to Claes for prior discussion and help with testing.
>
> Testing: tier1-3, local startup profiling
This pull request has now been integrated.
Changeset: 160759ce
Author: Jorn Vernee <jvernee at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/160759ce
Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod
8255838: Use 32-bit immediate movslq in macro assembler if 64-bit value fits in 32 bits on x86_64
Reviewed-by: azeemj, kvn, redestad, thartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/1038
More information about the hotspot-compiler-dev
mailing list