Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14780 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman 2004-07-12 23:36:12 +00:00
parent 878ba7cc5d
commit 01eca8d2c2
2 changed files with 23 additions and 0 deletions

View File

@ -28,6 +28,26 @@ namespace {
RegisterTarget<PowerPCTargetMachine> X("powerpc", " PowerPC (experimental)");
}
unsigned PowerPCTargetMachine::getJITMatchQuality() {
#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)
return 10;
#else
return 0;
#endif
}
unsigned PowerPCTargetMachine::getModuleMatchQuality(const Module &M) {
if (M.getEndianness() == Module::BigEndian &&
M.getPointerSize() == Module::Pointer32)
return 10; // Direct match
else if (M.getEndianness() != Module::AnyEndianness ||
M.getPointerSize() != Module::AnyPointerSize)
return 0; // Match for some other target
return getJITMatchQuality()/2;
}
/// PowerPCTargetMachine ctor - Create an ILP32 architecture model
///
/// FIXME: Should double alignment be 8 bytes? Then we get a PtrAl != DoubleAl

View File

@ -50,6 +50,9 @@ public:
MachineCodeEmitter &MCE);
virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
static unsigned getModuleMatchQuality(const Module &M);
static unsigned getJITMatchQuality();
};
} // end namespace llvm