2 * TCG Helper Information Structure
4 * Copyright (c) 2023 Linaro Ltd
6 * SPDX-License-Identifier: GPL-2.0-or-later
9 #ifndef TCG_HELPER_INFO_H
10 #define TCG_HELPER_INFO_H
12 #ifdef CONFIG_TCG_INTERPRETER
15 #include "tcg-target-reg-bits.h"
17 #define MAX_CALL_IARGS 7
20 * Describe the calling convention of a given argument type.
23 TCG_CALL_RET_NORMAL
, /* by registers */
24 TCG_CALL_RET_BY_REF
, /* for i128, by reference */
25 TCG_CALL_RET_BY_VEC
, /* for i128, by vector register */
29 TCG_CALL_ARG_NORMAL
, /* by registers (continuing onto stack) */
30 TCG_CALL_ARG_EVEN
, /* like normal, but skipping odd slots */
31 TCG_CALL_ARG_EXTEND
, /* for i32, as a sign/zero-extended i64 */
32 TCG_CALL_ARG_EXTEND_U
, /* ... as a zero-extended i64 */
33 TCG_CALL_ARG_EXTEND_S
, /* ... as a sign-extended i64 */
34 TCG_CALL_ARG_BY_REF
, /* for i128, by reference, first */
35 TCG_CALL_ARG_BY_REF_N
, /* ... by reference, subsequent */
36 } TCGCallArgumentKind
;
38 typedef struct TCGCallArgumentLoc
{
39 TCGCallArgumentKind kind
: 8;
40 unsigned arg_slot
: 8;
41 unsigned ref_slot
: 8;
43 unsigned tmp_subindex
: 2;
46 struct TCGHelperInfo
{
50 /* Used with g_once_init_enter. */
51 #ifdef CONFIG_TCG_INTERPRETER
57 unsigned typemask
: 32;
61 TCGCallReturnKind out_kind
: 8;
63 /* Maximum physical arguments are constrained by TCG_TYPE_I128. */
64 TCGCallArgumentLoc in
[MAX_CALL_IARGS
* (128 / TCG_TARGET_REG_BITS
)];
67 #endif /* TCG_HELPER_INFO_H */