intel/tools: Simplify dstregion
authorMatt Turner <mattst88@gmail.com>
Wed, 15 Jul 2020 23:32:37 +0000 (16:32 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 31 Jul 2020 19:59:24 +0000 (12:59 -0700)
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5956>

src/intel/tools/i965_gram.y

index bddf9781ed9c5f64827357df9bfc2877ec64501b..03ebc7e3e6da750ddf2ec9ebef8bf0983280279d 100644 (file)
@@ -1426,14 +1426,9 @@ dstoperand:
        dstreg dstregion writemask reg_type
        {
                $$ = $1;
-
-               if ($2 == -1) {
-                       $$.hstride = BRW_HORIZONTAL_STRIDE_1;
-                       $$.vstride = BRW_VERTICAL_STRIDE_1;
-                       $$.width = BRW_WIDTH_1;
-               } else {
-                       $$.hstride = $2;
-               }
+               $$.vstride = BRW_VERTICAL_STRIDE_1;
+               $$.width = BRW_WIDTH_1;
+               $$.hstride = $2;
                $$.type = $4;
                $$.writemask = $3;
                $$.swizzle = BRW_SWIZZLE_NOOP;
@@ -1457,13 +1452,9 @@ dstoperandex:
        | nullreg dstregion writemask reg_type
        {
                $$ = $1;
-               if ($2 == -1) {
-                       $$.hstride = BRW_HORIZONTAL_STRIDE_1;
-                       $$.vstride = BRW_VERTICAL_STRIDE_1;
-                       $$.width = BRW_WIDTH_1;
-               } else {
-                       $$.hstride = $2;
-               }
+               $$.vstride = BRW_VERTICAL_STRIDE_1;
+               $$.width = BRW_WIDTH_1;
+               $$.hstride = $2;
                $$.writemask = $3;
                $$.type = $4;
        }
@@ -1926,7 +1917,10 @@ immval:
 
 /* Regions */
 dstregion:
-       %empty  { $$ = -1; }
+       %empty
+       {
+               $$ = BRW_HORIZONTAL_STRIDE_1;
+       }
        | LANGLE exp RANGLE
        {
                if ($2 != 0 && ($2 > 4 || !isPowerofTwo($2)))