Skip to content

Commit

Permalink
Merge pull request #9819 from aviansie-ben/power-si16-range-fix
Browse files Browse the repository at this point in the history
(0.21.0) Fix a couple minor issues with 16-bit immediates on Power
  • Loading branch information
pshipton committed Jun 8, 2020
2 parents 365f3f8 + 6e4e75d commit 7da6108
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions runtime/compiler/p/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5539,7 +5539,7 @@ reservationLockEnter(TR::Node *node, int32_t lwOffset, TR::CodeGenerator *cg, TR
generateLabelInstruction(cg, TR::InstOpCode::label, node, resLabel);
generateTrg1Src1ImmInstruction(cg,TR::InstOpCode::Op_cmpli, node, cndReg, monitorReg, 0);
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, reserved_checkLabel, cndReg);
generateTrg1ImmInstruction(cg, TR::InstOpCode::li, node, tempReg, lwOffset & 0x0000FFFF);
generateTrg1ImmInstruction(cg, TR::InstOpCode::li, node, tempReg, lwOffset);
if (!isPrimitive)
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, valReg, metaReg, LOCK_RESERVATION_BIT | LOCK_INC_DEC_VALUE);
generateLabelInstruction(cg, TR::InstOpCode::label, node, loopLabel);
Expand Down Expand Up @@ -6426,7 +6426,15 @@ static void genHeapAlloc(TR::Node *node, TR::Instruction *&iCursor, TR_OpaqueCla
int32_t arrayletLeafSize = TR::Compiler->om.arrayletLeafSize();
int32_t maxContiguousArrayletLeafSizeInBytes = arrayletLeafSize - TR::Compiler->om.sizeofReferenceAddress(); //need to add definition
int32_t maxArrayletSizeInElements = maxContiguousArrayletLeafSizeInBytes / elementSize;
iCursor = generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::cmpi4, node, condReg, enumReg, maxArrayletSizeInElements, iCursor);
if (maxArrayletSizeInElements <= UPPER_IMMED)
{
iCursor = generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::cmpi4, node, condReg, enumReg, maxArrayletSizeInElements, iCursor);
}
else
{
iCursor = loadConstant(cg, node, maxArrayletSizeInElements, temp1Reg, iCursor);
iCursor = generateTrg1Src2Instruction(cg, TR::InstOpCode::cmp4, node, condReg, enumReg, temp1Reg, iCursor);
}
static const char *p = feGetEnv("TR_TarokPreLeafSizeCheckVarBreak");
if (p)
generateInstruction(cg, TR::InstOpCode::bad, node);
Expand Down

0 comments on commit 7da6108

Please sign in to comment.