Skip to content

Commit

Permalink
Migrate proc to the common codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
fjeremic committed May 12, 2021
1 parent e62f3d2 commit 9c45612
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 37 deletions.
2 changes: 1 addition & 1 deletion compiler/aarch64/codegen/ARM64Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static const char *opCodeToNameMap[] =
"dd",
"fence",
"label",
"proc",
"cbzw",
"cbnzw",
"cbzx",
Expand Down Expand Up @@ -749,7 +750,6 @@ static const char *opCodeToNameMap[] =
"vfneg2d",
"vnot16b",
"nop",
"proc",
"return",
"vgdnop",
};
Expand Down
1 change: 0 additions & 1 deletion compiler/aarch64/codegen/OMRInstOpCode.enum
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@
/* Hint instructions */
nop, /* 0xD503201F NOP */
/* Internal OpCodes */
proc, // Entry to the method
retn, // Return
vgdnop, // Virtual Guard NOP instruction
ARM64LastOp = vgdnop,
Expand Down
3 changes: 2 additions & 1 deletion compiler/codegen/OMRInstOpCode.enum
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
bad, // Bad Opcode
dd, // Define Doubleword
fence, // Fence
label, // Destination of a jump
label, // Destination of a jump
proc, // Entry to the method
1 change: 0 additions & 1 deletion compiler/p/codegen/OMRInstOpCode.enum
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@
ret, // Return
// rxor, // Rotate & XOR
wrtbar, // Write barrier directive
proc, // Entry to the method
vgdnop, // Virtual Guard NOP instruction
probenop, // Probe NOP (for RI)
iflong, // compare and branch long
Expand Down
22 changes: 11 additions & 11 deletions compiler/p/codegen/OMRInstOpCodeProperties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@
/* .properties = */ PPCOpProp_None,
},

{
/* .mnemonic = */ OMR::InstOpCode::proc,
/* .name = */ "proc",
/* .description = "Entry to the method", */
/* .prefix = */ 0x00000000,
/* .opcode = */ 0x00000000,
/* .format = */ FORMAT_NONE,
/* .minimumALS = */ OMR_PROCESSOR_PPC_UNKNOWN,
/* .properties = */ PPCOpProp_None,
},

{
/* .mnemonic = */ OMR::InstOpCode::add,
/* .name = */ "add",
Expand Down Expand Up @@ -6268,17 +6279,6 @@
/* .properties = */ PPCOpProp_None,
},

{
/* .mnemonic = */ OMR::InstOpCode::proc,
/* .name = */ "proc",
/* .description = "Entry to the method", */
/* .prefix = */ 0x00000000,
/* .opcode = */ 0x00000000,
/* .format = */ FORMAT_NONE,
/* .minimumALS = */ OMR_PROCESSOR_PPC_UNKNOWN,
/* .properties = */ PPCOpProp_None,
},

{
/* .mnemonic = */ OMR::InstOpCode::vgdnop,
/* .name = */ "vgdnop",
Expand Down
1 change: 0 additions & 1 deletion compiler/riscv/codegen/OMRInstOpCode.enum
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <riscv-opc.h>
#undef DECLARE_INSN
/* Internal OpCodes */
proc, // Entry to the method
retn, // Return
RVLastOp = retn,
RVNumOpCodes = RVLastOp+1,
2 changes: 1 addition & 1 deletion compiler/riscv/codegen/RVDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ static const char *opCodeToNameMap[] =
"dd",
"fence",
"label",
"proc",
/*
* RISC-V instructions
*/
#define DECLARE_INSN(mnemonic, match, mask) #mnemonic,
#include <riscv-opc.h>
#undef DECLARE_INSN
"proc",
"return",
};

Expand Down
2 changes: 1 addition & 1 deletion compiler/z/codegen/InstOpCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ OMR::Z::InstOpCode::isAdmin()
_mnemonic == assocreg ||
_mnemonic == DEPEND ||
_mnemonic == fence ||
_mnemonic == PROC ||
_mnemonic == proc ||
_mnemonic == dd ||
_mnemonic == DC2 ||
_mnemonic == DCB);
Expand Down
4 changes: 2 additions & 2 deletions compiler/z/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ OMR::Z::CodeGenerator::beginInstructionSelection()
_returnTypeInfoInstruction = new (self()->trHeapMemory()) TR::S390ImmInstruction(TR::InstOpCode::dd, startNode, 0, NULL, cursor, self());
}

generateS390PseudoInstruction(self(), TR::InstOpCode::PROC, startNode);
generateS390PseudoInstruction(self(), TR::InstOpCode::proc, startNode);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1971,7 +1971,7 @@ OMR::Z::CodeGenerator::doBinaryEncoding()
TR::Instruction* cursor = data.cursorInstruction;

// TODO: We should be caching the PROC instruction as it's used in several places and is pretty important
while (cursor && cursor->getOpCodeValue() != TR::InstOpCode::PROC)
while (cursor && cursor->getOpCodeValue() != TR::InstOpCode::proc)
{
cursor = cursor->getNext();
}
Expand Down
1 change: 0 additions & 1 deletion compiler/z/codegen/OMRInstOpCode.enum
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
DC2, // DC2
DCB, // Debug Counter Bump
DEPEND, // Someplace to hang dependencies
PROC, // Entry to the method
RET, // Return
VGNOP, // ValueGuardNOP

Expand Down
22 changes: 11 additions & 11 deletions compiler/z/codegen/OMRInstOpCodeProperties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@
/* .properties = */ S390OpProp_None
},

{
/* .mnemonic = */ OMR::InstOpCode::proc,
/* .name = */ "PROC",
/* .description = */ "Entry to the method",
/* .opcode[0] = */ 0x00,
/* .opcode[1] = */ 0x00,
/* .format = */ PSEUDO,
/* .minimumALS = */ OMR_PROCESSOR_S390_UNKNOWN,
/* .properties = */ S390OpProp_None
},

{
/* .mnemonic = */ OMR::InstOpCode::BREAK,
/* .name = */ "BREAK",
Expand Down Expand Up @@ -128,17 +139,6 @@
/* .properties = */ S390OpProp_None
},

{
/* .mnemonic = */ OMR::InstOpCode::PROC,
/* .name = */ "PROC",
/* .description = */ "Entry to the method",
/* .opcode[0] = */ 0x00,
/* .opcode[1] = */ 0x00,
/* .format = */ PSEUDO,
/* .minimumALS = */ OMR_PROCESSOR_S390_UNKNOWN,
/* .properties = */ S390OpProp_None
},

{
/* .mnemonic = */ OMR::InstOpCode::RET,
/* .name = */ "RET",
Expand Down
4 changes: 2 additions & 2 deletions compiler/z/codegen/OMRMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ boundNext(TR::Instruction * currentInstruction, int32_t realNum, TR::Register *
TR::RealRegister::RegNum realReg = (TR::RealRegister::RegNum) realNum;
TR::Node * nodeBBStart = NULL;

while (cursor->getOpCodeValue() != TR::InstOpCode::PROC)
while (cursor->getOpCodeValue() != TR::InstOpCode::proc)
{
TR::RegisterDependencyConditions * conditions;
if ((conditions = cursor->getDependencyConditions()) != NULL)
Expand Down Expand Up @@ -2532,7 +2532,7 @@ OMR::Z::Machine::freeBestRegister(TR::Instruction * currentInstruction, TR::Regi
}

TR::Instruction * cursor = currentInstruction->getPrev();
while (numCandidates > 1 && cursor != NULL && cursor->getOpCodeValue() != TR::InstOpCode::label && cursor->getOpCodeValue() != TR::InstOpCode::PROC)
while (numCandidates > 1 && cursor != NULL && cursor->getOpCodeValue() != TR::InstOpCode::label && cursor->getOpCodeValue() != TR::InstOpCode::proc)
{
for (int32_t i = 0; i < numCandidates; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion compiler/z/codegen/snippet/PPA1Snippet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ TR::PPA1Snippet::emitSnippetBody()
// value. Those need to also be improved.
TR::Instruction* prologueBegin = cg()->getFirstInstruction();

while (prologueBegin != NULL && prologueBegin->getOpCodeValue() != TR::InstOpCode::PROC)
while (prologueBegin != NULL && prologueBegin->getOpCodeValue() != TR::InstOpCode::proc)
{
prologueBegin = prologueBegin->getNext();
}
Expand Down
2 changes: 1 addition & 1 deletion fvtest/compilertest/z/codegen/Evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ TestCompiler::FrontEnd::generateBinaryEncodingPrologue(
data->estimate += 256;
}

while (data->cursorInstruction && data->cursorInstruction->getOpCodeValue() != TR::InstOpCode::PROC)
while (data->cursorInstruction && data->cursorInstruction->getOpCodeValue() != TR::InstOpCode::proc)
{
data->estimate = data->cursorInstruction->estimateBinaryLength(data->estimate);
data->cursorInstruction = data->cursorInstruction->getNext();
Expand Down
2 changes: 1 addition & 1 deletion jitbuilder/z/codegen/Evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ JitBuilder::FrontEnd::generateBinaryEncodingPrologue(
data->estimate += 256;
}

while (data->cursorInstruction && data->cursorInstruction->getOpCodeValue() != TR::InstOpCode::PROC)
while (data->cursorInstruction && data->cursorInstruction->getOpCodeValue() != TR::InstOpCode::proc)
{
data->estimate = data->cursorInstruction->estimateBinaryLength(data->estimate);
data->cursorInstruction = data->cursorInstruction->getNext();
Expand Down

0 comments on commit 9c45612

Please sign in to comment.