aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-11-01 12:51:04 +1100
committerRichard Henderson <richard.henderson@linaro.org>2023-05-16 15:21:39 -0700
commit0cadc1eda1a3120c37c713ab6d6b7a02da0d2e6f (patch)
tree480c1a82e17bf8dd990c96c9c98321f9373e6cbb /tcg/tcg.c
parent5b36f2684cbb07fcd75cc29b618651c43e7a80ed (diff)
downloadqemu-0cadc1eda1a3120c37c713ab6d6b7a02da0d2e6f.zip
qemu-0cadc1eda1a3120c37c713ab6d6b7a02da0d2e6f.tar.gz
qemu-0cadc1eda1a3120c37c713ab6d6b7a02da0d2e6f.tar.bz2
tcg: Unify helper_{be,le}_{ld,st}*
With the current structure of cputlb.c, there is no difference between the little-endian and big-endian entry points, aside from the assert. Unify the pairs of functions. Hoist the qemu_{ld,st}_helpers arrays to tcg.c. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index f156ca6..f5f9d8f 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -197,6 +197,27 @@ static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *l,
const TCGLdstHelperParam *p)
__attribute__((unused));
+#ifdef CONFIG_SOFTMMU
+static void * const qemu_ld_helpers[MO_SSIZE + 1] = {
+ [MO_UB] = helper_ldub_mmu,
+ [MO_SB] = helper_ldsb_mmu,
+ [MO_UW] = helper_lduw_mmu,
+ [MO_SW] = helper_ldsw_mmu,
+ [MO_UL] = helper_ldul_mmu,
+ [MO_UQ] = helper_ldq_mmu,
+#if TCG_TARGET_REG_BITS == 64
+ [MO_SL] = helper_ldsl_mmu,
+#endif
+};
+
+static void * const qemu_st_helpers[MO_SIZE + 1] = {
+ [MO_8] = helper_stb_mmu,
+ [MO_16] = helper_stw_mmu,
+ [MO_32] = helper_stl_mmu,
+ [MO_64] = helper_stq_mmu,
+};
+#endif
+
TCGContext tcg_init_ctx;
__thread TCGContext *tcg_ctx;