aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/R600/AMDGPUISelLowering.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-06-10 19:18:21 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-06-10 19:18:21 +0000
commitb5b5110b5c2be363f35a2ae90a9793cefb656dbf (patch)
treeac6325c4fc02bab000c3cfbdd4aa9bcc5955b154 /llvm/lib/Target/R600/AMDGPUISelLowering.cpp
parent9a54da08e001dedd16e96def9c9ea1b413d838db (diff)
downloadllvm-b5b5110b5c2be363f35a2ae90a9793cefb656dbf.zip
llvm-b5b5110b5c2be363f35a2ae90a9793cefb656dbf.tar.gz
llvm-b5b5110b5c2be363f35a2ae90a9793cefb656dbf.tar.bz2
R600/SI: Use bcnt instruction for ctpop
llvm-svn: 210567
Diffstat (limited to 'llvm/lib/Target/R600/AMDGPUISelLowering.cpp')
-rw-r--r--llvm/lib/Target/R600/AMDGPUISelLowering.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUISelLowering.cpp b/llvm/lib/Target/R600/AMDGPUISelLowering.cpp
index cb4f8cd..8ee453d 100644
--- a/llvm/lib/Target/R600/AMDGPUISelLowering.cpp
+++ b/llvm/lib/Target/R600/AMDGPUISelLowering.cpp
@@ -220,12 +220,19 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
}
+ for (MVT VT : { MVT::i32, MVT::i64 }) {
+ // TODO: Evergreen has BCNT_INT for CTPOP
+ setOperationAction(ISD::CTPOP, VT, Expand);
+ setOperationAction(ISD::CTTZ, VT, Expand);
+ setOperationAction(ISD::CTLZ, VT, Expand);
+ }
+
static const MVT::SimpleValueType IntTypes[] = {
MVT::v2i32, MVT::v4i32
};
for (MVT VT : IntTypes) {
- //Expand the following operations for the current type by default
+ // Expand the following operations for the current type by default.
setOperationAction(ISD::ADD, VT, Expand);
setOperationAction(ISD::AND, VT, Expand);
setOperationAction(ISD::FP_TO_SINT, VT, Expand);
@@ -244,6 +251,9 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
setOperationAction(ISD::VSELECT, VT, Expand);
setOperationAction(ISD::XOR, VT, Expand);
setOperationAction(ISD::BSWAP, VT, Expand);
+ setOperationAction(ISD::CTPOP, VT, Expand);
+ setOperationAction(ISD::CTTZ, VT, Expand);
+ setOperationAction(ISD::CTLZ, VT, Expand);
}
static const MVT::SimpleValueType FloatTypes[] = {