RFR: 8266267: Remove unnecessary jumps in Intel Math Library StubRoutines
Jie Fu
jiefu at openjdk.java.net
Thu Apr 29 05:11:00 UTC 2021
Hi all,
May I get reviews for this small change?
If I look at the StubRoutines::libmPow carefully, an unnecessary jump instruction can be found, which is generated here [1].
- - - [BEGIN] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StubRoutines::libmPow [0x00007f0f8455ddd1, 0x00007f0f8455ef05] (4404 bytes)
--------------------------------------------------------------------------------
0x00007f0f8455ddd1: push %rbp
0x00007f0f8455ddd2: mov %rsp,%rbp
0x00007f0f8455ddd5: jmpq 0x00007f0f8455ddda <--- unnecessary jump
0x00007f0f8455ddda: sub $0x28,%rsp
0x00007f0f8455ddde: vmovsd %xmm0,0x8(%rsp)
0x00007f0f8455dde4: vmovsd %xmm1,0x10(%rsp)
...
And similar issues can be found for StubRoutines::libmLog and StubRoutines::libmExp.
- - - [BEGIN] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StubRoutines::libmLog [0x00007f3fb94d48a6, 0x00007f3fb94d4b22] (636 bytes)
--------------------------------------------------------------------------------
0x00007f3fb94d48a6: push %rbp
0x00007f3fb94d48a7: mov %rsp,%rbp
0x00007f3fb94d48aa: jmpq 0x00007f3fb94d48af <--- unnecessary jump
0x00007f3fb94d48af: sub $0x18,%rsp
0x00007f3fb94d48b3: vmovsd %xmm0,(%rsp)
0x00007f3fb94d48b8: movabs $0x3ff0000000000000,%rax
...
- - - [BEGIN] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StubRoutines::libmExp [0x00007f3fb94d4579, 0x00007f3fb94d48a6] (813 bytes)
--------------------------------------------------------------------------------
0x00007f3fb94d4579: push %rbp
0x00007f3fb94d457a: mov %rsp,%rbp
0x00007f3fb94d457d: jmpq 0x00007f3fb94d4582 <--- unnecessary jump
0x00007f3fb94d4582: sub $0x18,%rsp
0x00007f3fb94d4586: vmovsd %xmm0,0x8(%rsp)
0x00007f3fb94d458c: vunpcklpd %xmm0,%xmm0,%xmm0
I can't find a reason why we need an extra jump there.
So I suggest removing them.
Testing:
- tier1 ~ tier3 on Linux/x64, no regression
Am I missing something?
Thanks.
Best regards,
Jie
-------------
Commit messages:
- 8266267: Remove unnecessary jumps in Intel Math Library StubRoutines
Changes: https://git.openjdk.java.net/jdk/pull/3784/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3784&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8266267
Stats: 7 lines in 3 files changed: 2 ins; 5 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/3784.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3784/head:pull/3784
PR: https://git.openjdk.java.net/jdk/pull/3784
More information about the hotspot-compiler-dev
mailing list