Convert to dense 16 bit encoding.
(self)
| 191 | impl<D: Reg, S1: Reg, S2: Reg> BinaryOperands<D, S1, S2> { |
| 192 | /// Convert to dense 16 bit encoding. |
| 193 | pub fn to_bits(self) -> u16 { |
| 194 | let dst = self.dst.to_u8(); |
| 195 | let src1 = self.src1.to_u8(); |
| 196 | let src2 = self.src2.to_u8(); |
| 197 | (dst as u16) | ((src1 as u16) << 5) | ((src2 as u16) << 10) |
| 198 | } |
| 199 | |
| 200 | /// Convert from dense 16 bit encoding. The topmost bit is ignored. |
| 201 | pub fn from_bits(bits: u16) -> Self { |