machinst x64: lower Ctz using the Bsf x86 instruction
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,6 +566,7 @@ pub(crate) fn emit(
|
||||
|
||||
let (opcode, num_opcodes) = match op {
|
||||
ReadOnlyGprRmROpcode::Bsr => (0x0fbd, 2),
|
||||
ReadOnlyGprRmROpcode::Bsf => (0x0fbc, 2),
|
||||
};
|
||||
|
||||
match src {
|
||||
|
||||
Reference in New Issue
Block a user