intel/tools: Handle STATE_REG in typed source operand
authorSagar Ghuge <sagar.ghuge@intel.com>
Wed, 5 Feb 2020 00:38:44 +0000 (16:38 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 25 Feb 2020 22:23:38 +0000 (22:23 +0000)
Also stop using brw_sr0_reg function as it return new brw_reg, we
already created register, all we have to is just set file, register
number and subnr.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>

src/intel/tools/i965_gram.y

index 0ac6d50c16a26adfb497ff2b80fcb398cc81d17a..82b3d2f5119047797ad786ea0583be691f07c19d 100644 (file)
@@ -1658,6 +1658,7 @@ srcarcoperandex_ud_typed:
 srcarcoperandex_typed:
        flagreg
        | maskreg
+       | statereg
        ;
 
 indirectsrcoperand:
@@ -1863,8 +1864,9 @@ statereg:
                        error(&@2, "State sub register number %d"
                                   " out of range\n", $2);
 
-               $$ = brw_sr0_reg($2);
-               $$.nr = $1;
+               $$.file = BRW_ARCHITECTURE_REGISTER_FILE;
+               $$.nr = BRW_ARF_STATE;
+               $$.subnr = $2;
        }
        ;