machinst x64: implement support for dynamic heaps and explicit bound checks;

This commit is contained in:
Benjamin Bouvier
2020-07-23 14:57:23 +02:00
parent 2e3ad3227d
commit 987c616bf5
5 changed files with 109 additions and 35 deletions

View File

@@ -122,6 +122,27 @@ impl IntCC {
}
}
/// Determines whether this condcode interprets inputs as signed or
/// unsigned. See the documentation for the `icmp` instruction in
/// cranelift-codegen/meta/src/shared/instructions.rs for further insights
/// into this.
pub fn is_signed(&self) -> bool {
match self {
IntCC::Equal
| IntCC::UnsignedGreaterThanOrEqual
| IntCC::UnsignedGreaterThan
| IntCC::UnsignedLessThanOrEqual
| IntCC::UnsignedLessThan
| IntCC::NotEqual => false,
IntCC::SignedGreaterThanOrEqual
| IntCC::SignedGreaterThan
| IntCC::SignedLessThanOrEqual
| IntCC::SignedLessThan
| IntCC::Overflow
| IntCC::NotOverflow => true,
}
}
/// Get the corresponding string condition code for the IntCC object.
pub fn to_static_str(self) -> &'static str {
use self::IntCC::*;