Skip to content

Commit aaea552

Browse files
committed
clean up
1 parent 685f86c commit aaea552

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

runtime/compiler/p/codegen/J9TreeEvaluator.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11708,9 +11708,7 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
1170811708
TR::Register *tempReg = cg->allocateRegister();
1170911709

1171011710
TR::Register *cr6 = cg->allocateRegister(TR_CCR);
11711-
TR::Register *cr0 = NULL;
11712-
if (isCountPositives && isLE)
11713-
cr0 = cg->allocateRegister(TR_CCR);
11711+
TR::Register *cr0 = cg->allocateRegister(TR_CCR);
1171411712

1171511713
TR::Register *vconstant0Reg = cg->allocateRegister(TR_VRF);
1171611714
TR::Register *vtmp1Reg = cg->allocateRegister(TR_VRF);
@@ -11759,9 +11757,9 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
1175911757
// check the negative bit
1176011758
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::andi_r, node, tempReg, tempReg, 0x80);
1176111759
if (isCountPositives) // when counting positives, just return the index which is 0
11762-
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, endLabel, cr6);
11760+
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, endLabel, cr0);
1176311761
else // when seeking negatives, we need to return 1
11764-
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, matchLabel, cr6);
11762+
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, matchLabel, cr0);
1176511763

1176611764
// if we only have one byte end it here, and return 0 for hasNegative
1176711765
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, indexReg, indexReg, 1);
@@ -11906,7 +11904,7 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
1190611904
if (isCountPositives)
1190711905
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, endLabel, cr0);
1190811906
else
11909-
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, resultLabel, cr0);
11907+
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, matchLabel, cr0);
1191011908

1191111909
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, indexReg, indexReg, 1);
1191211910
generateLabelInstruction(cg, TR::InstOpCode::b, node, serialLabel);
@@ -11934,9 +11932,8 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
1193411932
deps->addPostCondition(tempReg, TR::RealRegister::NoReg);
1193511933

1193611934
deps->addPostCondition(cr6, TR::RealRegister::cr6);
11935+
deps->addPostCondition(cr0, TR::RealRegister::cr0);
1193711936

11938-
if (isCountPositives && isLE)
11939-
deps->addPostCondition(cr0, TR::RealRegister::cr0);
1194011937
deps->addPostCondition(vconstant0Reg, TR::RealRegister::NoReg);
1194111938
deps->addPostCondition(vtmp1Reg, TR::RealRegister::NoReg);
1194211939
deps->addPostCondition(vtmp2Reg, TR::RealRegister::NoReg);
@@ -12548,15 +12545,13 @@ J9::Power::CodeGenerator::inlineDirectCall(TR::Node *node, TR::Register *&result
1254812545
break;
1254912546

1255012547
case TR::java_lang_StringCoding_hasNegatives:
12551-
return false;
1255212548
if (cg->getSupportsInlineStringCodingHasNegatives())
1255312549
{
1255412550
resultReg = inlineStringCodingHasNegativesOrCountPositives(node, cg, false);
1255512551
return true;
1255612552
}
1255712553
break;
1255812554
case TR::java_lang_StringCoding_countPositives:
12559-
return true;
1256012555
if (cg->getSupportsInlineStringCodingCountPositives())
1256112556
{
1256212557
resultReg = inlineStringCodingHasNegativesOrCountPositives(node, cg, true);

0 commit comments

Comments
 (0)