@samitouri / QOSamiQemu / commits / 1b244ef0f7

target/hexagon: Add TCG values for sreg, greg

Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

Brian Cain committed Jun 22, 2026 at 15:28 UTC 1b244ef0f76341159c665ba496d316960c051d55
2 files changed +21
target/hexagon/translate.c
+16
@@ -66,6 +66,8 @@ TCGv hex_vstore_size[VSTORES_MAX];
66 TCGv hex_vstore_pending[VSTORES_MAX];
67
68 #ifndef CONFIG_USER_ONLY
69 +TCGv_i32 hex_greg[NUM_GREGS];
70 +TCGv_i32 hex_t_sreg[NUM_SREGS];
71 TCGv_i32 hex_cause_code;
72 #endif
73
@@ -1084,6 +1086,20 @@ void hexagon_translate_init(void)
1086
1087 opcode_init();
1088
1089 +#ifndef CONFIG_USER_ONLY
1090 + for (i = 0; i < NUM_GREGS; i++) {
1091 + hex_greg[i] = tcg_global_mem_new_i32(tcg_env,
1092 + offsetof(CPUHexagonState, greg[i]),
1093 + hexagon_gregnames[i]);
1094 + }
1095 + for (i = 0; i < NUM_SREGS; i++) {
1096 + if (i < HEX_SREG_GLB_START) {
1097 + hex_t_sreg[i] = tcg_global_mem_new_i32(tcg_env,
1098 + offsetof(CPUHexagonState, t_sreg[i]),
1099 + hexagon_sregnames[i]);
1100 + }
1101 + }
1102 +#endif
1103 for (i = 0; i < TOTAL_PER_THREAD_REGS; i++) {
1104 hex_gpr[i] = tcg_global_mem_new(tcg_env,
1105 offsetof(CPUHexagonState, gpr[i]),
target/hexagon/translate.h
+5
@@ -282,6 +282,11 @@ extern TCGv_i64 hex_llsc_val_i64;
282 extern TCGv hex_vstore_addr[VSTORES_MAX];
283 extern TCGv hex_vstore_size[VSTORES_MAX];
284 extern TCGv hex_vstore_pending[VSTORES_MAX];
285 +#ifndef CONFIG_USER_ONLY
286 +extern TCGv_i32 hex_greg[NUM_GREGS];
287 +extern TCGv_i32 hex_t_sreg[NUM_SREGS];
288 +#endif
289 +
290
291 void hex_gen_exception_end_tb(DisasContext *ctx, int excp);
292