diff options
author | Jason Ekstrand <[email protected]> | 2015-09-10 16:19:22 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-09-12 10:46:26 -0700 |
commit | dd7290cf59206c49f1a322d53baa9957b13d2949 (patch) | |
tree | 0df512785dbf9a213c5330e3e305a37004f966a4 /src/mesa/drivers | |
parent | 7852a44e3c460d26ebcd2a9ee66309cfa8c68001 (diff) |
i965/emit: Add assertions for accumulator restrictions
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_eu_emit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 637fd074ff1..0432efa7175 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -235,6 +235,15 @@ validate_reg(const struct brw_device_info *devinfo, reg.file == BRW_ARF_NULL) return; + /* From the IVB PRM Vol. 4, Pt. 3, Section 3.3.3.5: + * + * "Swizzling is not allowed when an accumulator is used as an implicit + * source or an explicit source in an instruction." + */ + if (reg.file == BRW_ARCHITECTURE_REGISTER_FILE && + reg.nr == BRW_ARF_ACCUMULATOR) + assert(reg.dw1.bits.swizzle == BRW_SWIZZLE_XYZW); + assert(reg.hstride >= 0 && reg.hstride < ARRAY_SIZE(hstride_for_reg)); hstride = hstride_for_reg[reg.hstride]; @@ -443,6 +452,14 @@ brw_set_src1(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg) if (reg.file != BRW_ARCHITECTURE_REGISTER_FILE) assert(reg.nr < 128); + /* From the IVB PRM Vol. 4, Pt. 3, Section 3.3.3.5: + * + * "Accumulator registers may be accessed explicitly as src0 + * operands only." + */ + assert(reg.file != BRW_ARCHITECTURE_REGISTER_FILE || + reg.nr != BRW_ARF_ACCUMULATOR); + gen7_convert_mrf_to_grf(p, ®); assert(reg.file != BRW_MESSAGE_REGISTER_FILE); |