From d486204ae806c28a539eb3f3be8e7d8764d9dde0 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 27 May 2020 23:29:54 -0700 Subject: [PATCH] working on instruction models --- src/instr_models.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/instr_models.rs b/src/instr_models.rs index 092f359..0890f45 100644 --- a/src/instr_models.rs +++ b/src/instr_models.rs @@ -124,8 +124,8 @@ pub fn divweo(inputs: TestDivInput) -> TestDivResult { } pub fn divweuo(inputs: TestDivInput) -> TestDivResult { - let dividend = u64::from(inputs.dividend) << 32; - let divisor = u64::from(inputs.divisor); + let dividend = u64::from(inputs.dividend as u32) << 32; + let divisor = u64::from(inputs.divisor as u32); let overflow; let result; if divisor == 0 { @@ -228,7 +228,7 @@ pub fn modsw(inputs: TestDivInput) -> TestDivResult { if divisor == 0 || (divisor == -1 && dividend == i32::min_value()) { result = 0; } else { - result = (dividend % divisor) as u32 as u64; + result = (dividend % divisor) as u64; } TestDivResult { result, -- 2.30.2