mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
long double patch 2 of N. Handle it in TargetData.
(I've tried to get the info right for all targets, but I'm not expert on all of them - check yours.) llvm-svn: 40792
This commit is contained in:
parent
891f5b4d28
commit
4b91728849
@ -57,7 +57,7 @@ unsigned AlphaTargetMachine::getJITMatchQuality() {
|
||||
}
|
||||
|
||||
AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout("e"),
|
||||
: DataLayout("e-f128:128:128"),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
||||
JITInfo(*this),
|
||||
Subtarget(M, FS),
|
||||
|
@ -63,7 +63,7 @@ unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
|
||||
/// IA64TargetMachine ctor - Create an LP64 architecture model
|
||||
///
|
||||
IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout("e"),
|
||||
: DataLayout("e-f80:128:128"),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
||||
TLInfo(*this) { // FIXME? check this stuff
|
||||
}
|
||||
|
@ -104,8 +104,8 @@ public:
|
||||
/// getTargetDataString - Return the pointer size and type alignment
|
||||
/// properties of this subtarget.
|
||||
const char *getTargetDataString() const {
|
||||
return isPPC64() ? "E-p:64:64-f64:32:64-i64:32:64"
|
||||
: "E-p:32:32-f64:32:64-i64:32:64";
|
||||
return isPPC64() ? "E-p:64:64-f64:32:64-i64:32:64-f128:64:128"
|
||||
: "E-p:32:32-f64:32:64-i64:32:64-f128:64:128";
|
||||
}
|
||||
|
||||
/// isPPC64 - Return true if we are generating code for 64-bit pointer mode.
|
||||
|
@ -30,7 +30,7 @@ const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
|
||||
/// SparcTargetMachine ctor - Create an ILP32 architecture model
|
||||
///
|
||||
SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS)
|
||||
: DataLayout("E-p:32:32"),
|
||||
: DataLayout("E-p:32:32-f128:128:128"),
|
||||
Subtarget(M, FS), InstrInfo(Subtarget),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
|
||||
}
|
||||
|
@ -436,6 +436,13 @@ uint64_t TargetData::getTypeSize(const Type *Ty) const {
|
||||
return 4;
|
||||
case Type::DoubleTyID:
|
||||
return 8;
|
||||
case Type::PPC_FP128TyID:
|
||||
case Type::FP128TyID:
|
||||
return 16;
|
||||
// In memory objects this is always aligned to a higher boundary, but
|
||||
// only 10 bytes contain information.
|
||||
case Type::X86_FP80TyID:
|
||||
return 10;
|
||||
case Type::VectorTyID: {
|
||||
const VectorType *PTy = cast<VectorType>(Ty);
|
||||
return PTy->getBitWidth() / 8;
|
||||
@ -493,6 +500,11 @@ unsigned char TargetData::getAlignment(const Type *Ty, bool abi_or_pref) const {
|
||||
break;
|
||||
case Type::FloatTyID:
|
||||
case Type::DoubleTyID:
|
||||
// PPC_FP128TyID and FP128TyID have different data contents, but the
|
||||
// same size and alignment, so they look the same here.
|
||||
case Type::PPC_FP128TyID:
|
||||
case Type::FP128TyID:
|
||||
case Type::X86_FP80TyID:
|
||||
AlignType = FLOAT_ALIGN;
|
||||
break;
|
||||
case Type::VectorTyID: {
|
||||
|
@ -115,8 +115,8 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS,
|
||||
bool is64Bit)
|
||||
: Subtarget(M, FS, is64Bit),
|
||||
DataLayout(Subtarget.is64Bit() ?
|
||||
std::string("e-p:64:64-f64:32:64-i64:32:64") :
|
||||
std::string("e-p:32:32-f64:32:64-i64:32:64")),
|
||||
std::string("e-p:64:64-f64:32:64-i64:32:64-f80:128:128") :
|
||||
std::string("e-p:32:32-f64:32:64-i64:32:64-f80:128:128")),
|
||||
FrameInfo(TargetFrameInfo::StackGrowsDown,
|
||||
Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4),
|
||||
InstrInfo(*this), JITInfo(*this), TLInfo(*this) {
|
||||
|
Loading…
Reference in New Issue
Block a user