[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 07/36] tcg: Add TCG_CALL_RET_BY_VEC
From: |
Richard Henderson |
Subject: |
[PATCH v6 07/36] tcg: Add TCG_CALL_RET_BY_VEC |
Date: |
Mon, 30 Jan 2023 11:48:15 -1000 |
This will be used by _WIN64 to return i128. Not yet used,
because allocation is not yet enabled.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tcg-internal.h | 1 +
tcg/tcg.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h
index 2ec1ea01df..33f1d8b411 100644
--- a/tcg/tcg-internal.h
+++ b/tcg/tcg-internal.h
@@ -37,6 +37,7 @@
typedef enum {
TCG_CALL_RET_NORMAL, /* by registers */
TCG_CALL_RET_BY_REF, /* for i128, by reference */
+ TCG_CALL_RET_BY_VEC, /* for i128, by vector register */
} TCGCallReturnKind;
typedef enum {
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 5d321e7e82..edc6185bf4 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -752,6 +752,10 @@ static void init_call_layout(TCGHelperInfo *info)
/* Query the last register now to trigger any assert early. */
tcg_target_call_oarg_reg(info->out_kind, info->nr_out - 1);
break;
+ case TCG_CALL_RET_BY_VEC:
+ /* Query the single register now to trigger any assert early. */
+ tcg_target_call_oarg_reg(TCG_CALL_RET_BY_VEC, 0);
+ break;
case TCG_CALL_RET_BY_REF:
/*
* Allocate the first argument to the output.
@@ -4602,6 +4606,21 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op)
}
break;
+ case TCG_CALL_RET_BY_VEC:
+ {
+ TCGTemp *ts = arg_temp(op->args[0]);
+
+ tcg_debug_assert(ts->base_type == TCG_TYPE_I128);
+ tcg_debug_assert(ts->temp_subindex == 0);
+ if (!ts->mem_allocated) {
+ temp_allocate_frame(s, ts);
+ }
+ tcg_out_st(s, TCG_TYPE_V128,
+ tcg_target_call_oarg_reg(TCG_CALL_RET_BY_VEC, 0),
+ ts->mem_base->reg, ts->mem_offset);
+ }
+ /* fall through to mark all parts in memory */
+
case TCG_CALL_RET_BY_REF:
/* The callee has performed a write through the reference. */
for (i = 0; i < nb_oargs; i++) {
--
2.34.1
- [PATCH v6 00/36] tcg: Support for Int128 with helpers, Richard Henderson, 2023/01/30
- [PATCH v6 01/36] tcg: Define TCG_TYPE_I128 and related helper macros, Richard Henderson, 2023/01/30
- [PATCH v6 03/36] tcg: Allocate objects contiguously in temp_allocate_frame, Richard Henderson, 2023/01/30
- [PATCH v6 02/36] tcg: Handle dh_typecode_i128 with TCG_CALL_{RET, ARG}_NORMAL, Richard Henderson, 2023/01/30
- [PATCH v6 04/36] tcg: Introduce tcg_out_addi_ptr, Richard Henderson, 2023/01/30
- [PATCH v6 05/36] tcg: Add TCG_CALL_{RET,ARG}_BY_REF, Richard Henderson, 2023/01/30
- [PATCH v6 06/36] tcg: Introduce tcg_target_call_oarg_reg, Richard Henderson, 2023/01/30
- [PATCH v6 07/36] tcg: Add TCG_CALL_RET_BY_VEC,
Richard Henderson <=
- [PATCH v6 08/36] include/qemu/int128: Use Int128 structure for TCI, Richard Henderson, 2023/01/30
- [PATCH v6 09/36] tcg/i386: Add TCG_TARGET_CALL_{RET,ARG}_I128, Richard Henderson, 2023/01/30
- [PATCH v6 10/36] tcg/tci: Fix big-endian return register ordering, Richard Henderson, 2023/01/30
- [PATCH v6 11/36] tcg/tci: Add TCG_TARGET_CALL_{RET,ARG}_I128, Richard Henderson, 2023/01/30
- [PATCH v6 12/36] tcg: Add TCG_TARGET_CALL_{RET,ARG}_I128, Richard Henderson, 2023/01/30
- [PATCH v6 13/36] tcg: Add temp allocation for TCGv_i128, Richard Henderson, 2023/01/30
- [PATCH v6 14/36] tcg: Add basic data movement for TCGv_i128, Richard Henderson, 2023/01/30
- [PATCH v6 15/36] tcg: Add guest load/store primitives for TCGv_i128, Richard Henderson, 2023/01/30
- [PATCH v6 16/36] tcg: Add tcg_gen_{non}atomic_cmpxchg_i128, Richard Henderson, 2023/01/30
- [PATCH v6 17/36] tcg: Split out tcg_gen_nonatomic_cmpxchg_i{32,64}, Richard Henderson, 2023/01/30