From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Joseph Myers <joseph@codesourcery.com>
Subject: [Qemu-devel] [PULL for-2.8 9/9] tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension
Date: Mon, 31 Oct 2016 08:47:33 -0600 [thread overview]
Message-ID: <1477925253-17772-10-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1477925253-17772-1-git-send-email-rth@twiddle.net>
From: Joseph Myers <joseph@codesourcery.com>
The version of tcg_gen_ld8s_i64 for 32-bit systems does a load into
the low part of the return value - then attempts a sign extension into
the high part, but wrongly sets the high part to a sign extension of
itself rather than of the low part. This results in TCG internal
errors from the use of the uninitialized high part (in some GCC tests
of AArch64 NEON shift intrinsics, in particular). This patch corrects
the sign-extension logic, making it match other functions such as
tcg_gen_ld16s_i64.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Message-Id: <alpine.DEB.2.20.1610272333560.22353@digraph.polyomino.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
tcg/tcg-op.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 4d125df..6e2fb35 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -817,7 +817,7 @@ void tcg_gen_ld8u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
void tcg_gen_ld8s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
{
tcg_gen_ld8s_i32(TCGV_LOW(ret), arg2, offset);
- tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_HIGH(ret), 31);
+ tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_LOW(ret), 31);
}
void tcg_gen_ld16u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
--
2.7.4
next prev parent reply other threads:[~2016-10-31 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-31 14:47 [Qemu-devel] [PULL for-2.8 0/9] tcg updates Richard Henderson
2016-10-31 14:47 ` [Qemu-devel] [PULL for-2.8 1/9] target-cris: Do not dump cpu state with -d in_asm Richard Henderson
2016-10-31 14:47 ` [Qemu-devel] [PULL for-2.8 2/9] target-microblaze: " Richard Henderson
2016-10-31 14:47 ` [Qemu-devel] [PULL for-2.8 4/9] log: Add locking to large logging blocks Richard Henderson
2016-10-31 14:47 ` [Qemu-devel] [PULL for-2.8 5/9] tcg: Add tcg_gen_mulsu2_{i32, i64, tl} Richard Henderson
2016-10-31 14:47 ` [Qemu-devel] [PULL for-2.8 6/9] target-microblaze: Cleanup dec_mul Richard Henderson
2016-10-31 14:47 ` [Qemu-devel] [PULL for-2.8 7/9] MAINTAINERS: Update PPC status and maintainer Richard Henderson
2016-10-31 14:47 ` [Qemu-devel] [PULL for-2.8 8/9] tcg/tcg.h: Improve documentation of TCGv_i32 etc types Richard Henderson
2016-10-31 14:47 ` Richard Henderson [this message]
2016-10-31 16:40 ` [Qemu-devel] [PULL for-2.8 0/9] tcg updates Peter Maydell
2016-10-31 16:57 ` Richard Henderson
2016-10-31 17:25 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1477925253-17772-10-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=joseph@codesourcery.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).