Add a DynRex recipe type for x86, decreasing the number of recipes (#1298)
This patch adds a third mode for templates: REX inference is requestable at template instantiation time. This reduces the number of recipes by removing rex()/nonrex() redundancy for many instructions.
This commit is contained in:
@@ -57,6 +57,24 @@ impl EncodingBits {
|
||||
new
|
||||
}
|
||||
|
||||
/// Returns a copy of the EncodingBits with the RRR bits set.
|
||||
#[inline]
|
||||
pub fn with_rrr(self, rrr: u8) -> Self {
|
||||
debug_assert_eq!(u8::from(self.rrr()), 0);
|
||||
let mut enc = self.clone();
|
||||
enc.write(RRR, rrr.into());
|
||||
enc
|
||||
}
|
||||
|
||||
/// Returns a copy of the EncodingBits with the REX.W bit set.
|
||||
#[inline]
|
||||
pub fn with_rex_w(self) -> Self {
|
||||
debug_assert_eq!(self.rex_w(), 0);
|
||||
let mut enc = self.clone();
|
||||
enc.write(REX_W, 1);
|
||||
enc
|
||||
}
|
||||
|
||||
/// Returns the raw bits.
|
||||
#[inline]
|
||||
pub fn bits(self) -> u16 {
|
||||
|
||||
Reference in New Issue
Block a user