assert(dest.hstride == BRW_HORIZONTAL_STRIDE_1);
if (devinfo->gen == 6) {
- assert(src0.hstride == BRW_HORIZONTAL_STRIDE_1);
- assert(src1.hstride == BRW_HORIZONTAL_STRIDE_1);
+ assert(has_scalar_region(src0) ||
+ src0.hstride == BRW_HORIZONTAL_STRIDE_1);
+ assert(has_scalar_region(src1) ||
+ src1.hstride == BRW_HORIZONTAL_STRIDE_1);
}
if (function == BRW_MATH_FUNCTION_INT_DIV_QUOTIENT ||
src_reg
fix_math_operand(const src_reg &src) const
{
- /* Can't do hstride == 0 args on gen6 math, so expand it out. We
- * might be able to do better by doing execsize = 1 math and then
- * expanding that result out, but we would need to be careful with
- * masking.
- *
- * Gen6 hardware ignores source modifiers (negate and abs) on math
+ /* Gen6 hardware ignores source modifiers (negate and abs) on math
* instructions, so we also move to a temp to set those up.
*
* Gen7 relaxes most of the above restrictions, but still can't use IMM
* operands to math
*/
if ((shader->devinfo->gen == 6 &&
- (src.file == IMM || src.file == UNIFORM ||
- src.abs || src.negate)) ||
+ (src.file == IMM || src.abs || src.negate)) ||
(shader->devinfo->gen == 7 && src.file == IMM)) {
const dst_reg tmp = vgrf(src.type);
MOV(tmp, src);
break;
/* fallthrough */
case SHADER_OPCODE_POW:
- /* Allow constant propagation into src1 (except on Gen 6), and let
- * constant combining promote the constant on Gen < 8.
- *
- * While Gen 6 MATH can take a scalar source, its source and
- * destination offsets must be equal and we cannot ensure that.
+ /* Allow constant propagation into src1, and let constant combining
+ * promote the constant on Gen < 8.
*/
- if (devinfo->gen == 6)
- break;
/* fallthrough */
case BRW_OPCODE_BFI1:
case BRW_OPCODE_ASR: