RFR: 8328998: Encoding support for Intel APX extended general-purpose registers [v5]
Sandhya Viswanathan
sviswanathan at openjdk.org
Fri Apr 26 23:41:07 UTC 2024
On Fri, 26 Apr 2024 20:44:03 GMT, Steve Dohrmann <duke at openjdk.org> wrote:
>> Add instruction encoding support for Intel APX extended general-purpose registers:
>>
>> Intel Advanced Performance Extensions (APX) doubles the number of general-purpose registers, from 16 to 32. For more information about APX, see https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html.
>>
>> By specification, instruction encoding remains unchanged for instructions using only the lower 16 GPRs. For cases where one or more instruction operands reference extended GPRs (Egprs), encoding targets either REX2, an extension of REX encoding, or an extended version of EVEX encoding. These new encoding schemes extend or modify existing instruction prefixes only when Egprs are used.
>
> Steve Dohrmann has updated the pull request incrementally with one additional commit since the last revision:
>
> from review comments: simplification, fix comments and white space
src/hotspot/cpu/x86/assembler_x86.cpp line 11717:
> 11715:
> 11716: void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) {
> 11717: bool is_extended = adr.base_needs_rex2() || adr.index_needs_rex2() || nds_enc >= 16 || xreg_enc >= 16;
We could add an assert here:
if (adr.base_needs_rex2() || adr.index_needs_rex2()) {
assert(UseAPX, "APX features not enabled");
}
src/hotspot/cpu/x86/assembler_x86.cpp line 11769:
> 11767: }
> 11768:
> 11769: int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes, bool src_is_gpr) {
We could add an assert here:
if (src_is_gpr && src_enc >= 16) {
assert(UseAPX, "APX features not enabled");
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18476#discussion_r1581608225
PR Review Comment: https://git.openjdk.org/jdk/pull/18476#discussion_r1581609969
More information about the hotspot-compiler-dev
mailing list