program: Remove OPCODE_KIL_NV.
authorMatt Turner <mattst88@gmail.com>
Sat, 27 Feb 2016 21:19:50 +0000 (13:19 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 1 Mar 2016 19:41:29 +0000 (11:41 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/i915/i915_fragprog.c
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/prog_execute.c
src/mesa/program/prog_instruction.c
src/mesa/program/prog_instruction.h
src/mesa/program/prog_print.c
src/mesa/program/program_parse.y
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 59d795998c62ee97e8e43c7ee18a7937b5d5dd20..691bae359fb552d15ffa039c2bdb94c7631a474f 100644 (file)
@@ -598,26 +598,6 @@ upload_program(struct i915_fragment_program *p)
                          0, src0, T0_TEXKILL);
          break;
 
-      case OPCODE_KIL_NV:
-        if (inst->DstReg.CondMask == COND_TR) {
-           tmp = i915_get_utemp(p);
-
-           /* The KIL instruction discards the fragment if any component of
-            * the source is < 0.  Emit an immediate operand of {-1}.xywz.
-            */
-           i915_emit_texld(p, get_live_regs(p, inst),
-                           tmp, A0_DEST_CHANNEL_ALL,
-                           0, /* use a dummy dest reg */
-                           negate(swizzle(tmp, ONE, ONE, ONE, ONE),
-                                  1, 1, 1, 1),
-                           T0_TEXKILL);
-        } else {
-           p->error = 1;
-           i915_program_error(p, "Unsupported KIL_NV condition code: %d",
-                              inst->DstReg.CondMask);
-        }
-        break;
-
       case OPCODE_LG2:
          src0 = src_vector(p, &inst->SrcReg[0], program);
 
index 6051df1546d8277b5b75204f2f1b6de5110603c6..c7ca3dc6cd6807997cbe64066dc69572d70e57a5 100644 (file)
@@ -2112,13 +2112,12 @@ ir_to_mesa_visitor::visit(ir_return *ir)
 void
 ir_to_mesa_visitor::visit(ir_discard *ir)
 {
-   if (ir->condition) {
-      ir->condition->accept(this);
-      this->result.negate = ~this->result.negate;
-      emit(ir, OPCODE_KIL, undef_dst, this->result);
-   } else {
-      emit(ir, OPCODE_KIL_NV);
-   }
+   if (!ir->condition)
+      ir->condition = new(mem_ctx) ir_constant(true);
+
+   ir->condition->accept(this);
+   this->result.negate = ~this->result.negate;
+   emit(ir, OPCODE_KIL, undef_dst, this->result);
 }
 
 void
index 2c52d0db5083c1e155ebe35212fb9691eda6ffbf..33f52fb25840e80afcca86b6874cd25b6790769e 100644 (file)
@@ -805,11 +805,6 @@ _mesa_execute_program(struct gl_context * ctx,
       case OPCODE_ENDIF:
          /* nothing */
          break;
-      case OPCODE_KIL_NV:      /* NV_f_p only (conditional) */
-         if (eval_condition(machine, inst)) {
-            return GL_FALSE;
-         }
-         break;
       case OPCODE_KIL:         /* ARB_f_p only */
          {
             GLfloat a[4];
index 21ef35337f65b994d220d4e571e06d033e7b2e6f..bba6c149e15d750fbad33de9562e55be6946a61b 100644 (file)
@@ -154,7 +154,6 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = {
    { OPCODE_FRC,    "FRC",     1, 1 },
    { OPCODE_IF,     "IF",      1, 0 },
    { OPCODE_KIL,    "KIL",     1, 0 },
-   { OPCODE_KIL_NV, "KIL_NV",  0, 0 },
    { OPCODE_LG2,    "LG2",     1, 1 },
    { OPCODE_LIT,    "LIT",     1, 1 },
    { OPCODE_LOG,    "LOG",     1, 1 },
index d839268d2d1489bf2de9e79278e6e151e589e6dc..b7ebe06057b7e5d25bee4850cce66ff0be309ad5 100644 (file)
@@ -166,7 +166,6 @@ enum prog_opcode {
    OPCODE_FRC,       /*   X        X       2       X         X   */
    OPCODE_IF,        /*                                     opt  */
    OPCODE_KIL,       /*            X                         X   */
-   OPCODE_KIL_NV,    /*                            X         X   */
    OPCODE_LG2,       /*   X        X       2       X         X   */
    OPCODE_LIT,       /*   X        X       X       X             */
    OPCODE_LOG,       /*   X                X                     */
index 2bc07cb82c6cc4148cefb5184812af845b0ec923..25684b2b8c500160c9f47e9200e0854f4e141c84 100644 (file)
@@ -706,16 +706,6 @@ _mesa_fprint_instruction_opt(FILE *f,
       fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
       fprint_comment(f, inst);
       break;
-   case OPCODE_KIL_NV:
-      fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
-      fprintf(f, " ");
-      fprintf(f, "%s.%s",
-             _mesa_condcode_string(inst->DstReg.CondMask),
-             _mesa_swizzle_string(inst->DstReg.CondSwizzle,
-                                  GL_FALSE, GL_FALSE));
-      fprint_comment(f, inst);
-      break;
-
    case OPCODE_ARL:
       fprintf(f, "ARL ");
       fprint_dst_reg(f, &inst->DstReg, mode, prog);
index 635f5d09d6016f2001b1f484bf22157a7369b0aa..40bb92be0975ec9e160fa7827209f951efadc494 100644 (file)
@@ -471,13 +471,6 @@ KIL_instruction: KIL swizzleSrcReg
           $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL);
           state->fragment.UsesKill = 1;
        }
-       | KIL ccTest
-       {
-          $$ = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL);
-          $$->Base.DstReg.CondMask = $2.CondMask;
-          $$->Base.DstReg.CondSwizzle = $2.CondSwizzle;
-          state->fragment.UsesKill = 1;
-       }
        ;
 
 TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget
index 62f0aee7a62ab94f65ed6622f59da6c5e0594f0d..dbee3d6018ce0d8a781e4aae0a650b2e8b949816 100644 (file)
@@ -526,9 +526,6 @@ translate_opcode( unsigned op )
       return TGSI_OPCODE_TRUNC;
    case OPCODE_KIL:
       return TGSI_OPCODE_KILL_IF;
-   case OPCODE_KIL_NV:
-      /* XXX we don't support condition codes in TGSI */
-      return TGSI_OPCODE_KILL;
    case OPCODE_LG2:
       return TGSI_OPCODE_LG2;
    case OPCODE_LOG: