aboutsummaryrefslogtreecommitdiff
path: root/target/loongarch/translate.c
diff options
context:
space:
mode:
authorJiajie Chen <c@jia.je>2023-08-22 09:13:51 +0200
committerSong Gao <gaosong@loongson.cn>2023-08-24 11:17:57 +0800
commit34423c01941928974f4854bc23a949789154fee7 (patch)
tree9709e15a492c6d1298247d156c24524cce444fd8 /target/loongarch/translate.c
parent3966582099b0c94b45a2ea0fd8afb0dcac8ad292 (diff)
target/loongarch: Extract make_address_x() helper
Signed-off-by: Jiajie Chen <c@jia.je> Co-authored-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230822032724.1353391-6-gaosong@loongson.cn> [PMD: Extract helper from bigger patch] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230822071405.35386-6-philmd@linaro.org>
Diffstat (limited to 'target/loongarch/translate.c')
-rw-r--r--target/loongarch/translate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c
index ac847745df..a68a979a55 100644
--- a/target/loongarch/translate.c
+++ b/target/loongarch/translate.c
@@ -208,6 +208,18 @@ static void set_fpr(int reg_num, TCGv val)
offsetof(CPULoongArchState, fpr[reg_num].vreg.D(0)));
}
+static TCGv make_address_x(DisasContext *ctx, TCGv base, TCGv addend)
+{
+ TCGv temp = NULL;
+
+ if (addend) {
+ temp = tcg_temp_new();
+ tcg_gen_add_tl(temp, base, addend);
+ base = temp;
+ }
+ return base;
+}
+
#include "decode-insns.c.inc"
#include "insn_trans/trans_arith.c.inc"
#include "insn_trans/trans_shift.c.inc"