diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2014-06-27 18:35:27 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2014-06-27 18:35:27 +0000 |
commit | ef92cf50d6101ee56445c9056d4f476047b8d180 (patch) | |
tree | b8c8577549524ab39726651691be834401e13eb1 /lib/Target/NVPTX/NVPTXInstrInfo.td | |
parent | de7bbdff33d8025d3d8c895689ea70b9377bc4d5 (diff) | |
download | llvm-ef92cf50d6101ee56445c9056d4f476047b8d180.tar.gz llvm-ef92cf50d6101ee56445c9056d4f476047b8d180.tar.bz2 llvm-ef92cf50d6101ee56445c9056d4f476047b8d180.tar.xz |
[NVPTX] Add isel patterns for bit-field extract (bfe)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/NVPTX/NVPTXInstrInfo.td')
-rw-r--r-- | lib/Target/NVPTX/NVPTXInstrInfo.td | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Target/NVPTX/NVPTXInstrInfo.td b/lib/Target/NVPTX/NVPTXInstrInfo.td index 14de4b76f0..e94250b38d 100644 --- a/lib/Target/NVPTX/NVPTXInstrInfo.td +++ b/lib/Target/NVPTX/NVPTXInstrInfo.td @@ -1179,6 +1179,29 @@ def ROTR64reg_sw : NVPTXInst<(outs Int64Regs:$dst), (ins Int64Regs:$src, !strconcat("}}", ""))))))))), [(set Int64Regs:$dst, (rotr Int64Regs:$src, Int32Regs:$amt))]>; +// BFE - bit-field extract + +multiclass BFE<string TyStr, RegisterClass RC> { + // BFE supports both 32-bit and 64-bit values, but the start and length + // operands are always 32-bit + def rrr + : NVPTXInst<(outs RC:$d), + (ins RC:$a, Int32Regs:$b, Int32Regs:$c), + !strconcat("bfe.", TyStr, " \t$d, $a, $b, $c;"), []>; + def rri + : NVPTXInst<(outs RC:$d), + (ins RC:$a, Int32Regs:$b, i32imm:$c), + !strconcat("bfe.", TyStr, " \t$d, $a, $b, $c;"), []>; + def rii + : NVPTXInst<(outs RC:$d), + (ins RC:$a, i32imm:$b, i32imm:$c), + !strconcat("bfe.", TyStr, " \t$d, $a, $b, $c;"), []>; +} + +defm BFE_S32 : BFE<"s32", Int32Regs>; +defm BFE_U32 : BFE<"u32", Int32Regs>; +defm BFE_S64 : BFE<"s64", Int64Regs>; +defm BFE_U64 : BFE<"u64", Int64Regs>; //----------------------------------- // General Comparison |