Add simple Uimm8 and ImmVector immediate types.

Implement the boxed storage of the UnaryImmVector instruction format.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-12 15:24:59 -07:00
parent e35811e120
commit cf8d628254
4 changed files with 34 additions and 6 deletions

View File

@@ -123,6 +123,11 @@ impl FromStr for Imm64 {
}
}
/// 8-bit unsigned integer immediate operand.
///
/// This is used to indicate lane indexes typically.
pub type Uimm8 = u8;
/// An IEEE binary32 immediate floating point value.
///
/// All bit patterns are allowed.
@@ -420,6 +425,12 @@ impl FromStr for Ieee64 {
}
}
/// Arbitrary vector immediate.
///
/// This kind of immediate can represent any kind of SIMD vector constant.
/// The representation is simply the sequence of bytes that would be used to store the vector.
pub type ImmVector = Vec<u8>;
#[cfg(test)]
mod tests {
use super::*;