diff options
author | Richard Henderson <rth@twiddle.net> | 2016-06-29 21:10:59 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2016-10-26 08:29:01 -0700 |
commit | 7ebee43ee3e2fcd7b5063058b7ef74bc43216733 (patch) | |
tree | 366db1d66ff70d8332b6fb38b07085a0f79c6293 /tcg-runtime.c | |
parent | c482cb117cc418115ca9c6d21a7a2315414c0a40 (diff) | |
download | qemu-7ebee43ee3e2fcd7b5063058b7ef74bc43216733.zip qemu-7ebee43ee3e2fcd7b5063058b7ef74bc43216733.tar.gz qemu-7ebee43ee3e2fcd7b5063058b7ef74bc43216733.tar.bz2 |
tcg: Add atomic128 helpers
Force the use of cmpxchg16b on x86_64.
Wikipedia suggests that only very old AMD64 (circa 2004) did not have
this instruction. Further, it's required by Windows 8 so no new cpus
will ever omit it.
If we truely care about these, then we could check this at startup time
and then avoid executing paths that use it.
Reviewed-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg-runtime.c')
-rw-r--r-- | tcg-runtime.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tcg-runtime.c b/tcg-runtime.c index aa55d12..e952153 100644 --- a/tcg-runtime.c +++ b/tcg-runtime.c @@ -133,4 +133,22 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, #define DATA_SIZE 8 #include "atomic_template.h" +/* The following is only callable from other helpers, and matches up + with the softmmu version. */ + +#ifdef CONFIG_ATOMIC128 + +#undef EXTRA_ARGS +#undef ATOMIC_NAME +#undef ATOMIC_MMU_LOOKUP + +#define EXTRA_ARGS , TCGMemOpIdx oi, uintptr_t retaddr +#define ATOMIC_NAME(X) \ + HELPER(glue(glue(glue(atomic_ ## X, SUFFIX), END), _mmu)) +#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, retaddr) + +#define DATA_SIZE 16 +#include "atomic_template.h" +#endif /* CONFIG_ATOMIC128 */ + #endif /* !CONFIG_SOFTMMU */ |