On Wednesday, October 21, 2015 03:58:08 PM Matt Turner wrote:
> Inspired by a bug this summer, I've written a basic assembly validation
> pass. The series currently checks only three things:
> 
>    - that instruction sources are not null (when they shouldn't be);
>    - that the Gen supports the instruction opcode; and
>    - that the various accumulator restrictions are satisfied.
> 
> To do this, I add a bit of infrastructure to the annotation system, to
> allow errors to be printed.
> 
> In debug builds, an assertion checks that the assembly was validated.
> When using INTEL_DEBUG=<shader stage>, ERROR: ... will be emitted
> following a bad instruction, with a hopefully helpful message describing
> what's wrong. For example:
> 
>    mov(8)          g116<1>.xUD     null
>       ERROR: src0 is null
>    [...]
>    shader_runner: 
> ../../../../../../mesa/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp:1671: 
> void brw::vec4_generator::generate_code(const cfg_t*, const nir_shader*): 
> Assertion `validated' failed.
> 
> I'd like to extend the validator to cover many more cases, but that's
> no reason to hold back what I've already written -- checking for null 
> source would have saved three people a week or two after all.

[PATCH 1/9] ralloc: Set *start in ralloc_vasprintf_rewrite_tail() if str is 
NULL.

    Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

[PATCH 2/9] i965: Fill out instruction list.

    Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

[PATCH 3/9] i965: Don't consider control flow instructions to have sources.

    Reviewed-by: Iago Toral Quiroga <ito...@igalia.com>
    Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

[PATCH 4/9] i965: Set annotation_info's mem_ctx.

    Reviewed-by: Topi Pohjolainen <topi.pohjolai...@intel.com>

[PATCH 5/9] i965: Combine assembly annotations if possible.

    With a fix,
    Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

[PATCH 6/9] i965: Add annotation_insert_error() and support for printing errors.

    I would like to see a v2.

[PATCH 7/9] i965: Add initial assembly validation pass.

    I sent suggestions, but gave a
    Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

[PATCH 8/9] i965: Check instructions appear only on supported hardware.

    Tiny comment.  Either way,
    Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

[PATCH 9/9] i965: Check accumulator restrictions.

    Sent feedback.  Probably best to see a v2.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to