cranelift x64: use the TZCNT instruction for Ctz when it's available;

This commit is contained in:
Benjamin Bouvier
2021-01-28 12:02:47 +01:00
parent d3acd9a283
commit 6bf6612d96
4 changed files with 53 additions and 4 deletions

View File

@@ -404,6 +404,8 @@ pub enum UnaryRmROpcode {
Bsf,
/// Counts leading zeroes (Leading Zero CouNT).
Lzcnt,
/// Counts trailing zeroes (Trailing Zero CouNT).
Tzcnt,
}
impl fmt::Debug for UnaryRmROpcode {
@@ -412,6 +414,7 @@ impl fmt::Debug for UnaryRmROpcode {
UnaryRmROpcode::Bsr => write!(fmt, "bsr"),
UnaryRmROpcode::Bsf => write!(fmt, "bsf"),
UnaryRmROpcode::Lzcnt => write!(fmt, "lzcnt"),
UnaryRmROpcode::Tzcnt => write!(fmt, "tzcnt"),
}
}
}