freedreno/afuc: Handle xmov modifiers
[mesa.git] / src / freedreno / afuc / asm.c
index a03a89a31fa33621a0a1bcf5ec88b3e933fcd34c..cb11439b9790c8bb6ce074843f3a49a64f12102a 100644 (file)
@@ -170,6 +170,10 @@ static void emit_instructions(int outfd)
                        if (ai->has_immed) {
                                /* MSB overlaps with STORE */
                                assert(ai->tok != T_OP_MSB);
+                               if (ai->xmov) {
+                                       fprintf(stderr, "ALU instruction cannot have immediate and xmov\n");
+                                       exit(1);
+                               }
                                opc = tok2alu(ai->tok);
                                instr.alui.dst = ai->dst;
                                instr.alui.src = ai->src1;
@@ -179,6 +183,7 @@ static void emit_instructions(int outfd)
                                instr.alu.dst  = ai->dst;
                                instr.alu.src1 = ai->src1;
                                instr.alu.src2 = ai->src2;
+                               instr.alu.xmov = ai->xmov;
                                instr.alu.alu = tok2alu(ai->tok);
                        }
                        break;
@@ -186,6 +191,10 @@ static void emit_instructions(int outfd)
                        /* move can either be encoded as movi (ie. move w/ immed) or
                         * an alu instruction
                         */
+                       if ((ai->has_immed || ai->label) && ai->xmov) {
+                               fprintf(stderr, "ALU instruction cannot have immediate and xmov\n");
+                               exit(1);
+                       }
                        if (ai->has_immed) {
                                opc = OPC_MOVI;
                                instr.movi.dst = ai->dst;
@@ -206,6 +215,7 @@ static void emit_instructions(int outfd)
                                instr.alu.dst  = ai->dst;
                                instr.alu.src1 = 0x00;      /* $00 reads-back 0 */
                                instr.alu.src2 = ai->src1;
+                               instr.alu.xmov = ai->xmov;
                                instr.alu.alu = OPC_OR;
                        }
                        break;