[Mesa-dev] [PATCH] intel/eu/validate: Look up types on demand in execution_type()

Emil Velikov emil.l.velikov at gmail.com
Wed Sep 13 18:36:45 UTC 2017


Hi all,

On 31 August 2017 at 23:48, Jason Ekstrand <jason at jlekstrand.net> wrote:
> We are looking up the execution type prior to checking how many sources
> we have.  This leads to looking for a type for src1 on MOV instructions
> which is bogus.  On BDW+, the src1 register type overlaps with the
> 64-bit immediate and causes us problems.
> ---
>  src/intel/compiler/brw_eu_validate.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
> index 249342f..d72c0a0 100644
> --- a/src/intel/compiler/brw_eu_validate.c
> +++ b/src/intel/compiler/brw_eu_validate.c
> @@ -300,15 +300,13 @@ execution_type(const struct gen_device_info *devinfo, const brw_inst *inst)
>  {
>     unsigned num_sources = num_sources_from_inst(devinfo, inst);
>     enum brw_reg_type src0_exec_type, src1_exec_type;
> -   enum brw_reg_type src0_type = brw_inst_src0_type(devinfo, inst);
> -   enum brw_reg_type src1_type = brw_inst_src1_type(devinfo, inst);
>
>     /* Execution data type is independent of destination data type, except in
>      * mixed F/HF instructions on CHV and SKL+.
>      */
>     enum brw_reg_type dst_exec_type = brw_inst_dst_type(devinfo, inst);
>
> -   src0_exec_type = execution_type_for_type(src0_type);
> +   src0_exec_type = execution_type_for_type(brw_inst_src0_type(devinfo, inst));
>     if (num_sources == 1) {
>        if ((devinfo->gen >= 9 || devinfo->is_cherryview) &&
>            src0_exec_type == BRW_REGISTER_TYPE_HF) {
> @@ -317,7 +315,7 @@ execution_type(const struct gen_device_info *devinfo, const brw_inst *inst)
>        return src0_exec_type;
>     }
>
> -   src1_exec_type = execution_type_for_type(src1_type);
> +   src1_exec_type = execution_type_for_type(brw_inst_src1_type(devinfo, inst));

As Andres pointed out this commit depends on 4fab67a4415 et al, which
seems to be missing in 17.1 and 17.2.

I've ported this to 17.2 by moving the brw_inst_src[01]_reg_type()
calls as in the original patch.
The brw_inst_src[01]_reg_file() ones are left as-is.

Let me know if extra porting is required.

Thanks
Emil


More information about the mesa-dev mailing list