[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/47] tcg: Introduce tcg_tbrel_diff
From: |
Richard Henderson |
Subject: |
[PULL 30/47] tcg: Introduce tcg_tbrel_diff |
Date: |
Thu, 7 Jan 2021 10:14:31 -1000 |
Reviewed-by: Joelle van Dyne <j@getutm.app>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index e744a1ce02..e6fce9a049 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -1146,6 +1146,19 @@ static inline ptrdiff_t tcg_pcrel_diff(TCGContext *s,
const void *target)
return tcg_ptr_byte_diff(target, tcg_splitwx_to_rx(s->code_ptr));
}
+/**
+ * tcg_tbrel_diff
+ * @s: the tcg context
+ * @target: address of the target
+ *
+ * Produce a difference, from the beginning of the current TB code
+ * to the destination address.
+ */
+static inline ptrdiff_t tcg_tbrel_diff(TCGContext *s, const void *target)
+{
+ return tcg_ptr_byte_diff(target, tcg_splitwx_to_rx(s->code_buf));
+}
+
/**
* tcg_current_code_size
* @s: the tcg context
--
2.25.1
- [PULL 32/47] tcg/ppc: Use tcg_out_mem_long to reset TCG_REG_TB, (continued)
- [PULL 32/47] tcg/ppc: Use tcg_out_mem_long to reset TCG_REG_TB, Richard Henderson, 2021/01/07
- [PULL 36/47] tcg/s390: Use tcg_tbrel_diff, Richard Henderson, 2021/01/07
- [PULL 20/47] tcg: Use Error with alloc_code_gen_buffer, Richard Henderson, 2021/01/07
- [PULL 33/47] tcg/ppc: Support split-wx code generation, Richard Henderson, 2021/01/07
- [PULL 37/47] tcg/s390: Support split-wx code generation, Richard Henderson, 2021/01/07
- [PULL 38/47] tcg/riscv: Fix branch range checks, Richard Henderson, 2021/01/07
- [PULL 34/47] tcg/sparc: Use tcg_tbrel_diff, Richard Henderson, 2021/01/07
- [PULL 45/47] tcg: Remove TCG_TARGET_SUPPORT_MIRROR, Richard Henderson, 2021/01/07
- [PULL 26/47] tcg/aarch64: Use B not BL for tcg_out_goto_long, Richard Henderson, 2021/01/07
- [PULL 41/47] accel/tcg: Add mips support to alloc_code_gen_buffer_splitwx_memfd, Richard Henderson, 2021/01/07
- [PULL 30/47] tcg: Introduce tcg_tbrel_diff,
Richard Henderson <=
- [PULL 28/47] disas: Push const down through host disassembly, Richard Henderson, 2021/01/07
- [PULL 31/47] tcg/ppc: Use tcg_tbrel_diff, Richard Henderson, 2021/01/07
- [PULL 35/47] tcg/sparc: Support split-wx code generation, Richard Henderson, 2021/01/07
- [PULL 42/47] tcg/mips: Do not assert on relocation overflow, Richard Henderson, 2021/01/07
- [PULL 39/47] tcg/riscv: Remove branch-over-branch fallback, Richard Henderson, 2021/01/07
- [PULL 40/47] tcg/riscv: Support split-wx code generation, Richard Henderson, 2021/01/07
- [PULL 47/47] tcg: Constify TCGLabelQemuLdst.raddr, Richard Henderson, 2021/01/07
- [PULL 44/47] tcg/arm: Support split-wx code generation, Richard Henderson, 2021/01/07
- [PULL 43/47] tcg/mips: Support split-wx code generation, Richard Henderson, 2021/01/07
- [PULL 46/47] tcg: Constify tcg_code_gen_epilogue, Richard Henderson, 2021/01/07