Skip to content

Commit

Permalink
Enable rdbar/wrtbar On Power
Browse files Browse the repository at this point in the history
This commit enables all rdbar/rdbari & wrtbar/wrtbari Evaluators on Power.
Added implementations for:
dwrtbar(i)Evaluator
fwrtbar(i)Evaluator
awrtbar(i)Evaluator

Signed-off-by: Alen Badel <[email protected]>
  • Loading branch information
Alen Badel authored and Alen Badel committed Jun 22, 2019
1 parent dc661ac commit 6385c23
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 14 deletions.
66 changes: 66 additions & 0 deletions compiler/p/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,72 @@ TR::Register *OMR::Power::TreeEvaluator::vstoreEvaluator(TR::Node *node, TR::Cod
return NULL;
}

TR::Register *OMR::Power::TreeEvaluator::awrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg)
{
// The wrtbar IL op represents a store with side effects.
// Currently we don't use the side effect node. So just evaluate it and decrement the reference count.
TR::Node *sideEffectNode = node->getSecondChild();
cg->evaluate(sideEffectNode);
cg->decReferenceCount(sideEffectNode);
// Delegate the evaluation of the remaining children and the store operation to the storeEvaluator.
return TR::TreeEvaluator::astoreEvaluator(node, cg);
}

TR::Register *OMR::Power::TreeEvaluator::awrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg)
{
// The wrtbar IL op represents a store with side effects.
// Currently we don't use the side effect node. So just evaluate it and decrement the reference count.
TR::Node *sideEffectNode = node->getThirdChild();
cg->evaluate(sideEffectNode);
cg->decReferenceCount(sideEffectNode);
// Delegate the evaluation of the remaining children and the store operation to the storeEvaluator.
return TR::TreeEvaluator::astoreEvaluator(node, cg);
}

TR::Register *OMR::Power::TreeEvaluator::dwrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg)
{
// The wrtbar IL op represents a store with side effects.
// Currently we don't use the side effect node. So just evaluate it and decrement the reference count.
TR::Node *sideEffectNode = node->getSecondChild();
cg->evaluate(sideEffectNode);
cg->decReferenceCount(sideEffectNode);
// Delegate the evaluation of the remaining children and the store operation to the storeEvaluator.
return TR::TreeEvaluator::dstoreEvaluator(node, cg);
}

TR::Register *OMR::Power::TreeEvaluator::dwrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg)
{
// The wrtbar IL op represents a store with side effects.
// Currently we don't use the side effect node. So just evaluate it and decrement the reference count.
TR::Node *sideEffectNode = node->getThirdChild();
cg->evaluate(sideEffectNode);
cg->decReferenceCount(sideEffectNode);
// Delegate the evaluation of the remaining children and the store operation to the storeEvaluator.
return TR::TreeEvaluator::dstoreEvaluator(node, cg);
}

TR::Register *OMR::Power::TreeEvaluator::fwrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg)
{
// The wrtbar IL op represents a store with side effects.
// Currently we don't use the side effect node. So just evaluate it and decrement the reference count.
TR::Node *sideEffectNode = node->getSecondChild();
cg->evaluate(sideEffectNode);
cg->decReferenceCount(sideEffectNode);
// Delegate the evaluation of the remaining children and the store operation to the storeEvaluator.
return TR::TreeEvaluator::fstoreEvaluator(node, cg);
}

TR::Register *OMR::Power::TreeEvaluator::fwrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg)
{
// The wrtbar IL op represents a store with side effects.
// Currently we don't use the side effect node. So just evaluate it and decrement the reference count.
TR::Node *sideEffectNode = node->getThirdChild();
cg->evaluate(sideEffectNode);
cg->decReferenceCount(sideEffectNode);
// Delegate the evaluation of the remaining children and the store operation to the storeEvaluator.
return TR::TreeEvaluator::fstoreEvaluator(node, cg);
}

TR::Register *OMR::Power::TreeEvaluator::inlineVectorUnaryOp(TR::Node *node, TR::CodeGenerator *cg, TR::InstOpCode::Mnemonic op) {
TR::Node *firstChild = node->getFirstChild();
TR::Register *srcReg = NULL;
Expand Down
6 changes: 6 additions & 0 deletions compiler/p/codegen/OMRTreeEvaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ class OMR_EXTENSIBLE TreeEvaluator: public OMR::TreeEvaluator
static TR::Register *cstoreEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *ilstoreEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *astoreEvaluator(TR::Node *node, TR::CodeGenerator *cg); // ibm@59591
static TR::Register *dwrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *awrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *fwrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *dwrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *awrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *fwrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *gotoEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *ireturnEvaluator(TR::Node *node, TR::CodeGenerator *cg);
static TR::Register *lreturnEvaluator(TR::Node *node, TR::CodeGenerator *cg);
Expand Down
28 changes: 14 additions & 14 deletions compiler/p/codegen/OMRTreeEvaluatorTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,27 @@
TR::TreeEvaluator::astoreEvaluator, // TR::astore
TR::TreeEvaluator::bstoreEvaluator, // TR::bstore
TR::TreeEvaluator::sstoreEvaluator, // TR::sstore
TR::TreeEvaluator::badILOpEvaluator, // TR::iwrtbar
TR::TreeEvaluator::badILOpEvaluator, // TR::lwrtbar
TR::TreeEvaluator::badILOpEvaluator, // TR::fwrtbar
TR::TreeEvaluator::badILOpEvaluator, // TR::dwrtbar
TR::TreeEvaluator::badILOpEvaluator, // TR::awrtbar
TR::TreeEvaluator::badILOpEvaluator, // TR::bwrtbar
TR::TreeEvaluator::badILOpEvaluator, // TR::swrtbar
TR::TreeEvaluator::iwrtbarEvaluator, // TR::iwrtbar
TR::TreeEvaluator::lwrtbarEvaluator, // TR::lwrtbar
TR::TreeEvaluator::fwrtbarEvaluator, // TR::fwrtbar
TR::TreeEvaluator::dwrtbarEvaluator, // TR::dwrtbar
TR::TreeEvaluator::awrtbarEvaluator, // TR::awrtbar
TR::TreeEvaluator::bwrtbarEvaluator, // TR::bwrtbar
TR::TreeEvaluator::swrtbarEvaluator, // TR::swrtbar
TR::TreeEvaluator::lstoreEvaluator, // TR::lstorei
TR::TreeEvaluator::fstoreEvaluator, // TR::fstorei
TR::TreeEvaluator::dstoreEvaluator, // TR::dstorei
TR::TreeEvaluator::astoreEvaluator, // TR::astorei
TR::TreeEvaluator::bstoreEvaluator, // TR::bstorei
TR::TreeEvaluator::sstoreEvaluator, // TR::sstorei
TR::TreeEvaluator::istoreEvaluator, // TR::istorei
TR::TreeEvaluator::badILOpEvaluator, // TR::lwrtbari
TR::TreeEvaluator::badILOpEvaluator, // TR::fwrtbari
TR::TreeEvaluator::badILOpEvaluator, // TR::dwrtbari
TR::TreeEvaluator::badILOpEvaluator, // TR::awrtbari
TR::TreeEvaluator::badILOpEvaluator, // TR::bwrtbari
TR::TreeEvaluator::badILOpEvaluator, // TR::swrtbari
TR::TreeEvaluator::badILOpEvaluator, // TR::iwrtbari
TR::TreeEvaluator::lwrtbariEvaluator, // TR::lwrtbari
TR::TreeEvaluator::fwrtbariEvaluator, // TR::fwrtbari
TR::TreeEvaluator::dwrtbariEvaluator, // TR::dwrtbari
TR::TreeEvaluator::awrtbariEvaluator, // TR::awrtbari
TR::TreeEvaluator::bwrtbariEvaluator, // TR::bwrtbari
TR::TreeEvaluator::swrtbariEvaluator, // TR::swrtbari
TR::TreeEvaluator::iwrtbariEvaluator, // TR::iwrtbari
TR::TreeEvaluator::gotoEvaluator, // TR::Goto
TR::TreeEvaluator::ireturnEvaluator, // TR::ireturn
TR::TreeEvaluator::lreturnEvaluator, // TR::lreturn
Expand Down

0 comments on commit 6385c23

Please sign in to comment.