3-src instructions can only have GRF/MRF destinations. It's really difficult to deal with that restriction in dead code elimination (that wants to give instructions null destinations to show that their result isn't used) while allowing 3-src instructions to have conditional mod, so don't, and just give then a destination before register allocation. --- src/mesa/drivers/dri/i965/brw_fs.cpp | 14 ++++++++++++++ src/mesa/drivers/dri/i965/brw_fs.h | 1 + 2 files changed, 15 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 35639de..73d722e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -3605,6 +3605,18 @@ fs_visitor::optimize() } void +fs_visitor::fixup_3src_null_dest() +{ + foreach_block_and_inst_safe (block, fs_inst, inst, cfg) { + if (inst->is_3src() && inst->dst.is_null()) { + /* 3-src instructions can only have GRF/MRF destination. */ + inst->dst = fs_reg(GRF, virtual_grf_alloc(dispatch_width / 8), + inst->dst.type); + } + } +} + +void fs_visitor::allocate_registers() { bool allocated_without_spills; @@ -3701,6 +3713,7 @@ fs_visitor::run_vs() assign_curb_setup(); assign_vs_urb_setup(); + fixup_3src_null_dest(); allocate_registers(); return !failed; @@ -3780,6 +3793,7 @@ fs_visitor::run_fs() assign_curb_setup(); assign_urb_setup(); + fixup_3src_null_dest(); allocate_registers(); if (failed) diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 2aa58eb..9c125a6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -423,6 +423,7 @@ public: void setup_payload_gen4(); void setup_payload_gen6(); void setup_vs_payload(); + void fixup_3src_null_dest(); void assign_curb_setup(); void calculate_urb_setup(); void assign_urb_setup(); -- 2.0.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev