From 3ad6e31d81bb8a47dc73a6342a6524a901f07687 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Fri, 20 Sep 2024 09:33:31 +0000 Subject: [PATCH] 8340438: RISC-V: minor improvement in base64 Reviewed-by: fyang --- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 9162c1d520027..ee14d045407a0 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -5491,9 +5491,7 @@ class StubGenerator: public StubCodeGenerator { Register stepSrcM2 = doff; Register stepDst = isURL; Register size = x29; // t4 - Register minusOne = x30; // t5 - __ mv(minusOne, -1); __ mv(size, MaxVectorSize * 2); __ mv(stepSrcM1, MaxVectorSize * 4); __ slli(stepSrcM2, stepSrcM1, 1); @@ -5513,7 +5511,8 @@ class StubGenerator: public StubCodeGenerator { __ sub(length, length, stepSrcM2); // error check - __ bne(failedIdx, minusOne, Exit); + // valid value of failedIdx can only be -1 when < 0 + __ bgez(failedIdx, Exit); __ bge(length, stepSrcM2, ProcessM2); @@ -5533,7 +5532,8 @@ class StubGenerator: public StubCodeGenerator { __ sub(length, length, stepSrcM1); // error check - __ bne(failedIdx, minusOne, Exit); + // valid value of failedIdx can only be -1 when < 0 + __ bgez(failedIdx, Exit); __ BIND(ProcessScalar); __ beqz(length, Exit);