From c4aede53719864f73b59abdd769e1fd78bfcd0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Wed, 11 Jan 2023 15:39:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Removed=20more=20clippy=20warnin?= =?UTF-8?q?gs=20from=20decode.rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/simulator/decode.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulator/decode.rs b/src/simulator/decode.rs index dea62b6..91c8651 100644 --- a/src/simulator/decode.rs +++ b/src/simulator/decode.rs @@ -41,7 +41,7 @@ pub fn decode(val : u64) -> Instruction { let rs3 = ((val >> 27) & 0x1f) as u8; let rd = ((val >> 7) & 0x1f) as u8; let funct7 = ((val >> 25) & 0x7f) as u8; - let funct7_smaller = (funct7 & 0x3e) as u8; + let funct7_smaller = funct7 & 0x3e; let funct3 = ((val >> 12) & 0x7) as u8; let imm12_I = ((val >> 20) & 0xfff) as u16; @@ -52,7 +52,7 @@ pub fn decode(val : u64) -> Instruction { let imm13 = (((val >> 19) & 0x1000) + ((val >> 20) & 0x7e0) + ((val >> 7) & 0x1e) + ((val << 4) & 0x800)) as i16; - let imm13_signed = if imm13 >= 4096 { imm13 - 8192 } else { imm13 } as i16; + let imm13_signed = if imm13 >= 4096 { imm13 - 8192 } else { imm13 }; let imm31_12 = (val & 0xfffff000) as u32; let imm31_12_signed = imm31_12 as i32;