From: Jacob Lifshay Date: Fri, 16 Oct 2020 23:50:49 +0000 (-0700) Subject: fix cmprb_0 X-Git-Tag: v0.2.0~3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1482c77ea447ca9a5ce450918583430c51a59794;p=power-instruction-analyzer.git fix cmprb_0 --- diff --git a/src/instr_models.rs b/src/instr_models.rs index 069e58e..89e4bdf 100644 --- a/src/instr_models.rs +++ b/src/instr_models.rs @@ -854,11 +854,11 @@ pub fn cmplw(inputs: InstructionInput) -> InstructionResult { pub fn cmprb_0(inputs: InstructionInput) -> InstructionResult { let ra = inputs.try_get_ra()? as u8; let rb: u64 = inputs.try_get_rb()?; - let eq = ra >= rb as u8 && ra <= (rb >> 8) as u8; + let in_range = ra >= rb as u8 && ra <= (rb >> 8) as u8; let cr0 = ConditionRegister { lt: false, - gt: false, - eq, + gt: in_range, + eq: false, so: false, }; Ok(InstructionOutput { diff --git a/src/lib.rs b/src/lib.rs index d544724..31d48a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -840,8 +840,8 @@ instructions! { // cmprb 0, 0, ..., ... #[enumerant = CmpRB0] - fn cmprb_0(Ra, Rb) -> (CR0) { - "cmprb 0, 0," + fn cmprb_0(Ra("r3"), Rb("r4")) -> (CR0) { + "cmprb_0" : "cmprb 0, 0, 3, 4" } }