Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8308726: RISC-V: avoid unnecessary slli in the vectorized arraycopy stubs for bytes #14288

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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