[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 25/31] tcg/loongarch64: Implement exit_tb/goto_tb
From: |
WANG Xuerui |
Subject: |
[PATCH v7 25/31] tcg/loongarch64: Implement exit_tb/goto_tb |
Date: |
Mon, 22 Nov 2021 18:41:55 +0800 |
Signed-off-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/loongarch64/tcg-target.c.inc | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index a806e3352e..2d066a035d 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -980,6 +980,25 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
int c2 = const_args[2];
switch (opc) {
+ case INDEX_op_exit_tb:
+ /* Reuse the zeroing that exists for goto_ptr. */
+ if (a0 == 0) {
+ tcg_out_call_int(s, tcg_code_gen_epilogue, true);
+ } else {
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_A0, a0);
+ tcg_out_call_int(s, tb_ret_addr, true);
+ }
+ break;
+
+ case INDEX_op_goto_tb:
+ assert(s->tb_jmp_insn_offset == 0);
+ /* indirect jump method */
+ tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP0, TCG_REG_ZERO,
+ (uintptr_t)(s->tb_jmp_target_addr + a0));
+ tcg_out_opc_jirl(s, TCG_REG_ZERO, TCG_REG_TMP0, 0);
+ set_jmp_reset_offset(s, a0);
+ break;
+
case INDEX_op_mb:
tcg_out_mb(s, a0);
break;
--
2.34.0
- [PATCH v7 20/31] tcg/loongarch64: Implement setcond ops, (continued)
- [PATCH v7 20/31] tcg/loongarch64: Implement setcond ops, WANG Xuerui, 2021/11/22
- [PATCH v7 18/31] tcg/loongarch64: Implement mul/mulsh/muluh/div/divu/rem/remu ops, WANG Xuerui, 2021/11/22
- [PATCH v7 21/31] tcg/loongarch64: Implement tcg_out_call, WANG Xuerui, 2021/11/22
- [PATCH v7 12/31] tcg/loongarch64: Implement not/and/or/xor/nor/andc/orc ops, WANG Xuerui, 2021/11/22
- [PATCH v7 23/31] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops, WANG Xuerui, 2021/11/22
- [PATCH v7 22/31] tcg/loongarch64: Implement simple load/store ops, WANG Xuerui, 2021/11/22
- [PATCH v7 24/31] tcg/loongarch64: Implement tcg_target_qemu_prologue, WANG Xuerui, 2021/11/22
- [PATCH v7 26/31] tcg/loongarch64: Implement tcg_target_init, WANG Xuerui, 2021/11/22
- [PATCH v7 27/31] tcg/loongarch64: Register the JIT, WANG Xuerui, 2021/11/22
- [PATCH v7 29/31] accel/tcg/user-exec: Implement CPU-specific signal handler for loongarch64 hosts, WANG Xuerui, 2021/11/22
- [PATCH v7 25/31] tcg/loongarch64: Implement exit_tb/goto_tb,
WANG Xuerui <=
- [PATCH v7 31/31] tests/docker: Add gentoo-loongarch64-cross image and run cross builds in GitLab, WANG Xuerui, 2021/11/22
- [PATCH v7 30/31] configure, meson.build: Mark support for loongarch64 hosts, WANG Xuerui, 2021/11/22
- [PATCH v7 19/31] tcg/loongarch64: Implement br/brcond ops, WANG Xuerui, 2021/11/22
- [PATCH v7 28/31] linux-user: Add safe syscall handling for loongarch64 hosts, WANG Xuerui, 2021/11/22