From f760ead789b8197aa96a72bff4f020ee48d51429 Mon Sep 17 00:00:00 2001 From: Elms Date: Thu, 18 Oct 2018 08:23:07 -0700 Subject: [PATCH] sim: Fix MAX ops on accumulator1 --- sim/mlsim.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sim/mlsim.cc b/sim/mlsim.cc index a84effd..2bfb206 100644 --- a/sim/mlsim.cc +++ b/sim/mlsim.cc @@ -272,7 +272,8 @@ void MlSim::exec(insn_t insn) if ((insn.op() & 1) != 0) { if (uint8_t(c0) != 0x00) acc0 = std::max(acc0, p0); - acc1 += p1; + if (uint8_t(c1) != 0x00) + acc1 = std::max(acc1, p1); } else { acc0 += p0; acc1 += p1;