Module: Mesa
Branch: master
Commit: db9675f5a4c68e39bb777eb7003f01854fd235dc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=db9675f5a4c68e39bb777eb7003f01854fd235dc

Author: Jason Ekstrand <[email protected]>
Date:   Tue May 29 15:28:36 2018 -0700

intel/eu: Set flag [sub]register number differently for 3src

Prior to gen8, the flag [sub]register number is in a different spot on
3src instructions than on other instructions.  Starting with Broadwell,
they made it consistent.  This commit fixes bugs that occur when a
conditional modifier gets propagated into a 3src instruction such as a
MAD.

Cc: [email protected]
Reviewed-by: Kenneth Graunke <[email protected]>

---

 src/intel/compiler/brw_eu_emit.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c
index a660d9eaaa..412a051bc9 100644
--- a/src/intel/compiler/brw_eu_emit.c
+++ b/src/intel/compiler/brw_eu_emit.c
@@ -701,9 +701,16 @@ brw_inst_set_state(const struct gen_device_info *devinfo,
    brw_inst_set_pred_control(devinfo, insn, state->predicate);
    brw_inst_set_pred_inv(devinfo, insn, state->pred_inv);
 
-   brw_inst_set_flag_subreg_nr(devinfo, insn, state->flag_subreg % 2);
-   if (devinfo->gen >= 7)
-      brw_inst_set_flag_reg_nr(devinfo, insn, state->flag_subreg / 2);
+   if (is_3src(devinfo, brw_inst_opcode(devinfo, insn)) &&
+       state->access_mode == BRW_ALIGN_16) {
+      brw_inst_set_3src_a16_flag_subreg_nr(devinfo, insn, state->flag_subreg % 
2);
+      if (devinfo->gen >= 7)
+         brw_inst_set_3src_a16_flag_reg_nr(devinfo, insn, state->flag_subreg / 
2);
+   } else {
+      brw_inst_set_flag_subreg_nr(devinfo, insn, state->flag_subreg % 2);
+      if (devinfo->gen >= 7)
+         brw_inst_set_flag_reg_nr(devinfo, insn, state->flag_subreg / 2);
+   }
 
    if (devinfo->gen >= 6)
       brw_inst_set_acc_wr_control(devinfo, insn, state->acc_wr_control);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to