38 match_t() : word0(0), word1(0) {}
39 match_t(big_int w0, big_int w1) : word0(w0), word1(w1) {}
40 explicit operator bool()
const {
return (word0 | word1) != 0; }
41 bool operator==(
const match_t &a)
const {
return word0 == a.word0 && word1 == a.word1; }
42 bool operator!=(
const match_t &a)
const {
return word0 != a.word0 || word1 != a.word1; }
43 bool matches(big_int v)
const {
44 return (v | word1) == word1 && ((~v & word1) | word0) == word0;
46 void setwidth(
int bits) {
47 big_int mask = (big_int(1) << bits) - 1;
50 mask &= ~(word0 | word1);
54 match_t(
int size, big_int val, big_int mask) : word0(~val & mask), word1(val & mask) {
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24