Use 'xor r, r' to set registers to 0 instead of mov (#766)
This commit is contained in:
committed by
Benjamin Bouvier
parent
b95508c51a
commit
99380fad1a
@@ -11,6 +11,12 @@
|
||||
|
||||
use crate::ir;
|
||||
|
||||
/// Check that an integer value is zero.
|
||||
#[allow(dead_code)]
|
||||
pub fn is_zero_int<T: Into<i64>>(x: T) -> bool {
|
||||
x.into() == 0
|
||||
}
|
||||
|
||||
/// Check that a 64-bit floating point value is zero.
|
||||
#[allow(dead_code)]
|
||||
pub fn is_zero_64_bit_float<T: Into<ir::immediates::Ieee64>>(x: T) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user