RFR: 8259822: [PPC64] Support the prefixed instruction format added in POWER10 [v2]

Corey Ashford github.com+51754783+coreyashford at openjdk.java.net
Wed Jan 27 17:53:42 UTC 2021


On Tue, 26 Jan 2021 19:07:40 GMT, Kazunori Ogata <ogatak at openjdk.org> wrote:

>> src/hotspot/cpu/ppc/assembler_ppc.hpp line 1533:
>> 
>>> 1531:      int32_t* p_inst = (int32_t*)p;
>>> 1532: 
>>> 1533:      if (is_aligned(reinterpret_cast<uintptr_t>(p_inst+1), 64) && is_nop(*p_inst)) {
>> 
>> This test is a bit confusing.  Shouldn't is_paddi return false if p points at a nop (even if it precedes the paddi)?
>
> "is_<instr>()" are the functions for testing instructions in the generated code and they are usually called in "assert()" or complex combination of if statements.  So if this function returns false when p points at nop, the assertions or the if-conditions need to handle the nop case and the code will become difficult to read.  Since the padding nop is a non-common case, I'd like to hide the existence of nop in this function.

Ok, got it.  Thanks for the explanation.  Maybe an extra comment in the code saying essentially what you said here would be appropriate?

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

PR: https://git.openjdk.java.net/jdk/pull/2095


More information about the hotspot-compiler-dev mailing list