i965/vec4: Use UW type for multiply into accumulator on GEN8+
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 14 Jan 2016 20:08:57 +0000 (12:08 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 16 Jan 2016 00:44:02 +0000 (16:44 -0800)
BDW adds the following restriction: "When multiplying DW x DW, the dst
cannot be accumulator."

Cc: "11.1,11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index 0ae723f07e9b0cd2ab5c5a6cb2731f6a144c251b..4ee2ed47d40e8a68dca1a750e7e26f48adcb3db7 100644 (file)
@@ -1069,7 +1069,11 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
    case nir_op_umul_high: {
       struct brw_reg acc = retype(brw_acc_reg(8), dst.type);
 
-      emit(MUL(acc, op[0], op[1]));
+      if (devinfo->gen >=8)
+         emit(MUL(acc, op[0], retype(op[1], BRW_REGISTER_TYPE_UW)));
+      else
+         emit(MUL(acc, op[0], op[1]));
+
       emit(MACH(dst, op[0], op[1]));
       break;
    }