summaryrefslogtreecommitdiff
path: root/yjit/src/asm/arm64/inst/test_bit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'yjit/src/asm/arm64/inst/test_bit.rs')
-rw-r--r--yjit/src/asm/arm64/inst/test_bit.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/yjit/src/asm/arm64/inst/test_bit.rs b/yjit/src/asm/arm64/inst/test_bit.rs
index 1961e65949..c57a05ad2b 100644
--- a/yjit/src/asm/arm64/inst/test_bit.rs
+++ b/yjit/src/asm/arm64/inst/test_bit.rs
@@ -1,3 +1,5 @@
+use super::super::arg::truncate_imm;
+
/// The upper bit of the bit number to test.
#[derive(Debug)]
enum B5 {
@@ -77,11 +79,7 @@ impl From<TestBit> for u32 {
/// Convert an instruction into a 32-bit value.
fn from(inst: TestBit) -> Self {
let b40 = (inst.b40 & 0b11111) as u32;
- let mut imm14 = (inst.imm14 & ((1 << 13) - 1)) as u32;
-
- if inst.imm14 < 0 {
- imm14 |= (1 << 13);
- }
+ let imm14 = truncate_imm::<_, 14>(inst.imm14);
0
| ((inst.b5 as u32) << 31)