cranelift x64: use the LZCNT instruction for Clz when it's available;

This commit is contained in:
Benjamin Bouvier
2021-01-27 18:44:14 +01:00
parent b1b078e2bc
commit d3acd9a283
4 changed files with 79 additions and 12 deletions

View File

@@ -402,6 +402,8 @@ pub enum UnaryRmROpcode {
Bsr,
/// Bit-scan forward.
Bsf,
/// Counts leading zeroes (Leading Zero CouNT).
Lzcnt,
}
impl fmt::Debug for UnaryRmROpcode {
@@ -409,6 +411,7 @@ impl fmt::Debug for UnaryRmROpcode {
match self {
UnaryRmROpcode::Bsr => write!(fmt, "bsr"),
UnaryRmROpcode::Bsf => write!(fmt, "bsf"),
UnaryRmROpcode::Lzcnt => write!(fmt, "lzcnt"),
}
}
}