Skip to content

Commit

Permalink
Should use LIR_Op2::_tmp1 not _opr2 as tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
reinrich committed Dec 4, 2024
1 parent 9a8a273 commit c34ef32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
value.load_item();
LIR_Opr dst = rlock_result(x);
LIR_Opr tmp = new_register(T_FLOAT);
// f2hf treats tmp as live_in. Workaround: initialize to some value.
__ move(LIR_OprFact::floatConst(-0.0), tmp); // just to satisfy LinearScan
__ f2hf(value.result(), dst, tmp);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/c1/c1_LIR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ class LIR_List: public CompilationResourceObj {
void fmaf(LIR_Opr from, LIR_Opr from1, LIR_Opr from2, LIR_Opr to) { append(new LIR_Op3(lir_fmaf, from, from1, from2, to)); }
void log10 (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_log10, from, LIR_OprFact::illegalOpr, to, tmp)); }
void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); }
void f2hf(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_f2hf, from, tmp, to)); }
void f2hf(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_f2hf, from, LIR_OprFact::illegalOpr, to, tmp)); }
void hf2f(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_hf2f, from, tmp, to)); }

void add (LIR_Opr left, LIR_Opr right, LIR_Opr res) { append(new LIR_Op2(lir_add, left, right, res)); }
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/c1/c1_LIRAssembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,12 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) {
case lir_sqrt:
case lir_tan:
case lir_log10:
case lir_f2hf:
case lir_hf2f:
intrinsic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op);
break;
case lir_f2hf:
intrinsic_op(op->code(), op->in_opr1(), op->tmp1_opr(), op->result_opr(), op);
break;

case lir_neg:
negate(op->in_opr1(), op->result_opr(), op->in_opr2());
Expand Down

0 comments on commit c34ef32

Please sign in to comment.