From: Richard Henderson <richard.henderson@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 07/19] target/i386: introduce flags writeback mechanism
Date: Thu, 19 Oct 2023 10:44:20 -0700 [thread overview]
Message-ID: <3cb64878-7f3c-46b4-b423-0c5a31aba797@linaro.org> (raw)
In-Reply-To: <20231019104648.389942-8-pbonzini@redhat.com>
On 10/19/23 03:46, Paolo Bonzini wrote:
> + /*
> + * Write back flags after last memory access. Some newer ALU instructions, as
> + * well as SSE instructions, write flags in the gen_* function, but that can
> + * cause incorrect tracking of CC_OP for instructions that write to both memory
> + * and flags.
> + */
> + if (decode.cc_op != -1) {
> + if (decode.cc_dst) {
> + tcg_gen_mov_tl(cpu_cc_dst, decode.cc_dst);
> + }
> + if (decode.cc_src) {
> + tcg_gen_mov_tl(cpu_cc_src, decode.cc_src);
> + }
> + if (decode.cc_src2) {
> + tcg_gen_mov_tl(cpu_cc_src2, decode.cc_src2);
> + }
> + if (decode.cc_op == CC_OP_DYNAMIC) {
> + tcg_gen_mov_i32(cpu_cc_op, decode.cc_op_dynamic);
> + } else {
> + assert(!decode.cc_op_dynamic);
> + }
> + set_cc_op(s, decode.cc_op);
> + } else {
> + assert(!decode.cc_dst);
> + assert(!decode.cc_src);
> + assert(!decode.cc_src2);
> + assert(!decode.cc_op_dynamic);
> + }
I suggest you use cc_op_live[] to ensure that each output is present if USES_CC_* is set,
and absent otherwise. Obviously that's not possible for CC_OP_DYNAMIC, but for everything
else...
r~
next prev parent reply other threads:[~2023-10-19 17:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 10:46 [PATCH v2 00/19] target/i386: decoder changes for 8.2 Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 01/19] target/i386: group common checks in the decoding phase Paolo Bonzini
2023-10-19 15:45 ` Richard Henderson
2023-10-19 10:46 ` [PATCH v2 02/19] target/i386: validate VEX.W for AVX instructions Paolo Bonzini
2023-10-19 15:45 ` Richard Henderson
2023-10-19 10:46 ` [PATCH v2 03/19] target/i386: implement SHA instructions Paolo Bonzini
2023-10-19 10:59 ` Philippe Mathieu-Daudé
2023-10-19 11:42 ` Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 04/19] tests/tcg/i386: initialize more registers in test-avx Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 05/19] tests/tcg/i386: test-avx: add test cases for SHA new instructions Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 06/19] target/i386: accept full MemOp in gen_ext_tl Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 07/19] target/i386: introduce flags writeback mechanism Paolo Bonzini
2023-10-19 17:44 ` Richard Henderson [this message]
2023-10-19 19:08 ` Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 08/19] target/i386: implement CMPccXADD Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 09/19] target/i386: do not clobber A0 in POP translation Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 10/19] target/i386: reintroduce debugging mechanism Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 11/19] target/i386: move 00-5F opcodes to new decoder Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 12/19] target/i386: adjust decoding of J operand Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 13/19] target/i386: split eflags computation out of gen_compute_eflags Paolo Bonzini
2023-10-19 10:46 ` [PATCH v2 14/19] tcg: add negsetcondi Paolo Bonzini
2023-10-19 16:00 ` Richard Henderson
2023-10-19 10:48 ` [PATCH v2 15/19] target/i386: move 60-BF opcodes to new decoder Paolo Bonzini
2023-10-19 10:48 ` [PATCH v2 16/19] target/i386: move operand load and writeback out of gen_cmovcc1 Paolo Bonzini
2023-10-19 10:48 ` [PATCH v2 17/19] target/i386: move remaining conditional operations to new decoder Paolo Bonzini
2023-10-19 10:48 ` [PATCH v2 18/19] target/i386: remove now converted opcodes from old decoder Paolo Bonzini
2023-10-19 10:48 ` [PATCH v2 19/19] target/i386: remove gen_op Paolo Bonzini
2023-10-19 11:39 ` [PATCH v2 00/19] target/i386: decoder changes for 8.2 Paolo Bonzini
2023-10-19 15:44 ` 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=3cb64878-7f3c-46b4-b423-0c5a31aba797@linaro.org \
--to=richard.henderson@linaro.org \
--cc=pbonzini@redhat.com \
--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).