aboutsummaryrefslogtreecommitdiff
path: root/target/i386/mem_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-08-15 16:47:59 -0700
committerRichard Henderson <richard.henderson@linaro.org>2018-10-18 19:46:53 -0700
commite1ed709fbe687b1c92b31014b0ecfcd059252ec1 (patch)
tree42b8d73f9d1223d65d54e5966c194fdcce39665c /target/i386/mem_helper.c
parente6cd4bb59b8154fa00da611200beef7eb4e8ec56 (diff)
downloadqemu-e1ed709fbe687b1c92b31014b0ecfcd059252ec1.zip
qemu-e1ed709fbe687b1c92b31014b0ecfcd059252ec1.tar.gz
qemu-e1ed709fbe687b1c92b31014b0ecfcd059252ec1.tar.bz2
target/i386: Convert to HAVE_CMPXCHG128
Reviewed-by: Emilio G. Cota <cota@braap.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/i386/mem_helper.c')
-rw-r--r--target/i386/mem_helper.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/target/i386/mem_helper.c b/target/i386/mem_helper.c
index 30c26b9..6cc53bc 100644
--- a/target/i386/mem_helper.c
+++ b/target/i386/mem_helper.c
@@ -23,6 +23,7 @@
#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
#include "qemu/int128.h"
+#include "qemu/atomic128.h"
#include "tcg.h"
void helper_cmpxchg8b_unlocked(CPUX86State *env, target_ulong a0)
@@ -137,10 +138,7 @@ void helper_cmpxchg16b(CPUX86State *env, target_ulong a0)
if ((a0 & 0xf) != 0) {
raise_exception_ra(env, EXCP0D_GPF, ra);
- } else {
-#ifndef CONFIG_ATOMIC128
- cpu_loop_exit_atomic(ENV_GET_CPU(env), ra);
-#else
+ } else if (HAVE_CMPXCHG128) {
int eflags = cpu_cc_compute_all(env, CC_OP);
Int128 cmpv = int128_make128(env->regs[R_EAX], env->regs[R_EDX]);
@@ -159,7 +157,8 @@ void helper_cmpxchg16b(CPUX86State *env, target_ulong a0)
eflags &= ~CC_Z;
}
CC_SRC = eflags;
-#endif
+ } else {
+ cpu_loop_exit_atomic(ENV_GET_CPU(env), ra);
}
}
#endif