]> git.ipfire.org Git - thirdparty/qemu.git/commit
tcg/loongarch64: Fix tcg_out_movi vs some pcrel pointers
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 19 Jun 2024 05:41:13 +0000 (05:41 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 20 Jun 2024 12:25:32 +0000 (15:25 +0300)
commitca5d7bb9529aa86ac852421867945f1842576966
treefeaaf0eaea689476212e7b5b0d797cb906f99f25
parentb07ff6d447385b0e5339cc19ce7724b9e39cf08a
tcg/loongarch64: Fix tcg_out_movi vs some pcrel pointers

Simplify the logic for two-part, 32-bit pc-relative addresses.
Rather than assume all such fit in int32_t, do some arithmetic
and assert a result, do some arithmetic first and then check
to see if the pieces are in range.

Cc: qemu-stable@nongnu.org
Fixes: dacc51720db ("tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi")
Reviewed-by: Song Gao <gaosong@loongson.cn>
Reported-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit 521d7fb3ebdf88112ed13556a93e3037742b9eb8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: context fixup in tcg/loongarch64/tcg-target.c.inc)
tcg/loongarch64/tcg-target.c.inc