new file mode 100644
@@ -0,0 +1,9 @@
+#ifndef TCG_MODULE_I386_H
+#define TCG_MODULE_I386_H
+
+struct TCGI386ModuleOps {
+ void (*update_fp_status)(CPUX86State *env);
+};
+extern struct TCGI386ModuleOps tcg_i386;
+
+#endif /* TCG_MODULE_I386_H */
@@ -1802,6 +1802,7 @@ struct X86CPU {
int32_t hv_max_vps;
};
+#include "tcg/tcg-module-i386.h"
#ifndef CONFIG_USER_ONLY
extern const VMStateDescription vmstate_x86_cpu;
@@ -2127,7 +2128,6 @@ static inline bool cpu_vmx_maybe_enabled(CPUX86State *env)
int get_pg_mode(CPUX86State *env);
/* fpu_helper.c */
-void update_fp_status(CPUX86State *env);
void update_mxcsr_status(CPUX86State *env);
void update_mxcsr_from_sse_status(CPUX86State *env);
@@ -2143,7 +2143,7 @@ static inline void cpu_set_fpuc(CPUX86State *env, uint16_t fpuc)
{
env->fpuc = fpuc;
if (tcg_enabled()) {
- update_fp_status(env);
+ tcg_i386.update_fp_status(env);
}
}
new file mode 100644
@@ -0,0 +1,10 @@
+#include "qemu/osdep.h"
+#include "cpu.h"
+
+static void i386_update_cpu_stub(CPUX86State *cpu)
+{
+}
+
+struct TCGI386ModuleOps tcg_i386 = {
+ .update_fp_status = i386_update_cpu_stub,
+};
@@ -371,7 +371,7 @@ static int cpu_post_load(void *opaque, int version_id)
}
if (tcg_enabled()) {
target_ulong dr7;
- update_fp_status(env);
+ tcg_i386.update_fp_status(env);
update_mxcsr_status(env);
cpu_breakpoint_remove_all(cs, BP_CPU);
@@ -672,7 +672,7 @@ uint32_t helper_fnstcw(CPUX86State *env)
return env->fpuc;
}
-void update_fp_status(CPUX86State *env)
+static void update_fp_status(CPUX86State *env)
{
FloatRoundMode rnd_mode;
FloatX80RoundPrec rnd_prec;
@@ -3039,3 +3039,10 @@ void helper_movq(CPUX86State *env, void *d, void *s)
#define SHIFT 1
#include "ops_sse.h"
+
+static void tcgi386_module_ops_fpu(void)
+{
+ tcg_i386.update_fp_status = update_fp_status;
+}
+
+type_init(tcgi386_module_ops_fpu);
@@ -1,6 +1,12 @@
specific_ss.add(files(
'tcg-module.c',
))
+specific_ss.add(when: 'TARGET_I386', if_true: files(
+ 'tcg-module-i386.c',
+))
+specific_ss.add(when: 'TARGET_X86_64', if_true: files(
+ 'tcg-module-i386.c',
+))
specific_ss.add(when: 'CONFIG_TCG', if_true: files(
'cpu-exec-common.c',
Also add TCGI386ModuleOps struct, which works like TCGModuleOps but for i386-specific functions. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- include/tcg/tcg-module-i386.h | 9 +++++++++ target/i386/cpu.h | 4 ++-- accel/tcg/tcg-module-i386.c | 10 ++++++++++ target/i386/machine.c | 2 +- target/i386/tcg/fpu_helper.c | 9 ++++++++- accel/tcg/meson.build | 6 ++++++ 6 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 include/tcg/tcg-module-i386.h create mode 100644 accel/tcg/tcg-module-i386.c