From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH] target/arm: Fix SMLAD incorrect setting of Q bit
Date: Fri, 9 Oct 2020 17:34:02 -0500 [thread overview]
Message-ID: <5702c321-0d70-6e26-4aea-8ac9e6f90cbc@linaro.org> (raw)
In-Reply-To: <CAFEAcA_TZQOFtQn=MhvaF7wvXCgQLHfhpekHb29kb-p8VgWfYA@mail.gmail.com>
On 10/9/20 1:47 PM, Peter Maydell wrote:
> On Fri, 9 Oct 2020 at 18:57, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> On 10/9/20 9:47 AM, Peter Maydell wrote:
>>> + /*
>>> + * t1 is the low half of the result which goes into Rd.
>>> + * We have overflow and must set Q if the high half (t2)
>>> + * is different from the sign-extension of t1.
>>> + */
>>> + t3 = tcg_temp_new_i32();
>>> + tcg_gen_sari_i32(t3, t1, 31);
>>> + qf = load_cpu_field(QF);
>>> + one = tcg_const_i32(1);
>>> + tcg_gen_movcond_i32(TCG_COND_NE, qf, t2, t3, one, qf);
>>> + store_cpu_field(qf, QF);
>>
>> This works, however, QF is not restricted to {0,1}.
>
> I'm not sure if you mean "this code doesn't maintain that
> invariant" or "there is no such invariant". If the former,
> the declaration of the field in cpu.h disagrees:
> uint32_t QF; /* 0 or 1 */
Oops, I confused QF with QC, the neon saturation bit.
r~
next prev parent reply other threads:[~2020-10-09 22:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 14:47 [PATCH] target/arm: Fix SMLAD incorrect setting of Q bit Peter Maydell
2020-10-09 17:57 ` Richard Henderson
2020-10-09 18:47 ` Peter Maydell
2020-10-09 22:34 ` Richard Henderson [this message]
2020-10-09 18:48 ` Peter Maydell
2020-10-09 22:36 ` Richard Henderson
2020-10-10 12:48 ` 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=5702c321-0d70-6e26-4aea-8ac9e6f90cbc@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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).