Esempio n. 1
0
static bool
skip_bit(const struct brw_context *brw, brw_inst *src, int bit)
{
   /* pad bit */
   if (bit == 7)
      return true;

   /* The compact bit -- uncompacted can't have it set. */
   if (bit == 29)
      return true;

   /* pad bit */
   if (bit == 47)
      return true;

   /* pad bits */
   if (bit >= 90 && bit <= 95)
      return true;

   /* sometimes these are pad bits. */
   if (brw_inst_opcode(brw, src) != BRW_OPCODE_SEND &&
       brw_inst_opcode(brw, src) != BRW_OPCODE_SENDC &&
       brw_inst_opcode(brw, src) != BRW_OPCODE_BREAK &&
       brw_inst_opcode(brw, src) != BRW_OPCODE_CONTINUE &&
       brw_inst_src0_reg_file(brw, src) != BRW_IMMEDIATE_VALUE &&
       brw_inst_src1_reg_file(brw, src) != BRW_IMMEDIATE_VALUE &&
       bit >= 121) {
      return true;
   }

   return false;
}
static bool
skip_bit(const struct gen_device_info *devinfo, brw_inst *src, int bit)
{
   /* pad bit */
   if (bit == 7)
      return true;

   /* The compact bit -- uncompacted can't have it set. */
   if (bit == 29)
      return true;

   if (is_3src(devinfo, (opcode)brw_inst_opcode(devinfo, src))) {
      if (devinfo->gen >= 9 || devinfo->is_cherryview) {
         if (bit == 127)
            return true;
      } else {
         if (bit >= 126 && bit <= 127)
            return true;

         if (bit == 105)
            return true;

         if (bit == 84)
            return true;

         if (bit >= 35 && bit <= 36)
            return true;
      }
   } else {
      if (bit == 47)
         return true;

      if (devinfo->gen >= 8) {
         if (bit == 11)
            return true;

         if (bit == 95)
            return true;
      } else {
         if (devinfo->gen < 7 && bit == 90)
            return true;

         if (bit >= 91 && bit <= 95)
            return true;
      }
   }

   /* sometimes these are pad bits. */
   if (brw_inst_opcode(devinfo, src) != BRW_OPCODE_SEND &&
       brw_inst_opcode(devinfo, src) != BRW_OPCODE_SENDC &&
       brw_inst_src0_reg_file(devinfo, src) != BRW_IMMEDIATE_VALUE &&
       brw_inst_src1_reg_file(devinfo, src) != BRW_IMMEDIATE_VALUE &&
       bit >= 121) {
      return true;
   }

   return false;
}
Esempio n. 3
0
/**
 * When doing fuzz testing, pad bits won't round-trip.
 *
 * This sort of a superset of skip_bit, which is testing for changing bits that
 * aren't worth testing for fuzzing.  We also just want to clear bits that
 * become meaningless once fuzzing twiddles a related bit.
 */
static void
clear_pad_bits(const struct brw_context *brw, brw_inst *inst)
{
   if (brw_inst_opcode(brw, inst) != BRW_OPCODE_SEND &&
       brw_inst_opcode(brw, inst) != BRW_OPCODE_SENDC &&
       brw_inst_opcode(brw, inst) != BRW_OPCODE_BREAK &&
       brw_inst_opcode(brw, inst) != BRW_OPCODE_CONTINUE &&
       brw_inst_src0_reg_file(brw, inst) != BRW_IMMEDIATE_VALUE &&
       brw_inst_src1_reg_file(brw, inst) != BRW_IMMEDIATE_VALUE) {
      brw_inst_set_bits(inst, 127, 111, 0);
   }
}
/**
 * When doing fuzz testing, pad bits won't round-trip.
 *
 * This sort of a superset of skip_bit, which is testing for changing bits that
 * aren't worth testing for fuzzing.  We also just want to clear bits that
 * become meaningless once fuzzing twiddles a related bit.
 */
static void
clear_pad_bits(const struct gen_device_info *devinfo, brw_inst *inst)
{
   if (brw_inst_opcode(devinfo, inst) != BRW_OPCODE_SEND &&
       brw_inst_opcode(devinfo, inst) != BRW_OPCODE_SENDC &&
       brw_inst_src0_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE &&
       brw_inst_src1_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE) {
      brw_inst_set_bits(inst, 127, 111, 0);
   }

   if (devinfo->gen == 8 && !devinfo->is_cherryview &&
       is_3src(devinfo, (opcode)brw_inst_opcode(devinfo, inst))) {
      brw_inst_set_bits(inst, 105, 105, 0);
      brw_inst_set_bits(inst, 84, 84, 0);
      brw_inst_set_bits(inst, 36, 35, 0);
   }
}
Esempio n. 5
0
static bool
src1_is_null(const struct brw_device_info *devinfo, const brw_inst *inst)
{
   return brw_inst_src1_reg_file(devinfo, inst) == BRW_ARCHITECTURE_REGISTER_FILE &&
          brw_inst_src1_da_reg_nr(devinfo, inst) == BRW_ARF_NULL;
}