[Mesa-dev] [PATCH 1/2] i965/emit: Add assertions for accumulator restrictions
Kenneth Graunke
kenneth at whitecape.org
Sat Sep 12 10:33:28 PDT 2015
On Thursday, September 10, 2015 04:24:50 PM Jason Ekstrand wrote:
> ---
> src/mesa/drivers/dri/i965/brw_eu_emit.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> index 637fd07..b2f7409 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 IBV PRM Vol. 4, Pt. 3, Section 3.3.3.5:
IVB
> + *
> + * Swizzling is not allowed when an accumulator is used as an implicit
> + * source or an explicit source in an instruction.
"" please
> + */
> + 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,13 @@ 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 IBV PRM Vol. 4, Pt. 3, Section 3.3.3.5:
IVB
> + *
> + * Accumulator registers may be accessed explicitly as src0 operands only.
> + */
"" please
> + 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);
>
>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150912/399f02f6/attachment.sig>
More information about the mesa-dev
mailing list