RFR: 8282182: Document algorithm used to encode aarch64 logical immediate operands.

Aleksey Shipilev shade at openjdk.java.net
Mon Feb 21 11:16:54 UTC 2022


On Fri, 18 Feb 2022 17:12:08 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

> This *documentation only* change explains how logical immediate mask values are derived from valid logical instruction operands. The encoding function is used to populate a sparse array that maps valid masks to a unique set of input operand values and a reverse lookup array that maps inputs to the associated mask.

src/hotspot/cpu/aarch64/immediate_aarch64.cpp line 129:

> 127: // SPEC
> 128: //
> 129: // bits(M*N) Replicate(bits(M) x, integer N);

Suggestion:

// bits(M*N) Replicate(bits(M) B, integer N);

...because the next text references "bit string B"?

src/hotspot/cpu/aarch64/immediate_aarch64.cpp line 216:

> 214: // ensures that an all 0s or all 1s bit pattern is never generated.
> 215: //
> 216: // bit field construction:

The flow in this section is odd. I think the text should flow as: "This is what we intend to do; this is how we construct it is done; this is the example of the generated output; given all above; here are the invariants that are enforced".

src/hotspot/cpu/aarch64/immediate_aarch64.cpp line 226:

> 224: // implementation note:
> 225: //
> 226: // For hysterical reasons the implementation of this function is much

Suggestion:

// For historical reasons the implementation of this function is much

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

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


More information about the hotspot-compiler-dev mailing list