From: Simon Scherer <scherer.simon89@gmail.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, richard.henderson@linaro.org,
qemu-stable@nongnu.org, Simon Scherer <scherer.simon89@gmail.com>
Subject: [PATCH] target/i386: Don't clear C1 for FCOMI/FCOMIP/FUCOMI/FUCOMIP
Date: Fri, 11 Sep 2026 12:58:11 +0200 [thread overview]
Message-ID: <20260911105811.16854-1-scherer.simon89@gmail.com> (raw)
Commit 6802a4b23919 ("target/i386: clear C1 for all x87 compare
instructions") added an unconditional C1 clear to helper_fcomi_ST0_FT0()
and helper_fucomi_ST0_FT0(), based on the SDM listing "C1 Set to 0" under
FPU Flags Affected for FCOMI/FCOMIP/FUCOMI/FUCOMIP.
Testing on real x86-64 Intel and AMD hardware shows these instructions leave
C1 unchanged, unlike FCOM/FUCOM/FICOM. The SDM text appears to have been
carried over from the FCOM/FUCOM description.
Revert that part of the commit. The FCOM/FUCOM/FICOM changes are kept.
Fixes: 6802a4b23919 ("target/i386: clear C1 for all x87 compare instructions")
Signed-off-by: Simon Scherer <scherer.simon89@gmail.com>
---
This was caught before 6802a4b23919 landed. V3 [1] dropped the
fcomi/fucomi changes, but v2 was the version applied
[1] https://patchew.org/QEMU/20260902135705.261863-1-scherer.simon89@gmail.com/
target/i386/tcg/fpu_helper.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c
index 54ff4fe31313..56d093da8c9a 100644
--- a/target/i386/tcg/fpu_helper.c
+++ b/target/i386/tcg/fpu_helper.c
@@ -565,8 +565,6 @@ void helper_fcomi_ST0_FT0(CPUX86State *env)
/* OF, SF, and AF are unconditionally cleared to 0 */
CC_SRC = fcomi_ccval[ret + 1];
CC_OP = CC_OP_EFLAGS;
- /* C1 is unconditionally cleared to 0 */
- env->fpus &= ~0x0200;
merge_exception_flags(env, old_flags);
}
@@ -579,8 +577,6 @@ void helper_fucomi_ST0_FT0(CPUX86State *env)
/* OF, SF, and AF are unconditionally cleared to 0 */
CC_SRC = fcomi_ccval[ret + 1];
CC_OP = CC_OP_EFLAGS;
- /* C1 is unconditionally cleared to 0 */
- env->fpus &= ~0x0200;
merge_exception_flags(env, old_flags);
}
--
2.53.0
reply other threads:[~2026-09-11 10:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260911105811.16854-1-scherer.simon89@gmail.com \
--to=scherer.simon89@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.