i965: Enable emitting Q and UQ instructions in the fs backend
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 1 Sep 2016 19:00:10 +0000 (12:00 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 20 Jan 2017 23:41:23 +0000 (15:41 -0800)
v2: Fixup assertion in brw_reg_type_to_hw_type to allow
BRW_REGISTER_TYPE_{UQ,Q} on Gen8+.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_inst.h

index 8d08d1856ab6fe6d16050d48124c81e6cf085137..4b557d98b48a63876044bfadb7e8b49f272e0ec8 100644 (file)
@@ -144,7 +144,7 @@ brw_reg_type_to_hw_type(const struct gen_device_info *devinfo,
       assert(type < ARRAY_SIZE(hw_types));
       assert(hw_types[type] != -1);
       assert(devinfo->gen >= 7 || type < BRW_REGISTER_TYPE_DF);
-      assert(devinfo->gen >= 8 || type < BRW_REGISTER_TYPE_HF);
+      assert(devinfo->gen >= 8 || type < BRW_REGISTER_TYPE_Q);
       return hw_types[type];
    }
 }
@@ -411,6 +411,9 @@ brw_set_src0(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg)
       if (reg.type == BRW_REGISTER_TYPE_DF ||
           brw_inst_opcode(devinfo, inst) == BRW_OPCODE_DIM)
          brw_inst_set_imm_df(devinfo, inst, reg.df);
+      else if (reg.type == BRW_REGISTER_TYPE_UQ ||
+               reg.type == BRW_REGISTER_TYPE_Q)
+         brw_inst_set_imm_uq(devinfo, inst, reg.u64);
       else
          brw_inst_set_imm_ud(devinfo, inst, reg.ud);
 
index d98bbf538a82ffd0bf2f9ecc5a19d8f32928f288..13fce97e5398436c3493949ae94338144a84f3d1 100644 (file)
@@ -627,6 +627,14 @@ brw_inst_set_imm_df(const struct gen_device_info *devinfo,
    brw_inst_set_bits(insn, 127, 64, dt.u);
 }
 
+static inline void
+brw_inst_set_imm_uq(const struct gen_device_info *devinfo,
+                    brw_inst *insn, uint64_t value)
+{
+   (void) devinfo;
+   brw_inst_set_bits(insn, 127, 64, value);
+}
+
 /** @} */
 
 /* The AddrImm fields are split into two discontiguous sections on Gen8+ */