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

8308997: RISC-V: Sign extend when comparing 32-bit value with zero instead of testing the sign bit #14197

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/interp_masm_riscv.hpp
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
void load_ptr(int n, Register val);
void store_ptr(int n, Register val);

// Load float value from 'address'. The value is loaded onto the FPU register v0.
// Load float value from 'address'. The value is loaded onto the fp register f10.
void load_float(Address src);
void load_double(Address src);

7 changes: 0 additions & 7 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
@@ -1642,22 +1642,16 @@ void MacroAssembler::subw(Register Rd, Register Rn, int32_t decrement, Register

void MacroAssembler::andrw(Register Rd, Register Rs1, Register Rs2) {
andr(Rd, Rs1, Rs2);
// addw: The result is clipped to 32 bits, then the sign bit is extended,
// and the result is stored in Rd
sign_extend(Rd, Rd, 32);
}

void MacroAssembler::orrw(Register Rd, Register Rs1, Register Rs2) {
orr(Rd, Rs1, Rs2);
// addw: The result is clipped to 32 bits, then the sign bit is extended,
// and the result is stored in Rd
sign_extend(Rd, Rd, 32);
}

void MacroAssembler::xorrw(Register Rd, Register Rs1, Register Rs2) {
xorr(Rd, Rs1, Rs2);
// addw: The result is clipped to 32 bits, then the sign bit is extended,
// and the result is stored in Rd
sign_extend(Rd, Rd, 32);
}

@@ -4419,7 +4413,6 @@ void MacroAssembler::move32_64(VMRegPair src, VMRegPair dst, Register tmp) {
sd(src.first()->as_Register(), Address(sp, reg2offset_out(dst.first())));
} else {
if (dst.first() != src.first()) {
// 32bits extend sign
sign_extend(dst.first()->as_Register(), src.first()->as_Register(), 32);
}
}