thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
ed5979
From cb2b591e1677db2837810eaedac534a7ff3a7b1c Mon Sep 17 00:00:00 2001
ed5979
From: Richard Henderson <richard.henderson@linaro.org>
ed5979
Date: Sat, 14 Jan 2023 08:06:01 -1000
ed5979
Subject: [PATCH 4/8] target/i386: Fix C flag for BLSI, BLSMSK, BLSR
ed5979
ed5979
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
ed5979
RH-MergeRequest: 154: target/i386: fix bugs in emulation of BMI instructions
ed5979
RH-Bugzilla: 2173590
ed5979
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ed5979
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
ed5979
RH-Acked-by: Bandan Das <None>
ed5979
RH-Commit: [4/7] 173e23c492c830da6c5a4be0cfc20a69ac655b59 (bonzini/rhel-qemu-kvm)
ed5979
ed5979
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2173590
ed5979
Upstream-Status: merged
ed5979
ed5979
We forgot to set cc_src, which is used for computing C.
ed5979
ed5979
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1370
ed5979
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
ed5979
Message-Id: <20230114180601.2993644-1-richard.henderson@linaro.org>
ed5979
Cc: qemu-stable@nongnu.org
ed5979
Fixes: 1d0b926150e5 ("target/i386: move scalar 0F 38 and 0F 3A instruction to new decoder", 2022-10-18)
ed5979
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ed5979
(cherry picked from commit 99282098dc74c2055bde5652bde6cf0067d0c370)
ed5979
---
ed5979
 target/i386/tcg/emit.c.inc | 3 +++
ed5979
 1 file changed, 3 insertions(+)
ed5979
ed5979
diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc
ed5979
index 99f6ba6e19..4d7702c106 100644
ed5979
--- a/target/i386/tcg/emit.c.inc
ed5979
+++ b/target/i386/tcg/emit.c.inc
ed5979
@@ -1111,6 +1111,7 @@ static void gen_BLSI(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
ed5979
 {
ed5979
     MemOp ot = decode->op[0].ot;
ed5979
 
ed5979
+    tcg_gen_mov_tl(cpu_cc_src, s->T0);
ed5979
     tcg_gen_neg_tl(s->T1, s->T0);
ed5979
     tcg_gen_and_tl(s->T0, s->T0, s->T1);
ed5979
     tcg_gen_mov_tl(cpu_cc_dst, s->T0);
ed5979
@@ -1121,6 +1122,7 @@ static void gen_BLSMSK(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode
ed5979
 {
ed5979
     MemOp ot = decode->op[0].ot;
ed5979
 
ed5979
+    tcg_gen_mov_tl(cpu_cc_src, s->T0);
ed5979
     tcg_gen_subi_tl(s->T1, s->T0, 1);
ed5979
     tcg_gen_xor_tl(s->T0, s->T0, s->T1);
ed5979
     tcg_gen_mov_tl(cpu_cc_dst, s->T0);
ed5979
@@ -1131,6 +1133,7 @@ static void gen_BLSR(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
ed5979
 {
ed5979
     MemOp ot = decode->op[0].ot;
ed5979
 
ed5979
+    tcg_gen_mov_tl(cpu_cc_src, s->T0);
ed5979
     tcg_gen_subi_tl(s->T1, s->T0, 1);
ed5979
     tcg_gen_and_tl(s->T0, s->T0, s->T1);
ed5979
     tcg_gen_mov_tl(cpu_cc_dst, s->T0);
ed5979
-- 
ed5979
2.39.1
ed5979