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

8295926: RISC-V: C1: Fix LIRGenerator::do_LibmIntrinsic #10867

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp
Expand Up @@ -671,19 +671,30 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) {
LIRItem value(x->argument_at(0), this);
value.set_destroys_register();

LIR_Opr calc_result = rlock_result(x);
LIR_Opr result_reg = result_register_for(x->type());

CallingConvention* cc = NULL;
BasicTypeList signature(1);
signature.append(T_DOUBLE);
if (x->id() == vmIntrinsics::_dpow) { signature.append(T_DOUBLE); }
cc = frame_map()->c_calling_convention(&signature);
value.load_item_force(cc->at(0));

if (x->id() == vmIntrinsics::_dpow) {
LIRItem value1(x->argument_at(1), this);

value1.set_destroys_register();

BasicTypeList signature(2);
signature.append(T_DOUBLE);
signature.append(T_DOUBLE);
cc = frame_map()->c_calling_convention(&signature);
value.load_item_force(cc->at(0));
value1.load_item_force(cc->at(1));
} else {
BasicTypeList signature(1);
signature.append(T_DOUBLE);
cc = frame_map()->c_calling_convention(&signature);
value.load_item_force(cc->at(0));
}

switch (x->id()) {
case vmIntrinsics::_dexp:
if (StubRoutines::dexp() != NULL) { __ call_runtime_leaf(StubRoutines::dexp(), getThreadTemp(), result_reg, cc->args()); }
Expand Down