[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 51/73] tcg: Constify tcg_op_defs
From: |
Richard Henderson |
Subject: |
[PATCH 51/73] tcg: Constify tcg_op_defs |
Date: |
Thu, 2 Jan 2025 10:06:31 -0800 |
Now that we're no longer assigning to TCGOpDef.args_ct,
we can make the array constant.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 2 +-
tcg/tcg-common.c | 2 +-
tcg/tcg.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 412d6d119c..b5ef89a6a9 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -712,7 +712,7 @@ typedef struct TCGOpDef {
uint8_t flags;
} TCGOpDef;
-extern TCGOpDef tcg_op_defs[];
+extern const TCGOpDef tcg_op_defs[];
extern const size_t tcg_op_defs_max;
bool tcg_op_supported(TCGOpcode op, TCGType type);
diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
index 0f30e5b3ec..e98b3e5fdd 100644
--- a/tcg/tcg-common.c
+++ b/tcg/tcg-common.c
@@ -26,7 +26,7 @@
#include "tcg/tcg.h"
#include "tcg-has.h"
-TCGOpDef tcg_op_defs[] = {
+const TCGOpDef tcg_op_defs[] = {
#define DEF(s, oargs, iargs, cargs, flags) \
{ #s, oargs, iargs, cargs, iargs + oargs + cargs, flags },
#include "tcg/tcg-opc.h"
diff --git a/tcg/tcg.c b/tcg/tcg.c
index b8be62934c..7871e349d4 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -3324,7 +3324,7 @@ static void process_op_defs(TCGContext *s)
}
for (TCGOpcode op = 0; op < NB_OPS; op++) {
- TCGOpDef *def = &tcg_op_defs[op];
+ const TCGOpDef *def = &tcg_op_defs[op];
const TCGConstraintSet *tdefs;
unsigned con_set;
int nb_args;
@@ -3355,7 +3355,7 @@ static void process_op_defs(TCGContext *s)
static const TCGArgConstraint *opcode_args_ct(const TCGOp *op)
{
- TCGOpDef *def = &tcg_op_defs[op->opc];
+ const TCGOpDef *def = &tcg_op_defs[op->opc];
unsigned con_set;
if (def->nb_iargs + def->nb_oargs == 0) {
--
2.43.0
- [PATCH 54/73] tcg: Pass TCGOp to tcg_target_op_def, (continued)
- [PATCH 54/73] tcg: Pass TCGOp to tcg_target_op_def, Richard Henderson, 2025/01/02
- [PATCH 68/73] tcg: Merge integer shift operations, Richard Henderson, 2025/01/02
- [PATCH 70/73] tcg: Merge extract2 operations, Richard Henderson, 2025/01/02
- [PATCH 44/73] tcg: Remove TCG_TARGET_HAS_{s}extract_{i32,i64}, Richard Henderson, 2025/01/02
- [PATCH 53/73] tcg: Use C_NotImplemented in tcg_target_op_def, Richard Henderson, 2025/01/02
- [PATCH 43/73] tcg/tci: Remove assertions for deposit and extract, Richard Henderson, 2025/01/02
- [PATCH 66/73] tcg: Merge brcond, setcond, negsetcond, movcond operations, Richard Henderson, 2025/01/02
- [PATCH 45/73] tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64}, Richard Henderson, 2025/01/02
- [PATCH 46/73] tcg: Merge TCG_TARGET_HAS_extract2_{i32,i64}, Richard Henderson, 2025/01/02
- [PATCH 51/73] tcg: Constify tcg_op_defs,
Richard Henderson <=
- [PATCH 56/73] tcg: Remove INDEX_op_qemu_st8_*_i32, Richard Henderson, 2025/01/02
- [PATCH 60/73] tcg: Change have_vec to has_type in tcg_op_supported, Richard Henderson, 2025/01/02
- [PATCH 64/73] tcg: Merge integer add2, sub2 operations, Richard Henderson, 2025/01/02
- [PATCH 62/73] tcg: Merge integer logical operations, Richard Henderson, 2025/01/02
- [PATCH 71/73] tcg: Merge host integer load/store operations, Richard Henderson, 2025/01/02
- [PATCH 49/73] tcg: Reorg process_op_defs, Richard Henderson, 2025/01/02
- [PATCH 73/73] tcg: Merge clz, ctz, ctpop operations, Richard Henderson, 2025/01/02
- [PATCH 61/73] tcg: Merge INDEX_op_mov_{i32,i64}, Richard Henderson, 2025/01/02