Skip to content

Commit

Permalink
Use common retn instruction on x86
Browse files Browse the repository at this point in the history
  • Loading branch information
fjeremic committed Jun 9, 2021
1 parent 9263c24 commit 00b4508
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion compiler/x/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ bool OMR::X86::CodeGenerator::isReturnInstruction(TR::Instruction *instr)
{
if (instr->getOpCodeValue() == RET ||
instr->getOpCodeValue() == RETImm2 ||
instr->getOpCodeValue() == ReturnMarker
instr->getOpCodeValue() == TR::InstOpCode::retn
)
return true;
else
Expand Down
1 change: 0 additions & 1 deletion compiler/x/codegen/OMRInstOpCode.enum
Original file line number Diff line number Diff line change
Expand Up @@ -1050,4 +1050,3 @@
PPS_OPCount,
PPS_OPField,
AdjustFramePtr,
ReturnMarker,
1 change: 0 additions & 1 deletion compiler/x/codegen/OMRInstOpCode.enum.temp.defines
Original file line number Diff line number Diff line change
Expand Up @@ -1038,4 +1038,3 @@
#define PPS_OPCount OMR::InstOpCode::PPS_OPCount
#define PPS_OPField OMR::InstOpCode::PPS_OPField
#define AdjustFramePtr OMR::InstOpCode::AdjustFramePtr
#define ReturnMarker OMR::InstOpCode::ReturnMarker
2 changes: 1 addition & 1 deletion compiler/x/codegen/OMRInstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void OMR::X86::Instruction::adjustVFPState(TR_VFPState *state, TR::CodeGenerator
state->_displacement += static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());
else if (self()->getOpCode().isPopOp())
state->_displacement -= static_cast<int32_t>(TR::Compiler->om.sizeofReferenceAddress());
else if (self()->getOpCodeValue() == RET || self()->getOpCodeValue() == RETImm2 || self()->getOpCodeValue() == ReturnMarker)
else if (self()->getOpCodeValue() == RET || self()->getOpCodeValue() == RETImm2 || self()->getOpCodeValue() == TR::InstOpCode::retn)
*state = cg->vfpResetInstruction()->getSavedState();
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/x/codegen/OMRMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ bool existsNextInstructionToTestFlags(TR::Instruction *startInstr,
cursor->getOpCodeValue() != TR::InstOpCode::label &&
cursor->getOpCodeValue() != RET &&
cursor->getOpCodeValue() != RETImm2 &&
cursor->getOpCodeValue() != ReturnMarker &&
cursor->getOpCodeValue() != TR::InstOpCode::retn &&
!cursor->getOpCode().isBranchOp());

return false;
Expand Down Expand Up @@ -2732,7 +2732,7 @@ TR::Instruction *OMR::X86::Machine::freeBestFPRegister(TR::Instruction *prevInst
cursor->getOpCodeValue() != TR::InstOpCode::label &&
cursor->getOpCodeValue() != RET &&
cursor->getOpCodeValue() != RETImm2 &&
cursor->getOpCodeValue() != ReturnMarker &&
cursor->getOpCodeValue() != TR::InstOpCode::retn &&
!cursor->getOpCode().isBranchOp())
{
for (int i = 0; i < numCandidates; i++)
Expand Down
4 changes: 0 additions & 4 deletions compiler/x/codegen/X86Ops.ins
Original file line number Diff line number Diff line change
Expand Up @@ -4136,7 +4136,3 @@ INSTRUCTION(AdjustFramePtr, AdjustFramePtr, // Adjust frame pointer
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(ReturnMarker, ReturnMarker, // Return Marker for linkages that do not end with a RET instruction
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
PROPERTY1(IA32OpProp1_PseudoOp)),

0 comments on commit 00b4508

Please sign in to comment.