diff options
Diffstat (limited to 'yjit/src/asm/arm64/inst/data_reg.rs')
-rw-r--r-- | yjit/src/asm/arm64/inst/data_reg.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/yjit/src/asm/arm64/inst/data_reg.rs b/yjit/src/asm/arm64/inst/data_reg.rs index e2c2723fcf..a742121f1f 100644 --- a/yjit/src/asm/arm64/inst/data_reg.rs +++ b/yjit/src/asm/arm64/inst/data_reg.rs @@ -1,4 +1,4 @@ -use super::super::arg::Sf; +use super::super::arg::{Sf, truncate_uimm}; /// The operation being performed by this instruction. enum Op { @@ -129,8 +129,6 @@ const FAMILY: u32 = 0b0101; impl From<DataReg> for u32 { /// Convert an instruction into a 32-bit value. fn from(inst: DataReg) -> Self { - let imm6 = (inst.imm6 as u32) & ((1 << 6) - 1); - 0 | ((inst.sf as u32) << 31) | ((inst.op as u32) << 30) @@ -139,7 +137,7 @@ impl From<DataReg> for u32 { | (1 << 24) | ((inst.shift as u32) << 22) | ((inst.rm as u32) << 16) - | (imm6 << 10) + | (truncate_uimm::<_, 6>(inst.imm6) << 10) | ((inst.rn as u32) << 5) | inst.rd as u32 } |