From b2f2f960ce8af01a5676d386de1793737a75e72e Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 4 Mar 2013 17:40:28 +0000 Subject: [PATCH] R600: Clean up datalayout strings so they better match hardware capabilities llvm-svn: 176439 --- llvm/lib/Target/R600/AMDILDevice.cpp | 20 ++++++++++++++------ llvm/lib/Target/R600/AMDILSIDevice.cpp | 15 +++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/llvm/lib/Target/R600/AMDILDevice.cpp b/llvm/lib/Target/R600/AMDILDevice.cpp index eec5059de296..db8e01ea4043 100644 --- a/llvm/lib/Target/R600/AMDILDevice.cpp +++ b/llvm/lib/Target/R600/AMDILDevice.cpp @@ -115,10 +115,18 @@ bool AMDGPUDevice::usesSoftware(AMDGPUDeviceInfo::Caps Mode) const { std::string AMDGPUDevice::getDataLayout() const { - return std::string("e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16" - "-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:32:32" - "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64" - "-v96:128:128-v128:128:128-v192:256:256-v256:256:256" - "-v512:512:512-v1024:1024:1024-v2048:2048:2048" - "-n8:16:32:64"); + std::string DataLayout = std::string( + "e" + "-p:32:32:32" + "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32" + "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128" + "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048" + "-n32:64" + ); + + if (usesHardware(AMDGPUDeviceInfo::DoubleOps)) { + DataLayout.append("-f64:64:64"); + } + + return DataLayout; } diff --git a/llvm/lib/Target/R600/AMDILSIDevice.cpp b/llvm/lib/Target/R600/AMDILSIDevice.cpp index 3096c2206701..0d1de3d11eb4 100644 --- a/llvm/lib/Target/R600/AMDILSIDevice.cpp +++ b/llvm/lib/Target/R600/AMDILSIDevice.cpp @@ -36,10 +36,13 @@ AMDGPUSIDevice::getGeneration() const { std::string AMDGPUSIDevice::getDataLayout() const { - return std::string("e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16" - "-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:32:32" - "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64" - "-v96:128:128-v128:128:128-v192:256:256-v256:256:256" - "-v512:512:512-v1024:1024:1024-v2048:2048:2048" - "-n8:16:32:64"); + return std::string( + "e" + "-p:64:64:64" + "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64" + "-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128" + "-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024" + "-v2048:2048:2048" + "-n32:64" + ); }