intel/eu: Provide desc immediate argument up front to brw_send_indirect_message().
authorFrancisco Jerez <currojerez@riseup.net>
Sat, 2 Jun 2018 22:07:31 +0000 (15:07 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 10 Jul 2018 06:46:57 +0000 (23:46 -0700)
The current approach of returning a setup instruction where additional
descriptor fields can be specified is still supported in order to keep
things working, but it will be removed later in this series.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_eu.h
src/intel/compiler/brw_eu_emit.c
src/intel/compiler/brw_fs_generator.cpp
src/intel/compiler/brw_vec4_generator.cpp

index d69bc5526cdcfc4ea33310f259fabc94d010974d..d128108ff7e622dd1b92558411bfde72cbfc27f5 100644 (file)
@@ -324,7 +324,8 @@ brw_send_indirect_message(struct brw_codegen *p,
                           unsigned sfid,
                           struct brw_reg dst,
                           struct brw_reg payload,
-                          struct brw_reg desc);
+                          struct brw_reg desc,
+                          unsigned desc_imm);
 
 void brw_ff_sync(struct brw_codegen *p,
                   struct brw_reg dest,
index d580eddb957a018b8a021f1863431ad971e70d6c..18378b847a919ef990b3a4f2aac116839c6af620 100644 (file)
@@ -2527,7 +2527,8 @@ brw_send_indirect_message(struct brw_codegen *p,
                           unsigned sfid,
                           struct brw_reg dst,
                           struct brw_reg payload,
-                          struct brw_reg desc)
+                          struct brw_reg desc,
+                          unsigned desc_imm)
 {
    const struct gen_device_info *devinfo = p->devinfo;
    struct brw_inst *send;
@@ -2546,7 +2547,7 @@ brw_send_indirect_message(struct brw_codegen *p,
    if (desc.file == BRW_IMMEDIATE_VALUE) {
       setup = p->nr_insn;
       send = next_insn(p, BRW_OPCODE_SEND);
-      brw_set_src1(p, send, desc);
+      brw_set_desc(p, send, desc.ud | desc_imm);
 
    } else {
       struct brw_reg addr = retype(brw_address_reg(0), BRW_REGISTER_TYPE_UD);
@@ -2562,7 +2563,7 @@ brw_send_indirect_message(struct brw_codegen *p,
        * brw_set_*_message() helper functions.
        */
       setup = p->nr_insn;
-      brw_OR(p, addr, desc, brw_imm_ud(0));
+      brw_OR(p, addr, desc, brw_imm_ud(desc_imm));
 
       brw_pop_insn_state(p);
 
@@ -2615,7 +2616,7 @@ brw_send_indirect_surface_message(struct brw_codegen *p,
       surface = addr;
    }
 
-   insn = brw_send_indirect_message(p, sfid, dst, payload, surface);
+   insn = brw_send_indirect_message(p, sfid, dst, payload, surface, 0);
    brw_inst_set_mlen(devinfo, insn, message_len);
    brw_inst_set_rlen(devinfo, insn, response_len);
    brw_inst_set_header_present(devinfo, insn, header_present);
@@ -3373,7 +3374,7 @@ brw_pixel_interpolator_query(struct brw_codegen *p,
                                     GEN7_SFID_PIXEL_INTERPOLATOR,
                                     dest,
                                     mrf,
-                                    vec1(data));
+                                    vec1(data), 0);
    brw_inst_set_mlen(devinfo, insn, msg_length);
    brw_inst_set_rlen(devinfo, insn, response_length);
 
index bc670603e5e67877a4c2220501d93fd07a120e98..c685537fa5ea62a660a69127b2c32ec1ccf02d34 100644 (file)
@@ -1180,7 +1180,7 @@ fs_generator::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src
 
       /* dst = send(offset, a0.0 | <descriptor>) */
       brw_inst *insn = brw_send_indirect_message(
-         p, BRW_SFID_SAMPLER, dst, src, addr);
+         p, BRW_SFID_SAMPLER, dst, src, addr, 0);
       brw_set_sampler_message(p, insn,
                               0 /* surface */,
                               0 /* sampler */,
@@ -1449,7 +1449,7 @@ fs_generator::generate_uniform_pull_constant_load_gen7(fs_inst *inst,
       brw_inst *insn = brw_send_indirect_message(
          p, GEN6_SFID_DATAPORT_CONSTANT_CACHE,
          retype(dst, BRW_REGISTER_TYPE_UD),
-         retype(payload, BRW_REGISTER_TYPE_UD), addr);
+         retype(payload, BRW_REGISTER_TYPE_UD), addr, 0);
       brw_set_dp_read_message(p, insn, 0 /* surface */,
                               BRW_DATAPORT_OWORD_BLOCK_DWORDS(inst->exec_size),
                               GEN7_DATAPORT_DC_OWORD_BLOCK_READ,
@@ -1585,7 +1585,7 @@ fs_generator::generate_varying_pull_constant_load_gen7(fs_inst *inst,
       /* dst = send(offset, a0.0 | <descriptor>) */
       brw_inst *insn = brw_send_indirect_message(
          p, BRW_SFID_SAMPLER, retype(dst, BRW_REGISTER_TYPE_UW),
-         offset, addr);
+         offset, addr, 0);
       brw_set_sampler_message(p, insn,
                               0 /* surface */,
                               0 /* sampler */,
index 386b071cfdaec6262c895202e25b7077bcad914b..7605ccdc6c52e80d18b4da09b5997210ed712f14 100644 (file)
@@ -325,7 +325,7 @@ generate_tex(struct brw_codegen *p,
 
       /* dst = send(offset, a0.0 | <descriptor>) */
       brw_inst *insn = brw_send_indirect_message(
-         p, BRW_SFID_SAMPLER, dst, src, addr);
+         p, BRW_SFID_SAMPLER, dst, src, addr, 0);
       brw_set_sampler_message(p, insn,
                               0 /* surface */,
                               0 /* sampler */,
@@ -1393,7 +1393,7 @@ generate_pull_constant_load_gen7(struct brw_codegen *p,
 
       /* dst = send(offset, a0.0 | <descriptor>) */
       brw_inst *insn = brw_send_indirect_message(
-         p, BRW_SFID_SAMPLER, dst, offset, addr);
+         p, BRW_SFID_SAMPLER, dst, offset, addr, 0);
       brw_set_sampler_message(p, insn,
                               0 /* surface */,
                               0 /* sampler */,