]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/sh4: Fix mac.l with saturation enabled
authorZack Buhman <zack@buhman.org>
Sat, 6 Apr 2024 01:17:39 +0000 (15:17 -1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 10 Apr 2024 17:32:12 +0000 (20:32 +0300)
commit77e03229ca4eaa3d9cf44ec34ebf887213d11dc7
treecf0107b7cb304358a0adb05536aea573895120d3
parent7fc1bcb65fb66b59b9cf8c2b1584713ef2db8741
target/sh4: Fix mac.l with saturation enabled

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

Signed-off-by: Zack Buhman <zack@buhman.org>
Message-Id: <20240404162641.27528-2-zack@buhman.org>
[rth: Reformat helper_macl, 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 c97e8977dcacb3fa8362ee28bcee75ceb01fceaa)
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-macl.c [new file with mode: 0644]