[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/30] tcg/loongarch: Implement exit_tb/goto_tb
From: |
WANG Xuerui |
Subject: |
[PATCH 25/30] tcg/loongarch: Implement exit_tb/goto_tb |
Date: |
Mon, 20 Sep 2021 16:04:46 +0800 |
Signed-off-by: WANG Xuerui <git@xen0n.name>
---
tcg/loongarch/tcg-target.c.inc | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tcg/loongarch/tcg-target.c.inc b/tcg/loongarch/tcg-target.c.inc
index 10df007087..585bf8dba0 100644
--- a/tcg/loongarch/tcg-target.c.inc
+++ b/tcg/loongarch/tcg-target.c.inc
@@ -899,6 +899,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.33.0
- Re: [PATCH 22/30] tcg/loongarch: Implement simple load/store ops, (continued)
- [PATCH 26/30] tcg/loongarch: Implement tcg_target_init, WANG Xuerui, 2021/09/20
- [PATCH 29/30] linux-user: Add host dependency for 64-bit LoongArch, WANG Xuerui, 2021/09/20
- [PATCH 09/30] tcg/loongarch: Implement tcg_out_mov and tcg_out_movi, WANG Xuerui, 2021/09/20
- [PATCH 01/30] elf: Add machine type value for LoongArch, WANG Xuerui, 2021/09/20
- [PATCH 30/30] accel/tcg/user-exec: Implement CPU-specific signal handler for LoongArch hosts, WANG Xuerui, 2021/09/20
- [PATCH 25/30] tcg/loongarch: Implement exit_tb/goto_tb,
WANG Xuerui <=
- [PATCH 05/30] tcg/loongarch: Add register names, allocation order and input/output sets, WANG Xuerui, 2021/09/20