Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old processor detection code on Power #5547

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions compiler/p/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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