summaryrefslogtreecommitdiff
path: root/yjit/src/asm/arm64/arg
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2022-09-30 10:14:55 -0500
committerGitHub <noreply@github.com>2022-09-30 11:14:55 -0400
commit31461c7e0eab4963ccc8649ea8ebf27979132c0c (patch)
tree69a0378ba20e47c085928ede356431a65d8e60c3 /yjit/src/asm/arm64/arg
parentad651925e365ca18645f05b5e9b2eca9cd5721bc (diff)
A bunch of clippy auto fixes for yjit (#6476)
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit/src/asm/arm64/arg')
-rw-r--r--yjit/src/asm/arm64/arg/shifted_imm.rs2
-rw-r--r--yjit/src/asm/arm64/arg/truncate.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/yjit/src/asm/arm64/arg/shifted_imm.rs b/yjit/src/asm/arm64/arg/shifted_imm.rs
index 5d1eeaf26d..0dd7af25b5 100644
--- a/yjit/src/asm/arm64/arg/shifted_imm.rs
+++ b/yjit/src/asm/arm64/arg/shifted_imm.rs
@@ -18,7 +18,7 @@ impl TryFrom<u64> for ShiftedImmediate {
/// Attempt to convert a u64 into a BitmaskImm.
fn try_from(value: u64) -> Result<Self, Self::Error> {
- let mut current = value;
+ let current = value;
if current < 2_u64.pow(12) {
return Ok(ShiftedImmediate { shift: Shift::LSL0, value: current as u16 });
}
diff --git a/yjit/src/asm/arm64/arg/truncate.rs b/yjit/src/asm/arm64/arg/truncate.rs
index 52f2c012cb..0de562f808 100644
--- a/yjit/src/asm/arm64/arg/truncate.rs
+++ b/yjit/src/asm/arm64/arg/truncate.rs
@@ -31,7 +31,7 @@ pub fn truncate_imm<T: Into<i32>, const WIDTH: usize>(imm: T) -> u32 {
/// This should effectively be a no-op since we're just dropping leading zeroes.
pub fn truncate_uimm<T: Into<u32>, const WIDTH: usize>(uimm: T) -> u32 {
let value: u32 = uimm.into();
- let masked = (value & ((1 << WIDTH) - 1));
+ let masked = value & ((1 << WIDTH) - 1);
// Assert that we didn't drop any bits by truncating.
assert_eq!(value, masked);
@@ -46,21 +46,21 @@ mod tests {
#[test]
fn test_truncate_imm_positive() {
let inst = truncate_imm::<i32, 4>(5);
- let result: u32 = inst.into();
+ let result: u32 = inst;
assert_eq!(0b0101, result);
}
#[test]
fn test_truncate_imm_negative() {
let inst = truncate_imm::<i32, 4>(-5);
- let result: u32 = inst.into();
+ let result: u32 = inst;
assert_eq!(0b1011, result);
}
#[test]
fn test_truncate_uimm() {
let inst = truncate_uimm::<u32, 4>(5);
- let result: u32 = inst.into();
+ let result: u32 = inst;
assert_eq!(0b0101, result);
}
}