aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-05-09 16:32:11 +0000
committerCraig Topper <craig.topper@gmail.com>2017-05-09 16:32:11 +0000
commitf893d49f0ceddb804af589de33f20e010402ffbd (patch)
treebe587d6efe1a4470ff576a8659a46cbdfe2b396f /llvm/lib/IR/Module.cpp
parent6844e21f593467c640f0e14e2113bf0dfb32b1a8 (diff)
downloadllvm-f893d49f0ceddb804af589de33f20e010402ffbd.zip
llvm-f893d49f0ceddb804af589de33f20e010402ffbd.tar.gz
llvm-f893d49f0ceddb804af589de33f20e010402ffbd.tar.bz2
[X86] Add more patterns for BZHI isel
This patch adds more patterns that a reasonable person might write that can be compiled to BZHI. This adds support for (~0U >> (32 - b)) & a; and a << (32 - b) >> (32 - b); This was inspired by the code in APInt::clearUnusedBits. This can pass an index of 32 to the bzhi instruction which a quick test of Haswell hardware shows will not mask any bits. Though the description text in the Intel manual says the "index is saturated to OperandSize-1". The pseudocode in the same manual indicates no bits will be zeroed for this case. I think this is still missing cases where the subtract portion is an 8-bit operation. Differential Revision: https://reviews.llvm.org/D32616 llvm-svn: 302549
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions