Skip to content

Commit

Permalink
8308726: RISC-V: avoid unnecessary slli in the vectorized arraycopy s…
Browse files Browse the repository at this point in the history
…tubs for bytes

Reviewed-by: fyang, luhenry
  • Loading branch information
gctony committed Jun 5, 2023
1 parent 80232b7 commit 5cd8af7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/hotspot/cpu/riscv/stubGenerator_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,10 @@ class StubGenerator: public StubCodeGenerator {

__ vlex_v(v0, src, sew);
__ sub(cnt, cnt, vl);
__ slli(vl, vl, (int)sew);
if (sew != Assembler::e8) {
// when sew == e8 (e.g., elem size is 1 byte), slli R, R, 0 is a nop and unnecessary
__ slli(vl, vl, sew);
}
__ add(src, src, vl);

__ vsex_v(v0, dst, sew);
Expand All @@ -927,7 +930,10 @@ class StubGenerator: public StubCodeGenerator {

__ bind(loop_backward);
__ sub(t0, cnt, vl);
__ slli(t0, t0, sew);
if (sew != Assembler::e8) {
// when sew == e8 (e.g., elem size is 1 byte), slli R, R, 0 is a nop and unnecessary
__ slli(t0, t0, sew);
}
__ add(tmp1, s, t0);
__ vlex_v(v0, tmp1, sew);
__ add(tmp2, d, t0);
Expand Down

1 comment on commit 5cd8af7

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.