Skip to content

Commit

Permalink
Fix for RealFYang comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeihan committed Mar 15, 2024
1 parent e49591b commit 178c0e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,27 +1574,27 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp1,
la(a1, Address(a1, base_offset));
la(a2, Address(a2, base_offset));
// Check for short strings, i.e. smaller than 16 bytes.
mv(tmp1, elem_per_word * 2);
blt(cnt1, tmp1, TAIL_8BYTE);
mv(t1, elem_per_word * 2);
blt(cnt1, t1, TAIL_8BYTE);

if (AvoidUnalignedAccesses) {
// TODO: Add code to make sure a1 and a2 are 8-byte aligned.
}

// Main 16-byte comparison loop.
bind(NEXT_16BYTE); {
ld(tmp1, Address(a1, wordSize));
ld(tmp2, Address(a2, wordSize));
ld(tmp3, Address(a1, wordSize * 2));
ld(tmp4, Address(a2, wordSize * 2));
addi(a1, a1, 16);
addi(a2, a2, 16);
ld(tmp1, Address(a1, 0));
ld(tmp2, Address(a2, 0));
ld(tmp3, Address(a1, wordSize));
ld(tmp4, Address(a2, wordSize));
addi(a1, a1, 2 * wordSize);
addi(a2, a2, 2 * wordSize);
addi(cnt1, cnt1, -elem_per_word * 2);
bne(tmp1, tmp2, DONE);
bne(tmp3, tmp4, DONE);
} bgtz(cnt1, NEXT_16BYTE);
} bge(cnt1, t1, NEXT_16BYTE);

addi(cnt1, cnt1, elem_per_word * 2);
beqz(cnt1, SAME);

bind(TAIL_8BYTE);
test_bit(tmp1, cnt1, 3 - log_elem_size);
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/riscv/riscv.ad
Original file line number Diff line number Diff line change
Expand Up @@ -10337,11 +10337,11 @@ instruct string_equalsL(iRegP_R11 str1, iRegP_R13 str2, iRegI_R14 cnt,

instruct array_equalsB(iRegP_R11 ary1, iRegP_R12 ary2, iRegI_R10 result,
iRegP_R13 tmp1, iRegP_R14 tmp2, iRegP_R15 tmp3,
iRegP_R16 tmp4, iRegP_R28 tmp5)
iRegP_R16 tmp4, iRegP_R28 tmp5, rFlagsReg cr)
%{
predicate(!UseRVV && ((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL);
match(Set result (AryEq ary1 ary2));
effect(USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL tmp5);
effect(USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL tmp5, KILL cr);

format %{ "Array Equals $ary1, ary2 -> $result\t#@array_equalsB // KILL $tmp5" %}
ins_encode %{
Expand All @@ -10354,11 +10354,11 @@ instruct array_equalsB(iRegP_R11 ary1, iRegP_R12 ary2, iRegI_R10 result,

instruct array_equalsC(iRegP_R11 ary1, iRegP_R12 ary2, iRegI_R10 result,
iRegP_R13 tmp1, iRegP_R14 tmp2, iRegP_R15 tmp3,
iRegP_R16 tmp4, iRegP_R28 tmp5)
iRegP_R16 tmp4, iRegP_R28 tmp5, rFlagsReg cr)
%{
predicate(!UseRVV && ((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
match(Set result (AryEq ary1 ary2));
effect(USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL tmp5);
effect(USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL tmp5, KILL cr);

format %{ "Array Equals $ary1, ary2 -> $result\t#@array_equalsC // KILL $tmp5" %}
ins_encode %{
Expand Down

0 comments on commit 178c0e1

Please sign in to comment.