summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/resource_mask.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/dex/quick/resource_mask.h')
-rw-r--r--compiler/dex/quick/resource_mask.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/dex/quick/resource_mask.h b/compiler/dex/quick/resource_mask.h
index 78e81b2..72db75c 100644
--- a/compiler/dex/quick/resource_mask.h
+++ b/compiler/dex/quick/resource_mask.h
@@ -86,6 +86,14 @@ class ResourceMask {
start_bit >= 64u ? UINT64_C(3) << (start_bit - 64u) : 0u);
}
+ // Four consecutive bits. The start_bit must be even.
+ static constexpr ResourceMask FourBits(size_t start_bit) {
+ return
+ DCHECK_CONSTEXPR((start_bit & 1u) == 0u, << start_bit << " isn't even", Bit(0))
+ ResourceMask(start_bit >= 64u ? 0u : UINT64_C(0xf) << start_bit,
+ start_bit >= 64u ? UINT64_C(0xf) << (start_bit - 64u) : 0u);
+ }
+
static constexpr ResourceMask NoBits() {
return ResourceMask(UINT64_C(0), UINT64_C(0));
}