cranelift: Rename Interpreter overflow method
This commit is contained in:
committed by
Andrew Brown
parent
e628fb376f
commit
037bd41c67
@@ -720,8 +720,8 @@ where
|
|||||||
&left.clone().convert(ValueConversionKind::ToUnsigned)?,
|
&left.clone().convert(ValueConversionKind::ToUnsigned)?,
|
||||||
&right.clone().convert(ValueConversionKind::ToUnsigned)?,
|
&right.clone().convert(ValueConversionKind::ToUnsigned)?,
|
||||||
)?,
|
)?,
|
||||||
IntCC::Overflow => Value::of(left, right)?,
|
IntCC::Overflow => Value::overflow(left, right)?,
|
||||||
IntCC::NotOverflow => !Value::of(left, right)?,
|
IntCC::NotOverflow => !Value::overflow(left, right)?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ pub trait Value: Clone + From<DataValue> {
|
|||||||
Ok(other.eq(self)? || other.gt(self)?)
|
Ok(other.eq(self)? || other.gt(self)?)
|
||||||
}
|
}
|
||||||
fn uno(&self, other: &Self) -> ValueResult<bool>;
|
fn uno(&self, other: &Self) -> ValueResult<bool>;
|
||||||
fn of(&self, other: &Self) -> ValueResult<bool>;
|
fn overflow(&self, other: &Self) -> ValueResult<bool>;
|
||||||
|
|
||||||
// Arithmetic.
|
// Arithmetic.
|
||||||
fn add(self, other: Self) -> ValueResult<Self>;
|
fn add(self, other: Self) -> ValueResult<Self>;
|
||||||
@@ -278,7 +278,7 @@ impl Value for DataValue {
|
|||||||
Ok(self.is_nan()? || other.is_nan()?)
|
Ok(self.is_nan()? || other.is_nan()?)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn of(&self, other: &Self) -> ValueResult<bool> {
|
fn overflow(&self, other: &Self) -> ValueResult<bool> {
|
||||||
Ok(match (self, other) {
|
Ok(match (self, other) {
|
||||||
(DataValue::I8(a), DataValue::I8(b)) => a.checked_sub(*b).is_none(),
|
(DataValue::I8(a), DataValue::I8(b)) => a.checked_sub(*b).is_none(),
|
||||||
(DataValue::I16(a), DataValue::I16(b)) => a.checked_sub(*b).is_none(),
|
(DataValue::I16(a), DataValue::I16(b)) => a.checked_sub(*b).is_none(),
|
||||||
|
|||||||
Reference in New Issue
Block a user