summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-18 06:07:13 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-18 06:07:13 +0000
commit3dd43fc75dc36504ee7a891550f27500866c40b6 (patch)
tree28b99ba904b1c80e05892a55d59e344bd1cde247 /llvm/lib
parent2e49830b3dc01f679ac21c4059b26257c42f22f8 (diff)
downloadbcm5719-llvm-3dd43fc75dc36504ee7a891550f27500866c40b6.tar.gz
bcm5719-llvm-3dd43fc75dc36504ee7a891550f27500866c40b6.zip
R600: Implement TTI:getPopcntSupport
The test is just copied from X86, and I don't know of a better way to test it. llvm-svn: 213351
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/R600/AMDGPUSubtarget.h6
-rw-r--r--llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp8
2 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUSubtarget.h b/llvm/lib/Target/R600/AMDGPUSubtarget.h
index 0edaca38219..a844b37b6be 100644
--- a/llvm/lib/Target/R600/AMDGPUSubtarget.h
+++ b/llvm/lib/Target/R600/AMDGPUSubtarget.h
@@ -123,8 +123,10 @@ public:
if (Size == 32)
return (getGeneration() >= EVERGREEN);
- assert(Size == 64);
- return (getGeneration() >= SOUTHERN_ISLANDS);
+ if (Size == 64)
+ return (getGeneration() >= SOUTHERN_ISLANDS);
+
+ return false;
}
bool hasMulU24() const {
diff --git a/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp
index 2d934a4cb09..e3a546e1d72 100644
--- a/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp
@@ -77,6 +77,8 @@ public:
void getUnrollingPreferences(Loop *L,
UnrollingPreferences &UP) const override;
+ PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const override;
+
/// @}
};
@@ -119,3 +121,9 @@ void AMDGPUTTI::getUnrollingPreferences(Loop *L,
}
}
}
+
+AMDGPUTTI::PopcntSupportKind
+AMDGPUTTI::getPopcntSupport(unsigned TyWidth) const {
+ assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2");
+ return ST->hasBCNT(TyWidth) ? PSK_FastHardware : PSK_Software;
+}
OpenPOWER on IntegriCloud