]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/sh4: Fix mac.w with saturation enabled
authorZack Buhman <zack@buhman.org>
Sat, 6 Apr 2024 03:11:47 +0000 (17:11 -1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 10 Apr 2024 17:32:12 +0000 (20:32 +0300)
commit733511728ac782d117f071801d3a7fc9b4df99b9
treeedbb6d913c9b3e8586553b326645067b33f0aa13
parent77e03229ca4eaa3d9cf44ec34ebf887213d11dc7
target/sh4: Fix mac.w with saturation enabled

The saturation arithmetic logic in helper_macw is not correct.
I tested and verified this behavior on a SH7091.

Reviewd-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Zack Buhman <zack@buhman.org>
Message-Id: <20240405233802.29128-3-zack@buhman.org>
[rth: Reformat helper_macw, add a test case.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit 7227c0cd506eaab5b1d89d15832cac7e05ecb412)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/sh4/helper.h
target/sh4/op_helper.c
tests/tcg/sh4/Makefile.target
tests/tcg/sh4/test-macw.c [new file with mode: 0644]