1
From 1933f99d75040dd2f6f62f066eda42a5979014a4 Mon Sep 17 00:00:00 2001
2
From: Richard Henderson <rth@twiddle.net>
3
Date: Mon, 9 Dec 2013 14:37:06 -0800
4
Subject: [PATCH 16/49] target-arm: Use new qemu_ld/st opcodes
6
Retain the existing gen_aa32_* inlines, to aid compilation for A64.
8
Cc: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Richard Henderson <rth@twiddle.net>
10
Message-id: 1386628626-21627-1-git-send-email-rth@twiddle.net
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
target-arm/translate.c | 56 ++++++++++++++++++++++----------------------------
14
1 file changed, 25 insertions(+), 31 deletions(-)
16
Index: qemu.hallyn/target-arm/translate.c
17
===================================================================
18
--- qemu.hallyn.orig/target-arm/translate.c 2014-01-15 11:01:24.270266109 -0700
19
+++ qemu.hallyn/target-arm/translate.c 2014-01-15 11:01:24.270266109 -0700
21
* extended if we're a 64 bit core) and data is also
22
* 32 bits unless specifically doing a 64 bit access.
23
* These functions work like tcg_gen_qemu_{ld,st}* except
24
- * that their arguments are TCGv_i32 rather than TCGv.
25
+ * that the address argument is TCGv_i32 rather than TCGv.
27
#if TARGET_LONG_BITS == 32
29
-#define DO_GEN_LD(OP) \
30
-static inline void gen_aa32_##OP(TCGv_i32 val, TCGv_i32 addr, int index) \
31
+#define DO_GEN_LD(SUFF, OPC) \
32
+static inline void gen_aa32_ld##SUFF(TCGv_i32 val, TCGv_i32 addr, int index) \
34
- tcg_gen_qemu_##OP(val, addr, index); \
35
+ tcg_gen_qemu_ld_i32(val, addr, index, OPC); \
38
-#define DO_GEN_ST(OP) \
39
-static inline void gen_aa32_##OP(TCGv_i32 val, TCGv_i32 addr, int index) \
40
+#define DO_GEN_ST(SUFF, OPC) \
41
+static inline void gen_aa32_st##SUFF(TCGv_i32 val, TCGv_i32 addr, int index) \
43
- tcg_gen_qemu_##OP(val, addr, index); \
44
+ tcg_gen_qemu_st_i32(val, addr, index, OPC); \
47
static inline void gen_aa32_ld64(TCGv_i64 val, TCGv_i32 addr, int index)
49
- tcg_gen_qemu_ld64(val, addr, index);
50
+ tcg_gen_qemu_ld_i64(val, addr, index, MO_TEQ);
53
static inline void gen_aa32_st64(TCGv_i64 val, TCGv_i32 addr, int index)
55
- tcg_gen_qemu_st64(val, addr, index);
56
+ tcg_gen_qemu_st_i64(val, addr, index, MO_TEQ);
61
-#define DO_GEN_LD(OP) \
62
-static inline void gen_aa32_##OP(TCGv_i32 val, TCGv_i32 addr, int index) \
63
+#define DO_GEN_LD(SUFF, OPC) \
64
+static inline void gen_aa32_ld##SUFF(TCGv_i32 val, TCGv_i32 addr, int index) \
66
TCGv addr64 = tcg_temp_new(); \
67
- TCGv val64 = tcg_temp_new(); \
68
tcg_gen_extu_i32_i64(addr64, addr); \
69
- tcg_gen_qemu_##OP(val64, addr64, index); \
70
+ tcg_gen_qemu_ld_i32(val, addr64, index, OPC); \
71
tcg_temp_free(addr64); \
72
- tcg_gen_trunc_i64_i32(val, val64); \
73
- tcg_temp_free(val64); \
76
-#define DO_GEN_ST(OP) \
77
-static inline void gen_aa32_##OP(TCGv_i32 val, TCGv_i32 addr, int index) \
78
+#define DO_GEN_ST(SUFF, OPC) \
79
+static inline void gen_aa32_st##SUFF(TCGv_i32 val, TCGv_i32 addr, int index) \
81
TCGv addr64 = tcg_temp_new(); \
82
- TCGv val64 = tcg_temp_new(); \
83
tcg_gen_extu_i32_i64(addr64, addr); \
84
- tcg_gen_extu_i32_i64(val64, val); \
85
- tcg_gen_qemu_##OP(val64, addr64, index); \
86
+ tcg_gen_qemu_st_i32(val, addr64, index, OPC); \
87
tcg_temp_free(addr64); \
88
- tcg_temp_free(val64); \
91
static inline void gen_aa32_ld64(TCGv_i64 val, TCGv_i32 addr, int index)
93
TCGv addr64 = tcg_temp_new();
94
tcg_gen_extu_i32_i64(addr64, addr);
95
- tcg_gen_qemu_ld64(val, addr64, index);
96
+ tcg_gen_qemu_ld_i64(val, addr64, index, MO_TEQ);
97
tcg_temp_free(addr64);
100
@@ -890,20 +884,20 @@
102
TCGv addr64 = tcg_temp_new();
103
tcg_gen_extu_i32_i64(addr64, addr);
104
- tcg_gen_qemu_st64(val, addr64, index);
105
+ tcg_gen_qemu_st_i64(val, addr64, index, MO_TEQ);
106
tcg_temp_free(addr64);
119
+DO_GEN_LD(8s, MO_SB)
120
+DO_GEN_LD(8u, MO_UB)
121
+DO_GEN_LD(16s, MO_TESW)
122
+DO_GEN_LD(16u, MO_TEUW)
123
+DO_GEN_LD(32u, MO_TEUL)
125
+DO_GEN_ST(16, MO_TEUW)
126
+DO_GEN_ST(32, MO_TEUL)
128
static inline void gen_smc(CPUARMState *env, DisasContext *s)