@samitouri / QOSamiQemu / commits / 229f9cb03e

target/hexagon: Decode trap1, rte as COF

Also: handle rte instructions at the end of the packet. Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

Brian Cain committed Jun 22, 2026 at 15:28 UTC 229f9cb03e76340f3ae58fbc419f91acf2ebf23f
1 file changed +14
target/hexagon/decode.c
+14
@@ -185,6 +185,8 @@ static bool decode_opcode_can_jump(int opcode)
185 if ((GET_ATTRIB(opcode, A_JUMP)) ||
186 (GET_ATTRIB(opcode, A_CALL)) ||
187 (opcode == J2_trap0) ||
188 + (opcode == J2_trap1) ||
189 + (opcode == J2_rte) ||
190 (opcode == J2_pause)) {
191 /* Exception to A_JUMP attribute */
192 if (opcode == J4_hintjumpr) {
@@ -363,6 +365,18 @@ static void decode_shuffle_for_execution(Packet *packet)
365 break;
366 }
367 }
368 + /*
369 + * And at the very very very end, move any RTE's, since they update
370 + * user/supervisor mode.
371 + */
372 +#if !defined(CONFIG_USER_ONLY)
373 + for (i = 0; i < last_insn; i++) {
374 + if (packet->insn[i].opcode == J2_rte) {
375 + decode_send_insn_to(packet, i, last_insn);
376 + break;
377 + }
378 + }
379 +#endif
380 }
381
382 static void