]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/hexagon: Decode trap1, rte as COF
authorBrian Cain <bcain@quicinc.com>
Mon, 22 Jun 2026 22:28:44 +0000 (15:28 -0700)
committerBrian Cain <brian.cain@oss.qualcomm.com>
Mon, 29 Jun 2026 13:03:00 +0000 (06:03 -0700)
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>
target/hexagon/decode.c

index 15954518b8313f4245bb5a93f5d01b62e6f570e2..6eddcca26ed11743bf56a712c7c9d97972611c0f 100644 (file)
@@ -185,6 +185,8 @@ static bool decode_opcode_can_jump(int opcode)
     if ((GET_ATTRIB(opcode, A_JUMP)) ||
         (GET_ATTRIB(opcode, A_CALL)) ||
         (opcode == J2_trap0) ||
+        (opcode == J2_trap1) ||
+        (opcode == J2_rte) ||
         (opcode == J2_pause)) {
         /* Exception to A_JUMP attribute */
         if (opcode == J4_hintjumpr) {
@@ -363,6 +365,18 @@ static void decode_shuffle_for_execution(Packet *packet)
             break;
         }
     }
+    /*
+     * And at the very very very end, move any RTE's, since they update
+     * user/supervisor mode.
+     */
+#if !defined(CONFIG_USER_ONLY)
+    for (i = 0; i < last_insn; i++) {
+        if (packet->insn[i].opcode == J2_rte) {
+            decode_send_insn_to(packet, i, last_insn);
+            break;
+        }
+    }
+#endif
 }
 
 static void