summaryrefslogtreecommitdiff
path: root/src/arch/hsail/insts
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2016-12-02 18:01:55 -0500
committerBrandon Potter <brandon.potter@amd.com>2016-12-02 18:01:55 -0500
commit86b375f2f3c5d039a74be6481f11426fb51a5e38 (patch)
tree180165468bab4c28fd4d76712e7a31d19f9613e7 /src/arch/hsail/insts
parent3bb3db6194bae29f03dfa40f589ff024232ee96c (diff)
downloadgem5-86b375f2f3c5d039a74be6481f11426fb51a5e38.tar.xz
hsail: add popcount type and generate popcount instructions
Diffstat (limited to 'src/arch/hsail/insts')
-rw-r--r--src/arch/hsail/insts/decl.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/hsail/insts/decl.hh b/src/arch/hsail/insts/decl.hh
index 4c0bc9ce1..919a4d9d4 100644
--- a/src/arch/hsail/insts/decl.hh
+++ b/src/arch/hsail/insts/decl.hh
@@ -725,6 +725,26 @@ namespace HsailISA
}
};
+ template<typename DestDataType, typename SrcDataType>
+ class PopcountInst :
+ public CommonInstBase<typename DestDataType::OperandType,
+ typename SrcDataType::OperandType, 1>
+ {
+ public:
+ std::string opcode_suffix()
+ {
+ return csprintf("_%s_%s", DestDataType::label, SrcDataType::label);
+ }
+
+ PopcountInst(const Brig::BrigInstBase *ib, const BrigObject *obj,
+ const char *_opcode)
+ : CommonInstBase<typename DestDataType::OperandType,
+ typename SrcDataType::OperandType,
+ 1>(ib, obj, _opcode)
+ {
+ }
+ };
+
class SpecialInstNoSrcNoDest : public HsailGPUStaticInst
{
public: