summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-07-14 18:30:09 +0000
committerCraig Topper <craig.topper@intel.com>2017-07-14 18:30:09 +0000
commitc68f8f2fd3c004e60e958761b00a9ae4bce97e2d (patch)
tree5910e9fe30f3c17adbdff2538227a58e4dc7df78 /include
parentcb105529db3efec7d2de569f14fb12987f035405 (diff)
[TableGen][MC] Fix a few places where we didn't hide the underlying type of LaneBitmask very well.
One place compared with 32, which I've replaced with LaneBitmask::BitWidth. The other places are shifts of a constant 1 by a lane number. But if LaneBitmask were to be a larger type than 32-bits like 64-bits, the 1 would need to be 1ULL to do a 64-bit shift. To hide this I've added a LanebitMask::getLane that hides the shift and make sures the 1 is casted to correct type first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/LaneBitmask.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/MC/LaneBitmask.h b/include/llvm/MC/LaneBitmask.h
index 5ca06d1148e2..73b987b074db 100644
--- a/include/llvm/MC/LaneBitmask.h
+++ b/include/llvm/MC/LaneBitmask.h
@@ -75,6 +75,9 @@ namespace llvm {
static LaneBitmask getNone() { return LaneBitmask(0); }
static LaneBitmask getAll() { return ~LaneBitmask(0); }
+ static LaneBitmask getLane(unsigned Lane) {
+ return LaneBitmask(Type(1) << Lane);
+ }
private:
Type Mask = 0;