sim: sh: fix uninitialized variable usage with pdmsb
authorMike Frysinger <vapier@gentoo.org>
Sat, 6 Nov 2021 17:19:35 +0000 (13:19 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 7 Nov 2021 00:32:31 +0000 (20:32 -0400)
commit524d770c9c127e077f59f0b2adadc9c14d003e0a
treec1d927fa9af90248d73ff3bcd96be027311870b2
parentee7af46230f0382eb5091592ce0d5e45ee2fa142
sim: sh: fix uninitialized variable usage with pdmsb

This block of code relies on i to control which bits to test and how
many times to run through the loop, but it never actually initialized
it.  There is another chunk of code that handles the pdmsb instruction
that sets i to 16, so use that here too assuming it's correct.  The
programming manual suggests this is the right value too, but I am by
no means a SuperH DSP expert.  The tests are still passing though ...
sim/sh/gencode.c