machinst x64: lower Ctz using the Bsf x86 instruction

This commit is contained in:
Benjamin Bouvier
2020-07-06 15:44:12 +02:00
parent 33e0d05645
commit 6f5403a94b
3 changed files with 36 additions and 0 deletions

View File

@@ -293,12 +293,15 @@ impl ToString for AluRmiROpcode {
pub enum ReadOnlyGprRmROpcode {
/// Bit-scan reverse.
Bsr,
/// Bit-scan forward.
Bsf,
}
impl fmt::Debug for ReadOnlyGprRmROpcode {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match self {
ReadOnlyGprRmROpcode::Bsr => write!(fmt, "bsr"),
ReadOnlyGprRmROpcode::Bsf => write!(fmt, "bsf"),
}
}
}