8310276: RISC-V: Make use of shadd macro-assembler function when possible
Reviewed-by: fyang, luhenry, fjiang, vkempik
This commit is contained in:
parent
c1c5bd0faf
commit
3357867928
@ -4327,6 +4327,7 @@ void MacroAssembler::shadd(Register Rd, Register Rs1, Register Rs2, Register tmp
|
||||
}
|
||||
|
||||
if (shamt != 0) {
|
||||
assert_different_registers(Rs2, tmp);
|
||||
slli(tmp, Rs1, shamt);
|
||||
add(Rd, Rs2, tmp);
|
||||
} else {
|
||||
|
@ -3337,8 +3337,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
assert(tmp1->encoding() < x28->encoding(), "register corruption");
|
||||
assert(tmp2->encoding() < x28->encoding(), "register corruption");
|
||||
|
||||
slli(tmp1, len, LogBytesPerWord);
|
||||
add(s, s, tmp1);
|
||||
shadd(s, len, s, tmp1, LogBytesPerWord);
|
||||
mv(tmp1, len);
|
||||
unroll_2(tmp1, &MontgomeryMultiplyGenerator::reverse1, d, s, tmp2);
|
||||
slli(tmp1, len, LogBytesPerWord);
|
||||
|
@ -1787,8 +1787,7 @@ void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
|
||||
// _counters[_index] ++;
|
||||
Register counter_addr = t1;
|
||||
__ mv(x7, (address) &BytecodePairHistogram::_counters);
|
||||
__ slli(index, index, LogBytesPerInt);
|
||||
__ add(counter_addr, x7, index);
|
||||
__ shadd(counter_addr, index, x7, counter_addr, LogBytesPerInt);
|
||||
__ atomic_addw(noreg, 1, counter_addr);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user