Skip to content

Commit

Permalink
Use common fence instruction on x86
Browse files Browse the repository at this point in the history
  • Loading branch information
fjeremic committed Jun 9, 2021
1 parent ef995bc commit 116b1ce
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion compiler/x/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,7 @@ TR::RealRegister::RegNum OMR::X86::CodeGenerator::pickNOPRegister(TR::Instructio
static const int32_t WINDOW_SIZE = 5;
while (j <= WINDOW_SIZE && cursor)
{
if (cursor->getOpCodeValue() != FENCE &&
if (cursor->getOpCodeValue() != TR::InstOpCode::fence &&
cursor->getOpCodeValue() != LABEL)
{
++j;
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 @@ -1037,7 +1037,6 @@
VFNMSUB213SDRegRegMem,
VFNMSUB231SDRegRegReg,
VFNMSUB231SDRegRegMem,
FENCE,
VGFENCE,
PROCENTRY,
DQImm64,
Expand Down
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 @@ -1025,7 +1025,6 @@
#define VFNMSUB213SDRegRegMem OMR::InstOpCode::VFNMSUB213SDRegRegMem
#define VFNMSUB231SDRegRegReg OMR::InstOpCode::VFNMSUB231SDRegRegReg
#define VFNMSUB231SDRegRegMem OMR::InstOpCode::VFNMSUB231SDRegRegMem
#define FENCE OMR::InstOpCode::FENCE
#define VGFENCE OMR::InstOpCode::VGFENCE
#define PROCENTRY OMR::InstOpCode::PROCENTRY
#define DQImm64 OMR::InstOpCode::DQImm64
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 @@ -552,7 +552,7 @@ TR::RealRegister *OMR::X86::Machine::freeBestGPRegister(TR::Instruction
if (distance > FREE_BEST_REGISTER_SEARCH_DISTANCE)
break;

if (cursor->getOpCodeValue() == FENCE)
if (cursor->getOpCodeValue() == TR::InstOpCode::fence)
{
// Don't walk past the start of the super (extended) block.
// This is primarily for the non-linear register assigner because
Expand All @@ -564,7 +564,7 @@ TR::RealRegister *OMR::X86::Machine::freeBestGPRegister(TR::Instruction
break;
}

if (cursor->getOpCodeValue() == FENCE ||
if (cursor->getOpCodeValue() == TR::InstOpCode::fence ||
cursor->getOpCodeValue() == FPREGSPILL)
continue;

Expand Down
4 changes: 2 additions & 2 deletions compiler/x/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3445,7 +3445,7 @@ TR::Register *OMR::X86::TreeEvaluator::BBStartEvaluator(TR::Node *node, TR::Code
}

TR::Instruction *fence =
generateFenceInstruction(FENCE,
generateFenceInstruction(TR::InstOpCode::fence,
node,
TR::Node::createRelative32BitFenceNode(node, &block->getInstructionBoundaries()._startPC),
cg);
Expand Down Expand Up @@ -3490,7 +3490,7 @@ TR::Register *OMR::X86::TreeEvaluator::BBEndEvaluator(TR::Node *node, TR::CodeGe
TR::Compilation *comp = cg->comp();
TR::TreeTop *nextTT = cg->getCurrentEvaluationTreeTop()->getNextTreeTop();

TR::X86FenceInstruction *instr = generateFenceInstruction(FENCE, node, TR::Node::createRelative32BitFenceNode(node, &node->getBlock()->getInstructionBoundaries()._endPC), cg);
TR::X86FenceInstruction *instr = generateFenceInstruction(TR::InstOpCode::fence, node, TR::Node::createRelative32BitFenceNode(node, &node->getBlock()->getInstructionBoundaries()._endPC), cg);

node->getBlock()->setLastInstruction(instr);

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 @@ -4084,10 +4084,6 @@ INSTRUCTION(VFNMSUB231SDRegRegMem, vfnmsub231sd,
PROPERTY1(IA32OpProp1_XMMSource | IA32OpProp1_SourceIsMemRef | IA32OpProp1_XMMTarget)),

// OpCodes beyond this point are pseudo instructions; they are for OMR internal usage only.
INSTRUCTION(FENCE, Fence, // Address of binary is to be written to specified data address, SymbolReference controls code motion across fence
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
PROPERTY1(IA32OpProp1_PseudoOp)),
INSTRUCTION(VGFENCE, VGFence, // Special Fence used for patching virtual guards
BINARY(VEX_L___, VEX_vNONE, PREFIX___, REX__, ESCAPE_____, 0x00, 0, ModRM_NONE, Immediate_0),
PROPERTY0(0),
Expand Down

0 comments on commit 116b1ce

Please sign in to comment.