third_party/mesa/src/src/mesa/drivers/dri/i965/brw_fs.cpp
/**
 * Returns how many MRFs an FS opcode will write over.
 *
 * Note that this is not the 0 or 1 implied writes in an actual gen
 * instruction -- the FS opcodes often generate MOVs in addition.
 */
Returns how many MRFs an FS opcode will write over.
Note that this is not the 0 or 1 implied writes in an actual gen
instruction -- the FS opcodes often generate MOVs in addition.
Returns how many MRFs an FS opcode will write over . Note that this is not the 0 or 1 implied writes in an actual gen instruction -- the FS opcodes often generate MOVs in addition .
int
fs_visitor::implied_mrf_writes(fs_inst *inst)
{
   if (inst->mlen == 0)
      return 0;
   switch (inst->opcode) {
   case SHADER_OPCODE_RCP:
   case SHADER_OPCODE_RSQ:
   case SHADER_OPCODE_SQRT:
   case SHADER_OPCODE_EXP2:
   case SHADER_OPCODE_LOG2:
   case SHADER_OPCODE_SIN:
   case SHADER_OPCODE_COS:
      return 1 * c->dispatch_width / 8;
   case SHADER_OPCODE_POW:
   case SHADER_OPCODE_INT_QUOTIENT:
   case SHADER_OPCODE_INT_REMAINDER:
      return 2 * c->dispatch_width / 8;
   case SHADER_OPCODE_TEX:
   case FS_OPCODE_TXB:
   case SHADER_OPCODE_TXD:
   case SHADER_OPCODE_TXF:
   case SHADER_OPCODE_TXL:
   case SHADER_OPCODE_TXS:
      return 1;
   case FS_OPCODE_FB_WRITE:
      return 2;
   case FS_OPCODE_PULL_CONSTANT_LOAD:
   case FS_OPCODE_UNSPILL:
      return 1;
   case FS_OPCODE_SPILL:
      return 2;
   default:
      assert(!"not reached");
      return inst->mlen;
   }
}
int fs_visitor :: implied_mrf_writes ( fs_inst * inst ) { if ( inst -> mlen == 0 ) return 0 ; switch ( inst -> opcode ) { case SHADER_OPCODE_RCP : case SHADER_OPCODE_RSQ : case SHADER_OPCODE_SQRT : case SHADER_OPCODE_EXP2 : case SHADER_OPCODE_LOG2 : case SHADER_OPCODE_SIN : case SHADER_OPCODE_COS : return 1 * c -> dispatch_width / 8 ; case SHADER_OPCODE_POW : case SHADER_OPCODE_INT_QUOTIENT : case SHADER_OPCODE_INT_REMAINDER : return 2 * c -> dispatch_width / 8 ; case SHADER_OPCODE_TEX : case FS_OPCODE_TXB : case SHADER_OPCODE_TXD : case SHADER_OPCODE_TXF : case SHADER_OPCODE_TXL : case SHADER_OPCODE_TXS : return 1 ; case FS_OPCODE_FB_WRITE : return 2 ; case FS_OPCODE_PULL_CONSTANT_LOAD : case FS_OPCODE_UNSPILL : return 1 ; case FS_OPCODE_SPILL : return 2 ; default : assert ( ! " " ) ; return inst -> mlen ; } }
Returns how many MRFs an FS opcode will write over.
Returns how many MRFs an FS opcode will write over .