i965/fs: Set default access mode to Align1 for all instructions in the generator.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 19 May 2016 01:41:28 +0000 (18:41 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 28 May 2016 06:19:22 +0000 (23:19 -0700)
Currently the generator code for most opcodes honours the default
access mode (which should typically be Align1 in the scalar back-end),
but generate_code() doesn't set it explicitly which means that the
access mode from a previous instruction could leak into the following
ones if you did something special and weren't careful enough to save
and restore the previous access mode.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp

index 9d1589cca7b18b2fea6b01f421d7e624cab27b65..a3cb4c0cc1d9dc577d9444da7e20d9f146c786a2 100644 (file)
@@ -1697,6 +1697,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
       }
       dst = brw_reg_from_fs_reg(p, inst, &inst->dst, devinfo->gen);
 
+      brw_set_default_access_mode(p, BRW_ALIGN_1);
       brw_set_default_predicate_control(p, inst->predicate);
       brw_set_default_predicate_inverse(p, inst->predicate_inverse);
       brw_set_default_flag_reg(p, 0, inst->flag_subreg);