@@ -11708,9 +11708,7 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
11708
11708
TR::Register *tempReg = cg->allocateRegister();
11709
11709
11710
11710
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);
11714
11712
11715
11713
TR::Register *vconstant0Reg = cg->allocateRegister(TR_VRF);
11716
11714
TR::Register *vtmp1Reg = cg->allocateRegister(TR_VRF);
@@ -11759,9 +11757,9 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
11759
11757
// check the negative bit
11760
11758
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::andi_r, node, tempReg, tempReg, 0x80);
11761
11759
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 );
11763
11761
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 );
11765
11763
11766
11764
// if we only have one byte end it here, and return 0 for hasNegative
11767
11765
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, indexReg, indexReg, 1);
@@ -11906,7 +11904,7 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
11906
11904
if (isCountPositives)
11907
11905
generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, endLabel, cr0);
11908
11906
else
11909
- generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, resultLabel , cr0);
11907
+ generateConditionalBranchInstruction(cg, TR::InstOpCode::bne, node, matchLabel , cr0);
11910
11908
11911
11909
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, indexReg, indexReg, 1);
11912
11910
generateLabelInstruction(cg, TR::InstOpCode::b, node, serialLabel);
@@ -11934,9 +11932,8 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
11934
11932
deps->addPostCondition(tempReg, TR::RealRegister::NoReg);
11935
11933
11936
11934
deps->addPostCondition(cr6, TR::RealRegister::cr6);
11935
+ deps->addPostCondition(cr0, TR::RealRegister::cr0);
11937
11936
11938
- if (isCountPositives && isLE)
11939
- deps->addPostCondition(cr0, TR::RealRegister::cr0);
11940
11937
deps->addPostCondition(vconstant0Reg, TR::RealRegister::NoReg);
11941
11938
deps->addPostCondition(vtmp1Reg, TR::RealRegister::NoReg);
11942
11939
deps->addPostCondition(vtmp2Reg, TR::RealRegister::NoReg);
@@ -11960,8 +11957,7 @@ static TR::Register *inlineStringCodingHasNegativesOrCountPositives(TR::Node *no
11960
11957
cg->stopUsingRegister(startReg);
11961
11958
cg->stopUsingRegister(lengthReg);
11962
11959
cg->stopUsingRegister(cr6);
11963
- if (isCountPositives && isLE)
11964
- cg->stopUsingRegister(cr0);
11960
+ cg->stopUsingRegister(cr0);
11965
11961
cg->stopUsingRegister(vconstant0Reg);
11966
11962
cg->stopUsingRegister(vtmp1Reg);
11967
11963
cg->stopUsingRegister(vtmp2Reg);
@@ -12548,15 +12544,13 @@ J9::Power::CodeGenerator::inlineDirectCall(TR::Node *node, TR::Register *&result
12548
12544
break;
12549
12545
12550
12546
case TR::java_lang_StringCoding_hasNegatives:
12551
- return false;
12552
12547
if (cg->getSupportsInlineStringCodingHasNegatives())
12553
12548
{
12554
12549
resultReg = inlineStringCodingHasNegativesOrCountPositives(node, cg, false);
12555
12550
return true;
12556
12551
}
12557
12552
break;
12558
12553
case TR::java_lang_StringCoding_countPositives:
12559
- return true;
12560
12554
if (cg->getSupportsInlineStringCodingCountPositives())
12561
12555
{
12562
12556
resultReg = inlineStringCodingHasNegativesOrCountPositives(node, cg, true);
0 commit comments