Add an IsEqual FieldPredicate.
Compare an immediate operand to a constant value.
This commit is contained in:
@@ -9,6 +9,12 @@
|
||||
//! Some of these predicates may be unused in certain ISA configurations, so we suppress the
|
||||
//! dead_code warning.
|
||||
|
||||
/// Check that `x` is the same as `y`.
|
||||
#[allow(dead_code)]
|
||||
pub fn is_equal<T: Eq + Copy>(x: T, y: T) -> bool {
|
||||
x == y
|
||||
}
|
||||
|
||||
/// Check that `x` can be represented as a `wd`-bit signed integer with `sc` low zero bits.
|
||||
#[allow(dead_code)]
|
||||
pub fn is_signed_int<T: Into<i64>>(x: T, wd: u8, sc: u8) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user