Integrated: 8310276: RISC-V: Make use of shadd macro-assembler function when possible

Dingli Zhang dzhang at openjdk.org
Mon Jun 26 12:51:12 UTC 2023


On Mon, 19 Jun 2023 06:57:34 GMT, Dingli Zhang <dzhang at openjdk.org> wrote:

> Hi all,
> 
> We can use `shadd` to replace the following command combinations when
> appropriate:
> 
> slli(rd1, rs1, imm)
> add(rd2, rs2, rs3)
> 
> 
> Conditions to be met:
> 1. Rd1 and rs3/rs2 are the same register;
> 2. The data given to rd1 by the `slli` instruction is not used later;
> 3.  Make sure rs2, rs3 are not the same register, so that the above instruction
> combination will actually be executed if zba is not enabled, whereas if rs2,
> rs3 are the same register then `slli` will destroy the value of rs3/rs2;
> 4.  The value of `imm` is in the range of [1, 3], so that if zba is enabled,
> it will use sh1add, sh2add, sh3add instructions instead of the above two
> instructions.
> 
> ### Testing:
> 
> - tier1-3 on QEMU-System w/ and w/o UseZba (release build)
> - tier1-3 tests on unmatched board w/o UseZba (release build)
> - `hotspot_tier1`, `jdk_tier1` on QEMU-User w/ and w/o UseZba (fastdebug build)
> - `hotspot_tier1`, `jdk_tier1` on unmatched w/o UseZba (fastdebug build)

This pull request has now been integrated.

Changeset: 33578679
Author:    Dingli Zhang <dzhang at openjdk.org>
Committer: Fei Yang <fyang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/33578679281e96e7cb5f4f898ef0c6e26bd5c6fa
Stats:     5 lines in 3 files changed: 1 ins; 2 del; 2 mod

8310276: RISC-V: Make use of shadd macro-assembler function when possible

Reviewed-by: fyang, luhenry, fjiang, vkempik

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

PR: https://git.openjdk.org/jdk/pull/14535


More information about the hotspot-dev mailing list