From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com
Subject: Re: [PATCH 2/2] target/i386: Fix carry flag for BLSI
Date: Fri, 16 Aug 2024 11:30:02 +0200 [thread overview]
Message-ID: <f6091ce8-0107-49cd-bf0f-05377711e493@linaro.org> (raw)
In-Reply-To: <20240801075845.573075-3-richard.henderson@linaro.org>
On 1/8/24 09:58, Richard Henderson wrote:
> BLSI has inverted semantics for C as compared to the other two
> BMI1 instructions, BLSMSK and BLSR. Introduce CC_OP_BLSI* for
> this purpose.
Fixes: 1d0b926150 ("target/i386: move scalar 0F 38 and 0F 3A instruction
to new decoder")
or even older?
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2175
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/i386/cpu.h | 5 +++++
> target/i386/tcg/cc_helper.c | 18 ++++++++++++++++++
> target/i386/tcg/translate.c | 5 +++++
> tests/tcg/x86_64/test-2175.c | 24 ++++++++++++++++++++++++
> target/i386/tcg/cc_helper_template.h.inc | 18 ++++++++++++++++++
> target/i386/tcg/emit.c.inc | 2 +-
> tests/tcg/x86_64/Makefile.target | 1 +
> 7 files changed, 72 insertions(+), 1 deletion(-)
> create mode 100644 tests/tcg/x86_64/test-2175.c
> +static int glue(compute_all_blsi, SUFFIX)(DATA_TYPE dst, DATA_TYPE src1)
> +{
> + int cf, pf, af, zf, sf, of;
> +
> + cf = (src1 != 0);
> + pf = 0; /* undefined */
> + af = 0; /* undefined */
> + zf = (dst == 0) * CC_Z;
> + sf = lshift(dst, 8 - DATA_BITS) & CC_S;
> + of = 0;
> + return cf | pf | af | zf | sf | of;
> +}
Except this function which I'm not reviewing, for the rest
to the best of my x86 knowledge:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
next prev parent reply other threads:[~2024-08-16 9:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 7:58 [PATCH 0/2] target/i386: Fix carry flag for BLSI Richard Henderson
2024-08-01 7:58 ` [PATCH 1/2] target/i386: Split out gen_prepare_val_nz Richard Henderson
2024-08-16 9:22 ` Philippe Mathieu-Daudé
2024-08-01 7:58 ` [PATCH 2/2] target/i386: Fix carry flag for BLSI Richard Henderson
2024-08-16 9:30 ` Philippe Mathieu-Daudé [this message]
2024-08-07 5:41 ` [PATCH 0/2] " Richard Henderson
2024-08-07 16:49 ` Philippe Mathieu-Daudé
2024-08-14 10:31 ` Richard Henderson
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=f6091ce8-0107-49cd-bf0f-05377711e493@linaro.org \
--to=philmd@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).