Skip to content

Commit

Permalink
Prefix x86 parameterized instruction mnemonic usages with TR::InstOpC…
Browse files Browse the repository at this point in the history
…ode::
  • Loading branch information
fjeremic committed Jun 15, 2021
1 parent 0b28027 commit f7368dd
Show file tree
Hide file tree
Showing 36 changed files with 529 additions and 528 deletions.
2 changes: 1 addition & 1 deletion compiler/x/amd64/codegen/AMD64SystemLinkage.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
2 changes: 1 addition & 1 deletion compiler/x/amd64/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
2 changes: 1 addition & 1 deletion compiler/x/amd64/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
6 changes: 3 additions & 3 deletions compiler/x/codegen/BinaryCommutativeAnalyser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -892,15 +892,15 @@ TR::Register *TR_X86BinaryCommutativeAnalyser::integerAddAnalyserImpl(TR::Node
// if eflags are required then we cannot use LEA as it doesn't set or use them
if (needsEflags || (carry != 0))
{
generateRegRegInstruction(MOVRegReg(is64Bit), root, tempReg, firstRegister, _cg);
generateRegRegInstruction(TR::InstOpCode::MOVRegReg(is64Bit), root, tempReg, firstRegister, _cg);
generateRegRegInstruction(regRegOpCode, root, tempReg, secondRegister, _cg);
}
else
{
TR::MemoryReference *tempMR = generateX86MemoryReference(_cg);
tempMR->setBaseRegister(firstRegister);
tempMR->setIndexRegister(secondRegister);
generateRegMemInstruction(LEARegMem(is64Bit), root, tempReg, tempMR, _cg);
generateRegMemInstruction(TR::InstOpCode::LEARegMem(is64Bit), root, tempReg, tempMR, _cg);
}
}
else if (getOpReg1Mem2())
Expand Down
200 changes: 100 additions & 100 deletions compiler/x/codegen/BinaryEvaluator.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion compiler/x/codegen/CompareAnalyser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
32 changes: 16 additions & 16 deletions compiler/x/codegen/ControlFlowEvaluator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -706,7 +706,7 @@ void OMR::X86::TreeEvaluator::compareIntegersForEquality(TR::Node *node, TR::Cod
cg->stopUsingRegister(tempReg);
}
else
generateMemImmInstruction(TESTMemImm4(is64Bit), node, tempMR, static_cast<int32_t>(mask), cg);
generateMemImmInstruction(TR::InstOpCode::TESTMemImm4(is64Bit), node, tempMR, static_cast<int32_t>(mask), cg);
tempMR->decNodeReferenceCounts(cg);
}
else
Expand Down Expand Up @@ -734,7 +734,7 @@ void OMR::X86::TreeEvaluator::compareIntegersForEquality(TR::Node *node, TR::Cod
(andSecondChild->getSize() == 1))
testInstr = TR::InstOpCode::TEST1RegImm1;
else
testInstr = TESTRegImm4(is64Bit);
testInstr = TR::InstOpCode::TESTRegImm4(is64Bit);
generateRegImmInstruction(testInstr, node, tempReg, static_cast<int32_t>(mask), cg);
}
if (conversionSkipped)
Expand Down Expand Up @@ -766,9 +766,9 @@ void OMR::X86::TreeEvaluator::compareIntegersForEquality(TR::Node *node, TR::Cod
}
else
{
testRRInstr = TESTRegReg(is64Bit);
testMRInstr = TESTMemReg(is64Bit);
movRRInstr = MOVRegReg(is64Bit);
testRRInstr = TR::InstOpCode::TESTRegReg(is64Bit);
testMRInstr = TR::InstOpCode::TESTMemReg(is64Bit);
movRRInstr = TR::InstOpCode::MOVRegReg(is64Bit);
}
temp.genericAnalyser(firstChild, testRRInstr, testMRInstr, movRRInstr, true);
}
Expand Down Expand Up @@ -925,7 +925,7 @@ void OMR::X86::TreeEvaluator::compareIntegersForEquality(TR::Node *node, TR::Cod
}
else
{
cmpInstruction = generateRegImmInstruction(CMPRegImm4(is64Bit), node, firstChildReg, static_cast<int32_t>(constValue), cg);
cmpInstruction = generateRegImmInstruction(TR::InstOpCode::CMPRegImm4(is64Bit), node, firstChildReg, static_cast<int32_t>(constValue), cg);
}
TR::Symbol *symbol = NULL;
if (node && secondChild->getOpCode().hasSymbolReference())
Expand Down Expand Up @@ -995,9 +995,9 @@ void OMR::X86::TreeEvaluator::compareIntegersForEquality(TR::Node *node, TR::Cod
}
else
{
cmpRRInstr = CMPRegReg(is64Bit);
cmpRMInstr = CMPRegMem(is64Bit);
cmpMRInstr = CMPMemReg(is64Bit);
cmpRRInstr = TR::InstOpCode::CMPRegReg(is64Bit);
cmpRMInstr = TR::InstOpCode::CMPRegMem(is64Bit);
cmpMRInstr = TR::InstOpCode::CMPMemReg(is64Bit);
}
temp.integerCompareAnalyser(node, cmpRRInstr, cmpRMInstr, cmpMRInstr);

Expand Down Expand Up @@ -1070,7 +1070,7 @@ void OMR::X86::TreeEvaluator::compareIntegersForOrder(
firstChild,
secondChild,
false,
CMPRegReg(is64Bit), CMPRegMem(is64Bit), CMPMemReg(is64Bit));
TR::InstOpCode::CMPRegReg(is64Bit), TR::InstOpCode::CMPRegMem(is64Bit), TR::InstOpCode::CMPMemReg(is64Bit));
}
}

Expand Down Expand Up @@ -1328,22 +1328,22 @@ TR::Register *OMR::X86::TreeEvaluator::iselectEvaluator(TR::Node *node, TR::Code
TR::TreeEvaluator::compareIntegersForEquality(condition, cg);
//if ((conditionOp == TR::icmpeq) || (conditionOp == TR::lcmpeq))
if (conditionOp.isCompareTrueIfEqual())
generateRegRegInstruction(CMOVNERegReg(trueValIs64Bit), node, trueReg, falseReg, cg);
generateRegRegInstruction(TR::InstOpCode::CMOVNERegReg(trueValIs64Bit), node, trueReg, falseReg, cg);
else
generateRegRegInstruction(CMOVERegReg(trueValIs64Bit), node, trueReg, falseReg, cg);
generateRegRegInstruction(TR::InstOpCode::CMOVERegReg(trueValIs64Bit), node, trueReg, falseReg, cg);
}
else if (!longCompareOn32bit && conditionOp.isCompareForOrder() && condition->getFirstChild()->getOpCode().isIntegerOrAddress())
{
TR::TreeEvaluator::compareIntegersForOrder(condition, cg);
generateRegRegInstruction((conditionOp.isCompareTrueIfEqual()) ?
((conditionOp.isCompareTrueIfGreater()) ? CMOVLRegReg(trueValIs64Bit) : CMOVGRegReg(trueValIs64Bit)) :
((conditionOp.isCompareTrueIfGreater()) ? CMOVLERegReg(trueValIs64Bit) : CMOVGERegReg(trueValIs64Bit)), node, trueReg, falseReg, cg);
((conditionOp.isCompareTrueIfGreater()) ? TR::InstOpCode::CMOVLRegReg(trueValIs64Bit) : TR::InstOpCode::CMOVGRegReg(trueValIs64Bit)) :
((conditionOp.isCompareTrueIfGreater()) ? TR::InstOpCode::CMOVLERegReg(trueValIs64Bit) : TR::InstOpCode::CMOVGERegReg(trueValIs64Bit)), node, trueReg, falseReg, cg);
}
else
{
TR::Register *condReg = cg->evaluate(condition);
generateRegRegInstruction(TR::InstOpCode::TEST4RegReg, node, condReg, condReg, cg); // condition is always an int
generateRegRegInstruction(CMOVERegReg(trueValIs64Bit), node, trueReg, falseReg, cg);
generateRegRegInstruction(TR::InstOpCode::CMOVERegReg(trueValIs64Bit), node, trueReg, falseReg, cg);
}

if (node->getOpCodeValue() == TR::bselect &&
Expand Down
4 changes: 2 additions & 2 deletions compiler/x/codegen/DivideCheckSnippet.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -44,7 +44,7 @@ uint8_t *TR::X86DivideCheckSnippet::emitSnippetBody()
// CMP realDivisorReg, -1
//
uint8_t rexPrefix = cg()->comp()->target().is64Bit() ? realDivisorReg->rexBits(TR::RealRegister::REX_B, false) : 0;
buffer = TR::InstOpCode(CMPRegImms(_divOp.isLong())).binary(buffer, rexPrefix);
buffer = TR::InstOpCode(TR::InstOpCode::CMPRegImms(_divOp.isLong())).binary(buffer, rexPrefix);
realDivisorReg->setRMRegisterFieldInModRM(buffer-1);
*buffer++ = -1;

Expand Down
2 changes: 1 addition & 1 deletion compiler/x/codegen/FPBinaryArithmeticAnalyser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
2 changes: 1 addition & 1 deletion compiler/x/codegen/FPCompareAnalyser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
14 changes: 7 additions & 7 deletions compiler/x/codegen/FPTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ TR::Register *OMR::X86::TreeEvaluator::floatingPointStoreEvaluator(TR::Node *nod
{
TR::Register *tempRegister = cg->allocateRegister(TR_GPR);
TR::MemoryReference *loadMR = generateX86MemoryReference(valueChild, cg);
generateRegMemInstruction(LRegMem(nodeIs64Bit), node, tempRegister, loadMR, cg);
exceptionPoint = generateMemRegInstruction(SMemReg(nodeIs64Bit), node, tempMR, tempRegister, cg);
generateRegMemInstruction(TR::InstOpCode::LRegMem(nodeIs64Bit), node, tempRegister, loadMR, cg);
exceptionPoint = generateMemRegInstruction(TR::InstOpCode::SMemReg(nodeIs64Bit), node, tempMR, tempRegister, cg);
cg->stopUsingRegister(tempRegister);
loadMR->decNodeReferenceCounts(cg);
}
Expand All @@ -462,7 +462,7 @@ TR::Register *OMR::X86::TreeEvaluator::floatingPointStoreEvaluator(TR::Node *nod
{
// The 64-bit static case does not require the LEA instruction as we can resolve the address in the MOV reg, imm instruction preceeding the store.
//
exceptionPoint = generateMemRegInstruction(MOVSMemReg(nodeIs64Bit), node, tempMR, sourceRegister, cg);
exceptionPoint = generateMemRegInstruction(TR::InstOpCode::MOVSMemReg(nodeIs64Bit), node, tempMR, sourceRegister, cg);
}
else
{
Expand All @@ -475,7 +475,7 @@ TR::Register *OMR::X86::TreeEvaluator::floatingPointStoreEvaluator(TR::Node *nod
generateRegMemInstruction(TR::InstOpCode::LEA8RegMem, node, memReg, tempMR, cg);
TR::MemoryReference *mr = generateX86MemoryReference(memReg, 0, cg);
TR_ASSERT(nodeIs64Bit != sourceRegister->isSinglePrecision(), "Wrong operand type to floating point store\n");
exceptionPoint = generateMemRegInstruction(MOVSMemReg(nodeIs64Bit), node, mr, sourceRegister, cg);
exceptionPoint = generateMemRegInstruction(TR::InstOpCode::MOVSMemReg(nodeIs64Bit), node, mr, sourceRegister, cg);

tempMR->setProcessAsFPVolatile();

Expand All @@ -490,7 +490,7 @@ TR::Register *OMR::X86::TreeEvaluator::floatingPointStoreEvaluator(TR::Node *nod
else
{
TR_ASSERT(nodeIs64Bit != sourceRegister->isSinglePrecision(), "Wrong operand type to floating point store\n");
exceptionPoint = generateMemRegInstruction(MOVSMemReg(nodeIs64Bit), node, tempMR, sourceRegister, cg);
exceptionPoint = generateMemRegInstruction(TR::InstOpCode::MOVSMemReg(nodeIs64Bit), node, tempMR, sourceRegister, cg);
}
}
else
Expand Down Expand Up @@ -1463,13 +1463,13 @@ TR::Register *OMR::X86::TreeEvaluator::f2iEvaluator(TR::Node *node, TR::CodeGene
generateX86MemoryReference(doubleSource ? cg->findOrCreate8ByteConstant(node, 0) : cg->findOrCreate4ByteConstant(node, 0), cg),
cg);
// load max int if source is positive, note that for long case, LLONG_MAX << 1 is loaded as it will be shifted right
generateRegMemInstruction(CMOVARegMem(longTarget),
generateRegMemInstruction(TR::InstOpCode::CMOVARegMem(longTarget),
node,
targetRegister,
generateX86MemoryReference(longTarget ? cg->findOrCreate8ByteConstant(node, LLONG_MAX << 1) : cg->findOrCreate4ByteConstant(node, INT_MAX), cg),
cg);
// load zero if source is NaN
generateRegMemInstruction(CMOVPRegMem(longTarget),
generateRegMemInstruction(TR::InstOpCode::CMOVPRegMem(longTarget),
node,
targetRegister,
generateX86MemoryReference(longTarget ? cg->findOrCreate8ByteConstant(node, 0) : cg->findOrCreate4ByteConstant(node, 0), cg),
Expand Down
2 changes: 1 addition & 1 deletion compiler/x/codegen/IA32LinkageUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
Loading

0 comments on commit f7368dd

Please sign in to comment.