Skip to content

Commit

Permalink
RISC-V: Add getReturnTypeInfoInstruction() / getReturnTypeInfoInstruc…
Browse files Browse the repository at this point in the history
…tion()

Signed-off-by: Jan Vrany <jan.vrany@fit.cvut.cz>
  • Loading branch information
janvrany committed Dec 14, 2020
1 parent 12588f6 commit 0f81a4f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
8 changes: 2 additions & 6 deletions compiler/riscv/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ OMR::RV::CodeGenerator::beginInstructionSelection()
TR::Node *startNode = comp->getStartTree()->getNode();
if (comp->getMethodSymbol()->getLinkageConvention() == TR_Private)
{
TR_UNIMPLEMENTED();

//_returnTypeInfoInstruction = new (self()->trHeapMemory()) TR::RVImmInstruction(TR::InstOpCode::dd, startNode, 0, self());
_returnTypeInfoInstruction = new (self()->trHeapMemory()) TR::DataInstruction(TR::InstOpCode::dd, startNode, 0, self());
}
else
{
Expand All @@ -153,9 +151,7 @@ OMR::RV::CodeGenerator::endInstructionSelection()
{
if (_returnTypeInfoInstruction != NULL)
{
TR_UNIMPLEMENTED();

//_returnTypeInfoInstruction->setSourceImmediate(static_cast<uint32_t>(self()->comp()->getReturnInfo()));
_returnTypeInfoInstruction->setSourceImmediate(static_cast<uint32_t>(self()->comp()->getReturnInfo()));
}
}

Expand Down
20 changes: 19 additions & 1 deletion compiler/riscv/codegen/OMRCodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,24 @@ class OMR_EXTENSIBLE CodeGenerator : public OMR::CodeGenerator
TR_GlobalRegisterNumber _gprLinkageGlobalRegisterNumbers[TR::RealRegister::NumRegisters]; // could be smaller
TR_GlobalRegisterNumber _fprLinkageGlobalRegisterNumbers[TR::RealRegister::NumRegisters]; // could be smaller


/**
* @return Retrieves the cached returnTypeInfo instruction
*/
TR::DataInstruction* getReturnTypeInfoInstruction()
{
return _returnTypeInfoInstruction;
}

/**
* @brief Caches the returnTypeInfo instruction
* @param[in] rtii : the returnTypeInfo instruction
*/
void setReturnTypeInfoInstruction(TR::DataInstruction *rtii)
{
_returnTypeInfoInstruction = rtii;
}

private:

enum // flags
Expand All @@ -329,7 +347,7 @@ class OMR_EXTENSIBLE CodeGenerator : public OMR::CodeGenerator

TR::RealRegister *_stackPtrRegister;
TR::RealRegister *_methodMetaDataRegister;
TR::Instruction *_returnTypeInfoInstruction;
TR::DataInstruction *_returnTypeInfoInstruction;
TR::ConstantDataSnippet *_constantData;
const TR::RVLinkageProperties *_linkageProperties;
TR::list<TR_RVOutOfLineCodeSection*> _outOfLineCodeSectionList;
Expand Down

0 comments on commit 0f81a4f

Please sign in to comment.