[riscv-port] RFR: 8278322: riscv: Support RVC: compressed instructions

Xiaolin Zheng xlinzheng at openjdk.java.net
Tue Dec 7 09:27:42 UTC 2021


On Tue, 7 Dec 2021 08:35:53 GMT, Yadong Wang <yadongwang at openjdk.org> wrote:

> > About the _nc postfix of some of Assembler instructions: we know a bunch of places should be reserved for patching, where we cannot change them into compressed instructions. _nc is short for not compressible - with this, those instructions should keep their origin 4-byte form and remain uncompressed.
> 
> Why the compressed instructions can not be patched?

Thank you for your reviews, yadong. For example, if we need to relocate oops to another place, we may emit a `movptr`, whose length is fixed, including `lui+addi+slli+addi+slli+addi`. For instructions like `addi`s, if we compress them to a 16-byte form, we will face troubles when we want to relocate them to another place since the new address may not be presented by simple `c.addi`s -- because `c.addi` could only present [-32, +31] but `addi` could present [-2048, +2047]. With this respect, it may be a good choice to remain their original forms for the patchable places, though quite conservative.

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

PR: https://git.openjdk.java.net/riscv-port/pull/24


More information about the riscv-port-dev mailing list