RFR: 8267968: [PPC64] Use prefixed load and addi instructions for better performance in POWER10
Michihiro Horie
mhorie at openjdk.java.net
Fri Jun 4 13:09:01 UTC 2021
On Mon, 31 May 2021 05:39:25 GMT, Kazunori Ogata <ogatak at openjdk.org> wrote:
> The POWER10 processor supports prefixed load and addi instructions that have larger displacement field of up to 34-bits. We can reduce instruction cycles to load constant from TOC and load an immediate value to a register.
>
> Assembler::{load|add}_const_optimized() and LoadCon[LPFD]Nodes are modified to use prefixed instructions, with fixing other functions that are affected by this change.
>
> I ran jtreg test on both POWER10 and POWER8 machines by using "make test-tier1" and verified no additional fails by this change. I also ran DaCapo, Renaissance, and SPECjbb2015 on both of them and verified they run successfully.
src/hotspot/cpu/ppc/macroAssembler_ppc.cpp line 311:
> 309: return inv_d1_field(inst1);
> 310: } else if (PowerArchitecturePPC64 >= 10 && is_pld_prefix(inst1)) {
> 311: return (get_imm18(inst1_addr, 0) << 16) + (get_imm(inst1_addr, 1) & 0xffff);
I couldn't understand here quickly. Maybe it would be nice to tell the reason by adding some comments like is_load_const_from_method_toc_at's one "CallDynamicJavaDirectSched_ExNode and CallLeaf(NoFP)Direct_ExNode are the nodes that require relocation and use pld".
src/hotspot/cpu/ppc/ppc.ad line 2894:
> 2892: if (loadConLNodes._small) nodes->push(loadConLNodes._small);
> 2893: if (loadConLNodes._large_hi) nodes->push(loadConLNodes._large_hi);
> 2894: if (loadConLNodes._large_lo) nodes->push(loadConLNodes._large_lo);
Is removing the _last checking needed? lf it's needed, code related to _last should be removed such as in loadConLNodesTuple_create. Also, it would be better to use an if-else condition because it cannot happen both _small and _large_hi are non null.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4267
More information about the hotspot-dev
mailing list