On Wed, Mar 4, 2015 at 9:33 AM, Neil Roberts <n...@linux.intel.com> wrote: > Stepping C0 of Skylake fails when using SIMD16 with 3-source > instructions (such as MAD). This patch just makes it disable SIMD16 in > that case. > > This implements WaDisableSIMD16On3SrcInstr and fixes ~190 Piglit > tests.
Just curious -- is this faster than lowering MAD into MUL + ADD but staying in SIMD16? (Should be fairly easy to implement as a post-RA fixup I'd think, although not totally familiar with how the i965 compiler works.) -ilia > --- > src/mesa/drivers/dri/i965/brw_fs.cpp | 21 +++++++++++++++++++++ > src/mesa/drivers/dri/i965/brw_fs.h | 1 + > 2 files changed, 22 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp > b/src/mesa/drivers/dri/i965/brw_fs.cpp > index 533feb4..62f29e5 100644 > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp > @@ -3729,6 +3729,26 @@ fs_visitor::fixup_3src_null_dest() > } > } > > +/** > + * 3-source instructions don't work on Skylake stepping C0. If the revision > + * isn't known then it will take the safe option and disable it in case it's > + * C0. Implements WaDisableSIMD16On3SrcInstr. > + */ > +void > +fs_visitor::disable_simd16_with_3src() > +{ > + if (brw->gen != 9 || (brw->revision != 2 && brw->revision != -1)) > + return; > + > + foreach_block_and_inst_safe (block, fs_inst, inst, cfg) { > + if (inst->is_3src()) { > + no16("SIMD16 doesn't work with 3-source instructions on " > + "Gen9 stepping C0\n"); > + return; > + } > + } > +} > + > void > fs_visitor::allocate_registers() > { > @@ -3910,6 +3930,7 @@ fs_visitor::run_fs() > assign_urb_setup(); > > fixup_3src_null_dest(); > + disable_simd16_with_3src(); > 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 70098d8..7091b9f 100644 > --- a/src/mesa/drivers/dri/i965/brw_fs.h > +++ b/src/mesa/drivers/dri/i965/brw_fs.h > @@ -196,6 +196,7 @@ public: > void setup_payload_gen6(); > void setup_vs_payload(); > void fixup_3src_null_dest(); > + void disable_simd16_with_3src(); > void assign_curb_setup(); > void calculate_urb_setup(); > void assign_urb_setup(); > -- > 1.9.3 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev