Add fix for #114 (#115)

* Reduce code duplication in TypeConstraint subclasses; Add ConstrainWiderOrEqual to ti and to ireduce,{s,u}extend and f{promote,demote}; Fix bug in emitting constraint edges in TypeEnv.dot(); Modify runtime constraint checks to reject match when they encounter overflow

* Rename Constrain types to something shorter; Move lane_bits/lane_counts in subclasses of ValueType; Add wider_or_eq function in rust and python;
This commit is contained in:
d1m0
2017-07-12 08:51:55 -07:00
committed by Jakob Stoklund Olesen
parent 962c945a3c
commit 7c438f866c
8 changed files with 471 additions and 132 deletions

View File

@@ -236,6 +236,13 @@ impl Type {
pub fn index(self) -> usize {
self.0 as usize
}
/// True iff:
/// 1) self.lane_count() == other.lane_count() and
/// 2) self.lane_bits() >= other.lane_bits()
pub fn wider_or_equal(self, other: Type) -> bool {
self.lane_count() == other.lane_count() && self.lane_bits() >= other.lane_bits()
}
}
impl Display for Type {