36 match_t() : word0(0), word1(0) {}
37 match_t(big_int w0, big_int w1) : word0(w0), word1(w1) {}
38 explicit operator bool()
const {
return (word0 | word1) != 0; }
39 bool operator==(
const match_t &a)
const {
return word0 == a.word0 && word1 == a.word1; }
40 bool operator!=(
const match_t &a)
const {
return word0 != a.word0 || word1 != a.word1; }
41 bool matches(big_int v)
const {
42 return (v | word1) == word1 && ((~v & word1) | word0) == word0;
44 void setwidth(
int bits) {
45 big_int mask = (big_int(1) << bits) - 1;
48 mask &= ~(word0 | word1);
52 match_t(
int size, big_int val, big_int mask) : word0(~val & mask), word1(val & mask) {