Skip to content

Commit

Permalink
Remove old processor detection code on Power
Browse files Browse the repository at this point in the history
Signed-off-by: Harry Yu <harryyu1994@gmail.com>
  • Loading branch information
harryyu1994 committed Sep 14, 2020
1 parent c72851c commit 47803ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
5 changes: 0 additions & 5 deletions compiler/p/codegen/OMRCodeGenerator.cpp
Expand Up @@ -509,26 +509,21 @@ OMR::Power::CodeGenerator::mulDecompositionCostIsJustified(
switch (self()->comp()->target().cpu.getProcessorDescription().processor)
{
case OMR_PROCESSOR_PPC_PWR630: // 2S+1M FXU out-of-order
TR_ASSERT_FATAL(self()->comp()->target().cpu.id() == TR_PPCpwr630, "TR_PPCpwr630");
return (numOfOperations<=4);

case OMR_PROCESSOR_PPC_NSTAR:
case OMR_PROCESSOR_PPC_PULSAR: // 1S+1M FXU in-order
TR_ASSERT_FATAL(self()->comp()->target().cpu.id() == TR_PPCnstar || self()->comp()->target().cpu.id() == TR_PPCpulsar, "TR_PPCnstar, TR_PPCpulsar");
return (numOfOperations<=8);

case OMR_PROCESSOR_PPC_GPUL:
case OMR_PROCESSOR_PPC_GP:
case OMR_PROCESSOR_PPC_GR: // 2 FXU out-of-order back-to-back 2 cycles. Mul is only 4 to 6 cycles
TR_ASSERT_FATAL(self()->comp()->target().cpu.id() == TR_PPCgpul || self()->comp()->target().cpu.id() == TR_PPCgp || self()->comp()->target().cpu.id() == TR_PPCgr, "TR_PPCgpul, TR_PPCgp, TR_PPCgr");
return (numOfOperations<=2);

case OMR_PROCESSOR_PPC_P6: // Mul is on FPU for 17cycles blocking other operations
TR_ASSERT_FATAL(self()->comp()->target().cpu.id() == TR_PPCp6, "TR_PPCp6");
return (numOfOperations<=16);

case OMR_PROCESSOR_PPC_P7: // Mul blocks other operations for up to 4 cycles
TR_ASSERT_FATAL(self()->comp()->target().cpu.id() == TR_PPCp7, "TR_PPCp7");
return (numOfOperations<=3);

default: // assume a generic design similar to 604
Expand Down
11 changes: 4 additions & 7 deletions compiler/p/env/OMRCPU.cpp
Expand Up @@ -102,34 +102,31 @@ bool
OMR::Power::CPU::is(OMRProcessorArchitecture p)
{
if (TR::Compiler->omrPortLib == NULL)
return self()->id() == self()->get_old_processor_type_from_new_processor_type(p);
return self()->id() == self()->getOldProcessorTypeFromNewProcessorType(p);

TR_ASSERT_FATAL((_processorDescription.processor == p) == (self()->id() == self()->get_old_processor_type_from_new_processor_type(p)), "is test %d failed, id() %d, _processorDescription.processor %d", p, self()->id(), _processorDescription.processor);
return _processorDescription.processor == p;
}

bool
OMR::Power::CPU::isAtLeast(OMRProcessorArchitecture p)
{
if (TR::Compiler->omrPortLib == NULL)
return self()->id() >= self()->get_old_processor_type_from_new_processor_type(p);
return self()->id() >= self()->getOldProcessorTypeFromNewProcessorType(p);

TR_ASSERT_FATAL((_processorDescription.processor >= p) == (self()->id() >= self()->get_old_processor_type_from_new_processor_type(p)), "is at least test %d failed, id() %d, _processorDescription.processor %d", p, self()->id(), _processorDescription.processor);
return _processorDescription.processor >= p;
}

bool
OMR::Power::CPU::isAtMost(OMRProcessorArchitecture p)
{
if (TR::Compiler->omrPortLib == NULL)
return self()->id() <= self()->get_old_processor_type_from_new_processor_type(p);
return self()->id() <= self()->getOldProcessorTypeFromNewProcessorType(p);

TR_ASSERT_FATAL((_processorDescription.processor <= p) == (self()->id() <= self()->get_old_processor_type_from_new_processor_type(p)), "is at most test %d failed, id() %d, _processorDescription.processor %d", p, self()->id(), _processorDescription.processor);
return _processorDescription.processor <= p;
}

TR_Processor
OMR::Power::CPU::get_old_processor_type_from_new_processor_type(OMRProcessorArchitecture p)
OMR::Power::CPU::getOldProcessorTypeFromNewProcessorType(OMRProcessorArchitecture p)
{
switch(p)
{
Expand Down
7 changes: 6 additions & 1 deletion compiler/p/env/OMRCPU.hpp
Expand Up @@ -55,6 +55,7 @@ class OMR_EXTENSIBLE CPU : public OMR::CPU
_processorDescription.physicalProcessor = OMR_PROCESSOR_PPC_UNKNOWN;
memset(_processorDescription.features, 0, OMRPORT_SYSINFO_FEATURES_SIZE*sizeof(uint32_t));
}

CPU(const OMRProcessorDesc& processorDescription) : OMR::CPU(processorDescription) {}

public:
Expand Down Expand Up @@ -129,8 +130,12 @@ class OMR_EXTENSIBLE CPU : public OMR::CPU
bool is(OMRProcessorArchitecture p);
bool isAtLeast(OMRProcessorArchitecture p);
bool isAtMost(OMRProcessorArchitecture p);
TR_Processor get_old_processor_type_from_new_processor_type(OMRProcessorArchitecture p);
void applyUserOptions();

private:

TR_Processor getOldProcessorTypeFromNewProcessorType(OMRProcessorArchitecture p);

};

}
Expand Down

0 comments on commit 47803ad

Please sign in to comment.