@samitouri / QOSamiQemu / commits / 58f43ca16c

target/hexagon: Implement siad inst

siad is the 'Set interrupt auto disable' instruction. 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 58f43ca16c4965cb95d15416bf542bf575b37b0f
1 file changed +16 -1
target/hexagon/op_helper.c
+16 -1
@@ -1436,7 +1436,22 @@ void HELPER(ciad)(CPUHexagonState *env, uint32_t mask)
1436
1437 void HELPER(siad)(CPUHexagonState *env, uint32_t mask)
1438 {
1439 - g_assert_not_reached();
1439 + uint32_t ipendad;
1440 + uint32_t iad;
1441 + HexagonCPU *cpu;
1442 +
1443 + BQL_LOCK_GUARD();
1444 + cpu = env_archcpu(env);
1445 + ipendad = cpu->globalregs ?
1446 + hexagon_globalreg_read(cpu->globalregs, HEX_SREG_IPENDAD,
1447 + env->threadId) : 0;
1448 + iad = fGET_FIELD(ipendad, IPENDAD_IAD);
1449 + fSET_FIELD(ipendad, IPENDAD_IAD, iad | mask);
1450 + if (cpu->globalregs) {
1451 + hexagon_globalreg_write(cpu->globalregs, HEX_SREG_IPENDAD,
1452 + ipendad, env->threadId);
1453 + }
1454 + hex_interrupt_update(env);
1455 }
1456
1457 void HELPER(swi)(CPUHexagonState *env, uint32_t mask)