From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL 01/11] tcg-s390: Fix off-by-one in wraparound andi
Date: Thu, 15 May 2014 09:39:33 -0700 [thread overview]
Message-ID: <1400171983-6015-2-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1400171983-6015-1-git-send-email-rth@twiddle.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
tcg/s390/tcg-target.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index ebdd074..0f972ae 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -983,8 +983,8 @@ static void tgen_andi(TCGContext *s, TCGType type, TCGReg dest, uint64_t val)
int msb, lsb;
if ((val & 0x8000000000000001ull) == 0x8000000000000001ull) {
/* Achieve wraparound by swapping msb and lsb. */
- msb = 63 - ctz64(~val);
- lsb = clz64(~val) + 1;
+ msb = 64 - ctz64(~val);
+ lsb = clz64(~val) - 1;
} else {
msb = clz64(val);
lsb = 63 - ctz64(val);
--
1.9.0
next prev parent reply other threads:[~2014-05-15 16:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 16:39 [Qemu-devel] [PULL 00/12] tcg s390 updates Richard Henderson
2014-05-15 16:39 ` Richard Henderson [this message]
2014-05-15 16:39 ` [Qemu-devel] [PULL 02/11] tcg-s390: Convert to TCGMemOp Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 03/11] tcg-s390: Integrate endianness into TCGMemOp Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 04/11] tcg-s390: Convert to new ldst opcodes Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 05/11] tcg-s390: Move ldst helpers out of line Richard Henderson
2015-01-29 16:01 ` Alexander Graf
2015-01-29 17:12 ` Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 06/11] tcg-s390: Use more risbg in the tlb sequence Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 07/11] tcg-s390: Implement tcg_register_jit Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 08/11] tcg-s390: Allow immediate operands to add2 and sub2 Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 09/11] tcg-s390: Improve setcond Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 10/11] tcg-s390: Don't force -march=z990 Richard Henderson
2014-05-15 16:39 ` [Qemu-devel] [PULL 11/11] tcg-s390: Implement direct chaining of TBs Richard Henderson
2014-05-15 18:45 ` [Qemu-devel] [PULL 00/12] tcg s390 updates 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=1400171983-6015-2-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--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).