machinst x64: implement bsr and lower Clz;

This commit is contained in:
Benjamin Bouvier
2020-07-03 17:11:03 +02:00
parent eda2d143ed
commit ec2209665a
5 changed files with 210 additions and 39 deletions

View File

@@ -289,6 +289,26 @@ impl ToString for AluRmiROpcode {
}
}
#[derive(Clone, PartialEq)]
pub enum ReadOnlyGprRmROpcode {
/// Bit-scan reverse.
Bsr,
}
impl fmt::Debug for ReadOnlyGprRmROpcode {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match self {
ReadOnlyGprRmROpcode::Bsr => write!(fmt, "bsr"),
}
}
}
impl ToString for ReadOnlyGprRmROpcode {
fn to_string(&self) -> String {
format!("{:?}", self)
}
}
pub(crate) enum InstructionSet {
SSE,
SSE2,