[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] target/i386: Introduce cpu_compute_eflags_ccop
|
From: |
Richard Henderson |
|
Subject: |
[PATCH 6/7] target/i386: Introduce cpu_compute_eflags_ccop |
|
Date: |
Mon, 15 Apr 2024 21:06:08 -0700 |
This is a generalization of cpu_compute_eflags, with a dynamic
value of cc_op, and is thus tcg specific.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/cpu.h | 2 ++
target/i386/tcg/cc_helper.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 6b05738079..285f26d99d 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2379,6 +2379,8 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int
bank,
uint32_t cpu_cc_compute_all(CPUX86State *env1);
+uint32_t cpu_compute_eflags_ccop(CPUX86State *env, CCOp op);
+
static inline uint32_t cpu_compute_eflags(CPUX86State *env)
{
uint32_t eflags = env->eflags;
diff --git a/target/i386/tcg/cc_helper.c b/target/i386/tcg/cc_helper.c
index f76e9cb8cf..8203682ca8 100644
--- a/target/i386/tcg/cc_helper.c
+++ b/target/i386/tcg/cc_helper.c
@@ -225,6 +225,16 @@ uint32_t cpu_cc_compute_all(CPUX86State *env)
return helper_cc_compute_all(CC_DST, CC_SRC, CC_SRC2, CC_OP);
}
+uint32_t cpu_compute_eflags_ccop(CPUX86State *env, CCOp op)
+{
+ uint32_t eflags;
+
+ eflags = helper_cc_compute_all(CC_DST, CC_SRC, CC_SRC2, op);
+ eflags |= env->df & DF_MASK;
+ eflags |= env->eflags & ~(VM_MASK | RF_MASK);
+ return eflags;
+}
+
target_ulong helper_cc_compute_c(target_ulong dst, target_ulong src1,
target_ulong src2, int op)
{
--
2.34.1
- [PATCH 1/7] tcg: Introduce INDEX_op_plugin_pc, (continued)
- [PATCH 1/7] tcg: Introduce INDEX_op_plugin_pc, Richard Henderson, 2024/04/16
- [PATCH 2/7] accel/tcg: Set CPUState.plugin_ra before all plugin callbacks, Richard Henderson, 2024/04/16
- [PATCH 3/7] accel/tcg: Return the TranslationBlock from cpu_unwind_state_data, Richard Henderson, 2024/04/16
- [PATCH 4/7] plugins: Introduce TCGCPUOps callbacks for mid-tb register reads, Richard Henderson, 2024/04/16
- [PATCH 5/7] target/i386: Split out gdb-internal.h, Richard Henderson, 2024/04/16
- [PATCH 6/7] target/i386: Introduce cpu_compute_eflags_ccop,
Richard Henderson <=
- [PATCH 7/7] target/i386: Implement TCGCPUOps for plugin register reads, Richard Henderson, 2024/04/16
- Re: [PATCH 0/7] plugins: Use unwind info for special gdb registers, Pierrick Bouvier, 2024/04/16
- Re: [PATCH 0/7] plugins: Use unwind info for special gdb registers, Alex Bennée, 2024/04/22