mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-29 13:24:25 +00:00
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:
@ -28,6 +28,26 @@ namespace {
|
|||||||
RegisterTarget<PowerPCTargetMachine> X("powerpc", " PowerPC (experimental)");
|
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
|
/// PowerPCTargetMachine ctor - Create an ILP32 architecture model
|
||||||
///
|
///
|
||||||
/// FIXME: Should double alignment be 8 bytes? Then we get a PtrAl != DoubleAl
|
/// FIXME: Should double alignment be 8 bytes? Then we get a PtrAl != DoubleAl
|
||||||
|
@ -50,6 +50,9 @@ public:
|
|||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
|
virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
|
||||||
|
|
||||||
|
static unsigned getModuleMatchQuality(const Module &M);
|
||||||
|
static unsigned getJITMatchQuality();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
Reference in New Issue
Block a user