29 match_t() : word0(0), word1(0) {}
30 match_t(big_int w0, big_int w1) : word0(w0), word1(w1) {}
31 explicit operator bool()
const {
return (word0 | word1) != 0; }
32 bool operator==(
const match_t &a)
const {
return word0 == a.word0 && word1 == a.word1; }
33 bool operator!=(
const match_t &a)
const {
return word0 != a.word0 || word1 != a.word1; }
34 bool matches(big_int v)
const {
35 return (v | word1) == word1 && ((~v & word1) | word0) == word0;
37 void setwidth(
int bits) {
38 big_int mask = (big_int(1) << bits) - 1;
41 mask &= ~(word0 | word1);
45 match_t(
int size, big_int val, big_int mask) : word0(~val & mask), word1(val & mask) {
48 static match_t dont_care(
int size) {
return match_t(size, 0, 0); }
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13