freedreno/afuc: Handle setsecure opcode
[mesa.git] / src / freedreno / afuc / asm.c
index 56036be46f68794d0cc25aeb8197c61c233a8844..896a8555cf3d49f875cc7354cff1297acf8e1479 100644 (file)
@@ -262,6 +262,17 @@ static void emit_instructions(int outfd)
                        opc = OPC_PREEMPTLEAVE6;
                        instr.call.uoff = resolve_label(ai->label);
                        break;
+               case T_OP_SETSECURE:
+                       opc = OPC_SETSECURE;
+                       if (resolve_label(ai->label) != i + 3) {
+                               fprintf(stderr, "jump label %s is incorrect for setsecure\n", ai->label);
+                               exit(1);
+                       }
+                       if (ai->src1 != 0x2) {
+                               fprintf(stderr, "source for setsecure must be $02\n");
+                               exit(1);
+                       }
+                       break;
                case T_OP_JUMP:
                        /* encode jump as: brne $00, b0, #label */
                        opc = OPC_BRNEB;