Home | History | Annotate | Download | only in genxml
      1 /*
      2  * Copyright  2017 Intel Corporation
      3  *
      4  * Permission is hereby granted, free of charge, to any person obtaining a
      5  * copy of this software and associated documentation files (the "Software"),
      6  * to deal in the Software without restriction, including without limitation
      7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      8  * and/or sell copies of the Software, and to permit persons to whom the
      9  * Software is furnished to do so, subject to the following conditions:
     10  *
     11  * The above copyright notice and this permission notice (including the next
     12  * paragraph) shall be included in all copies or substantial portions of the
     13  * Software.
     14  *
     15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     21  * IN THE SOFTWARE.
     22  */
     23 
     24 /* THIS FILE HAS BEEN GENERATED, DO NOT HAND EDIT.
     25  *
     26  * Sizes of bitfields in genxml instructions, structures, and registers.
     27  */
     28 
     29 #ifndef GENX_BITS_H
     30 #define GENX_BITS_H
     31 
     32 #include <stdint.h>
     33 
     34 #include "common/gen_device_info.h"
     35 #include "util/macros.h"
     36 
     37 
     38 
     39 #ifdef __cplusplus
     40 extern "C" {
     41 #endif
     42 
     43 /* 3DPRIMITIVE */
     44 
     45 
     46 #define GEN10_3DPRIMITIVE_length  7
     47 #define GEN9_3DPRIMITIVE_length  7
     48 #define GEN8_3DPRIMITIVE_length  7
     49 #define GEN75_3DPRIMITIVE_length  7
     50 #define GEN7_3DPRIMITIVE_length  7
     51 #define GEN6_3DPRIMITIVE_length  6
     52 #define GEN5_3DPRIMITIVE_length  6
     53 #define GEN45_3DPRIMITIVE_length  6
     54 #define GEN4_3DPRIMITIVE_length  6
     55 
     56 static inline uint32_t ATTRIBUTE_PURE
     57 _3DPRIMITIVE_length(const struct gen_device_info *devinfo)
     58 {
     59    switch (devinfo->gen) {
     60    case 10: return 7;
     61    case 9: return 7;
     62    case 8: return 7;
     63    case 7:
     64       if (devinfo->is_haswell) {
     65          return 7;
     66       } else {
     67          return 7;
     68       }
     69    case 6: return 6;
     70    case 5: return 6;
     71    case 4:
     72       if (devinfo->is_g4x) {
     73          return 6;
     74       } else {
     75          return 6;
     76       }
     77    default:
     78       unreachable("Invalid hardware generation");
     79    }
     80 }
     81 
     82 
     83 
     84 /* 3DPRIMITIVE::3D Command Opcode */
     85 
     86 
     87 #define GEN10_3DPRIMITIVE_3DCommandOpcode_bits  3
     88 #define GEN9_3DPRIMITIVE_3DCommandOpcode_bits  3
     89 #define GEN8_3DPRIMITIVE_3DCommandOpcode_bits  3
     90 #define GEN75_3DPRIMITIVE_3DCommandOpcode_bits  3
     91 #define GEN7_3DPRIMITIVE_3DCommandOpcode_bits  3
     92 #define GEN6_3DPRIMITIVE_3DCommandOpcode_bits  3
     93 #define GEN5_3DPRIMITIVE_3DCommandOpcode_bits  3
     94 #define GEN45_3DPRIMITIVE_3DCommandOpcode_bits  3
     95 #define GEN4_3DPRIMITIVE_3DCommandOpcode_bits  3
     96 
     97 static inline uint32_t ATTRIBUTE_PURE
     98 _3DPRIMITIVE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
     99 {
    100    switch (devinfo->gen) {
    101    case 10: return 3;
    102    case 9: return 3;
    103    case 8: return 3;
    104    case 7:
    105       if (devinfo->is_haswell) {
    106          return 3;
    107       } else {
    108          return 3;
    109       }
    110    case 6: return 3;
    111    case 5: return 3;
    112    case 4:
    113       if (devinfo->is_g4x) {
    114          return 3;
    115       } else {
    116          return 3;
    117       }
    118    default:
    119       unreachable("Invalid hardware generation");
    120    }
    121 }
    122 
    123 
    124 
    125 #define GEN10_3DPRIMITIVE_3DCommandOpcode_start  24
    126 #define GEN9_3DPRIMITIVE_3DCommandOpcode_start  24
    127 #define GEN8_3DPRIMITIVE_3DCommandOpcode_start  24
    128 #define GEN75_3DPRIMITIVE_3DCommandOpcode_start  24
    129 #define GEN7_3DPRIMITIVE_3DCommandOpcode_start  24
    130 #define GEN6_3DPRIMITIVE_3DCommandOpcode_start  24
    131 #define GEN5_3DPRIMITIVE_3DCommandOpcode_start  24
    132 #define GEN45_3DPRIMITIVE_3DCommandOpcode_start  24
    133 #define GEN4_3DPRIMITIVE_3DCommandOpcode_start  24
    134 
    135 static inline uint32_t ATTRIBUTE_PURE
    136 _3DPRIMITIVE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
    137 {
    138    switch (devinfo->gen) {
    139    case 10: return 24;
    140    case 9: return 24;
    141    case 8: return 24;
    142    case 7:
    143       if (devinfo->is_haswell) {
    144          return 24;
    145       } else {
    146          return 24;
    147       }
    148    case 6: return 24;
    149    case 5: return 24;
    150    case 4:
    151       if (devinfo->is_g4x) {
    152          return 24;
    153       } else {
    154          return 24;
    155       }
    156    default:
    157       unreachable("Invalid hardware generation");
    158    }
    159 }
    160 
    161 
    162 
    163 /* 3DPRIMITIVE::3D Command Sub Opcode */
    164 
    165 
    166 #define GEN10_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    167 #define GEN9_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    168 #define GEN8_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    169 #define GEN75_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    170 #define GEN7_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    171 #define GEN6_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    172 #define GEN5_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    173 #define GEN45_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    174 #define GEN4_3DPRIMITIVE_3DCommandSubOpcode_bits  8
    175 
    176 static inline uint32_t ATTRIBUTE_PURE
    177 _3DPRIMITIVE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
    178 {
    179    switch (devinfo->gen) {
    180    case 10: return 8;
    181    case 9: return 8;
    182    case 8: return 8;
    183    case 7:
    184       if (devinfo->is_haswell) {
    185          return 8;
    186       } else {
    187          return 8;
    188       }
    189    case 6: return 8;
    190    case 5: return 8;
    191    case 4:
    192       if (devinfo->is_g4x) {
    193          return 8;
    194       } else {
    195          return 8;
    196       }
    197    default:
    198       unreachable("Invalid hardware generation");
    199    }
    200 }
    201 
    202 
    203 
    204 #define GEN10_3DPRIMITIVE_3DCommandSubOpcode_start  16
    205 #define GEN9_3DPRIMITIVE_3DCommandSubOpcode_start  16
    206 #define GEN8_3DPRIMITIVE_3DCommandSubOpcode_start  16
    207 #define GEN75_3DPRIMITIVE_3DCommandSubOpcode_start  16
    208 #define GEN7_3DPRIMITIVE_3DCommandSubOpcode_start  16
    209 #define GEN6_3DPRIMITIVE_3DCommandSubOpcode_start  16
    210 #define GEN5_3DPRIMITIVE_3DCommandSubOpcode_start  16
    211 #define GEN45_3DPRIMITIVE_3DCommandSubOpcode_start  16
    212 #define GEN4_3DPRIMITIVE_3DCommandSubOpcode_start  16
    213 
    214 static inline uint32_t ATTRIBUTE_PURE
    215 _3DPRIMITIVE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
    216 {
    217    switch (devinfo->gen) {
    218    case 10: return 16;
    219    case 9: return 16;
    220    case 8: return 16;
    221    case 7:
    222       if (devinfo->is_haswell) {
    223          return 16;
    224       } else {
    225          return 16;
    226       }
    227    case 6: return 16;
    228    case 5: return 16;
    229    case 4:
    230       if (devinfo->is_g4x) {
    231          return 16;
    232       } else {
    233          return 16;
    234       }
    235    default:
    236       unreachable("Invalid hardware generation");
    237    }
    238 }
    239 
    240 
    241 
    242 /* 3DPRIMITIVE::Base Vertex Location */
    243 
    244 
    245 #define GEN10_3DPRIMITIVE_BaseVertexLocation_bits  32
    246 #define GEN9_3DPRIMITIVE_BaseVertexLocation_bits  32
    247 #define GEN8_3DPRIMITIVE_BaseVertexLocation_bits  32
    248 #define GEN75_3DPRIMITIVE_BaseVertexLocation_bits  32
    249 #define GEN7_3DPRIMITIVE_BaseVertexLocation_bits  32
    250 #define GEN6_3DPRIMITIVE_BaseVertexLocation_bits  32
    251 #define GEN5_3DPRIMITIVE_BaseVertexLocation_bits  32
    252 #define GEN45_3DPRIMITIVE_BaseVertexLocation_bits  32
    253 #define GEN4_3DPRIMITIVE_BaseVertexLocation_bits  32
    254 
    255 static inline uint32_t ATTRIBUTE_PURE
    256 _3DPRIMITIVE_BaseVertexLocation_bits(const struct gen_device_info *devinfo)
    257 {
    258    switch (devinfo->gen) {
    259    case 10: return 32;
    260    case 9: return 32;
    261    case 8: return 32;
    262    case 7:
    263       if (devinfo->is_haswell) {
    264          return 32;
    265       } else {
    266          return 32;
    267       }
    268    case 6: return 32;
    269    case 5: return 32;
    270    case 4:
    271       if (devinfo->is_g4x) {
    272          return 32;
    273       } else {
    274          return 32;
    275       }
    276    default:
    277       unreachable("Invalid hardware generation");
    278    }
    279 }
    280 
    281 
    282 
    283 #define GEN10_3DPRIMITIVE_BaseVertexLocation_start  192
    284 #define GEN9_3DPRIMITIVE_BaseVertexLocation_start  192
    285 #define GEN8_3DPRIMITIVE_BaseVertexLocation_start  192
    286 #define GEN75_3DPRIMITIVE_BaseVertexLocation_start  192
    287 #define GEN7_3DPRIMITIVE_BaseVertexLocation_start  192
    288 #define GEN6_3DPRIMITIVE_BaseVertexLocation_start  160
    289 #define GEN5_3DPRIMITIVE_BaseVertexLocation_start  160
    290 #define GEN45_3DPRIMITIVE_BaseVertexLocation_start  160
    291 #define GEN4_3DPRIMITIVE_BaseVertexLocation_start  160
    292 
    293 static inline uint32_t ATTRIBUTE_PURE
    294 _3DPRIMITIVE_BaseVertexLocation_start(const struct gen_device_info *devinfo)
    295 {
    296    switch (devinfo->gen) {
    297    case 10: return 192;
    298    case 9: return 192;
    299    case 8: return 192;
    300    case 7:
    301       if (devinfo->is_haswell) {
    302          return 192;
    303       } else {
    304          return 192;
    305       }
    306    case 6: return 160;
    307    case 5: return 160;
    308    case 4:
    309       if (devinfo->is_g4x) {
    310          return 160;
    311       } else {
    312          return 160;
    313       }
    314    default:
    315       unreachable("Invalid hardware generation");
    316    }
    317 }
    318 
    319 
    320 
    321 /* 3DPRIMITIVE::Command SubType */
    322 
    323 
    324 #define GEN10_3DPRIMITIVE_CommandSubType_bits  2
    325 #define GEN9_3DPRIMITIVE_CommandSubType_bits  2
    326 #define GEN8_3DPRIMITIVE_CommandSubType_bits  2
    327 #define GEN75_3DPRIMITIVE_CommandSubType_bits  2
    328 #define GEN7_3DPRIMITIVE_CommandSubType_bits  2
    329 #define GEN6_3DPRIMITIVE_CommandSubType_bits  2
    330 #define GEN5_3DPRIMITIVE_CommandSubType_bits  2
    331 #define GEN45_3DPRIMITIVE_CommandSubType_bits  2
    332 #define GEN4_3DPRIMITIVE_CommandSubType_bits  2
    333 
    334 static inline uint32_t ATTRIBUTE_PURE
    335 _3DPRIMITIVE_CommandSubType_bits(const struct gen_device_info *devinfo)
    336 {
    337    switch (devinfo->gen) {
    338    case 10: return 2;
    339    case 9: return 2;
    340    case 8: return 2;
    341    case 7:
    342       if (devinfo->is_haswell) {
    343          return 2;
    344       } else {
    345          return 2;
    346       }
    347    case 6: return 2;
    348    case 5: return 2;
    349    case 4:
    350       if (devinfo->is_g4x) {
    351          return 2;
    352       } else {
    353          return 2;
    354       }
    355    default:
    356       unreachable("Invalid hardware generation");
    357    }
    358 }
    359 
    360 
    361 
    362 #define GEN10_3DPRIMITIVE_CommandSubType_start  27
    363 #define GEN9_3DPRIMITIVE_CommandSubType_start  27
    364 #define GEN8_3DPRIMITIVE_CommandSubType_start  27
    365 #define GEN75_3DPRIMITIVE_CommandSubType_start  27
    366 #define GEN7_3DPRIMITIVE_CommandSubType_start  27
    367 #define GEN6_3DPRIMITIVE_CommandSubType_start  27
    368 #define GEN5_3DPRIMITIVE_CommandSubType_start  27
    369 #define GEN45_3DPRIMITIVE_CommandSubType_start  27
    370 #define GEN4_3DPRIMITIVE_CommandSubType_start  27
    371 
    372 static inline uint32_t ATTRIBUTE_PURE
    373 _3DPRIMITIVE_CommandSubType_start(const struct gen_device_info *devinfo)
    374 {
    375    switch (devinfo->gen) {
    376    case 10: return 27;
    377    case 9: return 27;
    378    case 8: return 27;
    379    case 7:
    380       if (devinfo->is_haswell) {
    381          return 27;
    382       } else {
    383          return 27;
    384       }
    385    case 6: return 27;
    386    case 5: return 27;
    387    case 4:
    388       if (devinfo->is_g4x) {
    389          return 27;
    390       } else {
    391          return 27;
    392       }
    393    default:
    394       unreachable("Invalid hardware generation");
    395    }
    396 }
    397 
    398 
    399 
    400 /* 3DPRIMITIVE::Command Type */
    401 
    402 
    403 #define GEN10_3DPRIMITIVE_CommandType_bits  3
    404 #define GEN9_3DPRIMITIVE_CommandType_bits  3
    405 #define GEN8_3DPRIMITIVE_CommandType_bits  3
    406 #define GEN75_3DPRIMITIVE_CommandType_bits  3
    407 #define GEN7_3DPRIMITIVE_CommandType_bits  3
    408 #define GEN6_3DPRIMITIVE_CommandType_bits  3
    409 #define GEN5_3DPRIMITIVE_CommandType_bits  3
    410 #define GEN45_3DPRIMITIVE_CommandType_bits  3
    411 #define GEN4_3DPRIMITIVE_CommandType_bits  3
    412 
    413 static inline uint32_t ATTRIBUTE_PURE
    414 _3DPRIMITIVE_CommandType_bits(const struct gen_device_info *devinfo)
    415 {
    416    switch (devinfo->gen) {
    417    case 10: return 3;
    418    case 9: return 3;
    419    case 8: return 3;
    420    case 7:
    421       if (devinfo->is_haswell) {
    422          return 3;
    423       } else {
    424          return 3;
    425       }
    426    case 6: return 3;
    427    case 5: return 3;
    428    case 4:
    429       if (devinfo->is_g4x) {
    430          return 3;
    431       } else {
    432          return 3;
    433       }
    434    default:
    435       unreachable("Invalid hardware generation");
    436    }
    437 }
    438 
    439 
    440 
    441 #define GEN10_3DPRIMITIVE_CommandType_start  29
    442 #define GEN9_3DPRIMITIVE_CommandType_start  29
    443 #define GEN8_3DPRIMITIVE_CommandType_start  29
    444 #define GEN75_3DPRIMITIVE_CommandType_start  29
    445 #define GEN7_3DPRIMITIVE_CommandType_start  29
    446 #define GEN6_3DPRIMITIVE_CommandType_start  29
    447 #define GEN5_3DPRIMITIVE_CommandType_start  29
    448 #define GEN45_3DPRIMITIVE_CommandType_start  29
    449 #define GEN4_3DPRIMITIVE_CommandType_start  29
    450 
    451 static inline uint32_t ATTRIBUTE_PURE
    452 _3DPRIMITIVE_CommandType_start(const struct gen_device_info *devinfo)
    453 {
    454    switch (devinfo->gen) {
    455    case 10: return 29;
    456    case 9: return 29;
    457    case 8: return 29;
    458    case 7:
    459       if (devinfo->is_haswell) {
    460          return 29;
    461       } else {
    462          return 29;
    463       }
    464    case 6: return 29;
    465    case 5: return 29;
    466    case 4:
    467       if (devinfo->is_g4x) {
    468          return 29;
    469       } else {
    470          return 29;
    471       }
    472    default:
    473       unreachable("Invalid hardware generation");
    474    }
    475 }
    476 
    477 
    478 
    479 /* 3DPRIMITIVE::DWord Length */
    480 
    481 
    482 #define GEN10_3DPRIMITIVE_DWordLength_bits  8
    483 #define GEN9_3DPRIMITIVE_DWordLength_bits  8
    484 #define GEN8_3DPRIMITIVE_DWordLength_bits  8
    485 #define GEN75_3DPRIMITIVE_DWordLength_bits  8
    486 #define GEN7_3DPRIMITIVE_DWordLength_bits  8
    487 #define GEN6_3DPRIMITIVE_DWordLength_bits  8
    488 #define GEN5_3DPRIMITIVE_DWordLength_bits  8
    489 #define GEN45_3DPRIMITIVE_DWordLength_bits  8
    490 #define GEN4_3DPRIMITIVE_DWordLength_bits  8
    491 
    492 static inline uint32_t ATTRIBUTE_PURE
    493 _3DPRIMITIVE_DWordLength_bits(const struct gen_device_info *devinfo)
    494 {
    495    switch (devinfo->gen) {
    496    case 10: return 8;
    497    case 9: return 8;
    498    case 8: return 8;
    499    case 7:
    500       if (devinfo->is_haswell) {
    501          return 8;
    502       } else {
    503          return 8;
    504       }
    505    case 6: return 8;
    506    case 5: return 8;
    507    case 4:
    508       if (devinfo->is_g4x) {
    509          return 8;
    510       } else {
    511          return 8;
    512       }
    513    default:
    514       unreachable("Invalid hardware generation");
    515    }
    516 }
    517 
    518 
    519 
    520 #define GEN10_3DPRIMITIVE_DWordLength_start  0
    521 #define GEN9_3DPRIMITIVE_DWordLength_start  0
    522 #define GEN8_3DPRIMITIVE_DWordLength_start  0
    523 #define GEN75_3DPRIMITIVE_DWordLength_start  0
    524 #define GEN7_3DPRIMITIVE_DWordLength_start  0
    525 #define GEN6_3DPRIMITIVE_DWordLength_start  0
    526 #define GEN5_3DPRIMITIVE_DWordLength_start  0
    527 #define GEN45_3DPRIMITIVE_DWordLength_start  0
    528 #define GEN4_3DPRIMITIVE_DWordLength_start  0
    529 
    530 static inline uint32_t ATTRIBUTE_PURE
    531 _3DPRIMITIVE_DWordLength_start(const struct gen_device_info *devinfo)
    532 {
    533    switch (devinfo->gen) {
    534    case 10: return 0;
    535    case 9: return 0;
    536    case 8: return 0;
    537    case 7:
    538       if (devinfo->is_haswell) {
    539          return 0;
    540       } else {
    541          return 0;
    542       }
    543    case 6: return 0;
    544    case 5: return 0;
    545    case 4:
    546       if (devinfo->is_g4x) {
    547          return 0;
    548       } else {
    549          return 0;
    550       }
    551    default:
    552       unreachable("Invalid hardware generation");
    553    }
    554 }
    555 
    556 
    557 
    558 /* 3DPRIMITIVE::End Offset Enable */
    559 
    560 
    561 #define GEN10_3DPRIMITIVE_EndOffsetEnable_bits  1
    562 #define GEN9_3DPRIMITIVE_EndOffsetEnable_bits  1
    563 #define GEN8_3DPRIMITIVE_EndOffsetEnable_bits  1
    564 #define GEN75_3DPRIMITIVE_EndOffsetEnable_bits  1
    565 #define GEN7_3DPRIMITIVE_EndOffsetEnable_bits  1
    566 
    567 static inline uint32_t ATTRIBUTE_PURE
    568 _3DPRIMITIVE_EndOffsetEnable_bits(const struct gen_device_info *devinfo)
    569 {
    570    switch (devinfo->gen) {
    571    case 10: return 1;
    572    case 9: return 1;
    573    case 8: return 1;
    574    case 7:
    575       if (devinfo->is_haswell) {
    576          return 1;
    577       } else {
    578          return 1;
    579       }
    580    case 6: return 0;
    581    case 5: return 0;
    582    case 4:
    583       if (devinfo->is_g4x) {
    584          return 0;
    585       } else {
    586          return 0;
    587       }
    588    default:
    589       unreachable("Invalid hardware generation");
    590    }
    591 }
    592 
    593 
    594 
    595 #define GEN10_3DPRIMITIVE_EndOffsetEnable_start  41
    596 #define GEN9_3DPRIMITIVE_EndOffsetEnable_start  41
    597 #define GEN8_3DPRIMITIVE_EndOffsetEnable_start  41
    598 #define GEN75_3DPRIMITIVE_EndOffsetEnable_start  41
    599 #define GEN7_3DPRIMITIVE_EndOffsetEnable_start  41
    600 
    601 static inline uint32_t ATTRIBUTE_PURE
    602 _3DPRIMITIVE_EndOffsetEnable_start(const struct gen_device_info *devinfo)
    603 {
    604    switch (devinfo->gen) {
    605    case 10: return 41;
    606    case 9: return 41;
    607    case 8: return 41;
    608    case 7:
    609       if (devinfo->is_haswell) {
    610          return 41;
    611       } else {
    612          return 41;
    613       }
    614    case 6: return 0;
    615    case 5: return 0;
    616    case 4:
    617       if (devinfo->is_g4x) {
    618          return 0;
    619       } else {
    620          return 0;
    621       }
    622    default:
    623       unreachable("Invalid hardware generation");
    624    }
    625 }
    626 
    627 
    628 
    629 /* 3DPRIMITIVE::Extended Parameter 0 */
    630 
    631 
    632 #define GEN10_3DPRIMITIVE_ExtendedParameter0_bits  32
    633 
    634 static inline uint32_t ATTRIBUTE_PURE
    635 _3DPRIMITIVE_ExtendedParameter0_bits(const struct gen_device_info *devinfo)
    636 {
    637    switch (devinfo->gen) {
    638    case 10: return 32;
    639    case 9: return 0;
    640    case 8: return 0;
    641    case 7:
    642       if (devinfo->is_haswell) {
    643          return 0;
    644       } else {
    645          return 0;
    646       }
    647    case 6: return 0;
    648    case 5: return 0;
    649    case 4:
    650       if (devinfo->is_g4x) {
    651          return 0;
    652       } else {
    653          return 0;
    654       }
    655    default:
    656       unreachable("Invalid hardware generation");
    657    }
    658 }
    659 
    660 
    661 
    662 #define GEN10_3DPRIMITIVE_ExtendedParameter0_start  224
    663 
    664 static inline uint32_t ATTRIBUTE_PURE
    665 _3DPRIMITIVE_ExtendedParameter0_start(const struct gen_device_info *devinfo)
    666 {
    667    switch (devinfo->gen) {
    668    case 10: return 224;
    669    case 9: return 0;
    670    case 8: return 0;
    671    case 7:
    672       if (devinfo->is_haswell) {
    673          return 0;
    674       } else {
    675          return 0;
    676       }
    677    case 6: return 0;
    678    case 5: return 0;
    679    case 4:
    680       if (devinfo->is_g4x) {
    681          return 0;
    682       } else {
    683          return 0;
    684       }
    685    default:
    686       unreachable("Invalid hardware generation");
    687    }
    688 }
    689 
    690 
    691 
    692 /* 3DPRIMITIVE::Extended Parameter 1 */
    693 
    694 
    695 #define GEN10_3DPRIMITIVE_ExtendedParameter1_bits  32
    696 
    697 static inline uint32_t ATTRIBUTE_PURE
    698 _3DPRIMITIVE_ExtendedParameter1_bits(const struct gen_device_info *devinfo)
    699 {
    700    switch (devinfo->gen) {
    701    case 10: return 32;
    702    case 9: return 0;
    703    case 8: return 0;
    704    case 7:
    705       if (devinfo->is_haswell) {
    706          return 0;
    707       } else {
    708          return 0;
    709       }
    710    case 6: return 0;
    711    case 5: return 0;
    712    case 4:
    713       if (devinfo->is_g4x) {
    714          return 0;
    715       } else {
    716          return 0;
    717       }
    718    default:
    719       unreachable("Invalid hardware generation");
    720    }
    721 }
    722 
    723 
    724 
    725 #define GEN10_3DPRIMITIVE_ExtendedParameter1_start  256
    726 
    727 static inline uint32_t ATTRIBUTE_PURE
    728 _3DPRIMITIVE_ExtendedParameter1_start(const struct gen_device_info *devinfo)
    729 {
    730    switch (devinfo->gen) {
    731    case 10: return 256;
    732    case 9: return 0;
    733    case 8: return 0;
    734    case 7:
    735       if (devinfo->is_haswell) {
    736          return 0;
    737       } else {
    738          return 0;
    739       }
    740    case 6: return 0;
    741    case 5: return 0;
    742    case 4:
    743       if (devinfo->is_g4x) {
    744          return 0;
    745       } else {
    746          return 0;
    747       }
    748    default:
    749       unreachable("Invalid hardware generation");
    750    }
    751 }
    752 
    753 
    754 
    755 /* 3DPRIMITIVE::Extended Parameter 2 */
    756 
    757 
    758 #define GEN10_3DPRIMITIVE_ExtendedParameter2_bits  32
    759 
    760 static inline uint32_t ATTRIBUTE_PURE
    761 _3DPRIMITIVE_ExtendedParameter2_bits(const struct gen_device_info *devinfo)
    762 {
    763    switch (devinfo->gen) {
    764    case 10: return 32;
    765    case 9: return 0;
    766    case 8: return 0;
    767    case 7:
    768       if (devinfo->is_haswell) {
    769          return 0;
    770       } else {
    771          return 0;
    772       }
    773    case 6: return 0;
    774    case 5: return 0;
    775    case 4:
    776       if (devinfo->is_g4x) {
    777          return 0;
    778       } else {
    779          return 0;
    780       }
    781    default:
    782       unreachable("Invalid hardware generation");
    783    }
    784 }
    785 
    786 
    787 
    788 #define GEN10_3DPRIMITIVE_ExtendedParameter2_start  288
    789 
    790 static inline uint32_t ATTRIBUTE_PURE
    791 _3DPRIMITIVE_ExtendedParameter2_start(const struct gen_device_info *devinfo)
    792 {
    793    switch (devinfo->gen) {
    794    case 10: return 288;
    795    case 9: return 0;
    796    case 8: return 0;
    797    case 7:
    798       if (devinfo->is_haswell) {
    799          return 0;
    800       } else {
    801          return 0;
    802       }
    803    case 6: return 0;
    804    case 5: return 0;
    805    case 4:
    806       if (devinfo->is_g4x) {
    807          return 0;
    808       } else {
    809          return 0;
    810       }
    811    default:
    812       unreachable("Invalid hardware generation");
    813    }
    814 }
    815 
    816 
    817 
    818 /* 3DPRIMITIVE::Extended Parameters Present */
    819 
    820 
    821 #define GEN10_3DPRIMITIVE_ExtendedParametersPresent_bits  1
    822 
    823 static inline uint32_t ATTRIBUTE_PURE
    824 _3DPRIMITIVE_ExtendedParametersPresent_bits(const struct gen_device_info *devinfo)
    825 {
    826    switch (devinfo->gen) {
    827    case 10: return 1;
    828    case 9: return 0;
    829    case 8: return 0;
    830    case 7:
    831       if (devinfo->is_haswell) {
    832          return 0;
    833       } else {
    834          return 0;
    835       }
    836    case 6: return 0;
    837    case 5: return 0;
    838    case 4:
    839       if (devinfo->is_g4x) {
    840          return 0;
    841       } else {
    842          return 0;
    843       }
    844    default:
    845       unreachable("Invalid hardware generation");
    846    }
    847 }
    848 
    849 
    850 
    851 #define GEN10_3DPRIMITIVE_ExtendedParametersPresent_start  11
    852 
    853 static inline uint32_t ATTRIBUTE_PURE
    854 _3DPRIMITIVE_ExtendedParametersPresent_start(const struct gen_device_info *devinfo)
    855 {
    856    switch (devinfo->gen) {
    857    case 10: return 11;
    858    case 9: return 0;
    859    case 8: return 0;
    860    case 7:
    861       if (devinfo->is_haswell) {
    862          return 0;
    863       } else {
    864          return 0;
    865       }
    866    case 6: return 0;
    867    case 5: return 0;
    868    case 4:
    869       if (devinfo->is_g4x) {
    870          return 0;
    871       } else {
    872          return 0;
    873       }
    874    default:
    875       unreachable("Invalid hardware generation");
    876    }
    877 }
    878 
    879 
    880 
    881 /* 3DPRIMITIVE::Indirect Parameter Enable */
    882 
    883 
    884 #define GEN10_3DPRIMITIVE_IndirectParameterEnable_bits  1
    885 #define GEN9_3DPRIMITIVE_IndirectParameterEnable_bits  1
    886 #define GEN8_3DPRIMITIVE_IndirectParameterEnable_bits  1
    887 #define GEN75_3DPRIMITIVE_IndirectParameterEnable_bits  1
    888 #define GEN7_3DPRIMITIVE_IndirectParameterEnable_bits  1
    889 
    890 static inline uint32_t ATTRIBUTE_PURE
    891 _3DPRIMITIVE_IndirectParameterEnable_bits(const struct gen_device_info *devinfo)
    892 {
    893    switch (devinfo->gen) {
    894    case 10: return 1;
    895    case 9: return 1;
    896    case 8: return 1;
    897    case 7:
    898       if (devinfo->is_haswell) {
    899          return 1;
    900       } else {
    901          return 1;
    902       }
    903    case 6: return 0;
    904    case 5: return 0;
    905    case 4:
    906       if (devinfo->is_g4x) {
    907          return 0;
    908       } else {
    909          return 0;
    910       }
    911    default:
    912       unreachable("Invalid hardware generation");
    913    }
    914 }
    915 
    916 
    917 
    918 #define GEN10_3DPRIMITIVE_IndirectParameterEnable_start  10
    919 #define GEN9_3DPRIMITIVE_IndirectParameterEnable_start  10
    920 #define GEN8_3DPRIMITIVE_IndirectParameterEnable_start  10
    921 #define GEN75_3DPRIMITIVE_IndirectParameterEnable_start  10
    922 #define GEN7_3DPRIMITIVE_IndirectParameterEnable_start  10
    923 
    924 static inline uint32_t ATTRIBUTE_PURE
    925 _3DPRIMITIVE_IndirectParameterEnable_start(const struct gen_device_info *devinfo)
    926 {
    927    switch (devinfo->gen) {
    928    case 10: return 10;
    929    case 9: return 10;
    930    case 8: return 10;
    931    case 7:
    932       if (devinfo->is_haswell) {
    933          return 10;
    934       } else {
    935          return 10;
    936       }
    937    case 6: return 0;
    938    case 5: return 0;
    939    case 4:
    940       if (devinfo->is_g4x) {
    941          return 0;
    942       } else {
    943          return 0;
    944       }
    945    default:
    946       unreachable("Invalid hardware generation");
    947    }
    948 }
    949 
    950 
    951 
    952 /* 3DPRIMITIVE::Indirect Vertex Count */
    953 
    954 
    955 #define GEN5_3DPRIMITIVE_IndirectVertexCount_bits  1
    956 #define GEN45_3DPRIMITIVE_IndirectVertexCount_bits  1
    957 
    958 static inline uint32_t ATTRIBUTE_PURE
    959 _3DPRIMITIVE_IndirectVertexCount_bits(const struct gen_device_info *devinfo)
    960 {
    961    switch (devinfo->gen) {
    962    case 10: return 0;
    963    case 9: return 0;
    964    case 8: return 0;
    965    case 7:
    966       if (devinfo->is_haswell) {
    967          return 0;
    968       } else {
    969          return 0;
    970       }
    971    case 6: return 0;
    972    case 5: return 1;
    973    case 4:
    974       if (devinfo->is_g4x) {
    975          return 1;
    976       } else {
    977          return 0;
    978       }
    979    default:
    980       unreachable("Invalid hardware generation");
    981    }
    982 }
    983 
    984 
    985 
    986 #define GEN5_3DPRIMITIVE_IndirectVertexCount_start  9
    987 #define GEN45_3DPRIMITIVE_IndirectVertexCount_start  9
    988 
    989 static inline uint32_t ATTRIBUTE_PURE
    990 _3DPRIMITIVE_IndirectVertexCount_start(const struct gen_device_info *devinfo)
    991 {
    992    switch (devinfo->gen) {
    993    case 10: return 0;
    994    case 9: return 0;
    995    case 8: return 0;
    996    case 7:
    997       if (devinfo->is_haswell) {
    998          return 0;
    999       } else {
   1000          return 0;
   1001       }
   1002    case 6: return 0;
   1003    case 5: return 9;
   1004    case 4:
   1005       if (devinfo->is_g4x) {
   1006          return 9;
   1007       } else {
   1008          return 0;
   1009       }
   1010    default:
   1011       unreachable("Invalid hardware generation");
   1012    }
   1013 }
   1014 
   1015 
   1016 
   1017 /* 3DPRIMITIVE::Instance Count */
   1018 
   1019 
   1020 #define GEN10_3DPRIMITIVE_InstanceCount_bits  32
   1021 #define GEN9_3DPRIMITIVE_InstanceCount_bits  32
   1022 #define GEN8_3DPRIMITIVE_InstanceCount_bits  32
   1023 #define GEN75_3DPRIMITIVE_InstanceCount_bits  32
   1024 #define GEN7_3DPRIMITIVE_InstanceCount_bits  32
   1025 #define GEN6_3DPRIMITIVE_InstanceCount_bits  32
   1026 #define GEN5_3DPRIMITIVE_InstanceCount_bits  32
   1027 #define GEN45_3DPRIMITIVE_InstanceCount_bits  32
   1028 #define GEN4_3DPRIMITIVE_InstanceCount_bits  32
   1029 
   1030 static inline uint32_t ATTRIBUTE_PURE
   1031 _3DPRIMITIVE_InstanceCount_bits(const struct gen_device_info *devinfo)
   1032 {
   1033    switch (devinfo->gen) {
   1034    case 10: return 32;
   1035    case 9: return 32;
   1036    case 8: return 32;
   1037    case 7:
   1038       if (devinfo->is_haswell) {
   1039          return 32;
   1040       } else {
   1041          return 32;
   1042       }
   1043    case 6: return 32;
   1044    case 5: return 32;
   1045    case 4:
   1046       if (devinfo->is_g4x) {
   1047          return 32;
   1048       } else {
   1049          return 32;
   1050       }
   1051    default:
   1052       unreachable("Invalid hardware generation");
   1053    }
   1054 }
   1055 
   1056 
   1057 
   1058 #define GEN10_3DPRIMITIVE_InstanceCount_start  128
   1059 #define GEN9_3DPRIMITIVE_InstanceCount_start  128
   1060 #define GEN8_3DPRIMITIVE_InstanceCount_start  128
   1061 #define GEN75_3DPRIMITIVE_InstanceCount_start  128
   1062 #define GEN7_3DPRIMITIVE_InstanceCount_start  128
   1063 #define GEN6_3DPRIMITIVE_InstanceCount_start  96
   1064 #define GEN5_3DPRIMITIVE_InstanceCount_start  96
   1065 #define GEN45_3DPRIMITIVE_InstanceCount_start  96
   1066 #define GEN4_3DPRIMITIVE_InstanceCount_start  96
   1067 
   1068 static inline uint32_t ATTRIBUTE_PURE
   1069 _3DPRIMITIVE_InstanceCount_start(const struct gen_device_info *devinfo)
   1070 {
   1071    switch (devinfo->gen) {
   1072    case 10: return 128;
   1073    case 9: return 128;
   1074    case 8: return 128;
   1075    case 7:
   1076       if (devinfo->is_haswell) {
   1077          return 128;
   1078       } else {
   1079          return 128;
   1080       }
   1081    case 6: return 96;
   1082    case 5: return 96;
   1083    case 4:
   1084       if (devinfo->is_g4x) {
   1085          return 96;
   1086       } else {
   1087          return 96;
   1088       }
   1089    default:
   1090       unreachable("Invalid hardware generation");
   1091    }
   1092 }
   1093 
   1094 
   1095 
   1096 /* 3DPRIMITIVE::Internal Vertex Count */
   1097 
   1098 
   1099 #define GEN6_3DPRIMITIVE_InternalVertexCount_bits  1
   1100 
   1101 static inline uint32_t ATTRIBUTE_PURE
   1102 _3DPRIMITIVE_InternalVertexCount_bits(const struct gen_device_info *devinfo)
   1103 {
   1104    switch (devinfo->gen) {
   1105    case 10: return 0;
   1106    case 9: return 0;
   1107    case 8: return 0;
   1108    case 7:
   1109       if (devinfo->is_haswell) {
   1110          return 0;
   1111       } else {
   1112          return 0;
   1113       }
   1114    case 6: return 1;
   1115    case 5: return 0;
   1116    case 4:
   1117       if (devinfo->is_g4x) {
   1118          return 0;
   1119       } else {
   1120          return 0;
   1121       }
   1122    default:
   1123       unreachable("Invalid hardware generation");
   1124    }
   1125 }
   1126 
   1127 
   1128 
   1129 #define GEN6_3DPRIMITIVE_InternalVertexCount_start  9
   1130 
   1131 static inline uint32_t ATTRIBUTE_PURE
   1132 _3DPRIMITIVE_InternalVertexCount_start(const struct gen_device_info *devinfo)
   1133 {
   1134    switch (devinfo->gen) {
   1135    case 10: return 0;
   1136    case 9: return 0;
   1137    case 8: return 0;
   1138    case 7:
   1139       if (devinfo->is_haswell) {
   1140          return 0;
   1141       } else {
   1142          return 0;
   1143       }
   1144    case 6: return 9;
   1145    case 5: return 0;
   1146    case 4:
   1147       if (devinfo->is_g4x) {
   1148          return 0;
   1149       } else {
   1150          return 0;
   1151       }
   1152    default:
   1153       unreachable("Invalid hardware generation");
   1154    }
   1155 }
   1156 
   1157 
   1158 
   1159 /* 3DPRIMITIVE::Predicate Enable */
   1160 
   1161 
   1162 #define GEN10_3DPRIMITIVE_PredicateEnable_bits  1
   1163 #define GEN9_3DPRIMITIVE_PredicateEnable_bits  1
   1164 #define GEN8_3DPRIMITIVE_PredicateEnable_bits  1
   1165 #define GEN75_3DPRIMITIVE_PredicateEnable_bits  1
   1166 #define GEN7_3DPRIMITIVE_PredicateEnable_bits  1
   1167 
   1168 static inline uint32_t ATTRIBUTE_PURE
   1169 _3DPRIMITIVE_PredicateEnable_bits(const struct gen_device_info *devinfo)
   1170 {
   1171    switch (devinfo->gen) {
   1172    case 10: return 1;
   1173    case 9: return 1;
   1174    case 8: return 1;
   1175    case 7:
   1176       if (devinfo->is_haswell) {
   1177          return 1;
   1178       } else {
   1179          return 1;
   1180       }
   1181    case 6: return 0;
   1182    case 5: return 0;
   1183    case 4:
   1184       if (devinfo->is_g4x) {
   1185          return 0;
   1186       } else {
   1187          return 0;
   1188       }
   1189    default:
   1190       unreachable("Invalid hardware generation");
   1191    }
   1192 }
   1193 
   1194 
   1195 
   1196 #define GEN10_3DPRIMITIVE_PredicateEnable_start  8
   1197 #define GEN9_3DPRIMITIVE_PredicateEnable_start  8
   1198 #define GEN8_3DPRIMITIVE_PredicateEnable_start  8
   1199 #define GEN75_3DPRIMITIVE_PredicateEnable_start  8
   1200 #define GEN7_3DPRIMITIVE_PredicateEnable_start  8
   1201 
   1202 static inline uint32_t ATTRIBUTE_PURE
   1203 _3DPRIMITIVE_PredicateEnable_start(const struct gen_device_info *devinfo)
   1204 {
   1205    switch (devinfo->gen) {
   1206    case 10: return 8;
   1207    case 9: return 8;
   1208    case 8: return 8;
   1209    case 7:
   1210       if (devinfo->is_haswell) {
   1211          return 8;
   1212       } else {
   1213          return 8;
   1214       }
   1215    case 6: return 0;
   1216    case 5: return 0;
   1217    case 4:
   1218       if (devinfo->is_g4x) {
   1219          return 0;
   1220       } else {
   1221          return 0;
   1222       }
   1223    default:
   1224       unreachable("Invalid hardware generation");
   1225    }
   1226 }
   1227 
   1228 
   1229 
   1230 /* 3DPRIMITIVE::Primitive Topology Type */
   1231 
   1232 
   1233 #define GEN10_3DPRIMITIVE_PrimitiveTopologyType_bits  6
   1234 #define GEN9_3DPRIMITIVE_PrimitiveTopologyType_bits  6
   1235 #define GEN8_3DPRIMITIVE_PrimitiveTopologyType_bits  6
   1236 #define GEN75_3DPRIMITIVE_PrimitiveTopologyType_bits  6
   1237 #define GEN7_3DPRIMITIVE_PrimitiveTopologyType_bits  6
   1238 #define GEN6_3DPRIMITIVE_PrimitiveTopologyType_bits  5
   1239 #define GEN5_3DPRIMITIVE_PrimitiveTopologyType_bits  5
   1240 #define GEN45_3DPRIMITIVE_PrimitiveTopologyType_bits  5
   1241 #define GEN4_3DPRIMITIVE_PrimitiveTopologyType_bits  5
   1242 
   1243 static inline uint32_t ATTRIBUTE_PURE
   1244 _3DPRIMITIVE_PrimitiveTopologyType_bits(const struct gen_device_info *devinfo)
   1245 {
   1246    switch (devinfo->gen) {
   1247    case 10: return 6;
   1248    case 9: return 6;
   1249    case 8: return 6;
   1250    case 7:
   1251       if (devinfo->is_haswell) {
   1252          return 6;
   1253       } else {
   1254          return 6;
   1255       }
   1256    case 6: return 5;
   1257    case 5: return 5;
   1258    case 4:
   1259       if (devinfo->is_g4x) {
   1260          return 5;
   1261       } else {
   1262          return 5;
   1263       }
   1264    default:
   1265       unreachable("Invalid hardware generation");
   1266    }
   1267 }
   1268 
   1269 
   1270 
   1271 #define GEN10_3DPRIMITIVE_PrimitiveTopologyType_start  32
   1272 #define GEN9_3DPRIMITIVE_PrimitiveTopologyType_start  32
   1273 #define GEN8_3DPRIMITIVE_PrimitiveTopologyType_start  32
   1274 #define GEN75_3DPRIMITIVE_PrimitiveTopologyType_start  32
   1275 #define GEN7_3DPRIMITIVE_PrimitiveTopologyType_start  32
   1276 #define GEN6_3DPRIMITIVE_PrimitiveTopologyType_start  10
   1277 #define GEN5_3DPRIMITIVE_PrimitiveTopologyType_start  10
   1278 #define GEN45_3DPRIMITIVE_PrimitiveTopologyType_start  10
   1279 #define GEN4_3DPRIMITIVE_PrimitiveTopologyType_start  10
   1280 
   1281 static inline uint32_t ATTRIBUTE_PURE
   1282 _3DPRIMITIVE_PrimitiveTopologyType_start(const struct gen_device_info *devinfo)
   1283 {
   1284    switch (devinfo->gen) {
   1285    case 10: return 32;
   1286    case 9: return 32;
   1287    case 8: return 32;
   1288    case 7:
   1289       if (devinfo->is_haswell) {
   1290          return 32;
   1291       } else {
   1292          return 32;
   1293       }
   1294    case 6: return 10;
   1295    case 5: return 10;
   1296    case 4:
   1297       if (devinfo->is_g4x) {
   1298          return 10;
   1299       } else {
   1300          return 10;
   1301       }
   1302    default:
   1303       unreachable("Invalid hardware generation");
   1304    }
   1305 }
   1306 
   1307 
   1308 
   1309 /* 3DPRIMITIVE::Start Instance Location */
   1310 
   1311 
   1312 #define GEN10_3DPRIMITIVE_StartInstanceLocation_bits  32
   1313 #define GEN9_3DPRIMITIVE_StartInstanceLocation_bits  32
   1314 #define GEN8_3DPRIMITIVE_StartInstanceLocation_bits  32
   1315 #define GEN75_3DPRIMITIVE_StartInstanceLocation_bits  32
   1316 #define GEN7_3DPRIMITIVE_StartInstanceLocation_bits  32
   1317 #define GEN6_3DPRIMITIVE_StartInstanceLocation_bits  32
   1318 #define GEN5_3DPRIMITIVE_StartInstanceLocation_bits  32
   1319 #define GEN45_3DPRIMITIVE_StartInstanceLocation_bits  32
   1320 
   1321 static inline uint32_t ATTRIBUTE_PURE
   1322 _3DPRIMITIVE_StartInstanceLocation_bits(const struct gen_device_info *devinfo)
   1323 {
   1324    switch (devinfo->gen) {
   1325    case 10: return 32;
   1326    case 9: return 32;
   1327    case 8: return 32;
   1328    case 7:
   1329       if (devinfo->is_haswell) {
   1330          return 32;
   1331       } else {
   1332          return 32;
   1333       }
   1334    case 6: return 32;
   1335    case 5: return 32;
   1336    case 4:
   1337       if (devinfo->is_g4x) {
   1338          return 32;
   1339       } else {
   1340          return 0;
   1341       }
   1342    default:
   1343       unreachable("Invalid hardware generation");
   1344    }
   1345 }
   1346 
   1347 
   1348 
   1349 #define GEN10_3DPRIMITIVE_StartInstanceLocation_start  160
   1350 #define GEN9_3DPRIMITIVE_StartInstanceLocation_start  160
   1351 #define GEN8_3DPRIMITIVE_StartInstanceLocation_start  160
   1352 #define GEN75_3DPRIMITIVE_StartInstanceLocation_start  160
   1353 #define GEN7_3DPRIMITIVE_StartInstanceLocation_start  160
   1354 #define GEN6_3DPRIMITIVE_StartInstanceLocation_start  128
   1355 #define GEN5_3DPRIMITIVE_StartInstanceLocation_start  128
   1356 #define GEN45_3DPRIMITIVE_StartInstanceLocation_start  128
   1357 
   1358 static inline uint32_t ATTRIBUTE_PURE
   1359 _3DPRIMITIVE_StartInstanceLocation_start(const struct gen_device_info *devinfo)
   1360 {
   1361    switch (devinfo->gen) {
   1362    case 10: return 160;
   1363    case 9: return 160;
   1364    case 8: return 160;
   1365    case 7:
   1366       if (devinfo->is_haswell) {
   1367          return 160;
   1368       } else {
   1369          return 160;
   1370       }
   1371    case 6: return 128;
   1372    case 5: return 128;
   1373    case 4:
   1374       if (devinfo->is_g4x) {
   1375          return 128;
   1376       } else {
   1377          return 0;
   1378       }
   1379    default:
   1380       unreachable("Invalid hardware generation");
   1381    }
   1382 }
   1383 
   1384 
   1385 
   1386 /* 3DPRIMITIVE::Start Vertex Location */
   1387 
   1388 
   1389 #define GEN10_3DPRIMITIVE_StartVertexLocation_bits  32
   1390 #define GEN9_3DPRIMITIVE_StartVertexLocation_bits  32
   1391 #define GEN8_3DPRIMITIVE_StartVertexLocation_bits  32
   1392 #define GEN75_3DPRIMITIVE_StartVertexLocation_bits  32
   1393 #define GEN7_3DPRIMITIVE_StartVertexLocation_bits  32
   1394 #define GEN6_3DPRIMITIVE_StartVertexLocation_bits  32
   1395 #define GEN5_3DPRIMITIVE_StartVertexLocation_bits  32
   1396 #define GEN45_3DPRIMITIVE_StartVertexLocation_bits  32
   1397 #define GEN4_3DPRIMITIVE_StartVertexLocation_bits  32
   1398 
   1399 static inline uint32_t ATTRIBUTE_PURE
   1400 _3DPRIMITIVE_StartVertexLocation_bits(const struct gen_device_info *devinfo)
   1401 {
   1402    switch (devinfo->gen) {
   1403    case 10: return 32;
   1404    case 9: return 32;
   1405    case 8: return 32;
   1406    case 7:
   1407       if (devinfo->is_haswell) {
   1408          return 32;
   1409       } else {
   1410          return 32;
   1411       }
   1412    case 6: return 32;
   1413    case 5: return 32;
   1414    case 4:
   1415       if (devinfo->is_g4x) {
   1416          return 32;
   1417       } else {
   1418          return 32;
   1419       }
   1420    default:
   1421       unreachable("Invalid hardware generation");
   1422    }
   1423 }
   1424 
   1425 
   1426 
   1427 #define GEN10_3DPRIMITIVE_StartVertexLocation_start  96
   1428 #define GEN9_3DPRIMITIVE_StartVertexLocation_start  96
   1429 #define GEN8_3DPRIMITIVE_StartVertexLocation_start  96
   1430 #define GEN75_3DPRIMITIVE_StartVertexLocation_start  96
   1431 #define GEN7_3DPRIMITIVE_StartVertexLocation_start  96
   1432 #define GEN6_3DPRIMITIVE_StartVertexLocation_start  64
   1433 #define GEN5_3DPRIMITIVE_StartVertexLocation_start  64
   1434 #define GEN45_3DPRIMITIVE_StartVertexLocation_start  64
   1435 #define GEN4_3DPRIMITIVE_StartVertexLocation_start  64
   1436 
   1437 static inline uint32_t ATTRIBUTE_PURE
   1438 _3DPRIMITIVE_StartVertexLocation_start(const struct gen_device_info *devinfo)
   1439 {
   1440    switch (devinfo->gen) {
   1441    case 10: return 96;
   1442    case 9: return 96;
   1443    case 8: return 96;
   1444    case 7:
   1445       if (devinfo->is_haswell) {
   1446          return 96;
   1447       } else {
   1448          return 96;
   1449       }
   1450    case 6: return 64;
   1451    case 5: return 64;
   1452    case 4:
   1453       if (devinfo->is_g4x) {
   1454          return 64;
   1455       } else {
   1456          return 64;
   1457       }
   1458    default:
   1459       unreachable("Invalid hardware generation");
   1460    }
   1461 }
   1462 
   1463 
   1464 
   1465 /* 3DPRIMITIVE::UAV Coherency Required */
   1466 
   1467 
   1468 #define GEN10_3DPRIMITIVE_UAVCoherencyRequired_bits  1
   1469 #define GEN9_3DPRIMITIVE_UAVCoherencyRequired_bits  1
   1470 #define GEN8_3DPRIMITIVE_UAVCoherencyRequired_bits  1
   1471 #define GEN75_3DPRIMITIVE_UAVCoherencyRequired_bits  1
   1472 
   1473 static inline uint32_t ATTRIBUTE_PURE
   1474 _3DPRIMITIVE_UAVCoherencyRequired_bits(const struct gen_device_info *devinfo)
   1475 {
   1476    switch (devinfo->gen) {
   1477    case 10: return 1;
   1478    case 9: return 1;
   1479    case 8: return 1;
   1480    case 7:
   1481       if (devinfo->is_haswell) {
   1482          return 1;
   1483       } else {
   1484          return 0;
   1485       }
   1486    case 6: return 0;
   1487    case 5: return 0;
   1488    case 4:
   1489       if (devinfo->is_g4x) {
   1490          return 0;
   1491       } else {
   1492          return 0;
   1493       }
   1494    default:
   1495       unreachable("Invalid hardware generation");
   1496    }
   1497 }
   1498 
   1499 
   1500 
   1501 #define GEN10_3DPRIMITIVE_UAVCoherencyRequired_start  9
   1502 #define GEN9_3DPRIMITIVE_UAVCoherencyRequired_start  9
   1503 #define GEN8_3DPRIMITIVE_UAVCoherencyRequired_start  9
   1504 #define GEN75_3DPRIMITIVE_UAVCoherencyRequired_start  9
   1505 
   1506 static inline uint32_t ATTRIBUTE_PURE
   1507 _3DPRIMITIVE_UAVCoherencyRequired_start(const struct gen_device_info *devinfo)
   1508 {
   1509    switch (devinfo->gen) {
   1510    case 10: return 9;
   1511    case 9: return 9;
   1512    case 8: return 9;
   1513    case 7:
   1514       if (devinfo->is_haswell) {
   1515          return 9;
   1516       } else {
   1517          return 0;
   1518       }
   1519    case 6: return 0;
   1520    case 5: return 0;
   1521    case 4:
   1522       if (devinfo->is_g4x) {
   1523          return 0;
   1524       } else {
   1525          return 0;
   1526       }
   1527    default:
   1528       unreachable("Invalid hardware generation");
   1529    }
   1530 }
   1531 
   1532 
   1533 
   1534 /* 3DPRIMITIVE::Vertex Access Type */
   1535 
   1536 
   1537 #define GEN10_3DPRIMITIVE_VertexAccessType_bits  1
   1538 #define GEN9_3DPRIMITIVE_VertexAccessType_bits  1
   1539 #define GEN8_3DPRIMITIVE_VertexAccessType_bits  1
   1540 #define GEN75_3DPRIMITIVE_VertexAccessType_bits  1
   1541 #define GEN7_3DPRIMITIVE_VertexAccessType_bits  1
   1542 #define GEN6_3DPRIMITIVE_VertexAccessType_bits  1
   1543 #define GEN5_3DPRIMITIVE_VertexAccessType_bits  1
   1544 #define GEN45_3DPRIMITIVE_VertexAccessType_bits  1
   1545 #define GEN4_3DPRIMITIVE_VertexAccessType_bits  1
   1546 
   1547 static inline uint32_t ATTRIBUTE_PURE
   1548 _3DPRIMITIVE_VertexAccessType_bits(const struct gen_device_info *devinfo)
   1549 {
   1550    switch (devinfo->gen) {
   1551    case 10: return 1;
   1552    case 9: return 1;
   1553    case 8: return 1;
   1554    case 7:
   1555       if (devinfo->is_haswell) {
   1556          return 1;
   1557       } else {
   1558          return 1;
   1559       }
   1560    case 6: return 1;
   1561    case 5: return 1;
   1562    case 4:
   1563       if (devinfo->is_g4x) {
   1564          return 1;
   1565       } else {
   1566          return 1;
   1567       }
   1568    default:
   1569       unreachable("Invalid hardware generation");
   1570    }
   1571 }
   1572 
   1573 
   1574 
   1575 #define GEN10_3DPRIMITIVE_VertexAccessType_start  40
   1576 #define GEN9_3DPRIMITIVE_VertexAccessType_start  40
   1577 #define GEN8_3DPRIMITIVE_VertexAccessType_start  40
   1578 #define GEN75_3DPRIMITIVE_VertexAccessType_start  40
   1579 #define GEN7_3DPRIMITIVE_VertexAccessType_start  40
   1580 #define GEN6_3DPRIMITIVE_VertexAccessType_start  15
   1581 #define GEN5_3DPRIMITIVE_VertexAccessType_start  15
   1582 #define GEN45_3DPRIMITIVE_VertexAccessType_start  15
   1583 #define GEN4_3DPRIMITIVE_VertexAccessType_start  15
   1584 
   1585 static inline uint32_t ATTRIBUTE_PURE
   1586 _3DPRIMITIVE_VertexAccessType_start(const struct gen_device_info *devinfo)
   1587 {
   1588    switch (devinfo->gen) {
   1589    case 10: return 40;
   1590    case 9: return 40;
   1591    case 8: return 40;
   1592    case 7:
   1593       if (devinfo->is_haswell) {
   1594          return 40;
   1595       } else {
   1596          return 40;
   1597       }
   1598    case 6: return 15;
   1599    case 5: return 15;
   1600    case 4:
   1601       if (devinfo->is_g4x) {
   1602          return 15;
   1603       } else {
   1604          return 15;
   1605       }
   1606    default:
   1607       unreachable("Invalid hardware generation");
   1608    }
   1609 }
   1610 
   1611 
   1612 
   1613 /* 3DPRIMITIVE::Vertex Count Per Instance */
   1614 
   1615 
   1616 #define GEN10_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1617 #define GEN9_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1618 #define GEN8_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1619 #define GEN75_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1620 #define GEN7_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1621 #define GEN6_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1622 #define GEN5_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1623 #define GEN45_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1624 #define GEN4_3DPRIMITIVE_VertexCountPerInstance_bits  32
   1625 
   1626 static inline uint32_t ATTRIBUTE_PURE
   1627 _3DPRIMITIVE_VertexCountPerInstance_bits(const struct gen_device_info *devinfo)
   1628 {
   1629    switch (devinfo->gen) {
   1630    case 10: return 32;
   1631    case 9: return 32;
   1632    case 8: return 32;
   1633    case 7:
   1634       if (devinfo->is_haswell) {
   1635          return 32;
   1636       } else {
   1637          return 32;
   1638       }
   1639    case 6: return 32;
   1640    case 5: return 32;
   1641    case 4:
   1642       if (devinfo->is_g4x) {
   1643          return 32;
   1644       } else {
   1645          return 32;
   1646       }
   1647    default:
   1648       unreachable("Invalid hardware generation");
   1649    }
   1650 }
   1651 
   1652 
   1653 
   1654 #define GEN10_3DPRIMITIVE_VertexCountPerInstance_start  64
   1655 #define GEN9_3DPRIMITIVE_VertexCountPerInstance_start  64
   1656 #define GEN8_3DPRIMITIVE_VertexCountPerInstance_start  64
   1657 #define GEN75_3DPRIMITIVE_VertexCountPerInstance_start  64
   1658 #define GEN7_3DPRIMITIVE_VertexCountPerInstance_start  64
   1659 #define GEN6_3DPRIMITIVE_VertexCountPerInstance_start  32
   1660 #define GEN5_3DPRIMITIVE_VertexCountPerInstance_start  32
   1661 #define GEN45_3DPRIMITIVE_VertexCountPerInstance_start  32
   1662 #define GEN4_3DPRIMITIVE_VertexCountPerInstance_start  32
   1663 
   1664 static inline uint32_t ATTRIBUTE_PURE
   1665 _3DPRIMITIVE_VertexCountPerInstance_start(const struct gen_device_info *devinfo)
   1666 {
   1667    switch (devinfo->gen) {
   1668    case 10: return 64;
   1669    case 9: return 64;
   1670    case 8: return 64;
   1671    case 7:
   1672       if (devinfo->is_haswell) {
   1673          return 64;
   1674       } else {
   1675          return 64;
   1676       }
   1677    case 6: return 32;
   1678    case 5: return 32;
   1679    case 4:
   1680       if (devinfo->is_g4x) {
   1681          return 32;
   1682       } else {
   1683          return 32;
   1684       }
   1685    default:
   1686       unreachable("Invalid hardware generation");
   1687    }
   1688 }
   1689 
   1690 
   1691 
   1692 /* 3DSTATE_AA_LINE_PARAMETERS */
   1693 
   1694 
   1695 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_length  3
   1696 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_length  3
   1697 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_length  3
   1698 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_length  3
   1699 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_length  3
   1700 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_length  3
   1701 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_length  3
   1702 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_length  3
   1703 
   1704 static inline uint32_t ATTRIBUTE_PURE
   1705 _3DSTATE_AA_LINE_PARAMETERS_length(const struct gen_device_info *devinfo)
   1706 {
   1707    switch (devinfo->gen) {
   1708    case 10: return 3;
   1709    case 9: return 3;
   1710    case 8: return 3;
   1711    case 7:
   1712       if (devinfo->is_haswell) {
   1713          return 3;
   1714       } else {
   1715          return 3;
   1716       }
   1717    case 6: return 3;
   1718    case 5: return 3;
   1719    case 4:
   1720       if (devinfo->is_g4x) {
   1721          return 3;
   1722       } else {
   1723          return 0;
   1724       }
   1725    default:
   1726       unreachable("Invalid hardware generation");
   1727    }
   1728 }
   1729 
   1730 
   1731 
   1732 /* 3DSTATE_AA_LINE_PARAMETERS::3D Command Opcode */
   1733 
   1734 
   1735 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1736 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1737 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1738 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1739 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1740 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1741 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1742 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits  3
   1743 
   1744 static inline uint32_t ATTRIBUTE_PURE
   1745 _3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   1746 {
   1747    switch (devinfo->gen) {
   1748    case 10: return 3;
   1749    case 9: return 3;
   1750    case 8: return 3;
   1751    case 7:
   1752       if (devinfo->is_haswell) {
   1753          return 3;
   1754       } else {
   1755          return 3;
   1756       }
   1757    case 6: return 3;
   1758    case 5: return 3;
   1759    case 4:
   1760       if (devinfo->is_g4x) {
   1761          return 3;
   1762       } else {
   1763          return 0;
   1764       }
   1765    default:
   1766       unreachable("Invalid hardware generation");
   1767    }
   1768 }
   1769 
   1770 
   1771 
   1772 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1773 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1774 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1775 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1776 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1777 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1778 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1779 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start  24
   1780 
   1781 static inline uint32_t ATTRIBUTE_PURE
   1782 _3DSTATE_AA_LINE_PARAMETERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   1783 {
   1784    switch (devinfo->gen) {
   1785    case 10: return 24;
   1786    case 9: return 24;
   1787    case 8: return 24;
   1788    case 7:
   1789       if (devinfo->is_haswell) {
   1790          return 24;
   1791       } else {
   1792          return 24;
   1793       }
   1794    case 6: return 24;
   1795    case 5: return 24;
   1796    case 4:
   1797       if (devinfo->is_g4x) {
   1798          return 24;
   1799       } else {
   1800          return 0;
   1801       }
   1802    default:
   1803       unreachable("Invalid hardware generation");
   1804    }
   1805 }
   1806 
   1807 
   1808 
   1809 /* 3DSTATE_AA_LINE_PARAMETERS::3D Command Sub Opcode */
   1810 
   1811 
   1812 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1813 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1814 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1815 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1816 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1817 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1818 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1819 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits  8
   1820 
   1821 static inline uint32_t ATTRIBUTE_PURE
   1822 _3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   1823 {
   1824    switch (devinfo->gen) {
   1825    case 10: return 8;
   1826    case 9: return 8;
   1827    case 8: return 8;
   1828    case 7:
   1829       if (devinfo->is_haswell) {
   1830          return 8;
   1831       } else {
   1832          return 8;
   1833       }
   1834    case 6: return 8;
   1835    case 5: return 8;
   1836    case 4:
   1837       if (devinfo->is_g4x) {
   1838          return 8;
   1839       } else {
   1840          return 0;
   1841       }
   1842    default:
   1843       unreachable("Invalid hardware generation");
   1844    }
   1845 }
   1846 
   1847 
   1848 
   1849 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1850 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1851 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1852 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1853 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1854 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1855 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1856 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start  16
   1857 
   1858 static inline uint32_t ATTRIBUTE_PURE
   1859 _3DSTATE_AA_LINE_PARAMETERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   1860 {
   1861    switch (devinfo->gen) {
   1862    case 10: return 16;
   1863    case 9: return 16;
   1864    case 8: return 16;
   1865    case 7:
   1866       if (devinfo->is_haswell) {
   1867          return 16;
   1868       } else {
   1869          return 16;
   1870       }
   1871    case 6: return 16;
   1872    case 5: return 16;
   1873    case 4:
   1874       if (devinfo->is_g4x) {
   1875          return 16;
   1876       } else {
   1877          return 0;
   1878       }
   1879    default:
   1880       unreachable("Invalid hardware generation");
   1881    }
   1882 }
   1883 
   1884 
   1885 
   1886 /* 3DSTATE_AA_LINE_PARAMETERS::AA Coverage Bias */
   1887 
   1888 
   1889 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1890 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1891 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1892 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1893 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1894 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1895 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1896 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits  8
   1897 
   1898 static inline uint32_t ATTRIBUTE_PURE
   1899 _3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_bits(const struct gen_device_info *devinfo)
   1900 {
   1901    switch (devinfo->gen) {
   1902    case 10: return 8;
   1903    case 9: return 8;
   1904    case 8: return 8;
   1905    case 7:
   1906       if (devinfo->is_haswell) {
   1907          return 8;
   1908       } else {
   1909          return 8;
   1910       }
   1911    case 6: return 8;
   1912    case 5: return 8;
   1913    case 4:
   1914       if (devinfo->is_g4x) {
   1915          return 8;
   1916       } else {
   1917          return 0;
   1918       }
   1919    default:
   1920       unreachable("Invalid hardware generation");
   1921    }
   1922 }
   1923 
   1924 
   1925 
   1926 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1927 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1928 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1929 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1930 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1931 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1932 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1933 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start  48
   1934 
   1935 static inline uint32_t ATTRIBUTE_PURE
   1936 _3DSTATE_AA_LINE_PARAMETERS_AACoverageBias_start(const struct gen_device_info *devinfo)
   1937 {
   1938    switch (devinfo->gen) {
   1939    case 10: return 48;
   1940    case 9: return 48;
   1941    case 8: return 48;
   1942    case 7:
   1943       if (devinfo->is_haswell) {
   1944          return 48;
   1945       } else {
   1946          return 48;
   1947       }
   1948    case 6: return 48;
   1949    case 5: return 48;
   1950    case 4:
   1951       if (devinfo->is_g4x) {
   1952          return 48;
   1953       } else {
   1954          return 0;
   1955       }
   1956    default:
   1957       unreachable("Invalid hardware generation");
   1958    }
   1959 }
   1960 
   1961 
   1962 
   1963 /* 3DSTATE_AA_LINE_PARAMETERS::AA Coverage EndCap Bias */
   1964 
   1965 
   1966 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1967 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1968 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1969 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1970 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1971 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1972 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1973 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits  8
   1974 
   1975 static inline uint32_t ATTRIBUTE_PURE
   1976 _3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_bits(const struct gen_device_info *devinfo)
   1977 {
   1978    switch (devinfo->gen) {
   1979    case 10: return 8;
   1980    case 9: return 8;
   1981    case 8: return 8;
   1982    case 7:
   1983       if (devinfo->is_haswell) {
   1984          return 8;
   1985       } else {
   1986          return 8;
   1987       }
   1988    case 6: return 8;
   1989    case 5: return 8;
   1990    case 4:
   1991       if (devinfo->is_g4x) {
   1992          return 8;
   1993       } else {
   1994          return 0;
   1995       }
   1996    default:
   1997       unreachable("Invalid hardware generation");
   1998    }
   1999 }
   2000 
   2001 
   2002 
   2003 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2004 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2005 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2006 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2007 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2008 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2009 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2010 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start  80
   2011 
   2012 static inline uint32_t ATTRIBUTE_PURE
   2013 _3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapBias_start(const struct gen_device_info *devinfo)
   2014 {
   2015    switch (devinfo->gen) {
   2016    case 10: return 80;
   2017    case 9: return 80;
   2018    case 8: return 80;
   2019    case 7:
   2020       if (devinfo->is_haswell) {
   2021          return 80;
   2022       } else {
   2023          return 80;
   2024       }
   2025    case 6: return 80;
   2026    case 5: return 80;
   2027    case 4:
   2028       if (devinfo->is_g4x) {
   2029          return 80;
   2030       } else {
   2031          return 0;
   2032       }
   2033    default:
   2034       unreachable("Invalid hardware generation");
   2035    }
   2036 }
   2037 
   2038 
   2039 
   2040 /* 3DSTATE_AA_LINE_PARAMETERS::AA Coverage EndCap Slope */
   2041 
   2042 
   2043 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2044 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2045 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2046 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2047 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2048 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2049 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2050 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits  8
   2051 
   2052 static inline uint32_t ATTRIBUTE_PURE
   2053 _3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_bits(const struct gen_device_info *devinfo)
   2054 {
   2055    switch (devinfo->gen) {
   2056    case 10: return 8;
   2057    case 9: return 8;
   2058    case 8: return 8;
   2059    case 7:
   2060       if (devinfo->is_haswell) {
   2061          return 8;
   2062       } else {
   2063          return 8;
   2064       }
   2065    case 6: return 8;
   2066    case 5: return 8;
   2067    case 4:
   2068       if (devinfo->is_g4x) {
   2069          return 8;
   2070       } else {
   2071          return 0;
   2072       }
   2073    default:
   2074       unreachable("Invalid hardware generation");
   2075    }
   2076 }
   2077 
   2078 
   2079 
   2080 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2081 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2082 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2083 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2084 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2085 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2086 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2087 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start  64
   2088 
   2089 static inline uint32_t ATTRIBUTE_PURE
   2090 _3DSTATE_AA_LINE_PARAMETERS_AACoverageEndCapSlope_start(const struct gen_device_info *devinfo)
   2091 {
   2092    switch (devinfo->gen) {
   2093    case 10: return 64;
   2094    case 9: return 64;
   2095    case 8: return 64;
   2096    case 7:
   2097       if (devinfo->is_haswell) {
   2098          return 64;
   2099       } else {
   2100          return 64;
   2101       }
   2102    case 6: return 64;
   2103    case 5: return 64;
   2104    case 4:
   2105       if (devinfo->is_g4x) {
   2106          return 64;
   2107       } else {
   2108          return 0;
   2109       }
   2110    default:
   2111       unreachable("Invalid hardware generation");
   2112    }
   2113 }
   2114 
   2115 
   2116 
   2117 /* 3DSTATE_AA_LINE_PARAMETERS::AA Coverage Slope */
   2118 
   2119 
   2120 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2121 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2122 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2123 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2124 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2125 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2126 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2127 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits  8
   2128 
   2129 static inline uint32_t ATTRIBUTE_PURE
   2130 _3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_bits(const struct gen_device_info *devinfo)
   2131 {
   2132    switch (devinfo->gen) {
   2133    case 10: return 8;
   2134    case 9: return 8;
   2135    case 8: return 8;
   2136    case 7:
   2137       if (devinfo->is_haswell) {
   2138          return 8;
   2139       } else {
   2140          return 8;
   2141       }
   2142    case 6: return 8;
   2143    case 5: return 8;
   2144    case 4:
   2145       if (devinfo->is_g4x) {
   2146          return 8;
   2147       } else {
   2148          return 0;
   2149       }
   2150    default:
   2151       unreachable("Invalid hardware generation");
   2152    }
   2153 }
   2154 
   2155 
   2156 
   2157 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2158 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2159 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2160 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2161 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2162 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2163 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2164 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start  32
   2165 
   2166 static inline uint32_t ATTRIBUTE_PURE
   2167 _3DSTATE_AA_LINE_PARAMETERS_AACoverageSlope_start(const struct gen_device_info *devinfo)
   2168 {
   2169    switch (devinfo->gen) {
   2170    case 10: return 32;
   2171    case 9: return 32;
   2172    case 8: return 32;
   2173    case 7:
   2174       if (devinfo->is_haswell) {
   2175          return 32;
   2176       } else {
   2177          return 32;
   2178       }
   2179    case 6: return 32;
   2180    case 5: return 32;
   2181    case 4:
   2182       if (devinfo->is_g4x) {
   2183          return 32;
   2184       } else {
   2185          return 0;
   2186       }
   2187    default:
   2188       unreachable("Invalid hardware generation");
   2189    }
   2190 }
   2191 
   2192 
   2193 
   2194 /* 3DSTATE_AA_LINE_PARAMETERS::AA Point Coverage Bias */
   2195 
   2196 
   2197 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_bits  8
   2198 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_bits  8
   2199 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_bits  8
   2200 
   2201 static inline uint32_t ATTRIBUTE_PURE
   2202 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_bits(const struct gen_device_info *devinfo)
   2203 {
   2204    switch (devinfo->gen) {
   2205    case 10: return 8;
   2206    case 9: return 8;
   2207    case 8: return 8;
   2208    case 7:
   2209       if (devinfo->is_haswell) {
   2210          return 0;
   2211       } else {
   2212          return 0;
   2213       }
   2214    case 6: return 0;
   2215    case 5: return 0;
   2216    case 4:
   2217       if (devinfo->is_g4x) {
   2218          return 0;
   2219       } else {
   2220          return 0;
   2221       }
   2222    default:
   2223       unreachable("Invalid hardware generation");
   2224    }
   2225 }
   2226 
   2227 
   2228 
   2229 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_start  56
   2230 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_start  56
   2231 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_start  56
   2232 
   2233 static inline uint32_t ATTRIBUTE_PURE
   2234 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageBias_start(const struct gen_device_info *devinfo)
   2235 {
   2236    switch (devinfo->gen) {
   2237    case 10: return 56;
   2238    case 9: return 56;
   2239    case 8: return 56;
   2240    case 7:
   2241       if (devinfo->is_haswell) {
   2242          return 0;
   2243       } else {
   2244          return 0;
   2245       }
   2246    case 6: return 0;
   2247    case 5: return 0;
   2248    case 4:
   2249       if (devinfo->is_g4x) {
   2250          return 0;
   2251       } else {
   2252          return 0;
   2253       }
   2254    default:
   2255       unreachable("Invalid hardware generation");
   2256    }
   2257 }
   2258 
   2259 
   2260 
   2261 /* 3DSTATE_AA_LINE_PARAMETERS::AA Point Coverage EndCap Bias */
   2262 
   2263 
   2264 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_bits  8
   2265 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_bits  8
   2266 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_bits  8
   2267 
   2268 static inline uint32_t ATTRIBUTE_PURE
   2269 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_bits(const struct gen_device_info *devinfo)
   2270 {
   2271    switch (devinfo->gen) {
   2272    case 10: return 8;
   2273    case 9: return 8;
   2274    case 8: return 8;
   2275    case 7:
   2276       if (devinfo->is_haswell) {
   2277          return 0;
   2278       } else {
   2279          return 0;
   2280       }
   2281    case 6: return 0;
   2282    case 5: return 0;
   2283    case 4:
   2284       if (devinfo->is_g4x) {
   2285          return 0;
   2286       } else {
   2287          return 0;
   2288       }
   2289    default:
   2290       unreachable("Invalid hardware generation");
   2291    }
   2292 }
   2293 
   2294 
   2295 
   2296 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_start  88
   2297 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_start  88
   2298 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_start  88
   2299 
   2300 static inline uint32_t ATTRIBUTE_PURE
   2301 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapBias_start(const struct gen_device_info *devinfo)
   2302 {
   2303    switch (devinfo->gen) {
   2304    case 10: return 88;
   2305    case 9: return 88;
   2306    case 8: return 88;
   2307    case 7:
   2308       if (devinfo->is_haswell) {
   2309          return 0;
   2310       } else {
   2311          return 0;
   2312       }
   2313    case 6: return 0;
   2314    case 5: return 0;
   2315    case 4:
   2316       if (devinfo->is_g4x) {
   2317          return 0;
   2318       } else {
   2319          return 0;
   2320       }
   2321    default:
   2322       unreachable("Invalid hardware generation");
   2323    }
   2324 }
   2325 
   2326 
   2327 
   2328 /* 3DSTATE_AA_LINE_PARAMETERS::AA Point Coverage EndCap Slope */
   2329 
   2330 
   2331 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_bits  8
   2332 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_bits  8
   2333 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_bits  8
   2334 
   2335 static inline uint32_t ATTRIBUTE_PURE
   2336 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_bits(const struct gen_device_info *devinfo)
   2337 {
   2338    switch (devinfo->gen) {
   2339    case 10: return 8;
   2340    case 9: return 8;
   2341    case 8: return 8;
   2342    case 7:
   2343       if (devinfo->is_haswell) {
   2344          return 0;
   2345       } else {
   2346          return 0;
   2347       }
   2348    case 6: return 0;
   2349    case 5: return 0;
   2350    case 4:
   2351       if (devinfo->is_g4x) {
   2352          return 0;
   2353       } else {
   2354          return 0;
   2355       }
   2356    default:
   2357       unreachable("Invalid hardware generation");
   2358    }
   2359 }
   2360 
   2361 
   2362 
   2363 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_start  72
   2364 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_start  72
   2365 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_start  72
   2366 
   2367 static inline uint32_t ATTRIBUTE_PURE
   2368 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageEndCapSlope_start(const struct gen_device_info *devinfo)
   2369 {
   2370    switch (devinfo->gen) {
   2371    case 10: return 72;
   2372    case 9: return 72;
   2373    case 8: return 72;
   2374    case 7:
   2375       if (devinfo->is_haswell) {
   2376          return 0;
   2377       } else {
   2378          return 0;
   2379       }
   2380    case 6: return 0;
   2381    case 5: return 0;
   2382    case 4:
   2383       if (devinfo->is_g4x) {
   2384          return 0;
   2385       } else {
   2386          return 0;
   2387       }
   2388    default:
   2389       unreachable("Invalid hardware generation");
   2390    }
   2391 }
   2392 
   2393 
   2394 
   2395 /* 3DSTATE_AA_LINE_PARAMETERS::AA Point Coverage Slope */
   2396 
   2397 
   2398 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_bits  8
   2399 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_bits  8
   2400 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_bits  8
   2401 
   2402 static inline uint32_t ATTRIBUTE_PURE
   2403 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_bits(const struct gen_device_info *devinfo)
   2404 {
   2405    switch (devinfo->gen) {
   2406    case 10: return 8;
   2407    case 9: return 8;
   2408    case 8: return 8;
   2409    case 7:
   2410       if (devinfo->is_haswell) {
   2411          return 0;
   2412       } else {
   2413          return 0;
   2414       }
   2415    case 6: return 0;
   2416    case 5: return 0;
   2417    case 4:
   2418       if (devinfo->is_g4x) {
   2419          return 0;
   2420       } else {
   2421          return 0;
   2422       }
   2423    default:
   2424       unreachable("Invalid hardware generation");
   2425    }
   2426 }
   2427 
   2428 
   2429 
   2430 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_start  40
   2431 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_start  40
   2432 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_start  40
   2433 
   2434 static inline uint32_t ATTRIBUTE_PURE
   2435 _3DSTATE_AA_LINE_PARAMETERS_AAPointCoverageSlope_start(const struct gen_device_info *devinfo)
   2436 {
   2437    switch (devinfo->gen) {
   2438    case 10: return 40;
   2439    case 9: return 40;
   2440    case 8: return 40;
   2441    case 7:
   2442       if (devinfo->is_haswell) {
   2443          return 0;
   2444       } else {
   2445          return 0;
   2446       }
   2447    case 6: return 0;
   2448    case 5: return 0;
   2449    case 4:
   2450       if (devinfo->is_g4x) {
   2451          return 0;
   2452       } else {
   2453          return 0;
   2454       }
   2455    default:
   2456       unreachable("Invalid hardware generation");
   2457    }
   2458 }
   2459 
   2460 
   2461 
   2462 /* 3DSTATE_AA_LINE_PARAMETERS::Command SubType */
   2463 
   2464 
   2465 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2466 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2467 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2468 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2469 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2470 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2471 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2472 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits  2
   2473 
   2474 static inline uint32_t ATTRIBUTE_PURE
   2475 _3DSTATE_AA_LINE_PARAMETERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   2476 {
   2477    switch (devinfo->gen) {
   2478    case 10: return 2;
   2479    case 9: return 2;
   2480    case 8: return 2;
   2481    case 7:
   2482       if (devinfo->is_haswell) {
   2483          return 2;
   2484       } else {
   2485          return 2;
   2486       }
   2487    case 6: return 2;
   2488    case 5: return 2;
   2489    case 4:
   2490       if (devinfo->is_g4x) {
   2491          return 2;
   2492       } else {
   2493          return 0;
   2494       }
   2495    default:
   2496       unreachable("Invalid hardware generation");
   2497    }
   2498 }
   2499 
   2500 
   2501 
   2502 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2503 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2504 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2505 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2506 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2507 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2508 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2509 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start  27
   2510 
   2511 static inline uint32_t ATTRIBUTE_PURE
   2512 _3DSTATE_AA_LINE_PARAMETERS_CommandSubType_start(const struct gen_device_info *devinfo)
   2513 {
   2514    switch (devinfo->gen) {
   2515    case 10: return 27;
   2516    case 9: return 27;
   2517    case 8: return 27;
   2518    case 7:
   2519       if (devinfo->is_haswell) {
   2520          return 27;
   2521       } else {
   2522          return 27;
   2523       }
   2524    case 6: return 27;
   2525    case 5: return 27;
   2526    case 4:
   2527       if (devinfo->is_g4x) {
   2528          return 27;
   2529       } else {
   2530          return 0;
   2531       }
   2532    default:
   2533       unreachable("Invalid hardware generation");
   2534    }
   2535 }
   2536 
   2537 
   2538 
   2539 /* 3DSTATE_AA_LINE_PARAMETERS::Command Type */
   2540 
   2541 
   2542 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2543 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2544 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2545 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2546 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2547 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2548 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2549 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_CommandType_bits  3
   2550 
   2551 static inline uint32_t ATTRIBUTE_PURE
   2552 _3DSTATE_AA_LINE_PARAMETERS_CommandType_bits(const struct gen_device_info *devinfo)
   2553 {
   2554    switch (devinfo->gen) {
   2555    case 10: return 3;
   2556    case 9: return 3;
   2557    case 8: return 3;
   2558    case 7:
   2559       if (devinfo->is_haswell) {
   2560          return 3;
   2561       } else {
   2562          return 3;
   2563       }
   2564    case 6: return 3;
   2565    case 5: return 3;
   2566    case 4:
   2567       if (devinfo->is_g4x) {
   2568          return 3;
   2569       } else {
   2570          return 0;
   2571       }
   2572    default:
   2573       unreachable("Invalid hardware generation");
   2574    }
   2575 }
   2576 
   2577 
   2578 
   2579 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2580 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2581 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2582 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2583 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2584 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2585 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2586 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_CommandType_start  29
   2587 
   2588 static inline uint32_t ATTRIBUTE_PURE
   2589 _3DSTATE_AA_LINE_PARAMETERS_CommandType_start(const struct gen_device_info *devinfo)
   2590 {
   2591    switch (devinfo->gen) {
   2592    case 10: return 29;
   2593    case 9: return 29;
   2594    case 8: return 29;
   2595    case 7:
   2596       if (devinfo->is_haswell) {
   2597          return 29;
   2598       } else {
   2599          return 29;
   2600       }
   2601    case 6: return 29;
   2602    case 5: return 29;
   2603    case 4:
   2604       if (devinfo->is_g4x) {
   2605          return 29;
   2606       } else {
   2607          return 0;
   2608       }
   2609    default:
   2610       unreachable("Invalid hardware generation");
   2611    }
   2612 }
   2613 
   2614 
   2615 
   2616 /* 3DSTATE_AA_LINE_PARAMETERS::DWord Length */
   2617 
   2618 
   2619 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2620 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2621 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2622 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2623 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2624 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2625 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2626 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits  8
   2627 
   2628 static inline uint32_t ATTRIBUTE_PURE
   2629 _3DSTATE_AA_LINE_PARAMETERS_DWordLength_bits(const struct gen_device_info *devinfo)
   2630 {
   2631    switch (devinfo->gen) {
   2632    case 10: return 8;
   2633    case 9: return 8;
   2634    case 8: return 8;
   2635    case 7:
   2636       if (devinfo->is_haswell) {
   2637          return 8;
   2638       } else {
   2639          return 8;
   2640       }
   2641    case 6: return 8;
   2642    case 5: return 8;
   2643    case 4:
   2644       if (devinfo->is_g4x) {
   2645          return 8;
   2646       } else {
   2647          return 0;
   2648       }
   2649    default:
   2650       unreachable("Invalid hardware generation");
   2651    }
   2652 }
   2653 
   2654 
   2655 
   2656 #define GEN10_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2657 #define GEN9_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2658 #define GEN8_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2659 #define GEN75_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2660 #define GEN7_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2661 #define GEN6_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2662 #define GEN5_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2663 #define GEN45_3DSTATE_AA_LINE_PARAMETERS_DWordLength_start  0
   2664 
   2665 static inline uint32_t ATTRIBUTE_PURE
   2666 _3DSTATE_AA_LINE_PARAMETERS_DWordLength_start(const struct gen_device_info *devinfo)
   2667 {
   2668    switch (devinfo->gen) {
   2669    case 10: return 0;
   2670    case 9: return 0;
   2671    case 8: return 0;
   2672    case 7:
   2673       if (devinfo->is_haswell) {
   2674          return 0;
   2675       } else {
   2676          return 0;
   2677       }
   2678    case 6: return 0;
   2679    case 5: return 0;
   2680    case 4:
   2681       if (devinfo->is_g4x) {
   2682          return 0;
   2683       } else {
   2684          return 0;
   2685       }
   2686    default:
   2687       unreachable("Invalid hardware generation");
   2688    }
   2689 }
   2690 
   2691 
   2692 
   2693 /* 3DSTATE_BINDING_TABLE_EDIT_DS */
   2694 
   2695 
   2696 
   2697 
   2698 
   2699 /* 3DSTATE_BINDING_TABLE_EDIT_DS::3D Command Opcode */
   2700 
   2701 
   2702 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_bits  3
   2703 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_bits  3
   2704 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_bits  3
   2705 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_bits  3
   2706 
   2707 static inline uint32_t ATTRIBUTE_PURE
   2708 _3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   2709 {
   2710    switch (devinfo->gen) {
   2711    case 10: return 3;
   2712    case 9: return 3;
   2713    case 8: return 3;
   2714    case 7:
   2715       if (devinfo->is_haswell) {
   2716          return 3;
   2717       } else {
   2718          return 0;
   2719       }
   2720    case 6: return 0;
   2721    case 5: return 0;
   2722    case 4:
   2723       if (devinfo->is_g4x) {
   2724          return 0;
   2725       } else {
   2726          return 0;
   2727       }
   2728    default:
   2729       unreachable("Invalid hardware generation");
   2730    }
   2731 }
   2732 
   2733 
   2734 
   2735 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_start  24
   2736 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_start  24
   2737 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_start  24
   2738 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_start  24
   2739 
   2740 static inline uint32_t ATTRIBUTE_PURE
   2741 _3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   2742 {
   2743    switch (devinfo->gen) {
   2744    case 10: return 24;
   2745    case 9: return 24;
   2746    case 8: return 24;
   2747    case 7:
   2748       if (devinfo->is_haswell) {
   2749          return 24;
   2750       } else {
   2751          return 0;
   2752       }
   2753    case 6: return 0;
   2754    case 5: return 0;
   2755    case 4:
   2756       if (devinfo->is_g4x) {
   2757          return 0;
   2758       } else {
   2759          return 0;
   2760       }
   2761    default:
   2762       unreachable("Invalid hardware generation");
   2763    }
   2764 }
   2765 
   2766 
   2767 
   2768 /* 3DSTATE_BINDING_TABLE_EDIT_DS::3D Command Sub Opcode */
   2769 
   2770 
   2771 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_bits  8
   2772 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_bits  8
   2773 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_bits  8
   2774 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_bits  8
   2775 
   2776 static inline uint32_t ATTRIBUTE_PURE
   2777 _3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   2778 {
   2779    switch (devinfo->gen) {
   2780    case 10: return 8;
   2781    case 9: return 8;
   2782    case 8: return 8;
   2783    case 7:
   2784       if (devinfo->is_haswell) {
   2785          return 8;
   2786       } else {
   2787          return 0;
   2788       }
   2789    case 6: return 0;
   2790    case 5: return 0;
   2791    case 4:
   2792       if (devinfo->is_g4x) {
   2793          return 0;
   2794       } else {
   2795          return 0;
   2796       }
   2797    default:
   2798       unreachable("Invalid hardware generation");
   2799    }
   2800 }
   2801 
   2802 
   2803 
   2804 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_start  16
   2805 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_start  16
   2806 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_start  16
   2807 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_start  16
   2808 
   2809 static inline uint32_t ATTRIBUTE_PURE
   2810 _3DSTATE_BINDING_TABLE_EDIT_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   2811 {
   2812    switch (devinfo->gen) {
   2813    case 10: return 16;
   2814    case 9: return 16;
   2815    case 8: return 16;
   2816    case 7:
   2817       if (devinfo->is_haswell) {
   2818          return 16;
   2819       } else {
   2820          return 0;
   2821       }
   2822    case 6: return 0;
   2823    case 5: return 0;
   2824    case 4:
   2825       if (devinfo->is_g4x) {
   2826          return 0;
   2827       } else {
   2828          return 0;
   2829       }
   2830    default:
   2831       unreachable("Invalid hardware generation");
   2832    }
   2833 }
   2834 
   2835 
   2836 
   2837 /* 3DSTATE_BINDING_TABLE_EDIT_DS::Binding Table Block Clear */
   2838 
   2839 
   2840 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_bits  16
   2841 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_bits  16
   2842 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_bits  16
   2843 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_bits  16
   2844 
   2845 static inline uint32_t ATTRIBUTE_PURE
   2846 _3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_bits(const struct gen_device_info *devinfo)
   2847 {
   2848    switch (devinfo->gen) {
   2849    case 10: return 16;
   2850    case 9: return 16;
   2851    case 8: return 16;
   2852    case 7:
   2853       if (devinfo->is_haswell) {
   2854          return 16;
   2855       } else {
   2856          return 0;
   2857       }
   2858    case 6: return 0;
   2859    case 5: return 0;
   2860    case 4:
   2861       if (devinfo->is_g4x) {
   2862          return 0;
   2863       } else {
   2864          return 0;
   2865       }
   2866    default:
   2867       unreachable("Invalid hardware generation");
   2868    }
   2869 }
   2870 
   2871 
   2872 
   2873 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_start  48
   2874 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_start  48
   2875 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_start  48
   2876 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_start  48
   2877 
   2878 static inline uint32_t ATTRIBUTE_PURE
   2879 _3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableBlockClear_start(const struct gen_device_info *devinfo)
   2880 {
   2881    switch (devinfo->gen) {
   2882    case 10: return 48;
   2883    case 9: return 48;
   2884    case 8: return 48;
   2885    case 7:
   2886       if (devinfo->is_haswell) {
   2887          return 48;
   2888       } else {
   2889          return 0;
   2890       }
   2891    case 6: return 0;
   2892    case 5: return 0;
   2893    case 4:
   2894       if (devinfo->is_g4x) {
   2895          return 0;
   2896       } else {
   2897          return 0;
   2898       }
   2899    default:
   2900       unreachable("Invalid hardware generation");
   2901    }
   2902 }
   2903 
   2904 
   2905 
   2906 /* 3DSTATE_BINDING_TABLE_EDIT_DS::Binding Table Edit Target */
   2907 
   2908 
   2909 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_bits  2
   2910 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_bits  2
   2911 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_bits  2
   2912 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_bits  2
   2913 
   2914 static inline uint32_t ATTRIBUTE_PURE
   2915 _3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_bits(const struct gen_device_info *devinfo)
   2916 {
   2917    switch (devinfo->gen) {
   2918    case 10: return 2;
   2919    case 9: return 2;
   2920    case 8: return 2;
   2921    case 7:
   2922       if (devinfo->is_haswell) {
   2923          return 2;
   2924       } else {
   2925          return 0;
   2926       }
   2927    case 6: return 0;
   2928    case 5: return 0;
   2929    case 4:
   2930       if (devinfo->is_g4x) {
   2931          return 0;
   2932       } else {
   2933          return 0;
   2934       }
   2935    default:
   2936       unreachable("Invalid hardware generation");
   2937    }
   2938 }
   2939 
   2940 
   2941 
   2942 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_start  32
   2943 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_start  32
   2944 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_start  32
   2945 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_start  32
   2946 
   2947 static inline uint32_t ATTRIBUTE_PURE
   2948 _3DSTATE_BINDING_TABLE_EDIT_DS_BindingTableEditTarget_start(const struct gen_device_info *devinfo)
   2949 {
   2950    switch (devinfo->gen) {
   2951    case 10: return 32;
   2952    case 9: return 32;
   2953    case 8: return 32;
   2954    case 7:
   2955       if (devinfo->is_haswell) {
   2956          return 32;
   2957       } else {
   2958          return 0;
   2959       }
   2960    case 6: return 0;
   2961    case 5: return 0;
   2962    case 4:
   2963       if (devinfo->is_g4x) {
   2964          return 0;
   2965       } else {
   2966          return 0;
   2967       }
   2968    default:
   2969       unreachable("Invalid hardware generation");
   2970    }
   2971 }
   2972 
   2973 
   2974 
   2975 /* 3DSTATE_BINDING_TABLE_EDIT_DS::Command SubType */
   2976 
   2977 
   2978 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_bits  2
   2979 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_bits  2
   2980 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_bits  2
   2981 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_bits  2
   2982 
   2983 static inline uint32_t ATTRIBUTE_PURE
   2984 _3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   2985 {
   2986    switch (devinfo->gen) {
   2987    case 10: return 2;
   2988    case 9: return 2;
   2989    case 8: return 2;
   2990    case 7:
   2991       if (devinfo->is_haswell) {
   2992          return 2;
   2993       } else {
   2994          return 0;
   2995       }
   2996    case 6: return 0;
   2997    case 5: return 0;
   2998    case 4:
   2999       if (devinfo->is_g4x) {
   3000          return 0;
   3001       } else {
   3002          return 0;
   3003       }
   3004    default:
   3005       unreachable("Invalid hardware generation");
   3006    }
   3007 }
   3008 
   3009 
   3010 
   3011 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_start  27
   3012 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_start  27
   3013 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_start  27
   3014 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_start  27
   3015 
   3016 static inline uint32_t ATTRIBUTE_PURE
   3017 _3DSTATE_BINDING_TABLE_EDIT_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   3018 {
   3019    switch (devinfo->gen) {
   3020    case 10: return 27;
   3021    case 9: return 27;
   3022    case 8: return 27;
   3023    case 7:
   3024       if (devinfo->is_haswell) {
   3025          return 27;
   3026       } else {
   3027          return 0;
   3028       }
   3029    case 6: return 0;
   3030    case 5: return 0;
   3031    case 4:
   3032       if (devinfo->is_g4x) {
   3033          return 0;
   3034       } else {
   3035          return 0;
   3036       }
   3037    default:
   3038       unreachable("Invalid hardware generation");
   3039    }
   3040 }
   3041 
   3042 
   3043 
   3044 /* 3DSTATE_BINDING_TABLE_EDIT_DS::Command Type */
   3045 
   3046 
   3047 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_bits  3
   3048 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_bits  3
   3049 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_bits  3
   3050 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_bits  3
   3051 
   3052 static inline uint32_t ATTRIBUTE_PURE
   3053 _3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_bits(const struct gen_device_info *devinfo)
   3054 {
   3055    switch (devinfo->gen) {
   3056    case 10: return 3;
   3057    case 9: return 3;
   3058    case 8: return 3;
   3059    case 7:
   3060       if (devinfo->is_haswell) {
   3061          return 3;
   3062       } else {
   3063          return 0;
   3064       }
   3065    case 6: return 0;
   3066    case 5: return 0;
   3067    case 4:
   3068       if (devinfo->is_g4x) {
   3069          return 0;
   3070       } else {
   3071          return 0;
   3072       }
   3073    default:
   3074       unreachable("Invalid hardware generation");
   3075    }
   3076 }
   3077 
   3078 
   3079 
   3080 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_start  29
   3081 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_start  29
   3082 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_start  29
   3083 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_start  29
   3084 
   3085 static inline uint32_t ATTRIBUTE_PURE
   3086 _3DSTATE_BINDING_TABLE_EDIT_DS_CommandType_start(const struct gen_device_info *devinfo)
   3087 {
   3088    switch (devinfo->gen) {
   3089    case 10: return 29;
   3090    case 9: return 29;
   3091    case 8: return 29;
   3092    case 7:
   3093       if (devinfo->is_haswell) {
   3094          return 29;
   3095       } else {
   3096          return 0;
   3097       }
   3098    case 6: return 0;
   3099    case 5: return 0;
   3100    case 4:
   3101       if (devinfo->is_g4x) {
   3102          return 0;
   3103       } else {
   3104          return 0;
   3105       }
   3106    default:
   3107       unreachable("Invalid hardware generation");
   3108    }
   3109 }
   3110 
   3111 
   3112 
   3113 /* 3DSTATE_BINDING_TABLE_EDIT_DS::DWord Length */
   3114 
   3115 
   3116 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_bits  9
   3117 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_bits  9
   3118 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_bits  9
   3119 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_bits  9
   3120 
   3121 static inline uint32_t ATTRIBUTE_PURE
   3122 _3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   3123 {
   3124    switch (devinfo->gen) {
   3125    case 10: return 9;
   3126    case 9: return 9;
   3127    case 8: return 9;
   3128    case 7:
   3129       if (devinfo->is_haswell) {
   3130          return 9;
   3131       } else {
   3132          return 0;
   3133       }
   3134    case 6: return 0;
   3135    case 5: return 0;
   3136    case 4:
   3137       if (devinfo->is_g4x) {
   3138          return 0;
   3139       } else {
   3140          return 0;
   3141       }
   3142    default:
   3143       unreachable("Invalid hardware generation");
   3144    }
   3145 }
   3146 
   3147 
   3148 
   3149 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_start  0
   3150 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_start  0
   3151 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_start  0
   3152 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_start  0
   3153 
   3154 static inline uint32_t ATTRIBUTE_PURE
   3155 _3DSTATE_BINDING_TABLE_EDIT_DS_DWordLength_start(const struct gen_device_info *devinfo)
   3156 {
   3157    switch (devinfo->gen) {
   3158    case 10: return 0;
   3159    case 9: return 0;
   3160    case 8: return 0;
   3161    case 7:
   3162       if (devinfo->is_haswell) {
   3163          return 0;
   3164       } else {
   3165          return 0;
   3166       }
   3167    case 6: return 0;
   3168    case 5: return 0;
   3169    case 4:
   3170       if (devinfo->is_g4x) {
   3171          return 0;
   3172       } else {
   3173          return 0;
   3174       }
   3175    default:
   3176       unreachable("Invalid hardware generation");
   3177    }
   3178 }
   3179 
   3180 
   3181 
   3182 /* 3DSTATE_BINDING_TABLE_EDIT_DS::Entry [n] */
   3183 
   3184 
   3185 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_bits  32
   3186 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_bits  32
   3187 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_bits  32
   3188 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_bits  32
   3189 
   3190 static inline uint32_t ATTRIBUTE_PURE
   3191 _3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_bits(const struct gen_device_info *devinfo)
   3192 {
   3193    switch (devinfo->gen) {
   3194    case 10: return 32;
   3195    case 9: return 32;
   3196    case 8: return 32;
   3197    case 7:
   3198       if (devinfo->is_haswell) {
   3199          return 32;
   3200       } else {
   3201          return 0;
   3202       }
   3203    case 6: return 0;
   3204    case 5: return 0;
   3205    case 4:
   3206       if (devinfo->is_g4x) {
   3207          return 0;
   3208       } else {
   3209          return 0;
   3210       }
   3211    default:
   3212       unreachable("Invalid hardware generation");
   3213    }
   3214 }
   3215 
   3216 
   3217 
   3218 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_start  0
   3219 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_start  0
   3220 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_start  0
   3221 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_start  0
   3222 
   3223 static inline uint32_t ATTRIBUTE_PURE
   3224 _3DSTATE_BINDING_TABLE_EDIT_DS_Entryn_start(const struct gen_device_info *devinfo)
   3225 {
   3226    switch (devinfo->gen) {
   3227    case 10: return 0;
   3228    case 9: return 0;
   3229    case 8: return 0;
   3230    case 7:
   3231       if (devinfo->is_haswell) {
   3232          return 0;
   3233       } else {
   3234          return 0;
   3235       }
   3236    case 6: return 0;
   3237    case 5: return 0;
   3238    case 4:
   3239       if (devinfo->is_g4x) {
   3240          return 0;
   3241       } else {
   3242          return 0;
   3243       }
   3244    default:
   3245       unreachable("Invalid hardware generation");
   3246    }
   3247 }
   3248 
   3249 
   3250 
   3251 /* 3DSTATE_BINDING_TABLE_EDIT_GS */
   3252 
   3253 
   3254 
   3255 
   3256 
   3257 /* 3DSTATE_BINDING_TABLE_EDIT_GS::3D Command Opcode */
   3258 
   3259 
   3260 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_bits  3
   3261 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_bits  3
   3262 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_bits  3
   3263 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_bits  3
   3264 
   3265 static inline uint32_t ATTRIBUTE_PURE
   3266 _3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   3267 {
   3268    switch (devinfo->gen) {
   3269    case 10: return 3;
   3270    case 9: return 3;
   3271    case 8: return 3;
   3272    case 7:
   3273       if (devinfo->is_haswell) {
   3274          return 3;
   3275       } else {
   3276          return 0;
   3277       }
   3278    case 6: return 0;
   3279    case 5: return 0;
   3280    case 4:
   3281       if (devinfo->is_g4x) {
   3282          return 0;
   3283       } else {
   3284          return 0;
   3285       }
   3286    default:
   3287       unreachable("Invalid hardware generation");
   3288    }
   3289 }
   3290 
   3291 
   3292 
   3293 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_start  24
   3294 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_start  24
   3295 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_start  24
   3296 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_start  24
   3297 
   3298 static inline uint32_t ATTRIBUTE_PURE
   3299 _3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   3300 {
   3301    switch (devinfo->gen) {
   3302    case 10: return 24;
   3303    case 9: return 24;
   3304    case 8: return 24;
   3305    case 7:
   3306       if (devinfo->is_haswell) {
   3307          return 24;
   3308       } else {
   3309          return 0;
   3310       }
   3311    case 6: return 0;
   3312    case 5: return 0;
   3313    case 4:
   3314       if (devinfo->is_g4x) {
   3315          return 0;
   3316       } else {
   3317          return 0;
   3318       }
   3319    default:
   3320       unreachable("Invalid hardware generation");
   3321    }
   3322 }
   3323 
   3324 
   3325 
   3326 /* 3DSTATE_BINDING_TABLE_EDIT_GS::3D Command Sub Opcode */
   3327 
   3328 
   3329 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_bits  8
   3330 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_bits  8
   3331 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_bits  8
   3332 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_bits  8
   3333 
   3334 static inline uint32_t ATTRIBUTE_PURE
   3335 _3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   3336 {
   3337    switch (devinfo->gen) {
   3338    case 10: return 8;
   3339    case 9: return 8;
   3340    case 8: return 8;
   3341    case 7:
   3342       if (devinfo->is_haswell) {
   3343          return 8;
   3344       } else {
   3345          return 0;
   3346       }
   3347    case 6: return 0;
   3348    case 5: return 0;
   3349    case 4:
   3350       if (devinfo->is_g4x) {
   3351          return 0;
   3352       } else {
   3353          return 0;
   3354       }
   3355    default:
   3356       unreachable("Invalid hardware generation");
   3357    }
   3358 }
   3359 
   3360 
   3361 
   3362 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_start  16
   3363 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_start  16
   3364 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_start  16
   3365 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_start  16
   3366 
   3367 static inline uint32_t ATTRIBUTE_PURE
   3368 _3DSTATE_BINDING_TABLE_EDIT_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   3369 {
   3370    switch (devinfo->gen) {
   3371    case 10: return 16;
   3372    case 9: return 16;
   3373    case 8: return 16;
   3374    case 7:
   3375       if (devinfo->is_haswell) {
   3376          return 16;
   3377       } else {
   3378          return 0;
   3379       }
   3380    case 6: return 0;
   3381    case 5: return 0;
   3382    case 4:
   3383       if (devinfo->is_g4x) {
   3384          return 0;
   3385       } else {
   3386          return 0;
   3387       }
   3388    default:
   3389       unreachable("Invalid hardware generation");
   3390    }
   3391 }
   3392 
   3393 
   3394 
   3395 /* 3DSTATE_BINDING_TABLE_EDIT_GS::Binding Table Block Clear */
   3396 
   3397 
   3398 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_bits  16
   3399 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_bits  16
   3400 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_bits  16
   3401 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_bits  16
   3402 
   3403 static inline uint32_t ATTRIBUTE_PURE
   3404 _3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_bits(const struct gen_device_info *devinfo)
   3405 {
   3406    switch (devinfo->gen) {
   3407    case 10: return 16;
   3408    case 9: return 16;
   3409    case 8: return 16;
   3410    case 7:
   3411       if (devinfo->is_haswell) {
   3412          return 16;
   3413       } else {
   3414          return 0;
   3415       }
   3416    case 6: return 0;
   3417    case 5: return 0;
   3418    case 4:
   3419       if (devinfo->is_g4x) {
   3420          return 0;
   3421       } else {
   3422          return 0;
   3423       }
   3424    default:
   3425       unreachable("Invalid hardware generation");
   3426    }
   3427 }
   3428 
   3429 
   3430 
   3431 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_start  48
   3432 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_start  48
   3433 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_start  48
   3434 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_start  48
   3435 
   3436 static inline uint32_t ATTRIBUTE_PURE
   3437 _3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableBlockClear_start(const struct gen_device_info *devinfo)
   3438 {
   3439    switch (devinfo->gen) {
   3440    case 10: return 48;
   3441    case 9: return 48;
   3442    case 8: return 48;
   3443    case 7:
   3444       if (devinfo->is_haswell) {
   3445          return 48;
   3446       } else {
   3447          return 0;
   3448       }
   3449    case 6: return 0;
   3450    case 5: return 0;
   3451    case 4:
   3452       if (devinfo->is_g4x) {
   3453          return 0;
   3454       } else {
   3455          return 0;
   3456       }
   3457    default:
   3458       unreachable("Invalid hardware generation");
   3459    }
   3460 }
   3461 
   3462 
   3463 
   3464 /* 3DSTATE_BINDING_TABLE_EDIT_GS::Binding Table Edit Target */
   3465 
   3466 
   3467 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_bits  2
   3468 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_bits  2
   3469 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_bits  2
   3470 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_bits  2
   3471 
   3472 static inline uint32_t ATTRIBUTE_PURE
   3473 _3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_bits(const struct gen_device_info *devinfo)
   3474 {
   3475    switch (devinfo->gen) {
   3476    case 10: return 2;
   3477    case 9: return 2;
   3478    case 8: return 2;
   3479    case 7:
   3480       if (devinfo->is_haswell) {
   3481          return 2;
   3482       } else {
   3483          return 0;
   3484       }
   3485    case 6: return 0;
   3486    case 5: return 0;
   3487    case 4:
   3488       if (devinfo->is_g4x) {
   3489          return 0;
   3490       } else {
   3491          return 0;
   3492       }
   3493    default:
   3494       unreachable("Invalid hardware generation");
   3495    }
   3496 }
   3497 
   3498 
   3499 
   3500 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_start  32
   3501 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_start  32
   3502 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_start  32
   3503 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_start  32
   3504 
   3505 static inline uint32_t ATTRIBUTE_PURE
   3506 _3DSTATE_BINDING_TABLE_EDIT_GS_BindingTableEditTarget_start(const struct gen_device_info *devinfo)
   3507 {
   3508    switch (devinfo->gen) {
   3509    case 10: return 32;
   3510    case 9: return 32;
   3511    case 8: return 32;
   3512    case 7:
   3513       if (devinfo->is_haswell) {
   3514          return 32;
   3515       } else {
   3516          return 0;
   3517       }
   3518    case 6: return 0;
   3519    case 5: return 0;
   3520    case 4:
   3521       if (devinfo->is_g4x) {
   3522          return 0;
   3523       } else {
   3524          return 0;
   3525       }
   3526    default:
   3527       unreachable("Invalid hardware generation");
   3528    }
   3529 }
   3530 
   3531 
   3532 
   3533 /* 3DSTATE_BINDING_TABLE_EDIT_GS::Command SubType */
   3534 
   3535 
   3536 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_bits  2
   3537 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_bits  2
   3538 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_bits  2
   3539 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_bits  2
   3540 
   3541 static inline uint32_t ATTRIBUTE_PURE
   3542 _3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   3543 {
   3544    switch (devinfo->gen) {
   3545    case 10: return 2;
   3546    case 9: return 2;
   3547    case 8: return 2;
   3548    case 7:
   3549       if (devinfo->is_haswell) {
   3550          return 2;
   3551       } else {
   3552          return 0;
   3553       }
   3554    case 6: return 0;
   3555    case 5: return 0;
   3556    case 4:
   3557       if (devinfo->is_g4x) {
   3558          return 0;
   3559       } else {
   3560          return 0;
   3561       }
   3562    default:
   3563       unreachable("Invalid hardware generation");
   3564    }
   3565 }
   3566 
   3567 
   3568 
   3569 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_start  27
   3570 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_start  27
   3571 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_start  27
   3572 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_start  27
   3573 
   3574 static inline uint32_t ATTRIBUTE_PURE
   3575 _3DSTATE_BINDING_TABLE_EDIT_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   3576 {
   3577    switch (devinfo->gen) {
   3578    case 10: return 27;
   3579    case 9: return 27;
   3580    case 8: return 27;
   3581    case 7:
   3582       if (devinfo->is_haswell) {
   3583          return 27;
   3584       } else {
   3585          return 0;
   3586       }
   3587    case 6: return 0;
   3588    case 5: return 0;
   3589    case 4:
   3590       if (devinfo->is_g4x) {
   3591          return 0;
   3592       } else {
   3593          return 0;
   3594       }
   3595    default:
   3596       unreachable("Invalid hardware generation");
   3597    }
   3598 }
   3599 
   3600 
   3601 
   3602 /* 3DSTATE_BINDING_TABLE_EDIT_GS::Command Type */
   3603 
   3604 
   3605 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_bits  3
   3606 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_bits  3
   3607 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_bits  3
   3608 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_bits  3
   3609 
   3610 static inline uint32_t ATTRIBUTE_PURE
   3611 _3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_bits(const struct gen_device_info *devinfo)
   3612 {
   3613    switch (devinfo->gen) {
   3614    case 10: return 3;
   3615    case 9: return 3;
   3616    case 8: return 3;
   3617    case 7:
   3618       if (devinfo->is_haswell) {
   3619          return 3;
   3620       } else {
   3621          return 0;
   3622       }
   3623    case 6: return 0;
   3624    case 5: return 0;
   3625    case 4:
   3626       if (devinfo->is_g4x) {
   3627          return 0;
   3628       } else {
   3629          return 0;
   3630       }
   3631    default:
   3632       unreachable("Invalid hardware generation");
   3633    }
   3634 }
   3635 
   3636 
   3637 
   3638 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_start  29
   3639 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_start  29
   3640 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_start  29
   3641 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_start  29
   3642 
   3643 static inline uint32_t ATTRIBUTE_PURE
   3644 _3DSTATE_BINDING_TABLE_EDIT_GS_CommandType_start(const struct gen_device_info *devinfo)
   3645 {
   3646    switch (devinfo->gen) {
   3647    case 10: return 29;
   3648    case 9: return 29;
   3649    case 8: return 29;
   3650    case 7:
   3651       if (devinfo->is_haswell) {
   3652          return 29;
   3653       } else {
   3654          return 0;
   3655       }
   3656    case 6: return 0;
   3657    case 5: return 0;
   3658    case 4:
   3659       if (devinfo->is_g4x) {
   3660          return 0;
   3661       } else {
   3662          return 0;
   3663       }
   3664    default:
   3665       unreachable("Invalid hardware generation");
   3666    }
   3667 }
   3668 
   3669 
   3670 
   3671 /* 3DSTATE_BINDING_TABLE_EDIT_GS::DWord Length */
   3672 
   3673 
   3674 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_bits  9
   3675 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_bits  9
   3676 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_bits  9
   3677 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_bits  9
   3678 
   3679 static inline uint32_t ATTRIBUTE_PURE
   3680 _3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   3681 {
   3682    switch (devinfo->gen) {
   3683    case 10: return 9;
   3684    case 9: return 9;
   3685    case 8: return 9;
   3686    case 7:
   3687       if (devinfo->is_haswell) {
   3688          return 9;
   3689       } else {
   3690          return 0;
   3691       }
   3692    case 6: return 0;
   3693    case 5: return 0;
   3694    case 4:
   3695       if (devinfo->is_g4x) {
   3696          return 0;
   3697       } else {
   3698          return 0;
   3699       }
   3700    default:
   3701       unreachable("Invalid hardware generation");
   3702    }
   3703 }
   3704 
   3705 
   3706 
   3707 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_start  0
   3708 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_start  0
   3709 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_start  0
   3710 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_start  0
   3711 
   3712 static inline uint32_t ATTRIBUTE_PURE
   3713 _3DSTATE_BINDING_TABLE_EDIT_GS_DWordLength_start(const struct gen_device_info *devinfo)
   3714 {
   3715    switch (devinfo->gen) {
   3716    case 10: return 0;
   3717    case 9: return 0;
   3718    case 8: return 0;
   3719    case 7:
   3720       if (devinfo->is_haswell) {
   3721          return 0;
   3722       } else {
   3723          return 0;
   3724       }
   3725    case 6: return 0;
   3726    case 5: return 0;
   3727    case 4:
   3728       if (devinfo->is_g4x) {
   3729          return 0;
   3730       } else {
   3731          return 0;
   3732       }
   3733    default:
   3734       unreachable("Invalid hardware generation");
   3735    }
   3736 }
   3737 
   3738 
   3739 
   3740 /* 3DSTATE_BINDING_TABLE_EDIT_GS::Entry [n] */
   3741 
   3742 
   3743 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_bits  32
   3744 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_bits  32
   3745 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_bits  32
   3746 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_bits  32
   3747 
   3748 static inline uint32_t ATTRIBUTE_PURE
   3749 _3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_bits(const struct gen_device_info *devinfo)
   3750 {
   3751    switch (devinfo->gen) {
   3752    case 10: return 32;
   3753    case 9: return 32;
   3754    case 8: return 32;
   3755    case 7:
   3756       if (devinfo->is_haswell) {
   3757          return 32;
   3758       } else {
   3759          return 0;
   3760       }
   3761    case 6: return 0;
   3762    case 5: return 0;
   3763    case 4:
   3764       if (devinfo->is_g4x) {
   3765          return 0;
   3766       } else {
   3767          return 0;
   3768       }
   3769    default:
   3770       unreachable("Invalid hardware generation");
   3771    }
   3772 }
   3773 
   3774 
   3775 
   3776 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_start  0
   3777 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_start  0
   3778 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_start  0
   3779 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_start  0
   3780 
   3781 static inline uint32_t ATTRIBUTE_PURE
   3782 _3DSTATE_BINDING_TABLE_EDIT_GS_Entryn_start(const struct gen_device_info *devinfo)
   3783 {
   3784    switch (devinfo->gen) {
   3785    case 10: return 0;
   3786    case 9: return 0;
   3787    case 8: return 0;
   3788    case 7:
   3789       if (devinfo->is_haswell) {
   3790          return 0;
   3791       } else {
   3792          return 0;
   3793       }
   3794    case 6: return 0;
   3795    case 5: return 0;
   3796    case 4:
   3797       if (devinfo->is_g4x) {
   3798          return 0;
   3799       } else {
   3800          return 0;
   3801       }
   3802    default:
   3803       unreachable("Invalid hardware generation");
   3804    }
   3805 }
   3806 
   3807 
   3808 
   3809 /* 3DSTATE_BINDING_TABLE_EDIT_HS */
   3810 
   3811 
   3812 
   3813 
   3814 
   3815 /* 3DSTATE_BINDING_TABLE_EDIT_HS::3D Command Opcode */
   3816 
   3817 
   3818 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_bits  3
   3819 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_bits  3
   3820 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_bits  3
   3821 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_bits  3
   3822 
   3823 static inline uint32_t ATTRIBUTE_PURE
   3824 _3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   3825 {
   3826    switch (devinfo->gen) {
   3827    case 10: return 3;
   3828    case 9: return 3;
   3829    case 8: return 3;
   3830    case 7:
   3831       if (devinfo->is_haswell) {
   3832          return 3;
   3833       } else {
   3834          return 0;
   3835       }
   3836    case 6: return 0;
   3837    case 5: return 0;
   3838    case 4:
   3839       if (devinfo->is_g4x) {
   3840          return 0;
   3841       } else {
   3842          return 0;
   3843       }
   3844    default:
   3845       unreachable("Invalid hardware generation");
   3846    }
   3847 }
   3848 
   3849 
   3850 
   3851 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_start  24
   3852 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_start  24
   3853 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_start  24
   3854 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_start  24
   3855 
   3856 static inline uint32_t ATTRIBUTE_PURE
   3857 _3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   3858 {
   3859    switch (devinfo->gen) {
   3860    case 10: return 24;
   3861    case 9: return 24;
   3862    case 8: return 24;
   3863    case 7:
   3864       if (devinfo->is_haswell) {
   3865          return 24;
   3866       } else {
   3867          return 0;
   3868       }
   3869    case 6: return 0;
   3870    case 5: return 0;
   3871    case 4:
   3872       if (devinfo->is_g4x) {
   3873          return 0;
   3874       } else {
   3875          return 0;
   3876       }
   3877    default:
   3878       unreachable("Invalid hardware generation");
   3879    }
   3880 }
   3881 
   3882 
   3883 
   3884 /* 3DSTATE_BINDING_TABLE_EDIT_HS::3D Command Sub Opcode */
   3885 
   3886 
   3887 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_bits  8
   3888 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_bits  8
   3889 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_bits  8
   3890 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_bits  8
   3891 
   3892 static inline uint32_t ATTRIBUTE_PURE
   3893 _3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   3894 {
   3895    switch (devinfo->gen) {
   3896    case 10: return 8;
   3897    case 9: return 8;
   3898    case 8: return 8;
   3899    case 7:
   3900       if (devinfo->is_haswell) {
   3901          return 8;
   3902       } else {
   3903          return 0;
   3904       }
   3905    case 6: return 0;
   3906    case 5: return 0;
   3907    case 4:
   3908       if (devinfo->is_g4x) {
   3909          return 0;
   3910       } else {
   3911          return 0;
   3912       }
   3913    default:
   3914       unreachable("Invalid hardware generation");
   3915    }
   3916 }
   3917 
   3918 
   3919 
   3920 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_start  16
   3921 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_start  16
   3922 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_start  16
   3923 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_start  16
   3924 
   3925 static inline uint32_t ATTRIBUTE_PURE
   3926 _3DSTATE_BINDING_TABLE_EDIT_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   3927 {
   3928    switch (devinfo->gen) {
   3929    case 10: return 16;
   3930    case 9: return 16;
   3931    case 8: return 16;
   3932    case 7:
   3933       if (devinfo->is_haswell) {
   3934          return 16;
   3935       } else {
   3936          return 0;
   3937       }
   3938    case 6: return 0;
   3939    case 5: return 0;
   3940    case 4:
   3941       if (devinfo->is_g4x) {
   3942          return 0;
   3943       } else {
   3944          return 0;
   3945       }
   3946    default:
   3947       unreachable("Invalid hardware generation");
   3948    }
   3949 }
   3950 
   3951 
   3952 
   3953 /* 3DSTATE_BINDING_TABLE_EDIT_HS::Binding Table Block Clear */
   3954 
   3955 
   3956 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_bits  16
   3957 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_bits  16
   3958 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_bits  16
   3959 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_bits  16
   3960 
   3961 static inline uint32_t ATTRIBUTE_PURE
   3962 _3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_bits(const struct gen_device_info *devinfo)
   3963 {
   3964    switch (devinfo->gen) {
   3965    case 10: return 16;
   3966    case 9: return 16;
   3967    case 8: return 16;
   3968    case 7:
   3969       if (devinfo->is_haswell) {
   3970          return 16;
   3971       } else {
   3972          return 0;
   3973       }
   3974    case 6: return 0;
   3975    case 5: return 0;
   3976    case 4:
   3977       if (devinfo->is_g4x) {
   3978          return 0;
   3979       } else {
   3980          return 0;
   3981       }
   3982    default:
   3983       unreachable("Invalid hardware generation");
   3984    }
   3985 }
   3986 
   3987 
   3988 
   3989 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_start  48
   3990 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_start  48
   3991 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_start  48
   3992 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_start  48
   3993 
   3994 static inline uint32_t ATTRIBUTE_PURE
   3995 _3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableBlockClear_start(const struct gen_device_info *devinfo)
   3996 {
   3997    switch (devinfo->gen) {
   3998    case 10: return 48;
   3999    case 9: return 48;
   4000    case 8: return 48;
   4001    case 7:
   4002       if (devinfo->is_haswell) {
   4003          return 48;
   4004       } else {
   4005          return 0;
   4006       }
   4007    case 6: return 0;
   4008    case 5: return 0;
   4009    case 4:
   4010       if (devinfo->is_g4x) {
   4011          return 0;
   4012       } else {
   4013          return 0;
   4014       }
   4015    default:
   4016       unreachable("Invalid hardware generation");
   4017    }
   4018 }
   4019 
   4020 
   4021 
   4022 /* 3DSTATE_BINDING_TABLE_EDIT_HS::Binding Table Edit Target */
   4023 
   4024 
   4025 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_bits  2
   4026 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_bits  2
   4027 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_bits  2
   4028 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_bits  2
   4029 
   4030 static inline uint32_t ATTRIBUTE_PURE
   4031 _3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_bits(const struct gen_device_info *devinfo)
   4032 {
   4033    switch (devinfo->gen) {
   4034    case 10: return 2;
   4035    case 9: return 2;
   4036    case 8: return 2;
   4037    case 7:
   4038       if (devinfo->is_haswell) {
   4039          return 2;
   4040       } else {
   4041          return 0;
   4042       }
   4043    case 6: return 0;
   4044    case 5: return 0;
   4045    case 4:
   4046       if (devinfo->is_g4x) {
   4047          return 0;
   4048       } else {
   4049          return 0;
   4050       }
   4051    default:
   4052       unreachable("Invalid hardware generation");
   4053    }
   4054 }
   4055 
   4056 
   4057 
   4058 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_start  32
   4059 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_start  32
   4060 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_start  32
   4061 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_start  32
   4062 
   4063 static inline uint32_t ATTRIBUTE_PURE
   4064 _3DSTATE_BINDING_TABLE_EDIT_HS_BindingTableEditTarget_start(const struct gen_device_info *devinfo)
   4065 {
   4066    switch (devinfo->gen) {
   4067    case 10: return 32;
   4068    case 9: return 32;
   4069    case 8: return 32;
   4070    case 7:
   4071       if (devinfo->is_haswell) {
   4072          return 32;
   4073       } else {
   4074          return 0;
   4075       }
   4076    case 6: return 0;
   4077    case 5: return 0;
   4078    case 4:
   4079       if (devinfo->is_g4x) {
   4080          return 0;
   4081       } else {
   4082          return 0;
   4083       }
   4084    default:
   4085       unreachable("Invalid hardware generation");
   4086    }
   4087 }
   4088 
   4089 
   4090 
   4091 /* 3DSTATE_BINDING_TABLE_EDIT_HS::Command SubType */
   4092 
   4093 
   4094 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_bits  2
   4095 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_bits  2
   4096 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_bits  2
   4097 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_bits  2
   4098 
   4099 static inline uint32_t ATTRIBUTE_PURE
   4100 _3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   4101 {
   4102    switch (devinfo->gen) {
   4103    case 10: return 2;
   4104    case 9: return 2;
   4105    case 8: return 2;
   4106    case 7:
   4107       if (devinfo->is_haswell) {
   4108          return 2;
   4109       } else {
   4110          return 0;
   4111       }
   4112    case 6: return 0;
   4113    case 5: return 0;
   4114    case 4:
   4115       if (devinfo->is_g4x) {
   4116          return 0;
   4117       } else {
   4118          return 0;
   4119       }
   4120    default:
   4121       unreachable("Invalid hardware generation");
   4122    }
   4123 }
   4124 
   4125 
   4126 
   4127 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_start  27
   4128 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_start  27
   4129 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_start  27
   4130 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_start  27
   4131 
   4132 static inline uint32_t ATTRIBUTE_PURE
   4133 _3DSTATE_BINDING_TABLE_EDIT_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   4134 {
   4135    switch (devinfo->gen) {
   4136    case 10: return 27;
   4137    case 9: return 27;
   4138    case 8: return 27;
   4139    case 7:
   4140       if (devinfo->is_haswell) {
   4141          return 27;
   4142       } else {
   4143          return 0;
   4144       }
   4145    case 6: return 0;
   4146    case 5: return 0;
   4147    case 4:
   4148       if (devinfo->is_g4x) {
   4149          return 0;
   4150       } else {
   4151          return 0;
   4152       }
   4153    default:
   4154       unreachable("Invalid hardware generation");
   4155    }
   4156 }
   4157 
   4158 
   4159 
   4160 /* 3DSTATE_BINDING_TABLE_EDIT_HS::Command Type */
   4161 
   4162 
   4163 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_bits  3
   4164 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_bits  3
   4165 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_bits  3
   4166 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_bits  3
   4167 
   4168 static inline uint32_t ATTRIBUTE_PURE
   4169 _3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_bits(const struct gen_device_info *devinfo)
   4170 {
   4171    switch (devinfo->gen) {
   4172    case 10: return 3;
   4173    case 9: return 3;
   4174    case 8: return 3;
   4175    case 7:
   4176       if (devinfo->is_haswell) {
   4177          return 3;
   4178       } else {
   4179          return 0;
   4180       }
   4181    case 6: return 0;
   4182    case 5: return 0;
   4183    case 4:
   4184       if (devinfo->is_g4x) {
   4185          return 0;
   4186       } else {
   4187          return 0;
   4188       }
   4189    default:
   4190       unreachable("Invalid hardware generation");
   4191    }
   4192 }
   4193 
   4194 
   4195 
   4196 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_start  29
   4197 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_start  29
   4198 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_start  29
   4199 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_start  29
   4200 
   4201 static inline uint32_t ATTRIBUTE_PURE
   4202 _3DSTATE_BINDING_TABLE_EDIT_HS_CommandType_start(const struct gen_device_info *devinfo)
   4203 {
   4204    switch (devinfo->gen) {
   4205    case 10: return 29;
   4206    case 9: return 29;
   4207    case 8: return 29;
   4208    case 7:
   4209       if (devinfo->is_haswell) {
   4210          return 29;
   4211       } else {
   4212          return 0;
   4213       }
   4214    case 6: return 0;
   4215    case 5: return 0;
   4216    case 4:
   4217       if (devinfo->is_g4x) {
   4218          return 0;
   4219       } else {
   4220          return 0;
   4221       }
   4222    default:
   4223       unreachable("Invalid hardware generation");
   4224    }
   4225 }
   4226 
   4227 
   4228 
   4229 /* 3DSTATE_BINDING_TABLE_EDIT_HS::DWord Length */
   4230 
   4231 
   4232 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_bits  9
   4233 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_bits  9
   4234 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_bits  9
   4235 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_bits  9
   4236 
   4237 static inline uint32_t ATTRIBUTE_PURE
   4238 _3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   4239 {
   4240    switch (devinfo->gen) {
   4241    case 10: return 9;
   4242    case 9: return 9;
   4243    case 8: return 9;
   4244    case 7:
   4245       if (devinfo->is_haswell) {
   4246          return 9;
   4247       } else {
   4248          return 0;
   4249       }
   4250    case 6: return 0;
   4251    case 5: return 0;
   4252    case 4:
   4253       if (devinfo->is_g4x) {
   4254          return 0;
   4255       } else {
   4256          return 0;
   4257       }
   4258    default:
   4259       unreachable("Invalid hardware generation");
   4260    }
   4261 }
   4262 
   4263 
   4264 
   4265 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_start  0
   4266 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_start  0
   4267 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_start  0
   4268 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_start  0
   4269 
   4270 static inline uint32_t ATTRIBUTE_PURE
   4271 _3DSTATE_BINDING_TABLE_EDIT_HS_DWordLength_start(const struct gen_device_info *devinfo)
   4272 {
   4273    switch (devinfo->gen) {
   4274    case 10: return 0;
   4275    case 9: return 0;
   4276    case 8: return 0;
   4277    case 7:
   4278       if (devinfo->is_haswell) {
   4279          return 0;
   4280       } else {
   4281          return 0;
   4282       }
   4283    case 6: return 0;
   4284    case 5: return 0;
   4285    case 4:
   4286       if (devinfo->is_g4x) {
   4287          return 0;
   4288       } else {
   4289          return 0;
   4290       }
   4291    default:
   4292       unreachable("Invalid hardware generation");
   4293    }
   4294 }
   4295 
   4296 
   4297 
   4298 /* 3DSTATE_BINDING_TABLE_EDIT_HS::Entry [n] */
   4299 
   4300 
   4301 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_bits  32
   4302 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_bits  32
   4303 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_bits  32
   4304 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_bits  32
   4305 
   4306 static inline uint32_t ATTRIBUTE_PURE
   4307 _3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_bits(const struct gen_device_info *devinfo)
   4308 {
   4309    switch (devinfo->gen) {
   4310    case 10: return 32;
   4311    case 9: return 32;
   4312    case 8: return 32;
   4313    case 7:
   4314       if (devinfo->is_haswell) {
   4315          return 32;
   4316       } else {
   4317          return 0;
   4318       }
   4319    case 6: return 0;
   4320    case 5: return 0;
   4321    case 4:
   4322       if (devinfo->is_g4x) {
   4323          return 0;
   4324       } else {
   4325          return 0;
   4326       }
   4327    default:
   4328       unreachable("Invalid hardware generation");
   4329    }
   4330 }
   4331 
   4332 
   4333 
   4334 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_start  0
   4335 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_start  0
   4336 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_start  0
   4337 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_start  0
   4338 
   4339 static inline uint32_t ATTRIBUTE_PURE
   4340 _3DSTATE_BINDING_TABLE_EDIT_HS_Entryn_start(const struct gen_device_info *devinfo)
   4341 {
   4342    switch (devinfo->gen) {
   4343    case 10: return 0;
   4344    case 9: return 0;
   4345    case 8: return 0;
   4346    case 7:
   4347       if (devinfo->is_haswell) {
   4348          return 0;
   4349       } else {
   4350          return 0;
   4351       }
   4352    case 6: return 0;
   4353    case 5: return 0;
   4354    case 4:
   4355       if (devinfo->is_g4x) {
   4356          return 0;
   4357       } else {
   4358          return 0;
   4359       }
   4360    default:
   4361       unreachable("Invalid hardware generation");
   4362    }
   4363 }
   4364 
   4365 
   4366 
   4367 /* 3DSTATE_BINDING_TABLE_EDIT_PS */
   4368 
   4369 
   4370 
   4371 
   4372 
   4373 /* 3DSTATE_BINDING_TABLE_EDIT_PS::3D Command Opcode */
   4374 
   4375 
   4376 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_bits  3
   4377 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_bits  3
   4378 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_bits  3
   4379 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_bits  3
   4380 
   4381 static inline uint32_t ATTRIBUTE_PURE
   4382 _3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   4383 {
   4384    switch (devinfo->gen) {
   4385    case 10: return 3;
   4386    case 9: return 3;
   4387    case 8: return 3;
   4388    case 7:
   4389       if (devinfo->is_haswell) {
   4390          return 3;
   4391       } else {
   4392          return 0;
   4393       }
   4394    case 6: return 0;
   4395    case 5: return 0;
   4396    case 4:
   4397       if (devinfo->is_g4x) {
   4398          return 0;
   4399       } else {
   4400          return 0;
   4401       }
   4402    default:
   4403       unreachable("Invalid hardware generation");
   4404    }
   4405 }
   4406 
   4407 
   4408 
   4409 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_start  24
   4410 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_start  24
   4411 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_start  24
   4412 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_start  24
   4413 
   4414 static inline uint32_t ATTRIBUTE_PURE
   4415 _3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   4416 {
   4417    switch (devinfo->gen) {
   4418    case 10: return 24;
   4419    case 9: return 24;
   4420    case 8: return 24;
   4421    case 7:
   4422       if (devinfo->is_haswell) {
   4423          return 24;
   4424       } else {
   4425          return 0;
   4426       }
   4427    case 6: return 0;
   4428    case 5: return 0;
   4429    case 4:
   4430       if (devinfo->is_g4x) {
   4431          return 0;
   4432       } else {
   4433          return 0;
   4434       }
   4435    default:
   4436       unreachable("Invalid hardware generation");
   4437    }
   4438 }
   4439 
   4440 
   4441 
   4442 /* 3DSTATE_BINDING_TABLE_EDIT_PS::3D Command Sub Opcode */
   4443 
   4444 
   4445 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_bits  8
   4446 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_bits  8
   4447 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_bits  8
   4448 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_bits  8
   4449 
   4450 static inline uint32_t ATTRIBUTE_PURE
   4451 _3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   4452 {
   4453    switch (devinfo->gen) {
   4454    case 10: return 8;
   4455    case 9: return 8;
   4456    case 8: return 8;
   4457    case 7:
   4458       if (devinfo->is_haswell) {
   4459          return 8;
   4460       } else {
   4461          return 0;
   4462       }
   4463    case 6: return 0;
   4464    case 5: return 0;
   4465    case 4:
   4466       if (devinfo->is_g4x) {
   4467          return 0;
   4468       } else {
   4469          return 0;
   4470       }
   4471    default:
   4472       unreachable("Invalid hardware generation");
   4473    }
   4474 }
   4475 
   4476 
   4477 
   4478 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_start  16
   4479 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_start  16
   4480 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_start  16
   4481 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_start  16
   4482 
   4483 static inline uint32_t ATTRIBUTE_PURE
   4484 _3DSTATE_BINDING_TABLE_EDIT_PS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   4485 {
   4486    switch (devinfo->gen) {
   4487    case 10: return 16;
   4488    case 9: return 16;
   4489    case 8: return 16;
   4490    case 7:
   4491       if (devinfo->is_haswell) {
   4492          return 16;
   4493       } else {
   4494          return 0;
   4495       }
   4496    case 6: return 0;
   4497    case 5: return 0;
   4498    case 4:
   4499       if (devinfo->is_g4x) {
   4500          return 0;
   4501       } else {
   4502          return 0;
   4503       }
   4504    default:
   4505       unreachable("Invalid hardware generation");
   4506    }
   4507 }
   4508 
   4509 
   4510 
   4511 /* 3DSTATE_BINDING_TABLE_EDIT_PS::Binding Table Block Clear */
   4512 
   4513 
   4514 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_bits  16
   4515 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_bits  16
   4516 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_bits  16
   4517 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_bits  16
   4518 
   4519 static inline uint32_t ATTRIBUTE_PURE
   4520 _3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_bits(const struct gen_device_info *devinfo)
   4521 {
   4522    switch (devinfo->gen) {
   4523    case 10: return 16;
   4524    case 9: return 16;
   4525    case 8: return 16;
   4526    case 7:
   4527       if (devinfo->is_haswell) {
   4528          return 16;
   4529       } else {
   4530          return 0;
   4531       }
   4532    case 6: return 0;
   4533    case 5: return 0;
   4534    case 4:
   4535       if (devinfo->is_g4x) {
   4536          return 0;
   4537       } else {
   4538          return 0;
   4539       }
   4540    default:
   4541       unreachable("Invalid hardware generation");
   4542    }
   4543 }
   4544 
   4545 
   4546 
   4547 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_start  48
   4548 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_start  48
   4549 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_start  48
   4550 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_start  48
   4551 
   4552 static inline uint32_t ATTRIBUTE_PURE
   4553 _3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableBlockClear_start(const struct gen_device_info *devinfo)
   4554 {
   4555    switch (devinfo->gen) {
   4556    case 10: return 48;
   4557    case 9: return 48;
   4558    case 8: return 48;
   4559    case 7:
   4560       if (devinfo->is_haswell) {
   4561          return 48;
   4562       } else {
   4563          return 0;
   4564       }
   4565    case 6: return 0;
   4566    case 5: return 0;
   4567    case 4:
   4568       if (devinfo->is_g4x) {
   4569          return 0;
   4570       } else {
   4571          return 0;
   4572       }
   4573    default:
   4574       unreachable("Invalid hardware generation");
   4575    }
   4576 }
   4577 
   4578 
   4579 
   4580 /* 3DSTATE_BINDING_TABLE_EDIT_PS::Binding Table Edit Target */
   4581 
   4582 
   4583 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_bits  2
   4584 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_bits  2
   4585 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_bits  2
   4586 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_bits  2
   4587 
   4588 static inline uint32_t ATTRIBUTE_PURE
   4589 _3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_bits(const struct gen_device_info *devinfo)
   4590 {
   4591    switch (devinfo->gen) {
   4592    case 10: return 2;
   4593    case 9: return 2;
   4594    case 8: return 2;
   4595    case 7:
   4596       if (devinfo->is_haswell) {
   4597          return 2;
   4598       } else {
   4599          return 0;
   4600       }
   4601    case 6: return 0;
   4602    case 5: return 0;
   4603    case 4:
   4604       if (devinfo->is_g4x) {
   4605          return 0;
   4606       } else {
   4607          return 0;
   4608       }
   4609    default:
   4610       unreachable("Invalid hardware generation");
   4611    }
   4612 }
   4613 
   4614 
   4615 
   4616 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_start  32
   4617 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_start  32
   4618 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_start  32
   4619 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_start  32
   4620 
   4621 static inline uint32_t ATTRIBUTE_PURE
   4622 _3DSTATE_BINDING_TABLE_EDIT_PS_BindingTableEditTarget_start(const struct gen_device_info *devinfo)
   4623 {
   4624    switch (devinfo->gen) {
   4625    case 10: return 32;
   4626    case 9: return 32;
   4627    case 8: return 32;
   4628    case 7:
   4629       if (devinfo->is_haswell) {
   4630          return 32;
   4631       } else {
   4632          return 0;
   4633       }
   4634    case 6: return 0;
   4635    case 5: return 0;
   4636    case 4:
   4637       if (devinfo->is_g4x) {
   4638          return 0;
   4639       } else {
   4640          return 0;
   4641       }
   4642    default:
   4643       unreachable("Invalid hardware generation");
   4644    }
   4645 }
   4646 
   4647 
   4648 
   4649 /* 3DSTATE_BINDING_TABLE_EDIT_PS::Command SubType */
   4650 
   4651 
   4652 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_bits  2
   4653 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_bits  2
   4654 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_bits  2
   4655 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_bits  2
   4656 
   4657 static inline uint32_t ATTRIBUTE_PURE
   4658 _3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_bits(const struct gen_device_info *devinfo)
   4659 {
   4660    switch (devinfo->gen) {
   4661    case 10: return 2;
   4662    case 9: return 2;
   4663    case 8: return 2;
   4664    case 7:
   4665       if (devinfo->is_haswell) {
   4666          return 2;
   4667       } else {
   4668          return 0;
   4669       }
   4670    case 6: return 0;
   4671    case 5: return 0;
   4672    case 4:
   4673       if (devinfo->is_g4x) {
   4674          return 0;
   4675       } else {
   4676          return 0;
   4677       }
   4678    default:
   4679       unreachable("Invalid hardware generation");
   4680    }
   4681 }
   4682 
   4683 
   4684 
   4685 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_start  27
   4686 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_start  27
   4687 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_start  27
   4688 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_start  27
   4689 
   4690 static inline uint32_t ATTRIBUTE_PURE
   4691 _3DSTATE_BINDING_TABLE_EDIT_PS_CommandSubType_start(const struct gen_device_info *devinfo)
   4692 {
   4693    switch (devinfo->gen) {
   4694    case 10: return 27;
   4695    case 9: return 27;
   4696    case 8: return 27;
   4697    case 7:
   4698       if (devinfo->is_haswell) {
   4699          return 27;
   4700       } else {
   4701          return 0;
   4702       }
   4703    case 6: return 0;
   4704    case 5: return 0;
   4705    case 4:
   4706       if (devinfo->is_g4x) {
   4707          return 0;
   4708       } else {
   4709          return 0;
   4710       }
   4711    default:
   4712       unreachable("Invalid hardware generation");
   4713    }
   4714 }
   4715 
   4716 
   4717 
   4718 /* 3DSTATE_BINDING_TABLE_EDIT_PS::Command Type */
   4719 
   4720 
   4721 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_bits  3
   4722 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_bits  3
   4723 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_bits  3
   4724 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_bits  3
   4725 
   4726 static inline uint32_t ATTRIBUTE_PURE
   4727 _3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_bits(const struct gen_device_info *devinfo)
   4728 {
   4729    switch (devinfo->gen) {
   4730    case 10: return 3;
   4731    case 9: return 3;
   4732    case 8: return 3;
   4733    case 7:
   4734       if (devinfo->is_haswell) {
   4735          return 3;
   4736       } else {
   4737          return 0;
   4738       }
   4739    case 6: return 0;
   4740    case 5: return 0;
   4741    case 4:
   4742       if (devinfo->is_g4x) {
   4743          return 0;
   4744       } else {
   4745          return 0;
   4746       }
   4747    default:
   4748       unreachable("Invalid hardware generation");
   4749    }
   4750 }
   4751 
   4752 
   4753 
   4754 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_start  29
   4755 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_start  29
   4756 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_start  29
   4757 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_start  29
   4758 
   4759 static inline uint32_t ATTRIBUTE_PURE
   4760 _3DSTATE_BINDING_TABLE_EDIT_PS_CommandType_start(const struct gen_device_info *devinfo)
   4761 {
   4762    switch (devinfo->gen) {
   4763    case 10: return 29;
   4764    case 9: return 29;
   4765    case 8: return 29;
   4766    case 7:
   4767       if (devinfo->is_haswell) {
   4768          return 29;
   4769       } else {
   4770          return 0;
   4771       }
   4772    case 6: return 0;
   4773    case 5: return 0;
   4774    case 4:
   4775       if (devinfo->is_g4x) {
   4776          return 0;
   4777       } else {
   4778          return 0;
   4779       }
   4780    default:
   4781       unreachable("Invalid hardware generation");
   4782    }
   4783 }
   4784 
   4785 
   4786 
   4787 /* 3DSTATE_BINDING_TABLE_EDIT_PS::DWord Length */
   4788 
   4789 
   4790 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_bits  9
   4791 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_bits  9
   4792 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_bits  9
   4793 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_bits  9
   4794 
   4795 static inline uint32_t ATTRIBUTE_PURE
   4796 _3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_bits(const struct gen_device_info *devinfo)
   4797 {
   4798    switch (devinfo->gen) {
   4799    case 10: return 9;
   4800    case 9: return 9;
   4801    case 8: return 9;
   4802    case 7:
   4803       if (devinfo->is_haswell) {
   4804          return 9;
   4805       } else {
   4806          return 0;
   4807       }
   4808    case 6: return 0;
   4809    case 5: return 0;
   4810    case 4:
   4811       if (devinfo->is_g4x) {
   4812          return 0;
   4813       } else {
   4814          return 0;
   4815       }
   4816    default:
   4817       unreachable("Invalid hardware generation");
   4818    }
   4819 }
   4820 
   4821 
   4822 
   4823 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_start  0
   4824 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_start  0
   4825 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_start  0
   4826 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_start  0
   4827 
   4828 static inline uint32_t ATTRIBUTE_PURE
   4829 _3DSTATE_BINDING_TABLE_EDIT_PS_DWordLength_start(const struct gen_device_info *devinfo)
   4830 {
   4831    switch (devinfo->gen) {
   4832    case 10: return 0;
   4833    case 9: return 0;
   4834    case 8: return 0;
   4835    case 7:
   4836       if (devinfo->is_haswell) {
   4837          return 0;
   4838       } else {
   4839          return 0;
   4840       }
   4841    case 6: return 0;
   4842    case 5: return 0;
   4843    case 4:
   4844       if (devinfo->is_g4x) {
   4845          return 0;
   4846       } else {
   4847          return 0;
   4848       }
   4849    default:
   4850       unreachable("Invalid hardware generation");
   4851    }
   4852 }
   4853 
   4854 
   4855 
   4856 /* 3DSTATE_BINDING_TABLE_EDIT_PS::Entry [n] */
   4857 
   4858 
   4859 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_bits  32
   4860 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_bits  32
   4861 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_bits  32
   4862 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_bits  32
   4863 
   4864 static inline uint32_t ATTRIBUTE_PURE
   4865 _3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_bits(const struct gen_device_info *devinfo)
   4866 {
   4867    switch (devinfo->gen) {
   4868    case 10: return 32;
   4869    case 9: return 32;
   4870    case 8: return 32;
   4871    case 7:
   4872       if (devinfo->is_haswell) {
   4873          return 32;
   4874       } else {
   4875          return 0;
   4876       }
   4877    case 6: return 0;
   4878    case 5: return 0;
   4879    case 4:
   4880       if (devinfo->is_g4x) {
   4881          return 0;
   4882       } else {
   4883          return 0;
   4884       }
   4885    default:
   4886       unreachable("Invalid hardware generation");
   4887    }
   4888 }
   4889 
   4890 
   4891 
   4892 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_start  0
   4893 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_start  0
   4894 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_start  0
   4895 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_start  0
   4896 
   4897 static inline uint32_t ATTRIBUTE_PURE
   4898 _3DSTATE_BINDING_TABLE_EDIT_PS_Entryn_start(const struct gen_device_info *devinfo)
   4899 {
   4900    switch (devinfo->gen) {
   4901    case 10: return 0;
   4902    case 9: return 0;
   4903    case 8: return 0;
   4904    case 7:
   4905       if (devinfo->is_haswell) {
   4906          return 0;
   4907       } else {
   4908          return 0;
   4909       }
   4910    case 6: return 0;
   4911    case 5: return 0;
   4912    case 4:
   4913       if (devinfo->is_g4x) {
   4914          return 0;
   4915       } else {
   4916          return 0;
   4917       }
   4918    default:
   4919       unreachable("Invalid hardware generation");
   4920    }
   4921 }
   4922 
   4923 
   4924 
   4925 /* 3DSTATE_BINDING_TABLE_EDIT_VS */
   4926 
   4927 
   4928 
   4929 
   4930 
   4931 /* 3DSTATE_BINDING_TABLE_EDIT_VS::3D Command Opcode */
   4932 
   4933 
   4934 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_bits  3
   4935 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_bits  3
   4936 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_bits  3
   4937 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_bits  3
   4938 
   4939 static inline uint32_t ATTRIBUTE_PURE
   4940 _3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   4941 {
   4942    switch (devinfo->gen) {
   4943    case 10: return 3;
   4944    case 9: return 3;
   4945    case 8: return 3;
   4946    case 7:
   4947       if (devinfo->is_haswell) {
   4948          return 3;
   4949       } else {
   4950          return 0;
   4951       }
   4952    case 6: return 0;
   4953    case 5: return 0;
   4954    case 4:
   4955       if (devinfo->is_g4x) {
   4956          return 0;
   4957       } else {
   4958          return 0;
   4959       }
   4960    default:
   4961       unreachable("Invalid hardware generation");
   4962    }
   4963 }
   4964 
   4965 
   4966 
   4967 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_start  24
   4968 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_start  24
   4969 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_start  24
   4970 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_start  24
   4971 
   4972 static inline uint32_t ATTRIBUTE_PURE
   4973 _3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   4974 {
   4975    switch (devinfo->gen) {
   4976    case 10: return 24;
   4977    case 9: return 24;
   4978    case 8: return 24;
   4979    case 7:
   4980       if (devinfo->is_haswell) {
   4981          return 24;
   4982       } else {
   4983          return 0;
   4984       }
   4985    case 6: return 0;
   4986    case 5: return 0;
   4987    case 4:
   4988       if (devinfo->is_g4x) {
   4989          return 0;
   4990       } else {
   4991          return 0;
   4992       }
   4993    default:
   4994       unreachable("Invalid hardware generation");
   4995    }
   4996 }
   4997 
   4998 
   4999 
   5000 /* 3DSTATE_BINDING_TABLE_EDIT_VS::3D Command Sub Opcode */
   5001 
   5002 
   5003 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_bits  8
   5004 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_bits  8
   5005 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_bits  8
   5006 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_bits  8
   5007 
   5008 static inline uint32_t ATTRIBUTE_PURE
   5009 _3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   5010 {
   5011    switch (devinfo->gen) {
   5012    case 10: return 8;
   5013    case 9: return 8;
   5014    case 8: return 8;
   5015    case 7:
   5016       if (devinfo->is_haswell) {
   5017          return 8;
   5018       } else {
   5019          return 0;
   5020       }
   5021    case 6: return 0;
   5022    case 5: return 0;
   5023    case 4:
   5024       if (devinfo->is_g4x) {
   5025          return 0;
   5026       } else {
   5027          return 0;
   5028       }
   5029    default:
   5030       unreachable("Invalid hardware generation");
   5031    }
   5032 }
   5033 
   5034 
   5035 
   5036 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_start  16
   5037 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_start  16
   5038 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_start  16
   5039 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_start  16
   5040 
   5041 static inline uint32_t ATTRIBUTE_PURE
   5042 _3DSTATE_BINDING_TABLE_EDIT_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   5043 {
   5044    switch (devinfo->gen) {
   5045    case 10: return 16;
   5046    case 9: return 16;
   5047    case 8: return 16;
   5048    case 7:
   5049       if (devinfo->is_haswell) {
   5050          return 16;
   5051       } else {
   5052          return 0;
   5053       }
   5054    case 6: return 0;
   5055    case 5: return 0;
   5056    case 4:
   5057       if (devinfo->is_g4x) {
   5058          return 0;
   5059       } else {
   5060          return 0;
   5061       }
   5062    default:
   5063       unreachable("Invalid hardware generation");
   5064    }
   5065 }
   5066 
   5067 
   5068 
   5069 /* 3DSTATE_BINDING_TABLE_EDIT_VS::Binding Table Block Clear */
   5070 
   5071 
   5072 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_bits  16
   5073 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_bits  16
   5074 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_bits  16
   5075 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_bits  16
   5076 
   5077 static inline uint32_t ATTRIBUTE_PURE
   5078 _3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_bits(const struct gen_device_info *devinfo)
   5079 {
   5080    switch (devinfo->gen) {
   5081    case 10: return 16;
   5082    case 9: return 16;
   5083    case 8: return 16;
   5084    case 7:
   5085       if (devinfo->is_haswell) {
   5086          return 16;
   5087       } else {
   5088          return 0;
   5089       }
   5090    case 6: return 0;
   5091    case 5: return 0;
   5092    case 4:
   5093       if (devinfo->is_g4x) {
   5094          return 0;
   5095       } else {
   5096          return 0;
   5097       }
   5098    default:
   5099       unreachable("Invalid hardware generation");
   5100    }
   5101 }
   5102 
   5103 
   5104 
   5105 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_start  48
   5106 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_start  48
   5107 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_start  48
   5108 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_start  48
   5109 
   5110 static inline uint32_t ATTRIBUTE_PURE
   5111 _3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableBlockClear_start(const struct gen_device_info *devinfo)
   5112 {
   5113    switch (devinfo->gen) {
   5114    case 10: return 48;
   5115    case 9: return 48;
   5116    case 8: return 48;
   5117    case 7:
   5118       if (devinfo->is_haswell) {
   5119          return 48;
   5120       } else {
   5121          return 0;
   5122       }
   5123    case 6: return 0;
   5124    case 5: return 0;
   5125    case 4:
   5126       if (devinfo->is_g4x) {
   5127          return 0;
   5128       } else {
   5129          return 0;
   5130       }
   5131    default:
   5132       unreachable("Invalid hardware generation");
   5133    }
   5134 }
   5135 
   5136 
   5137 
   5138 /* 3DSTATE_BINDING_TABLE_EDIT_VS::Binding Table Edit Target */
   5139 
   5140 
   5141 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_bits  2
   5142 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_bits  2
   5143 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_bits  2
   5144 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_bits  2
   5145 
   5146 static inline uint32_t ATTRIBUTE_PURE
   5147 _3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_bits(const struct gen_device_info *devinfo)
   5148 {
   5149    switch (devinfo->gen) {
   5150    case 10: return 2;
   5151    case 9: return 2;
   5152    case 8: return 2;
   5153    case 7:
   5154       if (devinfo->is_haswell) {
   5155          return 2;
   5156       } else {
   5157          return 0;
   5158       }
   5159    case 6: return 0;
   5160    case 5: return 0;
   5161    case 4:
   5162       if (devinfo->is_g4x) {
   5163          return 0;
   5164       } else {
   5165          return 0;
   5166       }
   5167    default:
   5168       unreachable("Invalid hardware generation");
   5169    }
   5170 }
   5171 
   5172 
   5173 
   5174 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_start  32
   5175 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_start  32
   5176 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_start  32
   5177 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_start  32
   5178 
   5179 static inline uint32_t ATTRIBUTE_PURE
   5180 _3DSTATE_BINDING_TABLE_EDIT_VS_BindingTableEditTarget_start(const struct gen_device_info *devinfo)
   5181 {
   5182    switch (devinfo->gen) {
   5183    case 10: return 32;
   5184    case 9: return 32;
   5185    case 8: return 32;
   5186    case 7:
   5187       if (devinfo->is_haswell) {
   5188          return 32;
   5189       } else {
   5190          return 0;
   5191       }
   5192    case 6: return 0;
   5193    case 5: return 0;
   5194    case 4:
   5195       if (devinfo->is_g4x) {
   5196          return 0;
   5197       } else {
   5198          return 0;
   5199       }
   5200    default:
   5201       unreachable("Invalid hardware generation");
   5202    }
   5203 }
   5204 
   5205 
   5206 
   5207 /* 3DSTATE_BINDING_TABLE_EDIT_VS::Command SubType */
   5208 
   5209 
   5210 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_bits  2
   5211 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_bits  2
   5212 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_bits  2
   5213 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_bits  2
   5214 
   5215 static inline uint32_t ATTRIBUTE_PURE
   5216 _3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   5217 {
   5218    switch (devinfo->gen) {
   5219    case 10: return 2;
   5220    case 9: return 2;
   5221    case 8: return 2;
   5222    case 7:
   5223       if (devinfo->is_haswell) {
   5224          return 2;
   5225       } else {
   5226          return 0;
   5227       }
   5228    case 6: return 0;
   5229    case 5: return 0;
   5230    case 4:
   5231       if (devinfo->is_g4x) {
   5232          return 0;
   5233       } else {
   5234          return 0;
   5235       }
   5236    default:
   5237       unreachable("Invalid hardware generation");
   5238    }
   5239 }
   5240 
   5241 
   5242 
   5243 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_start  27
   5244 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_start  27
   5245 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_start  27
   5246 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_start  27
   5247 
   5248 static inline uint32_t ATTRIBUTE_PURE
   5249 _3DSTATE_BINDING_TABLE_EDIT_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   5250 {
   5251    switch (devinfo->gen) {
   5252    case 10: return 27;
   5253    case 9: return 27;
   5254    case 8: return 27;
   5255    case 7:
   5256       if (devinfo->is_haswell) {
   5257          return 27;
   5258       } else {
   5259          return 0;
   5260       }
   5261    case 6: return 0;
   5262    case 5: return 0;
   5263    case 4:
   5264       if (devinfo->is_g4x) {
   5265          return 0;
   5266       } else {
   5267          return 0;
   5268       }
   5269    default:
   5270       unreachable("Invalid hardware generation");
   5271    }
   5272 }
   5273 
   5274 
   5275 
   5276 /* 3DSTATE_BINDING_TABLE_EDIT_VS::Command Type */
   5277 
   5278 
   5279 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_bits  3
   5280 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_bits  3
   5281 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_bits  3
   5282 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_bits  3
   5283 
   5284 static inline uint32_t ATTRIBUTE_PURE
   5285 _3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_bits(const struct gen_device_info *devinfo)
   5286 {
   5287    switch (devinfo->gen) {
   5288    case 10: return 3;
   5289    case 9: return 3;
   5290    case 8: return 3;
   5291    case 7:
   5292       if (devinfo->is_haswell) {
   5293          return 3;
   5294       } else {
   5295          return 0;
   5296       }
   5297    case 6: return 0;
   5298    case 5: return 0;
   5299    case 4:
   5300       if (devinfo->is_g4x) {
   5301          return 0;
   5302       } else {
   5303          return 0;
   5304       }
   5305    default:
   5306       unreachable("Invalid hardware generation");
   5307    }
   5308 }
   5309 
   5310 
   5311 
   5312 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_start  29
   5313 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_start  29
   5314 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_start  29
   5315 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_start  29
   5316 
   5317 static inline uint32_t ATTRIBUTE_PURE
   5318 _3DSTATE_BINDING_TABLE_EDIT_VS_CommandType_start(const struct gen_device_info *devinfo)
   5319 {
   5320    switch (devinfo->gen) {
   5321    case 10: return 29;
   5322    case 9: return 29;
   5323    case 8: return 29;
   5324    case 7:
   5325       if (devinfo->is_haswell) {
   5326          return 29;
   5327       } else {
   5328          return 0;
   5329       }
   5330    case 6: return 0;
   5331    case 5: return 0;
   5332    case 4:
   5333       if (devinfo->is_g4x) {
   5334          return 0;
   5335       } else {
   5336          return 0;
   5337       }
   5338    default:
   5339       unreachable("Invalid hardware generation");
   5340    }
   5341 }
   5342 
   5343 
   5344 
   5345 /* 3DSTATE_BINDING_TABLE_EDIT_VS::DWord Length */
   5346 
   5347 
   5348 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_bits  9
   5349 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_bits  9
   5350 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_bits  9
   5351 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_bits  9
   5352 
   5353 static inline uint32_t ATTRIBUTE_PURE
   5354 _3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   5355 {
   5356    switch (devinfo->gen) {
   5357    case 10: return 9;
   5358    case 9: return 9;
   5359    case 8: return 9;
   5360    case 7:
   5361       if (devinfo->is_haswell) {
   5362          return 9;
   5363       } else {
   5364          return 0;
   5365       }
   5366    case 6: return 0;
   5367    case 5: return 0;
   5368    case 4:
   5369       if (devinfo->is_g4x) {
   5370          return 0;
   5371       } else {
   5372          return 0;
   5373       }
   5374    default:
   5375       unreachable("Invalid hardware generation");
   5376    }
   5377 }
   5378 
   5379 
   5380 
   5381 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_start  0
   5382 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_start  0
   5383 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_start  0
   5384 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_start  0
   5385 
   5386 static inline uint32_t ATTRIBUTE_PURE
   5387 _3DSTATE_BINDING_TABLE_EDIT_VS_DWordLength_start(const struct gen_device_info *devinfo)
   5388 {
   5389    switch (devinfo->gen) {
   5390    case 10: return 0;
   5391    case 9: return 0;
   5392    case 8: return 0;
   5393    case 7:
   5394       if (devinfo->is_haswell) {
   5395          return 0;
   5396       } else {
   5397          return 0;
   5398       }
   5399    case 6: return 0;
   5400    case 5: return 0;
   5401    case 4:
   5402       if (devinfo->is_g4x) {
   5403          return 0;
   5404       } else {
   5405          return 0;
   5406       }
   5407    default:
   5408       unreachable("Invalid hardware generation");
   5409    }
   5410 }
   5411 
   5412 
   5413 
   5414 /* 3DSTATE_BINDING_TABLE_EDIT_VS::Entry [n] */
   5415 
   5416 
   5417 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_bits  32
   5418 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_bits  32
   5419 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_bits  32
   5420 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_bits  32
   5421 
   5422 static inline uint32_t ATTRIBUTE_PURE
   5423 _3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_bits(const struct gen_device_info *devinfo)
   5424 {
   5425    switch (devinfo->gen) {
   5426    case 10: return 32;
   5427    case 9: return 32;
   5428    case 8: return 32;
   5429    case 7:
   5430       if (devinfo->is_haswell) {
   5431          return 32;
   5432       } else {
   5433          return 0;
   5434       }
   5435    case 6: return 0;
   5436    case 5: return 0;
   5437    case 4:
   5438       if (devinfo->is_g4x) {
   5439          return 0;
   5440       } else {
   5441          return 0;
   5442       }
   5443    default:
   5444       unreachable("Invalid hardware generation");
   5445    }
   5446 }
   5447 
   5448 
   5449 
   5450 #define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_start  0
   5451 #define GEN9_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_start  0
   5452 #define GEN8_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_start  0
   5453 #define GEN75_3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_start  0
   5454 
   5455 static inline uint32_t ATTRIBUTE_PURE
   5456 _3DSTATE_BINDING_TABLE_EDIT_VS_Entryn_start(const struct gen_device_info *devinfo)
   5457 {
   5458    switch (devinfo->gen) {
   5459    case 10: return 0;
   5460    case 9: return 0;
   5461    case 8: return 0;
   5462    case 7:
   5463       if (devinfo->is_haswell) {
   5464          return 0;
   5465       } else {
   5466          return 0;
   5467       }
   5468    case 6: return 0;
   5469    case 5: return 0;
   5470    case 4:
   5471       if (devinfo->is_g4x) {
   5472          return 0;
   5473       } else {
   5474          return 0;
   5475       }
   5476    default:
   5477       unreachable("Invalid hardware generation");
   5478    }
   5479 }
   5480 
   5481 
   5482 
   5483 /* 3DSTATE_BINDING_TABLE_POINTERS */
   5484 
   5485 
   5486 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_length  4
   5487 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_length  6
   5488 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_length  6
   5489 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_length  6
   5490 
   5491 static inline uint32_t ATTRIBUTE_PURE
   5492 _3DSTATE_BINDING_TABLE_POINTERS_length(const struct gen_device_info *devinfo)
   5493 {
   5494    switch (devinfo->gen) {
   5495    case 10: return 0;
   5496    case 9: return 0;
   5497    case 8: return 0;
   5498    case 7:
   5499       if (devinfo->is_haswell) {
   5500          return 0;
   5501       } else {
   5502          return 0;
   5503       }
   5504    case 6: return 4;
   5505    case 5: return 6;
   5506    case 4:
   5507       if (devinfo->is_g4x) {
   5508          return 6;
   5509       } else {
   5510          return 6;
   5511       }
   5512    default:
   5513       unreachable("Invalid hardware generation");
   5514    }
   5515 }
   5516 
   5517 
   5518 
   5519 /* 3DSTATE_BINDING_TABLE_POINTERS::3D Command Opcode */
   5520 
   5521 
   5522 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_bits  3
   5523 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_bits  3
   5524 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_bits  3
   5525 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_bits  3
   5526 
   5527 static inline uint32_t ATTRIBUTE_PURE
   5528 _3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   5529 {
   5530    switch (devinfo->gen) {
   5531    case 10: return 0;
   5532    case 9: return 0;
   5533    case 8: return 0;
   5534    case 7:
   5535       if (devinfo->is_haswell) {
   5536          return 0;
   5537       } else {
   5538          return 0;
   5539       }
   5540    case 6: return 3;
   5541    case 5: return 3;
   5542    case 4:
   5543       if (devinfo->is_g4x) {
   5544          return 3;
   5545       } else {
   5546          return 3;
   5547       }
   5548    default:
   5549       unreachable("Invalid hardware generation");
   5550    }
   5551 }
   5552 
   5553 
   5554 
   5555 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_start  24
   5556 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_start  24
   5557 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_start  24
   5558 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_start  24
   5559 
   5560 static inline uint32_t ATTRIBUTE_PURE
   5561 _3DSTATE_BINDING_TABLE_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   5562 {
   5563    switch (devinfo->gen) {
   5564    case 10: return 0;
   5565    case 9: return 0;
   5566    case 8: return 0;
   5567    case 7:
   5568       if (devinfo->is_haswell) {
   5569          return 0;
   5570       } else {
   5571          return 0;
   5572       }
   5573    case 6: return 24;
   5574    case 5: return 24;
   5575    case 4:
   5576       if (devinfo->is_g4x) {
   5577          return 24;
   5578       } else {
   5579          return 24;
   5580       }
   5581    default:
   5582       unreachable("Invalid hardware generation");
   5583    }
   5584 }
   5585 
   5586 
   5587 
   5588 /* 3DSTATE_BINDING_TABLE_POINTERS::3D Command Sub Opcode */
   5589 
   5590 
   5591 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_bits  8
   5592 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_bits  8
   5593 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_bits  8
   5594 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_bits  8
   5595 
   5596 static inline uint32_t ATTRIBUTE_PURE
   5597 _3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   5598 {
   5599    switch (devinfo->gen) {
   5600    case 10: return 0;
   5601    case 9: return 0;
   5602    case 8: return 0;
   5603    case 7:
   5604       if (devinfo->is_haswell) {
   5605          return 0;
   5606       } else {
   5607          return 0;
   5608       }
   5609    case 6: return 8;
   5610    case 5: return 8;
   5611    case 4:
   5612       if (devinfo->is_g4x) {
   5613          return 8;
   5614       } else {
   5615          return 8;
   5616       }
   5617    default:
   5618       unreachable("Invalid hardware generation");
   5619    }
   5620 }
   5621 
   5622 
   5623 
   5624 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_start  16
   5625 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_start  16
   5626 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_start  16
   5627 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_start  16
   5628 
   5629 static inline uint32_t ATTRIBUTE_PURE
   5630 _3DSTATE_BINDING_TABLE_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   5631 {
   5632    switch (devinfo->gen) {
   5633    case 10: return 0;
   5634    case 9: return 0;
   5635    case 8: return 0;
   5636    case 7:
   5637       if (devinfo->is_haswell) {
   5638          return 0;
   5639       } else {
   5640          return 0;
   5641       }
   5642    case 6: return 16;
   5643    case 5: return 16;
   5644    case 4:
   5645       if (devinfo->is_g4x) {
   5646          return 16;
   5647       } else {
   5648          return 16;
   5649       }
   5650    default:
   5651       unreachable("Invalid hardware generation");
   5652    }
   5653 }
   5654 
   5655 
   5656 
   5657 /* 3DSTATE_BINDING_TABLE_POINTERS::Command SubType */
   5658 
   5659 
   5660 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_bits  2
   5661 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_bits  2
   5662 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_bits  2
   5663 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_bits  2
   5664 
   5665 static inline uint32_t ATTRIBUTE_PURE
   5666 _3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   5667 {
   5668    switch (devinfo->gen) {
   5669    case 10: return 0;
   5670    case 9: return 0;
   5671    case 8: return 0;
   5672    case 7:
   5673       if (devinfo->is_haswell) {
   5674          return 0;
   5675       } else {
   5676          return 0;
   5677       }
   5678    case 6: return 2;
   5679    case 5: return 2;
   5680    case 4:
   5681       if (devinfo->is_g4x) {
   5682          return 2;
   5683       } else {
   5684          return 2;
   5685       }
   5686    default:
   5687       unreachable("Invalid hardware generation");
   5688    }
   5689 }
   5690 
   5691 
   5692 
   5693 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_start  27
   5694 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_start  27
   5695 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_start  27
   5696 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_start  27
   5697 
   5698 static inline uint32_t ATTRIBUTE_PURE
   5699 _3DSTATE_BINDING_TABLE_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   5700 {
   5701    switch (devinfo->gen) {
   5702    case 10: return 0;
   5703    case 9: return 0;
   5704    case 8: return 0;
   5705    case 7:
   5706       if (devinfo->is_haswell) {
   5707          return 0;
   5708       } else {
   5709          return 0;
   5710       }
   5711    case 6: return 27;
   5712    case 5: return 27;
   5713    case 4:
   5714       if (devinfo->is_g4x) {
   5715          return 27;
   5716       } else {
   5717          return 27;
   5718       }
   5719    default:
   5720       unreachable("Invalid hardware generation");
   5721    }
   5722 }
   5723 
   5724 
   5725 
   5726 /* 3DSTATE_BINDING_TABLE_POINTERS::Command Type */
   5727 
   5728 
   5729 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_CommandType_bits  3
   5730 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_CommandType_bits  3
   5731 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_CommandType_bits  3
   5732 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_CommandType_bits  3
   5733 
   5734 static inline uint32_t ATTRIBUTE_PURE
   5735 _3DSTATE_BINDING_TABLE_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   5736 {
   5737    switch (devinfo->gen) {
   5738    case 10: return 0;
   5739    case 9: return 0;
   5740    case 8: return 0;
   5741    case 7:
   5742       if (devinfo->is_haswell) {
   5743          return 0;
   5744       } else {
   5745          return 0;
   5746       }
   5747    case 6: return 3;
   5748    case 5: return 3;
   5749    case 4:
   5750       if (devinfo->is_g4x) {
   5751          return 3;
   5752       } else {
   5753          return 3;
   5754       }
   5755    default:
   5756       unreachable("Invalid hardware generation");
   5757    }
   5758 }
   5759 
   5760 
   5761 
   5762 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_CommandType_start  29
   5763 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_CommandType_start  29
   5764 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_CommandType_start  29
   5765 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_CommandType_start  29
   5766 
   5767 static inline uint32_t ATTRIBUTE_PURE
   5768 _3DSTATE_BINDING_TABLE_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   5769 {
   5770    switch (devinfo->gen) {
   5771    case 10: return 0;
   5772    case 9: return 0;
   5773    case 8: return 0;
   5774    case 7:
   5775       if (devinfo->is_haswell) {
   5776          return 0;
   5777       } else {
   5778          return 0;
   5779       }
   5780    case 6: return 29;
   5781    case 5: return 29;
   5782    case 4:
   5783       if (devinfo->is_g4x) {
   5784          return 29;
   5785       } else {
   5786          return 29;
   5787       }
   5788    default:
   5789       unreachable("Invalid hardware generation");
   5790    }
   5791 }
   5792 
   5793 
   5794 
   5795 /* 3DSTATE_BINDING_TABLE_POINTERS::DWord Length */
   5796 
   5797 
   5798 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_bits  8
   5799 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_bits  8
   5800 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_bits  8
   5801 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_bits  8
   5802 
   5803 static inline uint32_t ATTRIBUTE_PURE
   5804 _3DSTATE_BINDING_TABLE_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   5805 {
   5806    switch (devinfo->gen) {
   5807    case 10: return 0;
   5808    case 9: return 0;
   5809    case 8: return 0;
   5810    case 7:
   5811       if (devinfo->is_haswell) {
   5812          return 0;
   5813       } else {
   5814          return 0;
   5815       }
   5816    case 6: return 8;
   5817    case 5: return 8;
   5818    case 4:
   5819       if (devinfo->is_g4x) {
   5820          return 8;
   5821       } else {
   5822          return 8;
   5823       }
   5824    default:
   5825       unreachable("Invalid hardware generation");
   5826    }
   5827 }
   5828 
   5829 
   5830 
   5831 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_start  0
   5832 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_start  0
   5833 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_start  0
   5834 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_DWordLength_start  0
   5835 
   5836 static inline uint32_t ATTRIBUTE_PURE
   5837 _3DSTATE_BINDING_TABLE_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   5838 {
   5839    switch (devinfo->gen) {
   5840    case 10: return 0;
   5841    case 9: return 0;
   5842    case 8: return 0;
   5843    case 7:
   5844       if (devinfo->is_haswell) {
   5845          return 0;
   5846       } else {
   5847          return 0;
   5848       }
   5849    case 6: return 0;
   5850    case 5: return 0;
   5851    case 4:
   5852       if (devinfo->is_g4x) {
   5853          return 0;
   5854       } else {
   5855          return 0;
   5856       }
   5857    default:
   5858       unreachable("Invalid hardware generation");
   5859    }
   5860 }
   5861 
   5862 
   5863 
   5864 /* 3DSTATE_BINDING_TABLE_POINTERS::GS Binding Table Change */
   5865 
   5866 
   5867 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_GSBindingTableChange_bits  1
   5868 
   5869 static inline uint32_t ATTRIBUTE_PURE
   5870 _3DSTATE_BINDING_TABLE_POINTERS_GSBindingTableChange_bits(const struct gen_device_info *devinfo)
   5871 {
   5872    switch (devinfo->gen) {
   5873    case 10: return 0;
   5874    case 9: return 0;
   5875    case 8: return 0;
   5876    case 7:
   5877       if (devinfo->is_haswell) {
   5878          return 0;
   5879       } else {
   5880          return 0;
   5881       }
   5882    case 6: return 1;
   5883    case 5: return 0;
   5884    case 4:
   5885       if (devinfo->is_g4x) {
   5886          return 0;
   5887       } else {
   5888          return 0;
   5889       }
   5890    default:
   5891       unreachable("Invalid hardware generation");
   5892    }
   5893 }
   5894 
   5895 
   5896 
   5897 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_GSBindingTableChange_start  9
   5898 
   5899 static inline uint32_t ATTRIBUTE_PURE
   5900 _3DSTATE_BINDING_TABLE_POINTERS_GSBindingTableChange_start(const struct gen_device_info *devinfo)
   5901 {
   5902    switch (devinfo->gen) {
   5903    case 10: return 0;
   5904    case 9: return 0;
   5905    case 8: return 0;
   5906    case 7:
   5907       if (devinfo->is_haswell) {
   5908          return 0;
   5909       } else {
   5910          return 0;
   5911       }
   5912    case 6: return 9;
   5913    case 5: return 0;
   5914    case 4:
   5915       if (devinfo->is_g4x) {
   5916          return 0;
   5917       } else {
   5918          return 0;
   5919       }
   5920    default:
   5921       unreachable("Invalid hardware generation");
   5922    }
   5923 }
   5924 
   5925 
   5926 
   5927 /* 3DSTATE_BINDING_TABLE_POINTERS::PS Binding Table Change */
   5928 
   5929 
   5930 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PSBindingTableChange_bits  1
   5931 
   5932 static inline uint32_t ATTRIBUTE_PURE
   5933 _3DSTATE_BINDING_TABLE_POINTERS_PSBindingTableChange_bits(const struct gen_device_info *devinfo)
   5934 {
   5935    switch (devinfo->gen) {
   5936    case 10: return 0;
   5937    case 9: return 0;
   5938    case 8: return 0;
   5939    case 7:
   5940       if (devinfo->is_haswell) {
   5941          return 0;
   5942       } else {
   5943          return 0;
   5944       }
   5945    case 6: return 1;
   5946    case 5: return 0;
   5947    case 4:
   5948       if (devinfo->is_g4x) {
   5949          return 0;
   5950       } else {
   5951          return 0;
   5952       }
   5953    default:
   5954       unreachable("Invalid hardware generation");
   5955    }
   5956 }
   5957 
   5958 
   5959 
   5960 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PSBindingTableChange_start  12
   5961 
   5962 static inline uint32_t ATTRIBUTE_PURE
   5963 _3DSTATE_BINDING_TABLE_POINTERS_PSBindingTableChange_start(const struct gen_device_info *devinfo)
   5964 {
   5965    switch (devinfo->gen) {
   5966    case 10: return 0;
   5967    case 9: return 0;
   5968    case 8: return 0;
   5969    case 7:
   5970       if (devinfo->is_haswell) {
   5971          return 0;
   5972       } else {
   5973          return 0;
   5974       }
   5975    case 6: return 12;
   5976    case 5: return 0;
   5977    case 4:
   5978       if (devinfo->is_g4x) {
   5979          return 0;
   5980       } else {
   5981          return 0;
   5982       }
   5983    default:
   5984       unreachable("Invalid hardware generation");
   5985    }
   5986 }
   5987 
   5988 
   5989 
   5990 /* 3DSTATE_BINDING_TABLE_POINTERS::Pointer to CLIP Binding Table */
   5991 
   5992 
   5993 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_bits  27
   5994 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_bits  27
   5995 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_bits  27
   5996 
   5997 static inline uint32_t ATTRIBUTE_PURE
   5998 _3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_bits(const struct gen_device_info *devinfo)
   5999 {
   6000    switch (devinfo->gen) {
   6001    case 10: return 0;
   6002    case 9: return 0;
   6003    case 8: return 0;
   6004    case 7:
   6005       if (devinfo->is_haswell) {
   6006          return 0;
   6007       } else {
   6008          return 0;
   6009       }
   6010    case 6: return 0;
   6011    case 5: return 27;
   6012    case 4:
   6013       if (devinfo->is_g4x) {
   6014          return 27;
   6015       } else {
   6016          return 27;
   6017       }
   6018    default:
   6019       unreachable("Invalid hardware generation");
   6020    }
   6021 }
   6022 
   6023 
   6024 
   6025 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_start  101
   6026 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_start  101
   6027 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_start  101
   6028 
   6029 static inline uint32_t ATTRIBUTE_PURE
   6030 _3DSTATE_BINDING_TABLE_POINTERS_PointertoCLIPBindingTable_start(const struct gen_device_info *devinfo)
   6031 {
   6032    switch (devinfo->gen) {
   6033    case 10: return 0;
   6034    case 9: return 0;
   6035    case 8: return 0;
   6036    case 7:
   6037       if (devinfo->is_haswell) {
   6038          return 0;
   6039       } else {
   6040          return 0;
   6041       }
   6042    case 6: return 0;
   6043    case 5: return 101;
   6044    case 4:
   6045       if (devinfo->is_g4x) {
   6046          return 101;
   6047       } else {
   6048          return 101;
   6049       }
   6050    default:
   6051       unreachable("Invalid hardware generation");
   6052    }
   6053 }
   6054 
   6055 
   6056 
   6057 /* 3DSTATE_BINDING_TABLE_POINTERS::Pointer to GS Binding Table */
   6058 
   6059 
   6060 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_bits  27
   6061 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_bits  27
   6062 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_bits  27
   6063 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_bits  27
   6064 
   6065 static inline uint32_t ATTRIBUTE_PURE
   6066 _3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_bits(const struct gen_device_info *devinfo)
   6067 {
   6068    switch (devinfo->gen) {
   6069    case 10: return 0;
   6070    case 9: return 0;
   6071    case 8: return 0;
   6072    case 7:
   6073       if (devinfo->is_haswell) {
   6074          return 0;
   6075       } else {
   6076          return 0;
   6077       }
   6078    case 6: return 27;
   6079    case 5: return 27;
   6080    case 4:
   6081       if (devinfo->is_g4x) {
   6082          return 27;
   6083       } else {
   6084          return 27;
   6085       }
   6086    default:
   6087       unreachable("Invalid hardware generation");
   6088    }
   6089 }
   6090 
   6091 
   6092 
   6093 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_start  69
   6094 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_start  69
   6095 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_start  69
   6096 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_start  69
   6097 
   6098 static inline uint32_t ATTRIBUTE_PURE
   6099 _3DSTATE_BINDING_TABLE_POINTERS_PointertoGSBindingTable_start(const struct gen_device_info *devinfo)
   6100 {
   6101    switch (devinfo->gen) {
   6102    case 10: return 0;
   6103    case 9: return 0;
   6104    case 8: return 0;
   6105    case 7:
   6106       if (devinfo->is_haswell) {
   6107          return 0;
   6108       } else {
   6109          return 0;
   6110       }
   6111    case 6: return 69;
   6112    case 5: return 69;
   6113    case 4:
   6114       if (devinfo->is_g4x) {
   6115          return 69;
   6116       } else {
   6117          return 69;
   6118       }
   6119    default:
   6120       unreachable("Invalid hardware generation");
   6121    }
   6122 }
   6123 
   6124 
   6125 
   6126 /* 3DSTATE_BINDING_TABLE_POINTERS::Pointer to PS Binding Table */
   6127 
   6128 
   6129 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_bits  27
   6130 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_bits  27
   6131 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_bits  27
   6132 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_bits  27
   6133 
   6134 static inline uint32_t ATTRIBUTE_PURE
   6135 _3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_bits(const struct gen_device_info *devinfo)
   6136 {
   6137    switch (devinfo->gen) {
   6138    case 10: return 0;
   6139    case 9: return 0;
   6140    case 8: return 0;
   6141    case 7:
   6142       if (devinfo->is_haswell) {
   6143          return 0;
   6144       } else {
   6145          return 0;
   6146       }
   6147    case 6: return 27;
   6148    case 5: return 27;
   6149    case 4:
   6150       if (devinfo->is_g4x) {
   6151          return 27;
   6152       } else {
   6153          return 27;
   6154       }
   6155    default:
   6156       unreachable("Invalid hardware generation");
   6157    }
   6158 }
   6159 
   6160 
   6161 
   6162 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_start  101
   6163 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_start  165
   6164 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_start  165
   6165 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_start  165
   6166 
   6167 static inline uint32_t ATTRIBUTE_PURE
   6168 _3DSTATE_BINDING_TABLE_POINTERS_PointertoPSBindingTable_start(const struct gen_device_info *devinfo)
   6169 {
   6170    switch (devinfo->gen) {
   6171    case 10: return 0;
   6172    case 9: return 0;
   6173    case 8: return 0;
   6174    case 7:
   6175       if (devinfo->is_haswell) {
   6176          return 0;
   6177       } else {
   6178          return 0;
   6179       }
   6180    case 6: return 101;
   6181    case 5: return 165;
   6182    case 4:
   6183       if (devinfo->is_g4x) {
   6184          return 165;
   6185       } else {
   6186          return 165;
   6187       }
   6188    default:
   6189       unreachable("Invalid hardware generation");
   6190    }
   6191 }
   6192 
   6193 
   6194 
   6195 /* 3DSTATE_BINDING_TABLE_POINTERS::Pointer to SF Binding Table */
   6196 
   6197 
   6198 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_bits  27
   6199 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_bits  27
   6200 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_bits  27
   6201 
   6202 static inline uint32_t ATTRIBUTE_PURE
   6203 _3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_bits(const struct gen_device_info *devinfo)
   6204 {
   6205    switch (devinfo->gen) {
   6206    case 10: return 0;
   6207    case 9: return 0;
   6208    case 8: return 0;
   6209    case 7:
   6210       if (devinfo->is_haswell) {
   6211          return 0;
   6212       } else {
   6213          return 0;
   6214       }
   6215    case 6: return 0;
   6216    case 5: return 27;
   6217    case 4:
   6218       if (devinfo->is_g4x) {
   6219          return 27;
   6220       } else {
   6221          return 27;
   6222       }
   6223    default:
   6224       unreachable("Invalid hardware generation");
   6225    }
   6226 }
   6227 
   6228 
   6229 
   6230 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_start  133
   6231 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_start  133
   6232 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_start  133
   6233 
   6234 static inline uint32_t ATTRIBUTE_PURE
   6235 _3DSTATE_BINDING_TABLE_POINTERS_PointertoSFBindingTable_start(const struct gen_device_info *devinfo)
   6236 {
   6237    switch (devinfo->gen) {
   6238    case 10: return 0;
   6239    case 9: return 0;
   6240    case 8: return 0;
   6241    case 7:
   6242       if (devinfo->is_haswell) {
   6243          return 0;
   6244       } else {
   6245          return 0;
   6246       }
   6247    case 6: return 0;
   6248    case 5: return 133;
   6249    case 4:
   6250       if (devinfo->is_g4x) {
   6251          return 133;
   6252       } else {
   6253          return 133;
   6254       }
   6255    default:
   6256       unreachable("Invalid hardware generation");
   6257    }
   6258 }
   6259 
   6260 
   6261 
   6262 /* 3DSTATE_BINDING_TABLE_POINTERS::Pointer to VS Binding Table */
   6263 
   6264 
   6265 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_bits  27
   6266 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_bits  27
   6267 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_bits  27
   6268 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_bits  27
   6269 
   6270 static inline uint32_t ATTRIBUTE_PURE
   6271 _3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_bits(const struct gen_device_info *devinfo)
   6272 {
   6273    switch (devinfo->gen) {
   6274    case 10: return 0;
   6275    case 9: return 0;
   6276    case 8: return 0;
   6277    case 7:
   6278       if (devinfo->is_haswell) {
   6279          return 0;
   6280       } else {
   6281          return 0;
   6282       }
   6283    case 6: return 27;
   6284    case 5: return 27;
   6285    case 4:
   6286       if (devinfo->is_g4x) {
   6287          return 27;
   6288       } else {
   6289          return 27;
   6290       }
   6291    default:
   6292       unreachable("Invalid hardware generation");
   6293    }
   6294 }
   6295 
   6296 
   6297 
   6298 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_start  37
   6299 #define GEN5_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_start  37
   6300 #define GEN45_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_start  37
   6301 #define GEN4_3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_start  37
   6302 
   6303 static inline uint32_t ATTRIBUTE_PURE
   6304 _3DSTATE_BINDING_TABLE_POINTERS_PointertoVSBindingTable_start(const struct gen_device_info *devinfo)
   6305 {
   6306    switch (devinfo->gen) {
   6307    case 10: return 0;
   6308    case 9: return 0;
   6309    case 8: return 0;
   6310    case 7:
   6311       if (devinfo->is_haswell) {
   6312          return 0;
   6313       } else {
   6314          return 0;
   6315       }
   6316    case 6: return 37;
   6317    case 5: return 37;
   6318    case 4:
   6319       if (devinfo->is_g4x) {
   6320          return 37;
   6321       } else {
   6322          return 37;
   6323       }
   6324    default:
   6325       unreachable("Invalid hardware generation");
   6326    }
   6327 }
   6328 
   6329 
   6330 
   6331 /* 3DSTATE_BINDING_TABLE_POINTERS::VS Binding Table Change */
   6332 
   6333 
   6334 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_VSBindingTableChange_bits  1
   6335 
   6336 static inline uint32_t ATTRIBUTE_PURE
   6337 _3DSTATE_BINDING_TABLE_POINTERS_VSBindingTableChange_bits(const struct gen_device_info *devinfo)
   6338 {
   6339    switch (devinfo->gen) {
   6340    case 10: return 0;
   6341    case 9: return 0;
   6342    case 8: return 0;
   6343    case 7:
   6344       if (devinfo->is_haswell) {
   6345          return 0;
   6346       } else {
   6347          return 0;
   6348       }
   6349    case 6: return 1;
   6350    case 5: return 0;
   6351    case 4:
   6352       if (devinfo->is_g4x) {
   6353          return 0;
   6354       } else {
   6355          return 0;
   6356       }
   6357    default:
   6358       unreachable("Invalid hardware generation");
   6359    }
   6360 }
   6361 
   6362 
   6363 
   6364 #define GEN6_3DSTATE_BINDING_TABLE_POINTERS_VSBindingTableChange_start  8
   6365 
   6366 static inline uint32_t ATTRIBUTE_PURE
   6367 _3DSTATE_BINDING_TABLE_POINTERS_VSBindingTableChange_start(const struct gen_device_info *devinfo)
   6368 {
   6369    switch (devinfo->gen) {
   6370    case 10: return 0;
   6371    case 9: return 0;
   6372    case 8: return 0;
   6373    case 7:
   6374       if (devinfo->is_haswell) {
   6375          return 0;
   6376       } else {
   6377          return 0;
   6378       }
   6379    case 6: return 8;
   6380    case 5: return 0;
   6381    case 4:
   6382       if (devinfo->is_g4x) {
   6383          return 0;
   6384       } else {
   6385          return 0;
   6386       }
   6387    default:
   6388       unreachable("Invalid hardware generation");
   6389    }
   6390 }
   6391 
   6392 
   6393 
   6394 /* 3DSTATE_BINDING_TABLE_POINTERS_DS */
   6395 
   6396 
   6397 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_length  2
   6398 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_length  2
   6399 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_length  2
   6400 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_length  2
   6401 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_length  2
   6402 
   6403 static inline uint32_t ATTRIBUTE_PURE
   6404 _3DSTATE_BINDING_TABLE_POINTERS_DS_length(const struct gen_device_info *devinfo)
   6405 {
   6406    switch (devinfo->gen) {
   6407    case 10: return 2;
   6408    case 9: return 2;
   6409    case 8: return 2;
   6410    case 7:
   6411       if (devinfo->is_haswell) {
   6412          return 2;
   6413       } else {
   6414          return 2;
   6415       }
   6416    case 6: return 0;
   6417    case 5: return 0;
   6418    case 4:
   6419       if (devinfo->is_g4x) {
   6420          return 0;
   6421       } else {
   6422          return 0;
   6423       }
   6424    default:
   6425       unreachable("Invalid hardware generation");
   6426    }
   6427 }
   6428 
   6429 
   6430 
   6431 /* 3DSTATE_BINDING_TABLE_POINTERS_DS::3D Command Opcode */
   6432 
   6433 
   6434 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_bits  3
   6435 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_bits  3
   6436 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_bits  3
   6437 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_bits  3
   6438 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_bits  3
   6439 
   6440 static inline uint32_t ATTRIBUTE_PURE
   6441 _3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   6442 {
   6443    switch (devinfo->gen) {
   6444    case 10: return 3;
   6445    case 9: return 3;
   6446    case 8: return 3;
   6447    case 7:
   6448       if (devinfo->is_haswell) {
   6449          return 3;
   6450       } else {
   6451          return 3;
   6452       }
   6453    case 6: return 0;
   6454    case 5: return 0;
   6455    case 4:
   6456       if (devinfo->is_g4x) {
   6457          return 0;
   6458       } else {
   6459          return 0;
   6460       }
   6461    default:
   6462       unreachable("Invalid hardware generation");
   6463    }
   6464 }
   6465 
   6466 
   6467 
   6468 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_start  24
   6469 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_start  24
   6470 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_start  24
   6471 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_start  24
   6472 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_start  24
   6473 
   6474 static inline uint32_t ATTRIBUTE_PURE
   6475 _3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   6476 {
   6477    switch (devinfo->gen) {
   6478    case 10: return 24;
   6479    case 9: return 24;
   6480    case 8: return 24;
   6481    case 7:
   6482       if (devinfo->is_haswell) {
   6483          return 24;
   6484       } else {
   6485          return 24;
   6486       }
   6487    case 6: return 0;
   6488    case 5: return 0;
   6489    case 4:
   6490       if (devinfo->is_g4x) {
   6491          return 0;
   6492       } else {
   6493          return 0;
   6494       }
   6495    default:
   6496       unreachable("Invalid hardware generation");
   6497    }
   6498 }
   6499 
   6500 
   6501 
   6502 /* 3DSTATE_BINDING_TABLE_POINTERS_DS::3D Command Sub Opcode */
   6503 
   6504 
   6505 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_bits  8
   6506 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_bits  8
   6507 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_bits  8
   6508 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_bits  8
   6509 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_bits  8
   6510 
   6511 static inline uint32_t ATTRIBUTE_PURE
   6512 _3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   6513 {
   6514    switch (devinfo->gen) {
   6515    case 10: return 8;
   6516    case 9: return 8;
   6517    case 8: return 8;
   6518    case 7:
   6519       if (devinfo->is_haswell) {
   6520          return 8;
   6521       } else {
   6522          return 8;
   6523       }
   6524    case 6: return 0;
   6525    case 5: return 0;
   6526    case 4:
   6527       if (devinfo->is_g4x) {
   6528          return 0;
   6529       } else {
   6530          return 0;
   6531       }
   6532    default:
   6533       unreachable("Invalid hardware generation");
   6534    }
   6535 }
   6536 
   6537 
   6538 
   6539 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_start  16
   6540 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_start  16
   6541 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_start  16
   6542 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_start  16
   6543 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_start  16
   6544 
   6545 static inline uint32_t ATTRIBUTE_PURE
   6546 _3DSTATE_BINDING_TABLE_POINTERS_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   6547 {
   6548    switch (devinfo->gen) {
   6549    case 10: return 16;
   6550    case 9: return 16;
   6551    case 8: return 16;
   6552    case 7:
   6553       if (devinfo->is_haswell) {
   6554          return 16;
   6555       } else {
   6556          return 16;
   6557       }
   6558    case 6: return 0;
   6559    case 5: return 0;
   6560    case 4:
   6561       if (devinfo->is_g4x) {
   6562          return 0;
   6563       } else {
   6564          return 0;
   6565       }
   6566    default:
   6567       unreachable("Invalid hardware generation");
   6568    }
   6569 }
   6570 
   6571 
   6572 
   6573 /* 3DSTATE_BINDING_TABLE_POINTERS_DS::Command SubType */
   6574 
   6575 
   6576 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_bits  2
   6577 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_bits  2
   6578 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_bits  2
   6579 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_bits  2
   6580 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_bits  2
   6581 
   6582 static inline uint32_t ATTRIBUTE_PURE
   6583 _3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   6584 {
   6585    switch (devinfo->gen) {
   6586    case 10: return 2;
   6587    case 9: return 2;
   6588    case 8: return 2;
   6589    case 7:
   6590       if (devinfo->is_haswell) {
   6591          return 2;
   6592       } else {
   6593          return 2;
   6594       }
   6595    case 6: return 0;
   6596    case 5: return 0;
   6597    case 4:
   6598       if (devinfo->is_g4x) {
   6599          return 0;
   6600       } else {
   6601          return 0;
   6602       }
   6603    default:
   6604       unreachable("Invalid hardware generation");
   6605    }
   6606 }
   6607 
   6608 
   6609 
   6610 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_start  27
   6611 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_start  27
   6612 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_start  27
   6613 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_start  27
   6614 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_start  27
   6615 
   6616 static inline uint32_t ATTRIBUTE_PURE
   6617 _3DSTATE_BINDING_TABLE_POINTERS_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   6618 {
   6619    switch (devinfo->gen) {
   6620    case 10: return 27;
   6621    case 9: return 27;
   6622    case 8: return 27;
   6623    case 7:
   6624       if (devinfo->is_haswell) {
   6625          return 27;
   6626       } else {
   6627          return 27;
   6628       }
   6629    case 6: return 0;
   6630    case 5: return 0;
   6631    case 4:
   6632       if (devinfo->is_g4x) {
   6633          return 0;
   6634       } else {
   6635          return 0;
   6636       }
   6637    default:
   6638       unreachable("Invalid hardware generation");
   6639    }
   6640 }
   6641 
   6642 
   6643 
   6644 /* 3DSTATE_BINDING_TABLE_POINTERS_DS::Command Type */
   6645 
   6646 
   6647 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_bits  3
   6648 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_bits  3
   6649 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_bits  3
   6650 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_bits  3
   6651 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_bits  3
   6652 
   6653 static inline uint32_t ATTRIBUTE_PURE
   6654 _3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_bits(const struct gen_device_info *devinfo)
   6655 {
   6656    switch (devinfo->gen) {
   6657    case 10: return 3;
   6658    case 9: return 3;
   6659    case 8: return 3;
   6660    case 7:
   6661       if (devinfo->is_haswell) {
   6662          return 3;
   6663       } else {
   6664          return 3;
   6665       }
   6666    case 6: return 0;
   6667    case 5: return 0;
   6668    case 4:
   6669       if (devinfo->is_g4x) {
   6670          return 0;
   6671       } else {
   6672          return 0;
   6673       }
   6674    default:
   6675       unreachable("Invalid hardware generation");
   6676    }
   6677 }
   6678 
   6679 
   6680 
   6681 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_start  29
   6682 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_start  29
   6683 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_start  29
   6684 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_start  29
   6685 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_start  29
   6686 
   6687 static inline uint32_t ATTRIBUTE_PURE
   6688 _3DSTATE_BINDING_TABLE_POINTERS_DS_CommandType_start(const struct gen_device_info *devinfo)
   6689 {
   6690    switch (devinfo->gen) {
   6691    case 10: return 29;
   6692    case 9: return 29;
   6693    case 8: return 29;
   6694    case 7:
   6695       if (devinfo->is_haswell) {
   6696          return 29;
   6697       } else {
   6698          return 29;
   6699       }
   6700    case 6: return 0;
   6701    case 5: return 0;
   6702    case 4:
   6703       if (devinfo->is_g4x) {
   6704          return 0;
   6705       } else {
   6706          return 0;
   6707       }
   6708    default:
   6709       unreachable("Invalid hardware generation");
   6710    }
   6711 }
   6712 
   6713 
   6714 
   6715 /* 3DSTATE_BINDING_TABLE_POINTERS_DS::DWord Length */
   6716 
   6717 
   6718 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_bits  8
   6719 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_bits  8
   6720 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_bits  8
   6721 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_bits  8
   6722 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_bits  8
   6723 
   6724 static inline uint32_t ATTRIBUTE_PURE
   6725 _3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   6726 {
   6727    switch (devinfo->gen) {
   6728    case 10: return 8;
   6729    case 9: return 8;
   6730    case 8: return 8;
   6731    case 7:
   6732       if (devinfo->is_haswell) {
   6733          return 8;
   6734       } else {
   6735          return 8;
   6736       }
   6737    case 6: return 0;
   6738    case 5: return 0;
   6739    case 4:
   6740       if (devinfo->is_g4x) {
   6741          return 0;
   6742       } else {
   6743          return 0;
   6744       }
   6745    default:
   6746       unreachable("Invalid hardware generation");
   6747    }
   6748 }
   6749 
   6750 
   6751 
   6752 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_start  0
   6753 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_start  0
   6754 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_start  0
   6755 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_start  0
   6756 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_start  0
   6757 
   6758 static inline uint32_t ATTRIBUTE_PURE
   6759 _3DSTATE_BINDING_TABLE_POINTERS_DS_DWordLength_start(const struct gen_device_info *devinfo)
   6760 {
   6761    switch (devinfo->gen) {
   6762    case 10: return 0;
   6763    case 9: return 0;
   6764    case 8: return 0;
   6765    case 7:
   6766       if (devinfo->is_haswell) {
   6767          return 0;
   6768       } else {
   6769          return 0;
   6770       }
   6771    case 6: return 0;
   6772    case 5: return 0;
   6773    case 4:
   6774       if (devinfo->is_g4x) {
   6775          return 0;
   6776       } else {
   6777          return 0;
   6778       }
   6779    default:
   6780       unreachable("Invalid hardware generation");
   6781    }
   6782 }
   6783 
   6784 
   6785 
   6786 /* 3DSTATE_BINDING_TABLE_POINTERS_DS::Pointer to DS Binding Table */
   6787 
   6788 
   6789 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_bits  11
   6790 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_bits  11
   6791 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_bits  11
   6792 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_bits  11
   6793 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_bits  11
   6794 
   6795 static inline uint32_t ATTRIBUTE_PURE
   6796 _3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_bits(const struct gen_device_info *devinfo)
   6797 {
   6798    switch (devinfo->gen) {
   6799    case 10: return 11;
   6800    case 9: return 11;
   6801    case 8: return 11;
   6802    case 7:
   6803       if (devinfo->is_haswell) {
   6804          return 11;
   6805       } else {
   6806          return 11;
   6807       }
   6808    case 6: return 0;
   6809    case 5: return 0;
   6810    case 4:
   6811       if (devinfo->is_g4x) {
   6812          return 0;
   6813       } else {
   6814          return 0;
   6815       }
   6816    default:
   6817       unreachable("Invalid hardware generation");
   6818    }
   6819 }
   6820 
   6821 
   6822 
   6823 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_start  37
   6824 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_start  37
   6825 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_start  37
   6826 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_start  37
   6827 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_start  37
   6828 
   6829 static inline uint32_t ATTRIBUTE_PURE
   6830 _3DSTATE_BINDING_TABLE_POINTERS_DS_PointertoDSBindingTable_start(const struct gen_device_info *devinfo)
   6831 {
   6832    switch (devinfo->gen) {
   6833    case 10: return 37;
   6834    case 9: return 37;
   6835    case 8: return 37;
   6836    case 7:
   6837       if (devinfo->is_haswell) {
   6838          return 37;
   6839       } else {
   6840          return 37;
   6841       }
   6842    case 6: return 0;
   6843    case 5: return 0;
   6844    case 4:
   6845       if (devinfo->is_g4x) {
   6846          return 0;
   6847       } else {
   6848          return 0;
   6849       }
   6850    default:
   6851       unreachable("Invalid hardware generation");
   6852    }
   6853 }
   6854 
   6855 
   6856 
   6857 /* 3DSTATE_BINDING_TABLE_POINTERS_GS */
   6858 
   6859 
   6860 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_length  2
   6861 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_length  2
   6862 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_length  2
   6863 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_length  2
   6864 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_length  2
   6865 
   6866 static inline uint32_t ATTRIBUTE_PURE
   6867 _3DSTATE_BINDING_TABLE_POINTERS_GS_length(const struct gen_device_info *devinfo)
   6868 {
   6869    switch (devinfo->gen) {
   6870    case 10: return 2;
   6871    case 9: return 2;
   6872    case 8: return 2;
   6873    case 7:
   6874       if (devinfo->is_haswell) {
   6875          return 2;
   6876       } else {
   6877          return 2;
   6878       }
   6879    case 6: return 0;
   6880    case 5: return 0;
   6881    case 4:
   6882       if (devinfo->is_g4x) {
   6883          return 0;
   6884       } else {
   6885          return 0;
   6886       }
   6887    default:
   6888       unreachable("Invalid hardware generation");
   6889    }
   6890 }
   6891 
   6892 
   6893 
   6894 /* 3DSTATE_BINDING_TABLE_POINTERS_GS::3D Command Opcode */
   6895 
   6896 
   6897 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_bits  3
   6898 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_bits  3
   6899 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_bits  3
   6900 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_bits  3
   6901 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_bits  3
   6902 
   6903 static inline uint32_t ATTRIBUTE_PURE
   6904 _3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   6905 {
   6906    switch (devinfo->gen) {
   6907    case 10: return 3;
   6908    case 9: return 3;
   6909    case 8: return 3;
   6910    case 7:
   6911       if (devinfo->is_haswell) {
   6912          return 3;
   6913       } else {
   6914          return 3;
   6915       }
   6916    case 6: return 0;
   6917    case 5: return 0;
   6918    case 4:
   6919       if (devinfo->is_g4x) {
   6920          return 0;
   6921       } else {
   6922          return 0;
   6923       }
   6924    default:
   6925       unreachable("Invalid hardware generation");
   6926    }
   6927 }
   6928 
   6929 
   6930 
   6931 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_start  24
   6932 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_start  24
   6933 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_start  24
   6934 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_start  24
   6935 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_start  24
   6936 
   6937 static inline uint32_t ATTRIBUTE_PURE
   6938 _3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   6939 {
   6940    switch (devinfo->gen) {
   6941    case 10: return 24;
   6942    case 9: return 24;
   6943    case 8: return 24;
   6944    case 7:
   6945       if (devinfo->is_haswell) {
   6946          return 24;
   6947       } else {
   6948          return 24;
   6949       }
   6950    case 6: return 0;
   6951    case 5: return 0;
   6952    case 4:
   6953       if (devinfo->is_g4x) {
   6954          return 0;
   6955       } else {
   6956          return 0;
   6957       }
   6958    default:
   6959       unreachable("Invalid hardware generation");
   6960    }
   6961 }
   6962 
   6963 
   6964 
   6965 /* 3DSTATE_BINDING_TABLE_POINTERS_GS::3D Command Sub Opcode */
   6966 
   6967 
   6968 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_bits  8
   6969 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_bits  8
   6970 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_bits  8
   6971 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_bits  8
   6972 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_bits  8
   6973 
   6974 static inline uint32_t ATTRIBUTE_PURE
   6975 _3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   6976 {
   6977    switch (devinfo->gen) {
   6978    case 10: return 8;
   6979    case 9: return 8;
   6980    case 8: return 8;
   6981    case 7:
   6982       if (devinfo->is_haswell) {
   6983          return 8;
   6984       } else {
   6985          return 8;
   6986       }
   6987    case 6: return 0;
   6988    case 5: return 0;
   6989    case 4:
   6990       if (devinfo->is_g4x) {
   6991          return 0;
   6992       } else {
   6993          return 0;
   6994       }
   6995    default:
   6996       unreachable("Invalid hardware generation");
   6997    }
   6998 }
   6999 
   7000 
   7001 
   7002 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_start  16
   7003 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_start  16
   7004 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_start  16
   7005 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_start  16
   7006 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_start  16
   7007 
   7008 static inline uint32_t ATTRIBUTE_PURE
   7009 _3DSTATE_BINDING_TABLE_POINTERS_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   7010 {
   7011    switch (devinfo->gen) {
   7012    case 10: return 16;
   7013    case 9: return 16;
   7014    case 8: return 16;
   7015    case 7:
   7016       if (devinfo->is_haswell) {
   7017          return 16;
   7018       } else {
   7019          return 16;
   7020       }
   7021    case 6: return 0;
   7022    case 5: return 0;
   7023    case 4:
   7024       if (devinfo->is_g4x) {
   7025          return 0;
   7026       } else {
   7027          return 0;
   7028       }
   7029    default:
   7030       unreachable("Invalid hardware generation");
   7031    }
   7032 }
   7033 
   7034 
   7035 
   7036 /* 3DSTATE_BINDING_TABLE_POINTERS_GS::Command SubType */
   7037 
   7038 
   7039 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_bits  2
   7040 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_bits  2
   7041 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_bits  2
   7042 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_bits  2
   7043 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_bits  2
   7044 
   7045 static inline uint32_t ATTRIBUTE_PURE
   7046 _3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   7047 {
   7048    switch (devinfo->gen) {
   7049    case 10: return 2;
   7050    case 9: return 2;
   7051    case 8: return 2;
   7052    case 7:
   7053       if (devinfo->is_haswell) {
   7054          return 2;
   7055       } else {
   7056          return 2;
   7057       }
   7058    case 6: return 0;
   7059    case 5: return 0;
   7060    case 4:
   7061       if (devinfo->is_g4x) {
   7062          return 0;
   7063       } else {
   7064          return 0;
   7065       }
   7066    default:
   7067       unreachable("Invalid hardware generation");
   7068    }
   7069 }
   7070 
   7071 
   7072 
   7073 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_start  27
   7074 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_start  27
   7075 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_start  27
   7076 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_start  27
   7077 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_start  27
   7078 
   7079 static inline uint32_t ATTRIBUTE_PURE
   7080 _3DSTATE_BINDING_TABLE_POINTERS_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   7081 {
   7082    switch (devinfo->gen) {
   7083    case 10: return 27;
   7084    case 9: return 27;
   7085    case 8: return 27;
   7086    case 7:
   7087       if (devinfo->is_haswell) {
   7088          return 27;
   7089       } else {
   7090          return 27;
   7091       }
   7092    case 6: return 0;
   7093    case 5: return 0;
   7094    case 4:
   7095       if (devinfo->is_g4x) {
   7096          return 0;
   7097       } else {
   7098          return 0;
   7099       }
   7100    default:
   7101       unreachable("Invalid hardware generation");
   7102    }
   7103 }
   7104 
   7105 
   7106 
   7107 /* 3DSTATE_BINDING_TABLE_POINTERS_GS::Command Type */
   7108 
   7109 
   7110 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_bits  3
   7111 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_bits  3
   7112 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_bits  3
   7113 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_bits  3
   7114 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_bits  3
   7115 
   7116 static inline uint32_t ATTRIBUTE_PURE
   7117 _3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_bits(const struct gen_device_info *devinfo)
   7118 {
   7119    switch (devinfo->gen) {
   7120    case 10: return 3;
   7121    case 9: return 3;
   7122    case 8: return 3;
   7123    case 7:
   7124       if (devinfo->is_haswell) {
   7125          return 3;
   7126       } else {
   7127          return 3;
   7128       }
   7129    case 6: return 0;
   7130    case 5: return 0;
   7131    case 4:
   7132       if (devinfo->is_g4x) {
   7133          return 0;
   7134       } else {
   7135          return 0;
   7136       }
   7137    default:
   7138       unreachable("Invalid hardware generation");
   7139    }
   7140 }
   7141 
   7142 
   7143 
   7144 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_start  29
   7145 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_start  29
   7146 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_start  29
   7147 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_start  29
   7148 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_start  29
   7149 
   7150 static inline uint32_t ATTRIBUTE_PURE
   7151 _3DSTATE_BINDING_TABLE_POINTERS_GS_CommandType_start(const struct gen_device_info *devinfo)
   7152 {
   7153    switch (devinfo->gen) {
   7154    case 10: return 29;
   7155    case 9: return 29;
   7156    case 8: return 29;
   7157    case 7:
   7158       if (devinfo->is_haswell) {
   7159          return 29;
   7160       } else {
   7161          return 29;
   7162       }
   7163    case 6: return 0;
   7164    case 5: return 0;
   7165    case 4:
   7166       if (devinfo->is_g4x) {
   7167          return 0;
   7168       } else {
   7169          return 0;
   7170       }
   7171    default:
   7172       unreachable("Invalid hardware generation");
   7173    }
   7174 }
   7175 
   7176 
   7177 
   7178 /* 3DSTATE_BINDING_TABLE_POINTERS_GS::DWord Length */
   7179 
   7180 
   7181 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_bits  8
   7182 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_bits  8
   7183 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_bits  8
   7184 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_bits  8
   7185 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_bits  8
   7186 
   7187 static inline uint32_t ATTRIBUTE_PURE
   7188 _3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   7189 {
   7190    switch (devinfo->gen) {
   7191    case 10: return 8;
   7192    case 9: return 8;
   7193    case 8: return 8;
   7194    case 7:
   7195       if (devinfo->is_haswell) {
   7196          return 8;
   7197       } else {
   7198          return 8;
   7199       }
   7200    case 6: return 0;
   7201    case 5: return 0;
   7202    case 4:
   7203       if (devinfo->is_g4x) {
   7204          return 0;
   7205       } else {
   7206          return 0;
   7207       }
   7208    default:
   7209       unreachable("Invalid hardware generation");
   7210    }
   7211 }
   7212 
   7213 
   7214 
   7215 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_start  0
   7216 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_start  0
   7217 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_start  0
   7218 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_start  0
   7219 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_start  0
   7220 
   7221 static inline uint32_t ATTRIBUTE_PURE
   7222 _3DSTATE_BINDING_TABLE_POINTERS_GS_DWordLength_start(const struct gen_device_info *devinfo)
   7223 {
   7224    switch (devinfo->gen) {
   7225    case 10: return 0;
   7226    case 9: return 0;
   7227    case 8: return 0;
   7228    case 7:
   7229       if (devinfo->is_haswell) {
   7230          return 0;
   7231       } else {
   7232          return 0;
   7233       }
   7234    case 6: return 0;
   7235    case 5: return 0;
   7236    case 4:
   7237       if (devinfo->is_g4x) {
   7238          return 0;
   7239       } else {
   7240          return 0;
   7241       }
   7242    default:
   7243       unreachable("Invalid hardware generation");
   7244    }
   7245 }
   7246 
   7247 
   7248 
   7249 /* 3DSTATE_BINDING_TABLE_POINTERS_GS::Pointer to GS Binding Table */
   7250 
   7251 
   7252 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_bits  11
   7253 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_bits  11
   7254 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_bits  11
   7255 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_bits  11
   7256 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_bits  11
   7257 
   7258 static inline uint32_t ATTRIBUTE_PURE
   7259 _3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_bits(const struct gen_device_info *devinfo)
   7260 {
   7261    switch (devinfo->gen) {
   7262    case 10: return 11;
   7263    case 9: return 11;
   7264    case 8: return 11;
   7265    case 7:
   7266       if (devinfo->is_haswell) {
   7267          return 11;
   7268       } else {
   7269          return 11;
   7270       }
   7271    case 6: return 0;
   7272    case 5: return 0;
   7273    case 4:
   7274       if (devinfo->is_g4x) {
   7275          return 0;
   7276       } else {
   7277          return 0;
   7278       }
   7279    default:
   7280       unreachable("Invalid hardware generation");
   7281    }
   7282 }
   7283 
   7284 
   7285 
   7286 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_start  37
   7287 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_start  37
   7288 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_start  37
   7289 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_start  37
   7290 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_start  37
   7291 
   7292 static inline uint32_t ATTRIBUTE_PURE
   7293 _3DSTATE_BINDING_TABLE_POINTERS_GS_PointertoGSBindingTable_start(const struct gen_device_info *devinfo)
   7294 {
   7295    switch (devinfo->gen) {
   7296    case 10: return 37;
   7297    case 9: return 37;
   7298    case 8: return 37;
   7299    case 7:
   7300       if (devinfo->is_haswell) {
   7301          return 37;
   7302       } else {
   7303          return 37;
   7304       }
   7305    case 6: return 0;
   7306    case 5: return 0;
   7307    case 4:
   7308       if (devinfo->is_g4x) {
   7309          return 0;
   7310       } else {
   7311          return 0;
   7312       }
   7313    default:
   7314       unreachable("Invalid hardware generation");
   7315    }
   7316 }
   7317 
   7318 
   7319 
   7320 /* 3DSTATE_BINDING_TABLE_POINTERS_HS */
   7321 
   7322 
   7323 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_length  2
   7324 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_length  2
   7325 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_length  2
   7326 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_length  2
   7327 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_length  2
   7328 
   7329 static inline uint32_t ATTRIBUTE_PURE
   7330 _3DSTATE_BINDING_TABLE_POINTERS_HS_length(const struct gen_device_info *devinfo)
   7331 {
   7332    switch (devinfo->gen) {
   7333    case 10: return 2;
   7334    case 9: return 2;
   7335    case 8: return 2;
   7336    case 7:
   7337       if (devinfo->is_haswell) {
   7338          return 2;
   7339       } else {
   7340          return 2;
   7341       }
   7342    case 6: return 0;
   7343    case 5: return 0;
   7344    case 4:
   7345       if (devinfo->is_g4x) {
   7346          return 0;
   7347       } else {
   7348          return 0;
   7349       }
   7350    default:
   7351       unreachable("Invalid hardware generation");
   7352    }
   7353 }
   7354 
   7355 
   7356 
   7357 /* 3DSTATE_BINDING_TABLE_POINTERS_HS::3D Command Opcode */
   7358 
   7359 
   7360 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_bits  3
   7361 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_bits  3
   7362 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_bits  3
   7363 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_bits  3
   7364 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_bits  3
   7365 
   7366 static inline uint32_t ATTRIBUTE_PURE
   7367 _3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   7368 {
   7369    switch (devinfo->gen) {
   7370    case 10: return 3;
   7371    case 9: return 3;
   7372    case 8: return 3;
   7373    case 7:
   7374       if (devinfo->is_haswell) {
   7375          return 3;
   7376       } else {
   7377          return 3;
   7378       }
   7379    case 6: return 0;
   7380    case 5: return 0;
   7381    case 4:
   7382       if (devinfo->is_g4x) {
   7383          return 0;
   7384       } else {
   7385          return 0;
   7386       }
   7387    default:
   7388       unreachable("Invalid hardware generation");
   7389    }
   7390 }
   7391 
   7392 
   7393 
   7394 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_start  24
   7395 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_start  24
   7396 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_start  24
   7397 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_start  24
   7398 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_start  24
   7399 
   7400 static inline uint32_t ATTRIBUTE_PURE
   7401 _3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   7402 {
   7403    switch (devinfo->gen) {
   7404    case 10: return 24;
   7405    case 9: return 24;
   7406    case 8: return 24;
   7407    case 7:
   7408       if (devinfo->is_haswell) {
   7409          return 24;
   7410       } else {
   7411          return 24;
   7412       }
   7413    case 6: return 0;
   7414    case 5: return 0;
   7415    case 4:
   7416       if (devinfo->is_g4x) {
   7417          return 0;
   7418       } else {
   7419          return 0;
   7420       }
   7421    default:
   7422       unreachable("Invalid hardware generation");
   7423    }
   7424 }
   7425 
   7426 
   7427 
   7428 /* 3DSTATE_BINDING_TABLE_POINTERS_HS::3D Command Sub Opcode */
   7429 
   7430 
   7431 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_bits  8
   7432 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_bits  8
   7433 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_bits  8
   7434 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_bits  8
   7435 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_bits  8
   7436 
   7437 static inline uint32_t ATTRIBUTE_PURE
   7438 _3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   7439 {
   7440    switch (devinfo->gen) {
   7441    case 10: return 8;
   7442    case 9: return 8;
   7443    case 8: return 8;
   7444    case 7:
   7445       if (devinfo->is_haswell) {
   7446          return 8;
   7447       } else {
   7448          return 8;
   7449       }
   7450    case 6: return 0;
   7451    case 5: return 0;
   7452    case 4:
   7453       if (devinfo->is_g4x) {
   7454          return 0;
   7455       } else {
   7456          return 0;
   7457       }
   7458    default:
   7459       unreachable("Invalid hardware generation");
   7460    }
   7461 }
   7462 
   7463 
   7464 
   7465 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_start  16
   7466 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_start  16
   7467 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_start  16
   7468 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_start  16
   7469 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_start  16
   7470 
   7471 static inline uint32_t ATTRIBUTE_PURE
   7472 _3DSTATE_BINDING_TABLE_POINTERS_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   7473 {
   7474    switch (devinfo->gen) {
   7475    case 10: return 16;
   7476    case 9: return 16;
   7477    case 8: return 16;
   7478    case 7:
   7479       if (devinfo->is_haswell) {
   7480          return 16;
   7481       } else {
   7482          return 16;
   7483       }
   7484    case 6: return 0;
   7485    case 5: return 0;
   7486    case 4:
   7487       if (devinfo->is_g4x) {
   7488          return 0;
   7489       } else {
   7490          return 0;
   7491       }
   7492    default:
   7493       unreachable("Invalid hardware generation");
   7494    }
   7495 }
   7496 
   7497 
   7498 
   7499 /* 3DSTATE_BINDING_TABLE_POINTERS_HS::Command SubType */
   7500 
   7501 
   7502 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_bits  2
   7503 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_bits  2
   7504 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_bits  2
   7505 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_bits  2
   7506 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_bits  2
   7507 
   7508 static inline uint32_t ATTRIBUTE_PURE
   7509 _3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   7510 {
   7511    switch (devinfo->gen) {
   7512    case 10: return 2;
   7513    case 9: return 2;
   7514    case 8: return 2;
   7515    case 7:
   7516       if (devinfo->is_haswell) {
   7517          return 2;
   7518       } else {
   7519          return 2;
   7520       }
   7521    case 6: return 0;
   7522    case 5: return 0;
   7523    case 4:
   7524       if (devinfo->is_g4x) {
   7525          return 0;
   7526       } else {
   7527          return 0;
   7528       }
   7529    default:
   7530       unreachable("Invalid hardware generation");
   7531    }
   7532 }
   7533 
   7534 
   7535 
   7536 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_start  27
   7537 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_start  27
   7538 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_start  27
   7539 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_start  27
   7540 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_start  27
   7541 
   7542 static inline uint32_t ATTRIBUTE_PURE
   7543 _3DSTATE_BINDING_TABLE_POINTERS_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   7544 {
   7545    switch (devinfo->gen) {
   7546    case 10: return 27;
   7547    case 9: return 27;
   7548    case 8: return 27;
   7549    case 7:
   7550       if (devinfo->is_haswell) {
   7551          return 27;
   7552       } else {
   7553          return 27;
   7554       }
   7555    case 6: return 0;
   7556    case 5: return 0;
   7557    case 4:
   7558       if (devinfo->is_g4x) {
   7559          return 0;
   7560       } else {
   7561          return 0;
   7562       }
   7563    default:
   7564       unreachable("Invalid hardware generation");
   7565    }
   7566 }
   7567 
   7568 
   7569 
   7570 /* 3DSTATE_BINDING_TABLE_POINTERS_HS::Command Type */
   7571 
   7572 
   7573 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_bits  3
   7574 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_bits  3
   7575 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_bits  3
   7576 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_bits  3
   7577 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_bits  3
   7578 
   7579 static inline uint32_t ATTRIBUTE_PURE
   7580 _3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_bits(const struct gen_device_info *devinfo)
   7581 {
   7582    switch (devinfo->gen) {
   7583    case 10: return 3;
   7584    case 9: return 3;
   7585    case 8: return 3;
   7586    case 7:
   7587       if (devinfo->is_haswell) {
   7588          return 3;
   7589       } else {
   7590          return 3;
   7591       }
   7592    case 6: return 0;
   7593    case 5: return 0;
   7594    case 4:
   7595       if (devinfo->is_g4x) {
   7596          return 0;
   7597       } else {
   7598          return 0;
   7599       }
   7600    default:
   7601       unreachable("Invalid hardware generation");
   7602    }
   7603 }
   7604 
   7605 
   7606 
   7607 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_start  29
   7608 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_start  29
   7609 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_start  29
   7610 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_start  29
   7611 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_start  29
   7612 
   7613 static inline uint32_t ATTRIBUTE_PURE
   7614 _3DSTATE_BINDING_TABLE_POINTERS_HS_CommandType_start(const struct gen_device_info *devinfo)
   7615 {
   7616    switch (devinfo->gen) {
   7617    case 10: return 29;
   7618    case 9: return 29;
   7619    case 8: return 29;
   7620    case 7:
   7621       if (devinfo->is_haswell) {
   7622          return 29;
   7623       } else {
   7624          return 29;
   7625       }
   7626    case 6: return 0;
   7627    case 5: return 0;
   7628    case 4:
   7629       if (devinfo->is_g4x) {
   7630          return 0;
   7631       } else {
   7632          return 0;
   7633       }
   7634    default:
   7635       unreachable("Invalid hardware generation");
   7636    }
   7637 }
   7638 
   7639 
   7640 
   7641 /* 3DSTATE_BINDING_TABLE_POINTERS_HS::DWord Length */
   7642 
   7643 
   7644 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_bits  8
   7645 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_bits  8
   7646 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_bits  8
   7647 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_bits  8
   7648 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_bits  8
   7649 
   7650 static inline uint32_t ATTRIBUTE_PURE
   7651 _3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   7652 {
   7653    switch (devinfo->gen) {
   7654    case 10: return 8;
   7655    case 9: return 8;
   7656    case 8: return 8;
   7657    case 7:
   7658       if (devinfo->is_haswell) {
   7659          return 8;
   7660       } else {
   7661          return 8;
   7662       }
   7663    case 6: return 0;
   7664    case 5: return 0;
   7665    case 4:
   7666       if (devinfo->is_g4x) {
   7667          return 0;
   7668       } else {
   7669          return 0;
   7670       }
   7671    default:
   7672       unreachable("Invalid hardware generation");
   7673    }
   7674 }
   7675 
   7676 
   7677 
   7678 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_start  0
   7679 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_start  0
   7680 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_start  0
   7681 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_start  0
   7682 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_start  0
   7683 
   7684 static inline uint32_t ATTRIBUTE_PURE
   7685 _3DSTATE_BINDING_TABLE_POINTERS_HS_DWordLength_start(const struct gen_device_info *devinfo)
   7686 {
   7687    switch (devinfo->gen) {
   7688    case 10: return 0;
   7689    case 9: return 0;
   7690    case 8: return 0;
   7691    case 7:
   7692       if (devinfo->is_haswell) {
   7693          return 0;
   7694       } else {
   7695          return 0;
   7696       }
   7697    case 6: return 0;
   7698    case 5: return 0;
   7699    case 4:
   7700       if (devinfo->is_g4x) {
   7701          return 0;
   7702       } else {
   7703          return 0;
   7704       }
   7705    default:
   7706       unreachable("Invalid hardware generation");
   7707    }
   7708 }
   7709 
   7710 
   7711 
   7712 /* 3DSTATE_BINDING_TABLE_POINTERS_HS::Pointer to HS Binding Table */
   7713 
   7714 
   7715 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_bits  11
   7716 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_bits  11
   7717 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_bits  11
   7718 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_bits  11
   7719 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_bits  11
   7720 
   7721 static inline uint32_t ATTRIBUTE_PURE
   7722 _3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_bits(const struct gen_device_info *devinfo)
   7723 {
   7724    switch (devinfo->gen) {
   7725    case 10: return 11;
   7726    case 9: return 11;
   7727    case 8: return 11;
   7728    case 7:
   7729       if (devinfo->is_haswell) {
   7730          return 11;
   7731       } else {
   7732          return 11;
   7733       }
   7734    case 6: return 0;
   7735    case 5: return 0;
   7736    case 4:
   7737       if (devinfo->is_g4x) {
   7738          return 0;
   7739       } else {
   7740          return 0;
   7741       }
   7742    default:
   7743       unreachable("Invalid hardware generation");
   7744    }
   7745 }
   7746 
   7747 
   7748 
   7749 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_start  37
   7750 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_start  37
   7751 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_start  37
   7752 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_start  37
   7753 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_start  37
   7754 
   7755 static inline uint32_t ATTRIBUTE_PURE
   7756 _3DSTATE_BINDING_TABLE_POINTERS_HS_PointertoHSBindingTable_start(const struct gen_device_info *devinfo)
   7757 {
   7758    switch (devinfo->gen) {
   7759    case 10: return 37;
   7760    case 9: return 37;
   7761    case 8: return 37;
   7762    case 7:
   7763       if (devinfo->is_haswell) {
   7764          return 37;
   7765       } else {
   7766          return 37;
   7767       }
   7768    case 6: return 0;
   7769    case 5: return 0;
   7770    case 4:
   7771       if (devinfo->is_g4x) {
   7772          return 0;
   7773       } else {
   7774          return 0;
   7775       }
   7776    default:
   7777       unreachable("Invalid hardware generation");
   7778    }
   7779 }
   7780 
   7781 
   7782 
   7783 /* 3DSTATE_BINDING_TABLE_POINTERS_PS */
   7784 
   7785 
   7786 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_length  2
   7787 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_length  2
   7788 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_length  2
   7789 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_length  2
   7790 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_length  2
   7791 
   7792 static inline uint32_t ATTRIBUTE_PURE
   7793 _3DSTATE_BINDING_TABLE_POINTERS_PS_length(const struct gen_device_info *devinfo)
   7794 {
   7795    switch (devinfo->gen) {
   7796    case 10: return 2;
   7797    case 9: return 2;
   7798    case 8: return 2;
   7799    case 7:
   7800       if (devinfo->is_haswell) {
   7801          return 2;
   7802       } else {
   7803          return 2;
   7804       }
   7805    case 6: return 0;
   7806    case 5: return 0;
   7807    case 4:
   7808       if (devinfo->is_g4x) {
   7809          return 0;
   7810       } else {
   7811          return 0;
   7812       }
   7813    default:
   7814       unreachable("Invalid hardware generation");
   7815    }
   7816 }
   7817 
   7818 
   7819 
   7820 /* 3DSTATE_BINDING_TABLE_POINTERS_PS::3D Command Opcode */
   7821 
   7822 
   7823 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_bits  3
   7824 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_bits  3
   7825 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_bits  3
   7826 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_bits  3
   7827 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_bits  3
   7828 
   7829 static inline uint32_t ATTRIBUTE_PURE
   7830 _3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   7831 {
   7832    switch (devinfo->gen) {
   7833    case 10: return 3;
   7834    case 9: return 3;
   7835    case 8: return 3;
   7836    case 7:
   7837       if (devinfo->is_haswell) {
   7838          return 3;
   7839       } else {
   7840          return 3;
   7841       }
   7842    case 6: return 0;
   7843    case 5: return 0;
   7844    case 4:
   7845       if (devinfo->is_g4x) {
   7846          return 0;
   7847       } else {
   7848          return 0;
   7849       }
   7850    default:
   7851       unreachable("Invalid hardware generation");
   7852    }
   7853 }
   7854 
   7855 
   7856 
   7857 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_start  24
   7858 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_start  24
   7859 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_start  24
   7860 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_start  24
   7861 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_start  24
   7862 
   7863 static inline uint32_t ATTRIBUTE_PURE
   7864 _3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   7865 {
   7866    switch (devinfo->gen) {
   7867    case 10: return 24;
   7868    case 9: return 24;
   7869    case 8: return 24;
   7870    case 7:
   7871       if (devinfo->is_haswell) {
   7872          return 24;
   7873       } else {
   7874          return 24;
   7875       }
   7876    case 6: return 0;
   7877    case 5: return 0;
   7878    case 4:
   7879       if (devinfo->is_g4x) {
   7880          return 0;
   7881       } else {
   7882          return 0;
   7883       }
   7884    default:
   7885       unreachable("Invalid hardware generation");
   7886    }
   7887 }
   7888 
   7889 
   7890 
   7891 /* 3DSTATE_BINDING_TABLE_POINTERS_PS::3D Command Sub Opcode */
   7892 
   7893 
   7894 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_bits  8
   7895 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_bits  8
   7896 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_bits  8
   7897 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_bits  8
   7898 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_bits  8
   7899 
   7900 static inline uint32_t ATTRIBUTE_PURE
   7901 _3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   7902 {
   7903    switch (devinfo->gen) {
   7904    case 10: return 8;
   7905    case 9: return 8;
   7906    case 8: return 8;
   7907    case 7:
   7908       if (devinfo->is_haswell) {
   7909          return 8;
   7910       } else {
   7911          return 8;
   7912       }
   7913    case 6: return 0;
   7914    case 5: return 0;
   7915    case 4:
   7916       if (devinfo->is_g4x) {
   7917          return 0;
   7918       } else {
   7919          return 0;
   7920       }
   7921    default:
   7922       unreachable("Invalid hardware generation");
   7923    }
   7924 }
   7925 
   7926 
   7927 
   7928 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_start  16
   7929 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_start  16
   7930 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_start  16
   7931 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_start  16
   7932 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_start  16
   7933 
   7934 static inline uint32_t ATTRIBUTE_PURE
   7935 _3DSTATE_BINDING_TABLE_POINTERS_PS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   7936 {
   7937    switch (devinfo->gen) {
   7938    case 10: return 16;
   7939    case 9: return 16;
   7940    case 8: return 16;
   7941    case 7:
   7942       if (devinfo->is_haswell) {
   7943          return 16;
   7944       } else {
   7945          return 16;
   7946       }
   7947    case 6: return 0;
   7948    case 5: return 0;
   7949    case 4:
   7950       if (devinfo->is_g4x) {
   7951          return 0;
   7952       } else {
   7953          return 0;
   7954       }
   7955    default:
   7956       unreachable("Invalid hardware generation");
   7957    }
   7958 }
   7959 
   7960 
   7961 
   7962 /* 3DSTATE_BINDING_TABLE_POINTERS_PS::Command SubType */
   7963 
   7964 
   7965 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_bits  2
   7966 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_bits  2
   7967 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_bits  2
   7968 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_bits  2
   7969 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_bits  2
   7970 
   7971 static inline uint32_t ATTRIBUTE_PURE
   7972 _3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_bits(const struct gen_device_info *devinfo)
   7973 {
   7974    switch (devinfo->gen) {
   7975    case 10: return 2;
   7976    case 9: return 2;
   7977    case 8: return 2;
   7978    case 7:
   7979       if (devinfo->is_haswell) {
   7980          return 2;
   7981       } else {
   7982          return 2;
   7983       }
   7984    case 6: return 0;
   7985    case 5: return 0;
   7986    case 4:
   7987       if (devinfo->is_g4x) {
   7988          return 0;
   7989       } else {
   7990          return 0;
   7991       }
   7992    default:
   7993       unreachable("Invalid hardware generation");
   7994    }
   7995 }
   7996 
   7997 
   7998 
   7999 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_start  27
   8000 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_start  27
   8001 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_start  27
   8002 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_start  27
   8003 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_start  27
   8004 
   8005 static inline uint32_t ATTRIBUTE_PURE
   8006 _3DSTATE_BINDING_TABLE_POINTERS_PS_CommandSubType_start(const struct gen_device_info *devinfo)
   8007 {
   8008    switch (devinfo->gen) {
   8009    case 10: return 27;
   8010    case 9: return 27;
   8011    case 8: return 27;
   8012    case 7:
   8013       if (devinfo->is_haswell) {
   8014          return 27;
   8015       } else {
   8016          return 27;
   8017       }
   8018    case 6: return 0;
   8019    case 5: return 0;
   8020    case 4:
   8021       if (devinfo->is_g4x) {
   8022          return 0;
   8023       } else {
   8024          return 0;
   8025       }
   8026    default:
   8027       unreachable("Invalid hardware generation");
   8028    }
   8029 }
   8030 
   8031 
   8032 
   8033 /* 3DSTATE_BINDING_TABLE_POINTERS_PS::Command Type */
   8034 
   8035 
   8036 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_bits  3
   8037 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_bits  3
   8038 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_bits  3
   8039 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_bits  3
   8040 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_bits  3
   8041 
   8042 static inline uint32_t ATTRIBUTE_PURE
   8043 _3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_bits(const struct gen_device_info *devinfo)
   8044 {
   8045    switch (devinfo->gen) {
   8046    case 10: return 3;
   8047    case 9: return 3;
   8048    case 8: return 3;
   8049    case 7:
   8050       if (devinfo->is_haswell) {
   8051          return 3;
   8052       } else {
   8053          return 3;
   8054       }
   8055    case 6: return 0;
   8056    case 5: return 0;
   8057    case 4:
   8058       if (devinfo->is_g4x) {
   8059          return 0;
   8060       } else {
   8061          return 0;
   8062       }
   8063    default:
   8064       unreachable("Invalid hardware generation");
   8065    }
   8066 }
   8067 
   8068 
   8069 
   8070 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_start  29
   8071 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_start  29
   8072 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_start  29
   8073 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_start  29
   8074 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_start  29
   8075 
   8076 static inline uint32_t ATTRIBUTE_PURE
   8077 _3DSTATE_BINDING_TABLE_POINTERS_PS_CommandType_start(const struct gen_device_info *devinfo)
   8078 {
   8079    switch (devinfo->gen) {
   8080    case 10: return 29;
   8081    case 9: return 29;
   8082    case 8: return 29;
   8083    case 7:
   8084       if (devinfo->is_haswell) {
   8085          return 29;
   8086       } else {
   8087          return 29;
   8088       }
   8089    case 6: return 0;
   8090    case 5: return 0;
   8091    case 4:
   8092       if (devinfo->is_g4x) {
   8093          return 0;
   8094       } else {
   8095          return 0;
   8096       }
   8097    default:
   8098       unreachable("Invalid hardware generation");
   8099    }
   8100 }
   8101 
   8102 
   8103 
   8104 /* 3DSTATE_BINDING_TABLE_POINTERS_PS::DWord Length */
   8105 
   8106 
   8107 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_bits  8
   8108 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_bits  8
   8109 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_bits  8
   8110 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_bits  8
   8111 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_bits  8
   8112 
   8113 static inline uint32_t ATTRIBUTE_PURE
   8114 _3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_bits(const struct gen_device_info *devinfo)
   8115 {
   8116    switch (devinfo->gen) {
   8117    case 10: return 8;
   8118    case 9: return 8;
   8119    case 8: return 8;
   8120    case 7:
   8121       if (devinfo->is_haswell) {
   8122          return 8;
   8123       } else {
   8124          return 8;
   8125       }
   8126    case 6: return 0;
   8127    case 5: return 0;
   8128    case 4:
   8129       if (devinfo->is_g4x) {
   8130          return 0;
   8131       } else {
   8132          return 0;
   8133       }
   8134    default:
   8135       unreachable("Invalid hardware generation");
   8136    }
   8137 }
   8138 
   8139 
   8140 
   8141 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_start  0
   8142 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_start  0
   8143 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_start  0
   8144 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_start  0
   8145 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_start  0
   8146 
   8147 static inline uint32_t ATTRIBUTE_PURE
   8148 _3DSTATE_BINDING_TABLE_POINTERS_PS_DWordLength_start(const struct gen_device_info *devinfo)
   8149 {
   8150    switch (devinfo->gen) {
   8151    case 10: return 0;
   8152    case 9: return 0;
   8153    case 8: return 0;
   8154    case 7:
   8155       if (devinfo->is_haswell) {
   8156          return 0;
   8157       } else {
   8158          return 0;
   8159       }
   8160    case 6: return 0;
   8161    case 5: return 0;
   8162    case 4:
   8163       if (devinfo->is_g4x) {
   8164          return 0;
   8165       } else {
   8166          return 0;
   8167       }
   8168    default:
   8169       unreachable("Invalid hardware generation");
   8170    }
   8171 }
   8172 
   8173 
   8174 
   8175 /* 3DSTATE_BINDING_TABLE_POINTERS_PS::Pointer to PS Binding Table */
   8176 
   8177 
   8178 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_bits  11
   8179 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_bits  11
   8180 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_bits  11
   8181 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_bits  11
   8182 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_bits  11
   8183 
   8184 static inline uint32_t ATTRIBUTE_PURE
   8185 _3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_bits(const struct gen_device_info *devinfo)
   8186 {
   8187    switch (devinfo->gen) {
   8188    case 10: return 11;
   8189    case 9: return 11;
   8190    case 8: return 11;
   8191    case 7:
   8192       if (devinfo->is_haswell) {
   8193          return 11;
   8194       } else {
   8195          return 11;
   8196       }
   8197    case 6: return 0;
   8198    case 5: return 0;
   8199    case 4:
   8200       if (devinfo->is_g4x) {
   8201          return 0;
   8202       } else {
   8203          return 0;
   8204       }
   8205    default:
   8206       unreachable("Invalid hardware generation");
   8207    }
   8208 }
   8209 
   8210 
   8211 
   8212 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_start  37
   8213 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_start  37
   8214 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_start  37
   8215 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_start  37
   8216 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_start  37
   8217 
   8218 static inline uint32_t ATTRIBUTE_PURE
   8219 _3DSTATE_BINDING_TABLE_POINTERS_PS_PointertoPSBindingTable_start(const struct gen_device_info *devinfo)
   8220 {
   8221    switch (devinfo->gen) {
   8222    case 10: return 37;
   8223    case 9: return 37;
   8224    case 8: return 37;
   8225    case 7:
   8226       if (devinfo->is_haswell) {
   8227          return 37;
   8228       } else {
   8229          return 37;
   8230       }
   8231    case 6: return 0;
   8232    case 5: return 0;
   8233    case 4:
   8234       if (devinfo->is_g4x) {
   8235          return 0;
   8236       } else {
   8237          return 0;
   8238       }
   8239    default:
   8240       unreachable("Invalid hardware generation");
   8241    }
   8242 }
   8243 
   8244 
   8245 
   8246 /* 3DSTATE_BINDING_TABLE_POINTERS_VS */
   8247 
   8248 
   8249 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_length  2
   8250 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_length  2
   8251 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_length  2
   8252 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_length  2
   8253 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_length  2
   8254 
   8255 static inline uint32_t ATTRIBUTE_PURE
   8256 _3DSTATE_BINDING_TABLE_POINTERS_VS_length(const struct gen_device_info *devinfo)
   8257 {
   8258    switch (devinfo->gen) {
   8259    case 10: return 2;
   8260    case 9: return 2;
   8261    case 8: return 2;
   8262    case 7:
   8263       if (devinfo->is_haswell) {
   8264          return 2;
   8265       } else {
   8266          return 2;
   8267       }
   8268    case 6: return 0;
   8269    case 5: return 0;
   8270    case 4:
   8271       if (devinfo->is_g4x) {
   8272          return 0;
   8273       } else {
   8274          return 0;
   8275       }
   8276    default:
   8277       unreachable("Invalid hardware generation");
   8278    }
   8279 }
   8280 
   8281 
   8282 
   8283 /* 3DSTATE_BINDING_TABLE_POINTERS_VS::3D Command Opcode */
   8284 
   8285 
   8286 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_bits  3
   8287 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_bits  3
   8288 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_bits  3
   8289 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_bits  3
   8290 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_bits  3
   8291 
   8292 static inline uint32_t ATTRIBUTE_PURE
   8293 _3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   8294 {
   8295    switch (devinfo->gen) {
   8296    case 10: return 3;
   8297    case 9: return 3;
   8298    case 8: return 3;
   8299    case 7:
   8300       if (devinfo->is_haswell) {
   8301          return 3;
   8302       } else {
   8303          return 3;
   8304       }
   8305    case 6: return 0;
   8306    case 5: return 0;
   8307    case 4:
   8308       if (devinfo->is_g4x) {
   8309          return 0;
   8310       } else {
   8311          return 0;
   8312       }
   8313    default:
   8314       unreachable("Invalid hardware generation");
   8315    }
   8316 }
   8317 
   8318 
   8319 
   8320 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_start  24
   8321 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_start  24
   8322 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_start  24
   8323 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_start  24
   8324 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_start  24
   8325 
   8326 static inline uint32_t ATTRIBUTE_PURE
   8327 _3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   8328 {
   8329    switch (devinfo->gen) {
   8330    case 10: return 24;
   8331    case 9: return 24;
   8332    case 8: return 24;
   8333    case 7:
   8334       if (devinfo->is_haswell) {
   8335          return 24;
   8336       } else {
   8337          return 24;
   8338       }
   8339    case 6: return 0;
   8340    case 5: return 0;
   8341    case 4:
   8342       if (devinfo->is_g4x) {
   8343          return 0;
   8344       } else {
   8345          return 0;
   8346       }
   8347    default:
   8348       unreachable("Invalid hardware generation");
   8349    }
   8350 }
   8351 
   8352 
   8353 
   8354 /* 3DSTATE_BINDING_TABLE_POINTERS_VS::3D Command Sub Opcode */
   8355 
   8356 
   8357 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_bits  8
   8358 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_bits  8
   8359 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_bits  8
   8360 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_bits  8
   8361 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_bits  8
   8362 
   8363 static inline uint32_t ATTRIBUTE_PURE
   8364 _3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   8365 {
   8366    switch (devinfo->gen) {
   8367    case 10: return 8;
   8368    case 9: return 8;
   8369    case 8: return 8;
   8370    case 7:
   8371       if (devinfo->is_haswell) {
   8372          return 8;
   8373       } else {
   8374          return 8;
   8375       }
   8376    case 6: return 0;
   8377    case 5: return 0;
   8378    case 4:
   8379       if (devinfo->is_g4x) {
   8380          return 0;
   8381       } else {
   8382          return 0;
   8383       }
   8384    default:
   8385       unreachable("Invalid hardware generation");
   8386    }
   8387 }
   8388 
   8389 
   8390 
   8391 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_start  16
   8392 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_start  16
   8393 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_start  16
   8394 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_start  16
   8395 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_start  16
   8396 
   8397 static inline uint32_t ATTRIBUTE_PURE
   8398 _3DSTATE_BINDING_TABLE_POINTERS_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   8399 {
   8400    switch (devinfo->gen) {
   8401    case 10: return 16;
   8402    case 9: return 16;
   8403    case 8: return 16;
   8404    case 7:
   8405       if (devinfo->is_haswell) {
   8406          return 16;
   8407       } else {
   8408          return 16;
   8409       }
   8410    case 6: return 0;
   8411    case 5: return 0;
   8412    case 4:
   8413       if (devinfo->is_g4x) {
   8414          return 0;
   8415       } else {
   8416          return 0;
   8417       }
   8418    default:
   8419       unreachable("Invalid hardware generation");
   8420    }
   8421 }
   8422 
   8423 
   8424 
   8425 /* 3DSTATE_BINDING_TABLE_POINTERS_VS::Command SubType */
   8426 
   8427 
   8428 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_bits  2
   8429 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_bits  2
   8430 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_bits  2
   8431 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_bits  2
   8432 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_bits  2
   8433 
   8434 static inline uint32_t ATTRIBUTE_PURE
   8435 _3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   8436 {
   8437    switch (devinfo->gen) {
   8438    case 10: return 2;
   8439    case 9: return 2;
   8440    case 8: return 2;
   8441    case 7:
   8442       if (devinfo->is_haswell) {
   8443          return 2;
   8444       } else {
   8445          return 2;
   8446       }
   8447    case 6: return 0;
   8448    case 5: return 0;
   8449    case 4:
   8450       if (devinfo->is_g4x) {
   8451          return 0;
   8452       } else {
   8453          return 0;
   8454       }
   8455    default:
   8456       unreachable("Invalid hardware generation");
   8457    }
   8458 }
   8459 
   8460 
   8461 
   8462 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_start  27
   8463 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_start  27
   8464 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_start  27
   8465 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_start  27
   8466 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_start  27
   8467 
   8468 static inline uint32_t ATTRIBUTE_PURE
   8469 _3DSTATE_BINDING_TABLE_POINTERS_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   8470 {
   8471    switch (devinfo->gen) {
   8472    case 10: return 27;
   8473    case 9: return 27;
   8474    case 8: return 27;
   8475    case 7:
   8476       if (devinfo->is_haswell) {
   8477          return 27;
   8478       } else {
   8479          return 27;
   8480       }
   8481    case 6: return 0;
   8482    case 5: return 0;
   8483    case 4:
   8484       if (devinfo->is_g4x) {
   8485          return 0;
   8486       } else {
   8487          return 0;
   8488       }
   8489    default:
   8490       unreachable("Invalid hardware generation");
   8491    }
   8492 }
   8493 
   8494 
   8495 
   8496 /* 3DSTATE_BINDING_TABLE_POINTERS_VS::Command Type */
   8497 
   8498 
   8499 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_bits  3
   8500 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_bits  3
   8501 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_bits  3
   8502 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_bits  3
   8503 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_bits  3
   8504 
   8505 static inline uint32_t ATTRIBUTE_PURE
   8506 _3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_bits(const struct gen_device_info *devinfo)
   8507 {
   8508    switch (devinfo->gen) {
   8509    case 10: return 3;
   8510    case 9: return 3;
   8511    case 8: return 3;
   8512    case 7:
   8513       if (devinfo->is_haswell) {
   8514          return 3;
   8515       } else {
   8516          return 3;
   8517       }
   8518    case 6: return 0;
   8519    case 5: return 0;
   8520    case 4:
   8521       if (devinfo->is_g4x) {
   8522          return 0;
   8523       } else {
   8524          return 0;
   8525       }
   8526    default:
   8527       unreachable("Invalid hardware generation");
   8528    }
   8529 }
   8530 
   8531 
   8532 
   8533 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_start  29
   8534 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_start  29
   8535 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_start  29
   8536 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_start  29
   8537 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_start  29
   8538 
   8539 static inline uint32_t ATTRIBUTE_PURE
   8540 _3DSTATE_BINDING_TABLE_POINTERS_VS_CommandType_start(const struct gen_device_info *devinfo)
   8541 {
   8542    switch (devinfo->gen) {
   8543    case 10: return 29;
   8544    case 9: return 29;
   8545    case 8: return 29;
   8546    case 7:
   8547       if (devinfo->is_haswell) {
   8548          return 29;
   8549       } else {
   8550          return 29;
   8551       }
   8552    case 6: return 0;
   8553    case 5: return 0;
   8554    case 4:
   8555       if (devinfo->is_g4x) {
   8556          return 0;
   8557       } else {
   8558          return 0;
   8559       }
   8560    default:
   8561       unreachable("Invalid hardware generation");
   8562    }
   8563 }
   8564 
   8565 
   8566 
   8567 /* 3DSTATE_BINDING_TABLE_POINTERS_VS::DWord Length */
   8568 
   8569 
   8570 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_bits  8
   8571 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_bits  8
   8572 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_bits  8
   8573 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_bits  8
   8574 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_bits  8
   8575 
   8576 static inline uint32_t ATTRIBUTE_PURE
   8577 _3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   8578 {
   8579    switch (devinfo->gen) {
   8580    case 10: return 8;
   8581    case 9: return 8;
   8582    case 8: return 8;
   8583    case 7:
   8584       if (devinfo->is_haswell) {
   8585          return 8;
   8586       } else {
   8587          return 8;
   8588       }
   8589    case 6: return 0;
   8590    case 5: return 0;
   8591    case 4:
   8592       if (devinfo->is_g4x) {
   8593          return 0;
   8594       } else {
   8595          return 0;
   8596       }
   8597    default:
   8598       unreachable("Invalid hardware generation");
   8599    }
   8600 }
   8601 
   8602 
   8603 
   8604 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_start  0
   8605 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_start  0
   8606 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_start  0
   8607 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_start  0
   8608 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_start  0
   8609 
   8610 static inline uint32_t ATTRIBUTE_PURE
   8611 _3DSTATE_BINDING_TABLE_POINTERS_VS_DWordLength_start(const struct gen_device_info *devinfo)
   8612 {
   8613    switch (devinfo->gen) {
   8614    case 10: return 0;
   8615    case 9: return 0;
   8616    case 8: return 0;
   8617    case 7:
   8618       if (devinfo->is_haswell) {
   8619          return 0;
   8620       } else {
   8621          return 0;
   8622       }
   8623    case 6: return 0;
   8624    case 5: return 0;
   8625    case 4:
   8626       if (devinfo->is_g4x) {
   8627          return 0;
   8628       } else {
   8629          return 0;
   8630       }
   8631    default:
   8632       unreachable("Invalid hardware generation");
   8633    }
   8634 }
   8635 
   8636 
   8637 
   8638 /* 3DSTATE_BINDING_TABLE_POINTERS_VS::Pointer to VS Binding Table */
   8639 
   8640 
   8641 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_bits  11
   8642 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_bits  11
   8643 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_bits  11
   8644 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_bits  11
   8645 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_bits  11
   8646 
   8647 static inline uint32_t ATTRIBUTE_PURE
   8648 _3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_bits(const struct gen_device_info *devinfo)
   8649 {
   8650    switch (devinfo->gen) {
   8651    case 10: return 11;
   8652    case 9: return 11;
   8653    case 8: return 11;
   8654    case 7:
   8655       if (devinfo->is_haswell) {
   8656          return 11;
   8657       } else {
   8658          return 11;
   8659       }
   8660    case 6: return 0;
   8661    case 5: return 0;
   8662    case 4:
   8663       if (devinfo->is_g4x) {
   8664          return 0;
   8665       } else {
   8666          return 0;
   8667       }
   8668    default:
   8669       unreachable("Invalid hardware generation");
   8670    }
   8671 }
   8672 
   8673 
   8674 
   8675 #define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_start  37
   8676 #define GEN9_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_start  37
   8677 #define GEN8_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_start  37
   8678 #define GEN75_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_start  37
   8679 #define GEN7_3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_start  37
   8680 
   8681 static inline uint32_t ATTRIBUTE_PURE
   8682 _3DSTATE_BINDING_TABLE_POINTERS_VS_PointertoVSBindingTable_start(const struct gen_device_info *devinfo)
   8683 {
   8684    switch (devinfo->gen) {
   8685    case 10: return 37;
   8686    case 9: return 37;
   8687    case 8: return 37;
   8688    case 7:
   8689       if (devinfo->is_haswell) {
   8690          return 37;
   8691       } else {
   8692          return 37;
   8693       }
   8694    case 6: return 0;
   8695    case 5: return 0;
   8696    case 4:
   8697       if (devinfo->is_g4x) {
   8698          return 0;
   8699       } else {
   8700          return 0;
   8701       }
   8702    default:
   8703       unreachable("Invalid hardware generation");
   8704    }
   8705 }
   8706 
   8707 
   8708 
   8709 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC */
   8710 
   8711 
   8712 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_length  4
   8713 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_length  4
   8714 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_length  4
   8715 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_length  3
   8716 
   8717 static inline uint32_t ATTRIBUTE_PURE
   8718 _3DSTATE_BINDING_TABLE_POOL_ALLOC_length(const struct gen_device_info *devinfo)
   8719 {
   8720    switch (devinfo->gen) {
   8721    case 10: return 4;
   8722    case 9: return 4;
   8723    case 8: return 4;
   8724    case 7:
   8725       if (devinfo->is_haswell) {
   8726          return 3;
   8727       } else {
   8728          return 0;
   8729       }
   8730    case 6: return 0;
   8731    case 5: return 0;
   8732    case 4:
   8733       if (devinfo->is_g4x) {
   8734          return 0;
   8735       } else {
   8736          return 0;
   8737       }
   8738    default:
   8739       unreachable("Invalid hardware generation");
   8740    }
   8741 }
   8742 
   8743 
   8744 
   8745 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::3D Command Opcode */
   8746 
   8747 
   8748 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_bits  3
   8749 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_bits  3
   8750 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_bits  3
   8751 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_bits  3
   8752 
   8753 static inline uint32_t ATTRIBUTE_PURE
   8754 _3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   8755 {
   8756    switch (devinfo->gen) {
   8757    case 10: return 3;
   8758    case 9: return 3;
   8759    case 8: return 3;
   8760    case 7:
   8761       if (devinfo->is_haswell) {
   8762          return 3;
   8763       } else {
   8764          return 0;
   8765       }
   8766    case 6: return 0;
   8767    case 5: return 0;
   8768    case 4:
   8769       if (devinfo->is_g4x) {
   8770          return 0;
   8771       } else {
   8772          return 0;
   8773       }
   8774    default:
   8775       unreachable("Invalid hardware generation");
   8776    }
   8777 }
   8778 
   8779 
   8780 
   8781 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_start  24
   8782 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_start  24
   8783 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_start  24
   8784 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_start  24
   8785 
   8786 static inline uint32_t ATTRIBUTE_PURE
   8787 _3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   8788 {
   8789    switch (devinfo->gen) {
   8790    case 10: return 24;
   8791    case 9: return 24;
   8792    case 8: return 24;
   8793    case 7:
   8794       if (devinfo->is_haswell) {
   8795          return 24;
   8796       } else {
   8797          return 0;
   8798       }
   8799    case 6: return 0;
   8800    case 5: return 0;
   8801    case 4:
   8802       if (devinfo->is_g4x) {
   8803          return 0;
   8804       } else {
   8805          return 0;
   8806       }
   8807    default:
   8808       unreachable("Invalid hardware generation");
   8809    }
   8810 }
   8811 
   8812 
   8813 
   8814 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::3D Command Sub Opcode */
   8815 
   8816 
   8817 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_bits  8
   8818 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_bits  8
   8819 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_bits  8
   8820 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_bits  8
   8821 
   8822 static inline uint32_t ATTRIBUTE_PURE
   8823 _3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   8824 {
   8825    switch (devinfo->gen) {
   8826    case 10: return 8;
   8827    case 9: return 8;
   8828    case 8: return 8;
   8829    case 7:
   8830       if (devinfo->is_haswell) {
   8831          return 8;
   8832       } else {
   8833          return 0;
   8834       }
   8835    case 6: return 0;
   8836    case 5: return 0;
   8837    case 4:
   8838       if (devinfo->is_g4x) {
   8839          return 0;
   8840       } else {
   8841          return 0;
   8842       }
   8843    default:
   8844       unreachable("Invalid hardware generation");
   8845    }
   8846 }
   8847 
   8848 
   8849 
   8850 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_start  16
   8851 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_start  16
   8852 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_start  16
   8853 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_start  16
   8854 
   8855 static inline uint32_t ATTRIBUTE_PURE
   8856 _3DSTATE_BINDING_TABLE_POOL_ALLOC_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   8857 {
   8858    switch (devinfo->gen) {
   8859    case 10: return 16;
   8860    case 9: return 16;
   8861    case 8: return 16;
   8862    case 7:
   8863       if (devinfo->is_haswell) {
   8864          return 16;
   8865       } else {
   8866          return 0;
   8867       }
   8868    case 6: return 0;
   8869    case 5: return 0;
   8870    case 4:
   8871       if (devinfo->is_g4x) {
   8872          return 0;
   8873       } else {
   8874          return 0;
   8875       }
   8876    default:
   8877       unreachable("Invalid hardware generation");
   8878    }
   8879 }
   8880 
   8881 
   8882 
   8883 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::Binding Table Pool Base Address */
   8884 
   8885 
   8886 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_bits  52
   8887 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_bits  52
   8888 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_bits  52
   8889 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_bits  20
   8890 
   8891 static inline uint32_t ATTRIBUTE_PURE
   8892 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_bits(const struct gen_device_info *devinfo)
   8893 {
   8894    switch (devinfo->gen) {
   8895    case 10: return 52;
   8896    case 9: return 52;
   8897    case 8: return 52;
   8898    case 7:
   8899       if (devinfo->is_haswell) {
   8900          return 20;
   8901       } else {
   8902          return 0;
   8903       }
   8904    case 6: return 0;
   8905    case 5: return 0;
   8906    case 4:
   8907       if (devinfo->is_g4x) {
   8908          return 0;
   8909       } else {
   8910          return 0;
   8911       }
   8912    default:
   8913       unreachable("Invalid hardware generation");
   8914    }
   8915 }
   8916 
   8917 
   8918 
   8919 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_start  44
   8920 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_start  44
   8921 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_start  44
   8922 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_start  44
   8923 
   8924 static inline uint32_t ATTRIBUTE_PURE
   8925 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBaseAddress_start(const struct gen_device_info *devinfo)
   8926 {
   8927    switch (devinfo->gen) {
   8928    case 10: return 44;
   8929    case 9: return 44;
   8930    case 8: return 44;
   8931    case 7:
   8932       if (devinfo->is_haswell) {
   8933          return 44;
   8934       } else {
   8935          return 0;
   8936       }
   8937    case 6: return 0;
   8938    case 5: return 0;
   8939    case 4:
   8940       if (devinfo->is_g4x) {
   8941          return 0;
   8942       } else {
   8943          return 0;
   8944       }
   8945    default:
   8946       unreachable("Invalid hardware generation");
   8947    }
   8948 }
   8949 
   8950 
   8951 
   8952 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::Binding Table Pool Buffer Size */
   8953 
   8954 
   8955 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_bits  20
   8956 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_bits  20
   8957 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_bits  20
   8958 
   8959 static inline uint32_t ATTRIBUTE_PURE
   8960 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_bits(const struct gen_device_info *devinfo)
   8961 {
   8962    switch (devinfo->gen) {
   8963    case 10: return 20;
   8964    case 9: return 20;
   8965    case 8: return 20;
   8966    case 7:
   8967       if (devinfo->is_haswell) {
   8968          return 0;
   8969       } else {
   8970          return 0;
   8971       }
   8972    case 6: return 0;
   8973    case 5: return 0;
   8974    case 4:
   8975       if (devinfo->is_g4x) {
   8976          return 0;
   8977       } else {
   8978          return 0;
   8979       }
   8980    default:
   8981       unreachable("Invalid hardware generation");
   8982    }
   8983 }
   8984 
   8985 
   8986 
   8987 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_start  108
   8988 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_start  108
   8989 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_start  108
   8990 
   8991 static inline uint32_t ATTRIBUTE_PURE
   8992 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolBufferSize_start(const struct gen_device_info *devinfo)
   8993 {
   8994    switch (devinfo->gen) {
   8995    case 10: return 108;
   8996    case 9: return 108;
   8997    case 8: return 108;
   8998    case 7:
   8999       if (devinfo->is_haswell) {
   9000          return 0;
   9001       } else {
   9002          return 0;
   9003       }
   9004    case 6: return 0;
   9005    case 5: return 0;
   9006    case 4:
   9007       if (devinfo->is_g4x) {
   9008          return 0;
   9009       } else {
   9010          return 0;
   9011       }
   9012    default:
   9013       unreachable("Invalid hardware generation");
   9014    }
   9015 }
   9016 
   9017 
   9018 
   9019 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::Binding Table Pool Enable */
   9020 
   9021 
   9022 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_bits  1
   9023 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_bits  1
   9024 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_bits  1
   9025 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_bits  1
   9026 
   9027 static inline uint32_t ATTRIBUTE_PURE
   9028 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_bits(const struct gen_device_info *devinfo)
   9029 {
   9030    switch (devinfo->gen) {
   9031    case 10: return 1;
   9032    case 9: return 1;
   9033    case 8: return 1;
   9034    case 7:
   9035       if (devinfo->is_haswell) {
   9036          return 1;
   9037       } else {
   9038          return 0;
   9039       }
   9040    case 6: return 0;
   9041    case 5: return 0;
   9042    case 4:
   9043       if (devinfo->is_g4x) {
   9044          return 0;
   9045       } else {
   9046          return 0;
   9047       }
   9048    default:
   9049       unreachable("Invalid hardware generation");
   9050    }
   9051 }
   9052 
   9053 
   9054 
   9055 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_start  43
   9056 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_start  43
   9057 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_start  43
   9058 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_start  43
   9059 
   9060 static inline uint32_t ATTRIBUTE_PURE
   9061 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolEnable_start(const struct gen_device_info *devinfo)
   9062 {
   9063    switch (devinfo->gen) {
   9064    case 10: return 43;
   9065    case 9: return 43;
   9066    case 8: return 43;
   9067    case 7:
   9068       if (devinfo->is_haswell) {
   9069          return 43;
   9070       } else {
   9071          return 0;
   9072       }
   9073    case 6: return 0;
   9074    case 5: return 0;
   9075    case 4:
   9076       if (devinfo->is_g4x) {
   9077          return 0;
   9078       } else {
   9079          return 0;
   9080       }
   9081    default:
   9082       unreachable("Invalid hardware generation");
   9083    }
   9084 }
   9085 
   9086 
   9087 
   9088 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::Binding Table Pool Upper Bound */
   9089 
   9090 
   9091 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolUpperBound_bits  20
   9092 
   9093 static inline uint32_t ATTRIBUTE_PURE
   9094 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolUpperBound_bits(const struct gen_device_info *devinfo)
   9095 {
   9096    switch (devinfo->gen) {
   9097    case 10: return 0;
   9098    case 9: return 0;
   9099    case 8: return 0;
   9100    case 7:
   9101       if (devinfo->is_haswell) {
   9102          return 20;
   9103       } else {
   9104          return 0;
   9105       }
   9106    case 6: return 0;
   9107    case 5: return 0;
   9108    case 4:
   9109       if (devinfo->is_g4x) {
   9110          return 0;
   9111       } else {
   9112          return 0;
   9113       }
   9114    default:
   9115       unreachable("Invalid hardware generation");
   9116    }
   9117 }
   9118 
   9119 
   9120 
   9121 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolUpperBound_start  76
   9122 
   9123 static inline uint32_t ATTRIBUTE_PURE
   9124 _3DSTATE_BINDING_TABLE_POOL_ALLOC_BindingTablePoolUpperBound_start(const struct gen_device_info *devinfo)
   9125 {
   9126    switch (devinfo->gen) {
   9127    case 10: return 0;
   9128    case 9: return 0;
   9129    case 8: return 0;
   9130    case 7:
   9131       if (devinfo->is_haswell) {
   9132          return 76;
   9133       } else {
   9134          return 0;
   9135       }
   9136    case 6: return 0;
   9137    case 5: return 0;
   9138    case 4:
   9139       if (devinfo->is_g4x) {
   9140          return 0;
   9141       } else {
   9142          return 0;
   9143       }
   9144    default:
   9145       unreachable("Invalid hardware generation");
   9146    }
   9147 }
   9148 
   9149 
   9150 
   9151 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::Command SubType */
   9152 
   9153 
   9154 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_bits  2
   9155 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_bits  2
   9156 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_bits  2
   9157 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_bits  2
   9158 
   9159 static inline uint32_t ATTRIBUTE_PURE
   9160 _3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_bits(const struct gen_device_info *devinfo)
   9161 {
   9162    switch (devinfo->gen) {
   9163    case 10: return 2;
   9164    case 9: return 2;
   9165    case 8: return 2;
   9166    case 7:
   9167       if (devinfo->is_haswell) {
   9168          return 2;
   9169       } else {
   9170          return 0;
   9171       }
   9172    case 6: return 0;
   9173    case 5: return 0;
   9174    case 4:
   9175       if (devinfo->is_g4x) {
   9176          return 0;
   9177       } else {
   9178          return 0;
   9179       }
   9180    default:
   9181       unreachable("Invalid hardware generation");
   9182    }
   9183 }
   9184 
   9185 
   9186 
   9187 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_start  27
   9188 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_start  27
   9189 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_start  27
   9190 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_start  27
   9191 
   9192 static inline uint32_t ATTRIBUTE_PURE
   9193 _3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandSubType_start(const struct gen_device_info *devinfo)
   9194 {
   9195    switch (devinfo->gen) {
   9196    case 10: return 27;
   9197    case 9: return 27;
   9198    case 8: return 27;
   9199    case 7:
   9200       if (devinfo->is_haswell) {
   9201          return 27;
   9202       } else {
   9203          return 0;
   9204       }
   9205    case 6: return 0;
   9206    case 5: return 0;
   9207    case 4:
   9208       if (devinfo->is_g4x) {
   9209          return 0;
   9210       } else {
   9211          return 0;
   9212       }
   9213    default:
   9214       unreachable("Invalid hardware generation");
   9215    }
   9216 }
   9217 
   9218 
   9219 
   9220 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::Command Type */
   9221 
   9222 
   9223 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_bits  3
   9224 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_bits  3
   9225 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_bits  3
   9226 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_bits  3
   9227 
   9228 static inline uint32_t ATTRIBUTE_PURE
   9229 _3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_bits(const struct gen_device_info *devinfo)
   9230 {
   9231    switch (devinfo->gen) {
   9232    case 10: return 3;
   9233    case 9: return 3;
   9234    case 8: return 3;
   9235    case 7:
   9236       if (devinfo->is_haswell) {
   9237          return 3;
   9238       } else {
   9239          return 0;
   9240       }
   9241    case 6: return 0;
   9242    case 5: return 0;
   9243    case 4:
   9244       if (devinfo->is_g4x) {
   9245          return 0;
   9246       } else {
   9247          return 0;
   9248       }
   9249    default:
   9250       unreachable("Invalid hardware generation");
   9251    }
   9252 }
   9253 
   9254 
   9255 
   9256 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_start  29
   9257 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_start  29
   9258 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_start  29
   9259 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_start  29
   9260 
   9261 static inline uint32_t ATTRIBUTE_PURE
   9262 _3DSTATE_BINDING_TABLE_POOL_ALLOC_CommandType_start(const struct gen_device_info *devinfo)
   9263 {
   9264    switch (devinfo->gen) {
   9265    case 10: return 29;
   9266    case 9: return 29;
   9267    case 8: return 29;
   9268    case 7:
   9269       if (devinfo->is_haswell) {
   9270          return 29;
   9271       } else {
   9272          return 0;
   9273       }
   9274    case 6: return 0;
   9275    case 5: return 0;
   9276    case 4:
   9277       if (devinfo->is_g4x) {
   9278          return 0;
   9279       } else {
   9280          return 0;
   9281       }
   9282    default:
   9283       unreachable("Invalid hardware generation");
   9284    }
   9285 }
   9286 
   9287 
   9288 
   9289 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::DWord Length */
   9290 
   9291 
   9292 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_bits  8
   9293 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_bits  8
   9294 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_bits  8
   9295 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_bits  8
   9296 
   9297 static inline uint32_t ATTRIBUTE_PURE
   9298 _3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_bits(const struct gen_device_info *devinfo)
   9299 {
   9300    switch (devinfo->gen) {
   9301    case 10: return 8;
   9302    case 9: return 8;
   9303    case 8: return 8;
   9304    case 7:
   9305       if (devinfo->is_haswell) {
   9306          return 8;
   9307       } else {
   9308          return 0;
   9309       }
   9310    case 6: return 0;
   9311    case 5: return 0;
   9312    case 4:
   9313       if (devinfo->is_g4x) {
   9314          return 0;
   9315       } else {
   9316          return 0;
   9317       }
   9318    default:
   9319       unreachable("Invalid hardware generation");
   9320    }
   9321 }
   9322 
   9323 
   9324 
   9325 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_start  0
   9326 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_start  0
   9327 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_start  0
   9328 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_start  0
   9329 
   9330 static inline uint32_t ATTRIBUTE_PURE
   9331 _3DSTATE_BINDING_TABLE_POOL_ALLOC_DWordLength_start(const struct gen_device_info *devinfo)
   9332 {
   9333    switch (devinfo->gen) {
   9334    case 10: return 0;
   9335    case 9: return 0;
   9336    case 8: return 0;
   9337    case 7:
   9338       if (devinfo->is_haswell) {
   9339          return 0;
   9340       } else {
   9341          return 0;
   9342       }
   9343    case 6: return 0;
   9344    case 5: return 0;
   9345    case 4:
   9346       if (devinfo->is_g4x) {
   9347          return 0;
   9348       } else {
   9349          return 0;
   9350       }
   9351    default:
   9352       unreachable("Invalid hardware generation");
   9353    }
   9354 }
   9355 
   9356 
   9357 
   9358 /* 3DSTATE_BINDING_TABLE_POOL_ALLOC::Surface Object Control State */
   9359 
   9360 
   9361 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_bits  7
   9362 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_bits  7
   9363 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_bits  7
   9364 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_bits  4
   9365 
   9366 static inline uint32_t ATTRIBUTE_PURE
   9367 _3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_bits(const struct gen_device_info *devinfo)
   9368 {
   9369    switch (devinfo->gen) {
   9370    case 10: return 7;
   9371    case 9: return 7;
   9372    case 8: return 7;
   9373    case 7:
   9374       if (devinfo->is_haswell) {
   9375          return 4;
   9376       } else {
   9377          return 0;
   9378       }
   9379    case 6: return 0;
   9380    case 5: return 0;
   9381    case 4:
   9382       if (devinfo->is_g4x) {
   9383          return 0;
   9384       } else {
   9385          return 0;
   9386       }
   9387    default:
   9388       unreachable("Invalid hardware generation");
   9389    }
   9390 }
   9391 
   9392 
   9393 
   9394 #define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_start  32
   9395 #define GEN9_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_start  32
   9396 #define GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_start  32
   9397 #define GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_start  39
   9398 
   9399 static inline uint32_t ATTRIBUTE_PURE
   9400 _3DSTATE_BINDING_TABLE_POOL_ALLOC_SurfaceObjectControlState_start(const struct gen_device_info *devinfo)
   9401 {
   9402    switch (devinfo->gen) {
   9403    case 10: return 32;
   9404    case 9: return 32;
   9405    case 8: return 32;
   9406    case 7:
   9407       if (devinfo->is_haswell) {
   9408          return 39;
   9409       } else {
   9410          return 0;
   9411       }
   9412    case 6: return 0;
   9413    case 5: return 0;
   9414    case 4:
   9415       if (devinfo->is_g4x) {
   9416          return 0;
   9417       } else {
   9418          return 0;
   9419       }
   9420    default:
   9421       unreachable("Invalid hardware generation");
   9422    }
   9423 }
   9424 
   9425 
   9426 
   9427 /* 3DSTATE_BLEND_STATE_POINTERS */
   9428 
   9429 
   9430 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_length  2
   9431 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_length  2
   9432 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_length  2
   9433 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_length  2
   9434 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_length  2
   9435 
   9436 static inline uint32_t ATTRIBUTE_PURE
   9437 _3DSTATE_BLEND_STATE_POINTERS_length(const struct gen_device_info *devinfo)
   9438 {
   9439    switch (devinfo->gen) {
   9440    case 10: return 2;
   9441    case 9: return 2;
   9442    case 8: return 2;
   9443    case 7:
   9444       if (devinfo->is_haswell) {
   9445          return 2;
   9446       } else {
   9447          return 2;
   9448       }
   9449    case 6: return 0;
   9450    case 5: return 0;
   9451    case 4:
   9452       if (devinfo->is_g4x) {
   9453          return 0;
   9454       } else {
   9455          return 0;
   9456       }
   9457    default:
   9458       unreachable("Invalid hardware generation");
   9459    }
   9460 }
   9461 
   9462 
   9463 
   9464 /* 3DSTATE_BLEND_STATE_POINTERS::3D Command Opcode */
   9465 
   9466 
   9467 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_bits  3
   9468 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_bits  3
   9469 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_bits  3
   9470 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_bits  3
   9471 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_bits  3
   9472 
   9473 static inline uint32_t ATTRIBUTE_PURE
   9474 _3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   9475 {
   9476    switch (devinfo->gen) {
   9477    case 10: return 3;
   9478    case 9: return 3;
   9479    case 8: return 3;
   9480    case 7:
   9481       if (devinfo->is_haswell) {
   9482          return 3;
   9483       } else {
   9484          return 3;
   9485       }
   9486    case 6: return 0;
   9487    case 5: return 0;
   9488    case 4:
   9489       if (devinfo->is_g4x) {
   9490          return 0;
   9491       } else {
   9492          return 0;
   9493       }
   9494    default:
   9495       unreachable("Invalid hardware generation");
   9496    }
   9497 }
   9498 
   9499 
   9500 
   9501 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_start  24
   9502 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_start  24
   9503 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_start  24
   9504 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_start  24
   9505 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_start  24
   9506 
   9507 static inline uint32_t ATTRIBUTE_PURE
   9508 _3DSTATE_BLEND_STATE_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   9509 {
   9510    switch (devinfo->gen) {
   9511    case 10: return 24;
   9512    case 9: return 24;
   9513    case 8: return 24;
   9514    case 7:
   9515       if (devinfo->is_haswell) {
   9516          return 24;
   9517       } else {
   9518          return 24;
   9519       }
   9520    case 6: return 0;
   9521    case 5: return 0;
   9522    case 4:
   9523       if (devinfo->is_g4x) {
   9524          return 0;
   9525       } else {
   9526          return 0;
   9527       }
   9528    default:
   9529       unreachable("Invalid hardware generation");
   9530    }
   9531 }
   9532 
   9533 
   9534 
   9535 /* 3DSTATE_BLEND_STATE_POINTERS::3D Command Sub Opcode */
   9536 
   9537 
   9538 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_bits  8
   9539 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_bits  8
   9540 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_bits  8
   9541 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_bits  8
   9542 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_bits  8
   9543 
   9544 static inline uint32_t ATTRIBUTE_PURE
   9545 _3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   9546 {
   9547    switch (devinfo->gen) {
   9548    case 10: return 8;
   9549    case 9: return 8;
   9550    case 8: return 8;
   9551    case 7:
   9552       if (devinfo->is_haswell) {
   9553          return 8;
   9554       } else {
   9555          return 8;
   9556       }
   9557    case 6: return 0;
   9558    case 5: return 0;
   9559    case 4:
   9560       if (devinfo->is_g4x) {
   9561          return 0;
   9562       } else {
   9563          return 0;
   9564       }
   9565    default:
   9566       unreachable("Invalid hardware generation");
   9567    }
   9568 }
   9569 
   9570 
   9571 
   9572 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_start  16
   9573 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_start  16
   9574 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_start  16
   9575 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_start  16
   9576 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_start  16
   9577 
   9578 static inline uint32_t ATTRIBUTE_PURE
   9579 _3DSTATE_BLEND_STATE_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   9580 {
   9581    switch (devinfo->gen) {
   9582    case 10: return 16;
   9583    case 9: return 16;
   9584    case 8: return 16;
   9585    case 7:
   9586       if (devinfo->is_haswell) {
   9587          return 16;
   9588       } else {
   9589          return 16;
   9590       }
   9591    case 6: return 0;
   9592    case 5: return 0;
   9593    case 4:
   9594       if (devinfo->is_g4x) {
   9595          return 0;
   9596       } else {
   9597          return 0;
   9598       }
   9599    default:
   9600       unreachable("Invalid hardware generation");
   9601    }
   9602 }
   9603 
   9604 
   9605 
   9606 /* 3DSTATE_BLEND_STATE_POINTERS::Blend State Pointer */
   9607 
   9608 
   9609 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_bits  26
   9610 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_bits  26
   9611 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_bits  26
   9612 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_bits  26
   9613 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_bits  26
   9614 
   9615 static inline uint32_t ATTRIBUTE_PURE
   9616 _3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_bits(const struct gen_device_info *devinfo)
   9617 {
   9618    switch (devinfo->gen) {
   9619    case 10: return 26;
   9620    case 9: return 26;
   9621    case 8: return 26;
   9622    case 7:
   9623       if (devinfo->is_haswell) {
   9624          return 26;
   9625       } else {
   9626          return 26;
   9627       }
   9628    case 6: return 0;
   9629    case 5: return 0;
   9630    case 4:
   9631       if (devinfo->is_g4x) {
   9632          return 0;
   9633       } else {
   9634          return 0;
   9635       }
   9636    default:
   9637       unreachable("Invalid hardware generation");
   9638    }
   9639 }
   9640 
   9641 
   9642 
   9643 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_start  38
   9644 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_start  38
   9645 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_start  38
   9646 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_start  38
   9647 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_start  38
   9648 
   9649 static inline uint32_t ATTRIBUTE_PURE
   9650 _3DSTATE_BLEND_STATE_POINTERS_BlendStatePointer_start(const struct gen_device_info *devinfo)
   9651 {
   9652    switch (devinfo->gen) {
   9653    case 10: return 38;
   9654    case 9: return 38;
   9655    case 8: return 38;
   9656    case 7:
   9657       if (devinfo->is_haswell) {
   9658          return 38;
   9659       } else {
   9660          return 38;
   9661       }
   9662    case 6: return 0;
   9663    case 5: return 0;
   9664    case 4:
   9665       if (devinfo->is_g4x) {
   9666          return 0;
   9667       } else {
   9668          return 0;
   9669       }
   9670    default:
   9671       unreachable("Invalid hardware generation");
   9672    }
   9673 }
   9674 
   9675 
   9676 
   9677 /* 3DSTATE_BLEND_STATE_POINTERS::Blend State Pointer Valid */
   9678 
   9679 
   9680 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_bits  1
   9681 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_bits  1
   9682 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_bits  1
   9683 
   9684 static inline uint32_t ATTRIBUTE_PURE
   9685 _3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_bits(const struct gen_device_info *devinfo)
   9686 {
   9687    switch (devinfo->gen) {
   9688    case 10: return 1;
   9689    case 9: return 1;
   9690    case 8: return 1;
   9691    case 7:
   9692       if (devinfo->is_haswell) {
   9693          return 0;
   9694       } else {
   9695          return 0;
   9696       }
   9697    case 6: return 0;
   9698    case 5: return 0;
   9699    case 4:
   9700       if (devinfo->is_g4x) {
   9701          return 0;
   9702       } else {
   9703          return 0;
   9704       }
   9705    default:
   9706       unreachable("Invalid hardware generation");
   9707    }
   9708 }
   9709 
   9710 
   9711 
   9712 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_start  32
   9713 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_start  32
   9714 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_start  32
   9715 
   9716 static inline uint32_t ATTRIBUTE_PURE
   9717 _3DSTATE_BLEND_STATE_POINTERS_BlendStatePointerValid_start(const struct gen_device_info *devinfo)
   9718 {
   9719    switch (devinfo->gen) {
   9720    case 10: return 32;
   9721    case 9: return 32;
   9722    case 8: return 32;
   9723    case 7:
   9724       if (devinfo->is_haswell) {
   9725          return 0;
   9726       } else {
   9727          return 0;
   9728       }
   9729    case 6: return 0;
   9730    case 5: return 0;
   9731    case 4:
   9732       if (devinfo->is_g4x) {
   9733          return 0;
   9734       } else {
   9735          return 0;
   9736       }
   9737    default:
   9738       unreachable("Invalid hardware generation");
   9739    }
   9740 }
   9741 
   9742 
   9743 
   9744 /* 3DSTATE_BLEND_STATE_POINTERS::Command SubType */
   9745 
   9746 
   9747 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_bits  2
   9748 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_bits  2
   9749 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_bits  2
   9750 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_bits  2
   9751 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_bits  2
   9752 
   9753 static inline uint32_t ATTRIBUTE_PURE
   9754 _3DSTATE_BLEND_STATE_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   9755 {
   9756    switch (devinfo->gen) {
   9757    case 10: return 2;
   9758    case 9: return 2;
   9759    case 8: return 2;
   9760    case 7:
   9761       if (devinfo->is_haswell) {
   9762          return 2;
   9763       } else {
   9764          return 2;
   9765       }
   9766    case 6: return 0;
   9767    case 5: return 0;
   9768    case 4:
   9769       if (devinfo->is_g4x) {
   9770          return 0;
   9771       } else {
   9772          return 0;
   9773       }
   9774    default:
   9775       unreachable("Invalid hardware generation");
   9776    }
   9777 }
   9778 
   9779 
   9780 
   9781 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_start  27
   9782 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_start  27
   9783 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_start  27
   9784 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_start  27
   9785 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_CommandSubType_start  27
   9786 
   9787 static inline uint32_t ATTRIBUTE_PURE
   9788 _3DSTATE_BLEND_STATE_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   9789 {
   9790    switch (devinfo->gen) {
   9791    case 10: return 27;
   9792    case 9: return 27;
   9793    case 8: return 27;
   9794    case 7:
   9795       if (devinfo->is_haswell) {
   9796          return 27;
   9797       } else {
   9798          return 27;
   9799       }
   9800    case 6: return 0;
   9801    case 5: return 0;
   9802    case 4:
   9803       if (devinfo->is_g4x) {
   9804          return 0;
   9805       } else {
   9806          return 0;
   9807       }
   9808    default:
   9809       unreachable("Invalid hardware generation");
   9810    }
   9811 }
   9812 
   9813 
   9814 
   9815 /* 3DSTATE_BLEND_STATE_POINTERS::Command Type */
   9816 
   9817 
   9818 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_CommandType_bits  3
   9819 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_CommandType_bits  3
   9820 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_CommandType_bits  3
   9821 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_CommandType_bits  3
   9822 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_CommandType_bits  3
   9823 
   9824 static inline uint32_t ATTRIBUTE_PURE
   9825 _3DSTATE_BLEND_STATE_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   9826 {
   9827    switch (devinfo->gen) {
   9828    case 10: return 3;
   9829    case 9: return 3;
   9830    case 8: return 3;
   9831    case 7:
   9832       if (devinfo->is_haswell) {
   9833          return 3;
   9834       } else {
   9835          return 3;
   9836       }
   9837    case 6: return 0;
   9838    case 5: return 0;
   9839    case 4:
   9840       if (devinfo->is_g4x) {
   9841          return 0;
   9842       } else {
   9843          return 0;
   9844       }
   9845    default:
   9846       unreachable("Invalid hardware generation");
   9847    }
   9848 }
   9849 
   9850 
   9851 
   9852 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_CommandType_start  29
   9853 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_CommandType_start  29
   9854 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_CommandType_start  29
   9855 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_CommandType_start  29
   9856 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_CommandType_start  29
   9857 
   9858 static inline uint32_t ATTRIBUTE_PURE
   9859 _3DSTATE_BLEND_STATE_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   9860 {
   9861    switch (devinfo->gen) {
   9862    case 10: return 29;
   9863    case 9: return 29;
   9864    case 8: return 29;
   9865    case 7:
   9866       if (devinfo->is_haswell) {
   9867          return 29;
   9868       } else {
   9869          return 29;
   9870       }
   9871    case 6: return 0;
   9872    case 5: return 0;
   9873    case 4:
   9874       if (devinfo->is_g4x) {
   9875          return 0;
   9876       } else {
   9877          return 0;
   9878       }
   9879    default:
   9880       unreachable("Invalid hardware generation");
   9881    }
   9882 }
   9883 
   9884 
   9885 
   9886 /* 3DSTATE_BLEND_STATE_POINTERS::DWord Length */
   9887 
   9888 
   9889 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_DWordLength_bits  8
   9890 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_DWordLength_bits  8
   9891 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_DWordLength_bits  8
   9892 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_DWordLength_bits  8
   9893 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_DWordLength_bits  8
   9894 
   9895 static inline uint32_t ATTRIBUTE_PURE
   9896 _3DSTATE_BLEND_STATE_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   9897 {
   9898    switch (devinfo->gen) {
   9899    case 10: return 8;
   9900    case 9: return 8;
   9901    case 8: return 8;
   9902    case 7:
   9903       if (devinfo->is_haswell) {
   9904          return 8;
   9905       } else {
   9906          return 8;
   9907       }
   9908    case 6: return 0;
   9909    case 5: return 0;
   9910    case 4:
   9911       if (devinfo->is_g4x) {
   9912          return 0;
   9913       } else {
   9914          return 0;
   9915       }
   9916    default:
   9917       unreachable("Invalid hardware generation");
   9918    }
   9919 }
   9920 
   9921 
   9922 
   9923 #define GEN10_3DSTATE_BLEND_STATE_POINTERS_DWordLength_start  0
   9924 #define GEN9_3DSTATE_BLEND_STATE_POINTERS_DWordLength_start  0
   9925 #define GEN8_3DSTATE_BLEND_STATE_POINTERS_DWordLength_start  0
   9926 #define GEN75_3DSTATE_BLEND_STATE_POINTERS_DWordLength_start  0
   9927 #define GEN7_3DSTATE_BLEND_STATE_POINTERS_DWordLength_start  0
   9928 
   9929 static inline uint32_t ATTRIBUTE_PURE
   9930 _3DSTATE_BLEND_STATE_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   9931 {
   9932    switch (devinfo->gen) {
   9933    case 10: return 0;
   9934    case 9: return 0;
   9935    case 8: return 0;
   9936    case 7:
   9937       if (devinfo->is_haswell) {
   9938          return 0;
   9939       } else {
   9940          return 0;
   9941       }
   9942    case 6: return 0;
   9943    case 5: return 0;
   9944    case 4:
   9945       if (devinfo->is_g4x) {
   9946          return 0;
   9947       } else {
   9948          return 0;
   9949       }
   9950    default:
   9951       unreachable("Invalid hardware generation");
   9952    }
   9953 }
   9954 
   9955 
   9956 
   9957 /* 3DSTATE_CC_STATE_POINTERS */
   9958 
   9959 
   9960 #define GEN10_3DSTATE_CC_STATE_POINTERS_length  2
   9961 #define GEN9_3DSTATE_CC_STATE_POINTERS_length  2
   9962 #define GEN8_3DSTATE_CC_STATE_POINTERS_length  2
   9963 #define GEN75_3DSTATE_CC_STATE_POINTERS_length  2
   9964 #define GEN7_3DSTATE_CC_STATE_POINTERS_length  2
   9965 #define GEN6_3DSTATE_CC_STATE_POINTERS_length  4
   9966 
   9967 static inline uint32_t ATTRIBUTE_PURE
   9968 _3DSTATE_CC_STATE_POINTERS_length(const struct gen_device_info *devinfo)
   9969 {
   9970    switch (devinfo->gen) {
   9971    case 10: return 2;
   9972    case 9: return 2;
   9973    case 8: return 2;
   9974    case 7:
   9975       if (devinfo->is_haswell) {
   9976          return 2;
   9977       } else {
   9978          return 2;
   9979       }
   9980    case 6: return 4;
   9981    case 5: return 0;
   9982    case 4:
   9983       if (devinfo->is_g4x) {
   9984          return 0;
   9985       } else {
   9986          return 0;
   9987       }
   9988    default:
   9989       unreachable("Invalid hardware generation");
   9990    }
   9991 }
   9992 
   9993 
   9994 
   9995 /* 3DSTATE_CC_STATE_POINTERS::3D Command Opcode */
   9996 
   9997 
   9998 #define GEN10_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_bits  3
   9999 #define GEN9_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_bits  3
   10000 #define GEN8_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_bits  3
   10001 #define GEN75_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_bits  3
   10002 #define GEN7_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_bits  3
   10003 #define GEN6_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_bits  3
   10004 
   10005 static inline uint32_t ATTRIBUTE_PURE
   10006 _3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   10007 {
   10008    switch (devinfo->gen) {
   10009    case 10: return 3;
   10010    case 9: return 3;
   10011    case 8: return 3;
   10012    case 7:
   10013       if (devinfo->is_haswell) {
   10014          return 3;
   10015       } else {
   10016          return 3;
   10017       }
   10018    case 6: return 3;
   10019    case 5: return 0;
   10020    case 4:
   10021       if (devinfo->is_g4x) {
   10022          return 0;
   10023       } else {
   10024          return 0;
   10025       }
   10026    default:
   10027       unreachable("Invalid hardware generation");
   10028    }
   10029 }
   10030 
   10031 
   10032 
   10033 #define GEN10_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_start  24
   10034 #define GEN9_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_start  24
   10035 #define GEN8_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_start  24
   10036 #define GEN75_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_start  24
   10037 #define GEN7_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_start  24
   10038 #define GEN6_3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_start  24
   10039 
   10040 static inline uint32_t ATTRIBUTE_PURE
   10041 _3DSTATE_CC_STATE_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   10042 {
   10043    switch (devinfo->gen) {
   10044    case 10: return 24;
   10045    case 9: return 24;
   10046    case 8: return 24;
   10047    case 7:
   10048       if (devinfo->is_haswell) {
   10049          return 24;
   10050       } else {
   10051          return 24;
   10052       }
   10053    case 6: return 24;
   10054    case 5: return 0;
   10055    case 4:
   10056       if (devinfo->is_g4x) {
   10057          return 0;
   10058       } else {
   10059          return 0;
   10060       }
   10061    default:
   10062       unreachable("Invalid hardware generation");
   10063    }
   10064 }
   10065 
   10066 
   10067 
   10068 /* 3DSTATE_CC_STATE_POINTERS::3D Command Sub Opcode */
   10069 
   10070 
   10071 #define GEN10_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_bits  8
   10072 #define GEN9_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_bits  8
   10073 #define GEN8_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_bits  8
   10074 #define GEN75_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_bits  8
   10075 #define GEN7_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_bits  8
   10076 #define GEN6_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_bits  8
   10077 
   10078 static inline uint32_t ATTRIBUTE_PURE
   10079 _3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   10080 {
   10081    switch (devinfo->gen) {
   10082    case 10: return 8;
   10083    case 9: return 8;
   10084    case 8: return 8;
   10085    case 7:
   10086       if (devinfo->is_haswell) {
   10087          return 8;
   10088       } else {
   10089          return 8;
   10090       }
   10091    case 6: return 8;
   10092    case 5: return 0;
   10093    case 4:
   10094       if (devinfo->is_g4x) {
   10095          return 0;
   10096       } else {
   10097          return 0;
   10098       }
   10099    default:
   10100       unreachable("Invalid hardware generation");
   10101    }
   10102 }
   10103 
   10104 
   10105 
   10106 #define GEN10_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_start  16
   10107 #define GEN9_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_start  16
   10108 #define GEN8_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_start  16
   10109 #define GEN75_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_start  16
   10110 #define GEN7_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_start  16
   10111 #define GEN6_3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_start  16
   10112 
   10113 static inline uint32_t ATTRIBUTE_PURE
   10114 _3DSTATE_CC_STATE_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   10115 {
   10116    switch (devinfo->gen) {
   10117    case 10: return 16;
   10118    case 9: return 16;
   10119    case 8: return 16;
   10120    case 7:
   10121       if (devinfo->is_haswell) {
   10122          return 16;
   10123       } else {
   10124          return 16;
   10125       }
   10126    case 6: return 16;
   10127    case 5: return 0;
   10128    case 4:
   10129       if (devinfo->is_g4x) {
   10130          return 0;
   10131       } else {
   10132          return 0;
   10133       }
   10134    default:
   10135       unreachable("Invalid hardware generation");
   10136    }
   10137 }
   10138 
   10139 
   10140 
   10141 /* 3DSTATE_CC_STATE_POINTERS::BLEND_STATE Change */
   10142 
   10143 
   10144 #define GEN6_3DSTATE_CC_STATE_POINTERS_BLEND_STATEChange_bits  1
   10145 
   10146 static inline uint32_t ATTRIBUTE_PURE
   10147 _3DSTATE_CC_STATE_POINTERS_BLEND_STATEChange_bits(const struct gen_device_info *devinfo)
   10148 {
   10149    switch (devinfo->gen) {
   10150    case 10: return 0;
   10151    case 9: return 0;
   10152    case 8: return 0;
   10153    case 7:
   10154       if (devinfo->is_haswell) {
   10155          return 0;
   10156       } else {
   10157          return 0;
   10158       }
   10159    case 6: return 1;
   10160    case 5: return 0;
   10161    case 4:
   10162       if (devinfo->is_g4x) {
   10163          return 0;
   10164       } else {
   10165          return 0;
   10166       }
   10167    default:
   10168       unreachable("Invalid hardware generation");
   10169    }
   10170 }
   10171 
   10172 
   10173 
   10174 #define GEN6_3DSTATE_CC_STATE_POINTERS_BLEND_STATEChange_start  32
   10175 
   10176 static inline uint32_t ATTRIBUTE_PURE
   10177 _3DSTATE_CC_STATE_POINTERS_BLEND_STATEChange_start(const struct gen_device_info *devinfo)
   10178 {
   10179    switch (devinfo->gen) {
   10180    case 10: return 0;
   10181    case 9: return 0;
   10182    case 8: return 0;
   10183    case 7:
   10184       if (devinfo->is_haswell) {
   10185          return 0;
   10186       } else {
   10187          return 0;
   10188       }
   10189    case 6: return 32;
   10190    case 5: return 0;
   10191    case 4:
   10192       if (devinfo->is_g4x) {
   10193          return 0;
   10194       } else {
   10195          return 0;
   10196       }
   10197    default:
   10198       unreachable("Invalid hardware generation");
   10199    }
   10200 }
   10201 
   10202 
   10203 
   10204 /* 3DSTATE_CC_STATE_POINTERS::Color Calc State Pointer */
   10205 
   10206 
   10207 #define GEN10_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_bits  26
   10208 #define GEN9_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_bits  26
   10209 #define GEN8_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_bits  26
   10210 #define GEN75_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_bits  26
   10211 #define GEN7_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_bits  26
   10212 #define GEN6_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_bits  26
   10213 
   10214 static inline uint32_t ATTRIBUTE_PURE
   10215 _3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_bits(const struct gen_device_info *devinfo)
   10216 {
   10217    switch (devinfo->gen) {
   10218    case 10: return 26;
   10219    case 9: return 26;
   10220    case 8: return 26;
   10221    case 7:
   10222       if (devinfo->is_haswell) {
   10223          return 26;
   10224       } else {
   10225          return 26;
   10226       }
   10227    case 6: return 26;
   10228    case 5: return 0;
   10229    case 4:
   10230       if (devinfo->is_g4x) {
   10231          return 0;
   10232       } else {
   10233          return 0;
   10234       }
   10235    default:
   10236       unreachable("Invalid hardware generation");
   10237    }
   10238 }
   10239 
   10240 
   10241 
   10242 #define GEN10_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_start  38
   10243 #define GEN9_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_start  38
   10244 #define GEN8_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_start  38
   10245 #define GEN75_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_start  38
   10246 #define GEN7_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_start  38
   10247 #define GEN6_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_start  102
   10248 
   10249 static inline uint32_t ATTRIBUTE_PURE
   10250 _3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointer_start(const struct gen_device_info *devinfo)
   10251 {
   10252    switch (devinfo->gen) {
   10253    case 10: return 38;
   10254    case 9: return 38;
   10255    case 8: return 38;
   10256    case 7:
   10257       if (devinfo->is_haswell) {
   10258          return 38;
   10259       } else {
   10260          return 38;
   10261       }
   10262    case 6: return 102;
   10263    case 5: return 0;
   10264    case 4:
   10265       if (devinfo->is_g4x) {
   10266          return 0;
   10267       } else {
   10268          return 0;
   10269       }
   10270    default:
   10271       unreachable("Invalid hardware generation");
   10272    }
   10273 }
   10274 
   10275 
   10276 
   10277 /* 3DSTATE_CC_STATE_POINTERS::Color Calc State Pointer Valid */
   10278 
   10279 
   10280 #define GEN10_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_bits  1
   10281 #define GEN9_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_bits  1
   10282 #define GEN8_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_bits  1
   10283 #define GEN6_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_bits  1
   10284 
   10285 static inline uint32_t ATTRIBUTE_PURE
   10286 _3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_bits(const struct gen_device_info *devinfo)
   10287 {
   10288    switch (devinfo->gen) {
   10289    case 10: return 1;
   10290    case 9: return 1;
   10291    case 8: return 1;
   10292    case 7:
   10293       if (devinfo->is_haswell) {
   10294          return 0;
   10295       } else {
   10296          return 0;
   10297       }
   10298    case 6: return 1;
   10299    case 5: return 0;
   10300    case 4:
   10301       if (devinfo->is_g4x) {
   10302          return 0;
   10303       } else {
   10304          return 0;
   10305       }
   10306    default:
   10307       unreachable("Invalid hardware generation");
   10308    }
   10309 }
   10310 
   10311 
   10312 
   10313 #define GEN10_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_start  32
   10314 #define GEN9_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_start  32
   10315 #define GEN8_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_start  32
   10316 #define GEN6_3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_start  96
   10317 
   10318 static inline uint32_t ATTRIBUTE_PURE
   10319 _3DSTATE_CC_STATE_POINTERS_ColorCalcStatePointerValid_start(const struct gen_device_info *devinfo)
   10320 {
   10321    switch (devinfo->gen) {
   10322    case 10: return 32;
   10323    case 9: return 32;
   10324    case 8: return 32;
   10325    case 7:
   10326       if (devinfo->is_haswell) {
   10327          return 0;
   10328       } else {
   10329          return 0;
   10330       }
   10331    case 6: return 96;
   10332    case 5: return 0;
   10333    case 4:
   10334       if (devinfo->is_g4x) {
   10335          return 0;
   10336       } else {
   10337          return 0;
   10338       }
   10339    default:
   10340       unreachable("Invalid hardware generation");
   10341    }
   10342 }
   10343 
   10344 
   10345 
   10346 /* 3DSTATE_CC_STATE_POINTERS::Command SubType */
   10347 
   10348 
   10349 #define GEN10_3DSTATE_CC_STATE_POINTERS_CommandSubType_bits  2
   10350 #define GEN9_3DSTATE_CC_STATE_POINTERS_CommandSubType_bits  2
   10351 #define GEN8_3DSTATE_CC_STATE_POINTERS_CommandSubType_bits  2
   10352 #define GEN75_3DSTATE_CC_STATE_POINTERS_CommandSubType_bits  2
   10353 #define GEN7_3DSTATE_CC_STATE_POINTERS_CommandSubType_bits  2
   10354 #define GEN6_3DSTATE_CC_STATE_POINTERS_CommandSubType_bits  2
   10355 
   10356 static inline uint32_t ATTRIBUTE_PURE
   10357 _3DSTATE_CC_STATE_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   10358 {
   10359    switch (devinfo->gen) {
   10360    case 10: return 2;
   10361    case 9: return 2;
   10362    case 8: return 2;
   10363    case 7:
   10364       if (devinfo->is_haswell) {
   10365          return 2;
   10366       } else {
   10367          return 2;
   10368       }
   10369    case 6: return 2;
   10370    case 5: return 0;
   10371    case 4:
   10372       if (devinfo->is_g4x) {
   10373          return 0;
   10374       } else {
   10375          return 0;
   10376       }
   10377    default:
   10378       unreachable("Invalid hardware generation");
   10379    }
   10380 }
   10381 
   10382 
   10383 
   10384 #define GEN10_3DSTATE_CC_STATE_POINTERS_CommandSubType_start  27
   10385 #define GEN9_3DSTATE_CC_STATE_POINTERS_CommandSubType_start  27
   10386 #define GEN8_3DSTATE_CC_STATE_POINTERS_CommandSubType_start  27
   10387 #define GEN75_3DSTATE_CC_STATE_POINTERS_CommandSubType_start  27
   10388 #define GEN7_3DSTATE_CC_STATE_POINTERS_CommandSubType_start  27
   10389 #define GEN6_3DSTATE_CC_STATE_POINTERS_CommandSubType_start  27
   10390 
   10391 static inline uint32_t ATTRIBUTE_PURE
   10392 _3DSTATE_CC_STATE_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   10393 {
   10394    switch (devinfo->gen) {
   10395    case 10: return 27;
   10396    case 9: return 27;
   10397    case 8: return 27;
   10398    case 7:
   10399       if (devinfo->is_haswell) {
   10400          return 27;
   10401       } else {
   10402          return 27;
   10403       }
   10404    case 6: return 27;
   10405    case 5: return 0;
   10406    case 4:
   10407       if (devinfo->is_g4x) {
   10408          return 0;
   10409       } else {
   10410          return 0;
   10411       }
   10412    default:
   10413       unreachable("Invalid hardware generation");
   10414    }
   10415 }
   10416 
   10417 
   10418 
   10419 /* 3DSTATE_CC_STATE_POINTERS::Command Type */
   10420 
   10421 
   10422 #define GEN10_3DSTATE_CC_STATE_POINTERS_CommandType_bits  3
   10423 #define GEN9_3DSTATE_CC_STATE_POINTERS_CommandType_bits  3
   10424 #define GEN8_3DSTATE_CC_STATE_POINTERS_CommandType_bits  3
   10425 #define GEN75_3DSTATE_CC_STATE_POINTERS_CommandType_bits  3
   10426 #define GEN7_3DSTATE_CC_STATE_POINTERS_CommandType_bits  3
   10427 #define GEN6_3DSTATE_CC_STATE_POINTERS_CommandType_bits  3
   10428 
   10429 static inline uint32_t ATTRIBUTE_PURE
   10430 _3DSTATE_CC_STATE_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   10431 {
   10432    switch (devinfo->gen) {
   10433    case 10: return 3;
   10434    case 9: return 3;
   10435    case 8: return 3;
   10436    case 7:
   10437       if (devinfo->is_haswell) {
   10438          return 3;
   10439       } else {
   10440          return 3;
   10441       }
   10442    case 6: return 3;
   10443    case 5: return 0;
   10444    case 4:
   10445       if (devinfo->is_g4x) {
   10446          return 0;
   10447       } else {
   10448          return 0;
   10449       }
   10450    default:
   10451       unreachable("Invalid hardware generation");
   10452    }
   10453 }
   10454 
   10455 
   10456 
   10457 #define GEN10_3DSTATE_CC_STATE_POINTERS_CommandType_start  29
   10458 #define GEN9_3DSTATE_CC_STATE_POINTERS_CommandType_start  29
   10459 #define GEN8_3DSTATE_CC_STATE_POINTERS_CommandType_start  29
   10460 #define GEN75_3DSTATE_CC_STATE_POINTERS_CommandType_start  29
   10461 #define GEN7_3DSTATE_CC_STATE_POINTERS_CommandType_start  29
   10462 #define GEN6_3DSTATE_CC_STATE_POINTERS_CommandType_start  29
   10463 
   10464 static inline uint32_t ATTRIBUTE_PURE
   10465 _3DSTATE_CC_STATE_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   10466 {
   10467    switch (devinfo->gen) {
   10468    case 10: return 29;
   10469    case 9: return 29;
   10470    case 8: return 29;
   10471    case 7:
   10472       if (devinfo->is_haswell) {
   10473          return 29;
   10474       } else {
   10475          return 29;
   10476       }
   10477    case 6: return 29;
   10478    case 5: return 0;
   10479    case 4:
   10480       if (devinfo->is_g4x) {
   10481          return 0;
   10482       } else {
   10483          return 0;
   10484       }
   10485    default:
   10486       unreachable("Invalid hardware generation");
   10487    }
   10488 }
   10489 
   10490 
   10491 
   10492 /* 3DSTATE_CC_STATE_POINTERS::DEPTH_STENCIL_STATE Change */
   10493 
   10494 
   10495 #define GEN6_3DSTATE_CC_STATE_POINTERS_DEPTH_STENCIL_STATEChange_bits  1
   10496 
   10497 static inline uint32_t ATTRIBUTE_PURE
   10498 _3DSTATE_CC_STATE_POINTERS_DEPTH_STENCIL_STATEChange_bits(const struct gen_device_info *devinfo)
   10499 {
   10500    switch (devinfo->gen) {
   10501    case 10: return 0;
   10502    case 9: return 0;
   10503    case 8: return 0;
   10504    case 7:
   10505       if (devinfo->is_haswell) {
   10506          return 0;
   10507       } else {
   10508          return 0;
   10509       }
   10510    case 6: return 1;
   10511    case 5: return 0;
   10512    case 4:
   10513       if (devinfo->is_g4x) {
   10514          return 0;
   10515       } else {
   10516          return 0;
   10517       }
   10518    default:
   10519       unreachable("Invalid hardware generation");
   10520    }
   10521 }
   10522 
   10523 
   10524 
   10525 #define GEN6_3DSTATE_CC_STATE_POINTERS_DEPTH_STENCIL_STATEChange_start  64
   10526 
   10527 static inline uint32_t ATTRIBUTE_PURE
   10528 _3DSTATE_CC_STATE_POINTERS_DEPTH_STENCIL_STATEChange_start(const struct gen_device_info *devinfo)
   10529 {
   10530    switch (devinfo->gen) {
   10531    case 10: return 0;
   10532    case 9: return 0;
   10533    case 8: return 0;
   10534    case 7:
   10535       if (devinfo->is_haswell) {
   10536          return 0;
   10537       } else {
   10538          return 0;
   10539       }
   10540    case 6: return 64;
   10541    case 5: return 0;
   10542    case 4:
   10543       if (devinfo->is_g4x) {
   10544          return 0;
   10545       } else {
   10546          return 0;
   10547       }
   10548    default:
   10549       unreachable("Invalid hardware generation");
   10550    }
   10551 }
   10552 
   10553 
   10554 
   10555 /* 3DSTATE_CC_STATE_POINTERS::DWord Length */
   10556 
   10557 
   10558 #define GEN10_3DSTATE_CC_STATE_POINTERS_DWordLength_bits  8
   10559 #define GEN9_3DSTATE_CC_STATE_POINTERS_DWordLength_bits  8
   10560 #define GEN8_3DSTATE_CC_STATE_POINTERS_DWordLength_bits  8
   10561 #define GEN75_3DSTATE_CC_STATE_POINTERS_DWordLength_bits  8
   10562 #define GEN7_3DSTATE_CC_STATE_POINTERS_DWordLength_bits  8
   10563 #define GEN6_3DSTATE_CC_STATE_POINTERS_DWordLength_bits  8
   10564 
   10565 static inline uint32_t ATTRIBUTE_PURE
   10566 _3DSTATE_CC_STATE_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   10567 {
   10568    switch (devinfo->gen) {
   10569    case 10: return 8;
   10570    case 9: return 8;
   10571    case 8: return 8;
   10572    case 7:
   10573       if (devinfo->is_haswell) {
   10574          return 8;
   10575       } else {
   10576          return 8;
   10577       }
   10578    case 6: return 8;
   10579    case 5: return 0;
   10580    case 4:
   10581       if (devinfo->is_g4x) {
   10582          return 0;
   10583       } else {
   10584          return 0;
   10585       }
   10586    default:
   10587       unreachable("Invalid hardware generation");
   10588    }
   10589 }
   10590 
   10591 
   10592 
   10593 #define GEN10_3DSTATE_CC_STATE_POINTERS_DWordLength_start  0
   10594 #define GEN9_3DSTATE_CC_STATE_POINTERS_DWordLength_start  0
   10595 #define GEN8_3DSTATE_CC_STATE_POINTERS_DWordLength_start  0
   10596 #define GEN75_3DSTATE_CC_STATE_POINTERS_DWordLength_start  0
   10597 #define GEN7_3DSTATE_CC_STATE_POINTERS_DWordLength_start  0
   10598 #define GEN6_3DSTATE_CC_STATE_POINTERS_DWordLength_start  0
   10599 
   10600 static inline uint32_t ATTRIBUTE_PURE
   10601 _3DSTATE_CC_STATE_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   10602 {
   10603    switch (devinfo->gen) {
   10604    case 10: return 0;
   10605    case 9: return 0;
   10606    case 8: return 0;
   10607    case 7:
   10608       if (devinfo->is_haswell) {
   10609          return 0;
   10610       } else {
   10611          return 0;
   10612       }
   10613    case 6: return 0;
   10614    case 5: return 0;
   10615    case 4:
   10616       if (devinfo->is_g4x) {
   10617          return 0;
   10618       } else {
   10619          return 0;
   10620       }
   10621    default:
   10622       unreachable("Invalid hardware generation");
   10623    }
   10624 }
   10625 
   10626 
   10627 
   10628 /* 3DSTATE_CC_STATE_POINTERS::Pointer to BLEND_STATE */
   10629 
   10630 
   10631 #define GEN6_3DSTATE_CC_STATE_POINTERS_PointertoBLEND_STATE_bits  26
   10632 
   10633 static inline uint32_t ATTRIBUTE_PURE
   10634 _3DSTATE_CC_STATE_POINTERS_PointertoBLEND_STATE_bits(const struct gen_device_info *devinfo)
   10635 {
   10636    switch (devinfo->gen) {
   10637    case 10: return 0;
   10638    case 9: return 0;
   10639    case 8: return 0;
   10640    case 7:
   10641       if (devinfo->is_haswell) {
   10642          return 0;
   10643       } else {
   10644          return 0;
   10645       }
   10646    case 6: return 26;
   10647    case 5: return 0;
   10648    case 4:
   10649       if (devinfo->is_g4x) {
   10650          return 0;
   10651       } else {
   10652          return 0;
   10653       }
   10654    default:
   10655       unreachable("Invalid hardware generation");
   10656    }
   10657 }
   10658 
   10659 
   10660 
   10661 #define GEN6_3DSTATE_CC_STATE_POINTERS_PointertoBLEND_STATE_start  38
   10662 
   10663 static inline uint32_t ATTRIBUTE_PURE
   10664 _3DSTATE_CC_STATE_POINTERS_PointertoBLEND_STATE_start(const struct gen_device_info *devinfo)
   10665 {
   10666    switch (devinfo->gen) {
   10667    case 10: return 0;
   10668    case 9: return 0;
   10669    case 8: return 0;
   10670    case 7:
   10671       if (devinfo->is_haswell) {
   10672          return 0;
   10673       } else {
   10674          return 0;
   10675       }
   10676    case 6: return 38;
   10677    case 5: return 0;
   10678    case 4:
   10679       if (devinfo->is_g4x) {
   10680          return 0;
   10681       } else {
   10682          return 0;
   10683       }
   10684    default:
   10685       unreachable("Invalid hardware generation");
   10686    }
   10687 }
   10688 
   10689 
   10690 
   10691 /* 3DSTATE_CC_STATE_POINTERS::Pointer to DEPTH_STENCIL_STATE */
   10692 
   10693 
   10694 #define GEN6_3DSTATE_CC_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_bits  26
   10695 
   10696 static inline uint32_t ATTRIBUTE_PURE
   10697 _3DSTATE_CC_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_bits(const struct gen_device_info *devinfo)
   10698 {
   10699    switch (devinfo->gen) {
   10700    case 10: return 0;
   10701    case 9: return 0;
   10702    case 8: return 0;
   10703    case 7:
   10704       if (devinfo->is_haswell) {
   10705          return 0;
   10706       } else {
   10707          return 0;
   10708       }
   10709    case 6: return 26;
   10710    case 5: return 0;
   10711    case 4:
   10712       if (devinfo->is_g4x) {
   10713          return 0;
   10714       } else {
   10715          return 0;
   10716       }
   10717    default:
   10718       unreachable("Invalid hardware generation");
   10719    }
   10720 }
   10721 
   10722 
   10723 
   10724 #define GEN6_3DSTATE_CC_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_start  70
   10725 
   10726 static inline uint32_t ATTRIBUTE_PURE
   10727 _3DSTATE_CC_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_start(const struct gen_device_info *devinfo)
   10728 {
   10729    switch (devinfo->gen) {
   10730    case 10: return 0;
   10731    case 9: return 0;
   10732    case 8: return 0;
   10733    case 7:
   10734       if (devinfo->is_haswell) {
   10735          return 0;
   10736       } else {
   10737          return 0;
   10738       }
   10739    case 6: return 70;
   10740    case 5: return 0;
   10741    case 4:
   10742       if (devinfo->is_g4x) {
   10743          return 0;
   10744       } else {
   10745          return 0;
   10746       }
   10747    default:
   10748       unreachable("Invalid hardware generation");
   10749    }
   10750 }
   10751 
   10752 
   10753 
   10754 /* 3DSTATE_CHROMA_KEY */
   10755 
   10756 
   10757 #define GEN10_3DSTATE_CHROMA_KEY_length  4
   10758 #define GEN9_3DSTATE_CHROMA_KEY_length  4
   10759 #define GEN8_3DSTATE_CHROMA_KEY_length  4
   10760 #define GEN75_3DSTATE_CHROMA_KEY_length  4
   10761 #define GEN7_3DSTATE_CHROMA_KEY_length  4
   10762 #define GEN6_3DSTATE_CHROMA_KEY_length  4
   10763 
   10764 static inline uint32_t ATTRIBUTE_PURE
   10765 _3DSTATE_CHROMA_KEY_length(const struct gen_device_info *devinfo)
   10766 {
   10767    switch (devinfo->gen) {
   10768    case 10: return 4;
   10769    case 9: return 4;
   10770    case 8: return 4;
   10771    case 7:
   10772       if (devinfo->is_haswell) {
   10773          return 4;
   10774       } else {
   10775          return 4;
   10776       }
   10777    case 6: return 4;
   10778    case 5: return 0;
   10779    case 4:
   10780       if (devinfo->is_g4x) {
   10781          return 0;
   10782       } else {
   10783          return 0;
   10784       }
   10785    default:
   10786       unreachable("Invalid hardware generation");
   10787    }
   10788 }
   10789 
   10790 
   10791 
   10792 /* 3DSTATE_CHROMA_KEY::3D Command Opcode */
   10793 
   10794 
   10795 #define GEN10_3DSTATE_CHROMA_KEY_3DCommandOpcode_bits  3
   10796 #define GEN9_3DSTATE_CHROMA_KEY_3DCommandOpcode_bits  3
   10797 #define GEN8_3DSTATE_CHROMA_KEY_3DCommandOpcode_bits  3
   10798 #define GEN75_3DSTATE_CHROMA_KEY_3DCommandOpcode_bits  3
   10799 #define GEN7_3DSTATE_CHROMA_KEY_3DCommandOpcode_bits  3
   10800 #define GEN6_3DSTATE_CHROMA_KEY_3DCommandOpcode_bits  3
   10801 
   10802 static inline uint32_t ATTRIBUTE_PURE
   10803 _3DSTATE_CHROMA_KEY_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   10804 {
   10805    switch (devinfo->gen) {
   10806    case 10: return 3;
   10807    case 9: return 3;
   10808    case 8: return 3;
   10809    case 7:
   10810       if (devinfo->is_haswell) {
   10811          return 3;
   10812       } else {
   10813          return 3;
   10814       }
   10815    case 6: return 3;
   10816    case 5: return 0;
   10817    case 4:
   10818       if (devinfo->is_g4x) {
   10819          return 0;
   10820       } else {
   10821          return 0;
   10822       }
   10823    default:
   10824       unreachable("Invalid hardware generation");
   10825    }
   10826 }
   10827 
   10828 
   10829 
   10830 #define GEN10_3DSTATE_CHROMA_KEY_3DCommandOpcode_start  24
   10831 #define GEN9_3DSTATE_CHROMA_KEY_3DCommandOpcode_start  24
   10832 #define GEN8_3DSTATE_CHROMA_KEY_3DCommandOpcode_start  24
   10833 #define GEN75_3DSTATE_CHROMA_KEY_3DCommandOpcode_start  24
   10834 #define GEN7_3DSTATE_CHROMA_KEY_3DCommandOpcode_start  24
   10835 #define GEN6_3DSTATE_CHROMA_KEY_3DCommandOpcode_start  24
   10836 
   10837 static inline uint32_t ATTRIBUTE_PURE
   10838 _3DSTATE_CHROMA_KEY_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   10839 {
   10840    switch (devinfo->gen) {
   10841    case 10: return 24;
   10842    case 9: return 24;
   10843    case 8: return 24;
   10844    case 7:
   10845       if (devinfo->is_haswell) {
   10846          return 24;
   10847       } else {
   10848          return 24;
   10849       }
   10850    case 6: return 24;
   10851    case 5: return 0;
   10852    case 4:
   10853       if (devinfo->is_g4x) {
   10854          return 0;
   10855       } else {
   10856          return 0;
   10857       }
   10858    default:
   10859       unreachable("Invalid hardware generation");
   10860    }
   10861 }
   10862 
   10863 
   10864 
   10865 /* 3DSTATE_CHROMA_KEY::3D Command Sub Opcode */
   10866 
   10867 
   10868 #define GEN10_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_bits  8
   10869 #define GEN9_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_bits  8
   10870 #define GEN8_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_bits  8
   10871 #define GEN75_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_bits  8
   10872 #define GEN7_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_bits  8
   10873 #define GEN6_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_bits  8
   10874 
   10875 static inline uint32_t ATTRIBUTE_PURE
   10876 _3DSTATE_CHROMA_KEY_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   10877 {
   10878    switch (devinfo->gen) {
   10879    case 10: return 8;
   10880    case 9: return 8;
   10881    case 8: return 8;
   10882    case 7:
   10883       if (devinfo->is_haswell) {
   10884          return 8;
   10885       } else {
   10886          return 8;
   10887       }
   10888    case 6: return 8;
   10889    case 5: return 0;
   10890    case 4:
   10891       if (devinfo->is_g4x) {
   10892          return 0;
   10893       } else {
   10894          return 0;
   10895       }
   10896    default:
   10897       unreachable("Invalid hardware generation");
   10898    }
   10899 }
   10900 
   10901 
   10902 
   10903 #define GEN10_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_start  16
   10904 #define GEN9_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_start  16
   10905 #define GEN8_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_start  16
   10906 #define GEN75_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_start  16
   10907 #define GEN7_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_start  16
   10908 #define GEN6_3DSTATE_CHROMA_KEY_3DCommandSubOpcode_start  16
   10909 
   10910 static inline uint32_t ATTRIBUTE_PURE
   10911 _3DSTATE_CHROMA_KEY_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   10912 {
   10913    switch (devinfo->gen) {
   10914    case 10: return 16;
   10915    case 9: return 16;
   10916    case 8: return 16;
   10917    case 7:
   10918       if (devinfo->is_haswell) {
   10919          return 16;
   10920       } else {
   10921          return 16;
   10922       }
   10923    case 6: return 16;
   10924    case 5: return 0;
   10925    case 4:
   10926       if (devinfo->is_g4x) {
   10927          return 0;
   10928       } else {
   10929          return 0;
   10930       }
   10931    default:
   10932       unreachable("Invalid hardware generation");
   10933    }
   10934 }
   10935 
   10936 
   10937 
   10938 /* 3DSTATE_CHROMA_KEY::ChromaKey High Value */
   10939 
   10940 
   10941 #define GEN10_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_bits  32
   10942 #define GEN9_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_bits  32
   10943 #define GEN8_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_bits  32
   10944 #define GEN75_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_bits  32
   10945 #define GEN7_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_bits  32
   10946 #define GEN6_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_bits  32
   10947 
   10948 static inline uint32_t ATTRIBUTE_PURE
   10949 _3DSTATE_CHROMA_KEY_ChromaKeyHighValue_bits(const struct gen_device_info *devinfo)
   10950 {
   10951    switch (devinfo->gen) {
   10952    case 10: return 32;
   10953    case 9: return 32;
   10954    case 8: return 32;
   10955    case 7:
   10956       if (devinfo->is_haswell) {
   10957          return 32;
   10958       } else {
   10959          return 32;
   10960       }
   10961    case 6: return 32;
   10962    case 5: return 0;
   10963    case 4:
   10964       if (devinfo->is_g4x) {
   10965          return 0;
   10966       } else {
   10967          return 0;
   10968       }
   10969    default:
   10970       unreachable("Invalid hardware generation");
   10971    }
   10972 }
   10973 
   10974 
   10975 
   10976 #define GEN10_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_start  96
   10977 #define GEN9_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_start  96
   10978 #define GEN8_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_start  96
   10979 #define GEN75_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_start  96
   10980 #define GEN7_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_start  96
   10981 #define GEN6_3DSTATE_CHROMA_KEY_ChromaKeyHighValue_start  96
   10982 
   10983 static inline uint32_t ATTRIBUTE_PURE
   10984 _3DSTATE_CHROMA_KEY_ChromaKeyHighValue_start(const struct gen_device_info *devinfo)
   10985 {
   10986    switch (devinfo->gen) {
   10987    case 10: return 96;
   10988    case 9: return 96;
   10989    case 8: return 96;
   10990    case 7:
   10991       if (devinfo->is_haswell) {
   10992          return 96;
   10993       } else {
   10994          return 96;
   10995       }
   10996    case 6: return 96;
   10997    case 5: return 0;
   10998    case 4:
   10999       if (devinfo->is_g4x) {
   11000          return 0;
   11001       } else {
   11002          return 0;
   11003       }
   11004    default:
   11005       unreachable("Invalid hardware generation");
   11006    }
   11007 }
   11008 
   11009 
   11010 
   11011 /* 3DSTATE_CHROMA_KEY::ChromaKey Low Value */
   11012 
   11013 
   11014 #define GEN10_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_bits  32
   11015 #define GEN9_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_bits  32
   11016 #define GEN8_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_bits  32
   11017 #define GEN75_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_bits  32
   11018 #define GEN7_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_bits  32
   11019 #define GEN6_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_bits  32
   11020 
   11021 static inline uint32_t ATTRIBUTE_PURE
   11022 _3DSTATE_CHROMA_KEY_ChromaKeyLowValue_bits(const struct gen_device_info *devinfo)
   11023 {
   11024    switch (devinfo->gen) {
   11025    case 10: return 32;
   11026    case 9: return 32;
   11027    case 8: return 32;
   11028    case 7:
   11029       if (devinfo->is_haswell) {
   11030          return 32;
   11031       } else {
   11032          return 32;
   11033       }
   11034    case 6: return 32;
   11035    case 5: return 0;
   11036    case 4:
   11037       if (devinfo->is_g4x) {
   11038          return 0;
   11039       } else {
   11040          return 0;
   11041       }
   11042    default:
   11043       unreachable("Invalid hardware generation");
   11044    }
   11045 }
   11046 
   11047 
   11048 
   11049 #define GEN10_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_start  64
   11050 #define GEN9_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_start  64
   11051 #define GEN8_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_start  64
   11052 #define GEN75_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_start  64
   11053 #define GEN7_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_start  64
   11054 #define GEN6_3DSTATE_CHROMA_KEY_ChromaKeyLowValue_start  64
   11055 
   11056 static inline uint32_t ATTRIBUTE_PURE
   11057 _3DSTATE_CHROMA_KEY_ChromaKeyLowValue_start(const struct gen_device_info *devinfo)
   11058 {
   11059    switch (devinfo->gen) {
   11060    case 10: return 64;
   11061    case 9: return 64;
   11062    case 8: return 64;
   11063    case 7:
   11064       if (devinfo->is_haswell) {
   11065          return 64;
   11066       } else {
   11067          return 64;
   11068       }
   11069    case 6: return 64;
   11070    case 5: return 0;
   11071    case 4:
   11072       if (devinfo->is_g4x) {
   11073          return 0;
   11074       } else {
   11075          return 0;
   11076       }
   11077    default:
   11078       unreachable("Invalid hardware generation");
   11079    }
   11080 }
   11081 
   11082 
   11083 
   11084 /* 3DSTATE_CHROMA_KEY::ChromaKey Table Index */
   11085 
   11086 
   11087 #define GEN10_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_bits  2
   11088 #define GEN9_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_bits  2
   11089 #define GEN8_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_bits  2
   11090 #define GEN75_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_bits  2
   11091 #define GEN7_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_bits  2
   11092 #define GEN6_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_bits  2
   11093 
   11094 static inline uint32_t ATTRIBUTE_PURE
   11095 _3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_bits(const struct gen_device_info *devinfo)
   11096 {
   11097    switch (devinfo->gen) {
   11098    case 10: return 2;
   11099    case 9: return 2;
   11100    case 8: return 2;
   11101    case 7:
   11102       if (devinfo->is_haswell) {
   11103          return 2;
   11104       } else {
   11105          return 2;
   11106       }
   11107    case 6: return 2;
   11108    case 5: return 0;
   11109    case 4:
   11110       if (devinfo->is_g4x) {
   11111          return 0;
   11112       } else {
   11113          return 0;
   11114       }
   11115    default:
   11116       unreachable("Invalid hardware generation");
   11117    }
   11118 }
   11119 
   11120 
   11121 
   11122 #define GEN10_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_start  62
   11123 #define GEN9_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_start  62
   11124 #define GEN8_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_start  62
   11125 #define GEN75_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_start  62
   11126 #define GEN7_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_start  62
   11127 #define GEN6_3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_start  62
   11128 
   11129 static inline uint32_t ATTRIBUTE_PURE
   11130 _3DSTATE_CHROMA_KEY_ChromaKeyTableIndex_start(const struct gen_device_info *devinfo)
   11131 {
   11132    switch (devinfo->gen) {
   11133    case 10: return 62;
   11134    case 9: return 62;
   11135    case 8: return 62;
   11136    case 7:
   11137       if (devinfo->is_haswell) {
   11138          return 62;
   11139       } else {
   11140          return 62;
   11141       }
   11142    case 6: return 62;
   11143    case 5: return 0;
   11144    case 4:
   11145       if (devinfo->is_g4x) {
   11146          return 0;
   11147       } else {
   11148          return 0;
   11149       }
   11150    default:
   11151       unreachable("Invalid hardware generation");
   11152    }
   11153 }
   11154 
   11155 
   11156 
   11157 /* 3DSTATE_CHROMA_KEY::Command SubType */
   11158 
   11159 
   11160 #define GEN10_3DSTATE_CHROMA_KEY_CommandSubType_bits  2
   11161 #define GEN9_3DSTATE_CHROMA_KEY_CommandSubType_bits  2
   11162 #define GEN8_3DSTATE_CHROMA_KEY_CommandSubType_bits  2
   11163 #define GEN75_3DSTATE_CHROMA_KEY_CommandSubType_bits  2
   11164 #define GEN7_3DSTATE_CHROMA_KEY_CommandSubType_bits  2
   11165 #define GEN6_3DSTATE_CHROMA_KEY_CommandSubType_bits  2
   11166 
   11167 static inline uint32_t ATTRIBUTE_PURE
   11168 _3DSTATE_CHROMA_KEY_CommandSubType_bits(const struct gen_device_info *devinfo)
   11169 {
   11170    switch (devinfo->gen) {
   11171    case 10: return 2;
   11172    case 9: return 2;
   11173    case 8: return 2;
   11174    case 7:
   11175       if (devinfo->is_haswell) {
   11176          return 2;
   11177       } else {
   11178          return 2;
   11179       }
   11180    case 6: return 2;
   11181    case 5: return 0;
   11182    case 4:
   11183       if (devinfo->is_g4x) {
   11184          return 0;
   11185       } else {
   11186          return 0;
   11187       }
   11188    default:
   11189       unreachable("Invalid hardware generation");
   11190    }
   11191 }
   11192 
   11193 
   11194 
   11195 #define GEN10_3DSTATE_CHROMA_KEY_CommandSubType_start  27
   11196 #define GEN9_3DSTATE_CHROMA_KEY_CommandSubType_start  27
   11197 #define GEN8_3DSTATE_CHROMA_KEY_CommandSubType_start  27
   11198 #define GEN75_3DSTATE_CHROMA_KEY_CommandSubType_start  27
   11199 #define GEN7_3DSTATE_CHROMA_KEY_CommandSubType_start  27
   11200 #define GEN6_3DSTATE_CHROMA_KEY_CommandSubType_start  27
   11201 
   11202 static inline uint32_t ATTRIBUTE_PURE
   11203 _3DSTATE_CHROMA_KEY_CommandSubType_start(const struct gen_device_info *devinfo)
   11204 {
   11205    switch (devinfo->gen) {
   11206    case 10: return 27;
   11207    case 9: return 27;
   11208    case 8: return 27;
   11209    case 7:
   11210       if (devinfo->is_haswell) {
   11211          return 27;
   11212       } else {
   11213          return 27;
   11214       }
   11215    case 6: return 27;
   11216    case 5: return 0;
   11217    case 4:
   11218       if (devinfo->is_g4x) {
   11219          return 0;
   11220       } else {
   11221          return 0;
   11222       }
   11223    default:
   11224       unreachable("Invalid hardware generation");
   11225    }
   11226 }
   11227 
   11228 
   11229 
   11230 /* 3DSTATE_CHROMA_KEY::Command Type */
   11231 
   11232 
   11233 #define GEN10_3DSTATE_CHROMA_KEY_CommandType_bits  3
   11234 #define GEN9_3DSTATE_CHROMA_KEY_CommandType_bits  3
   11235 #define GEN8_3DSTATE_CHROMA_KEY_CommandType_bits  3
   11236 #define GEN75_3DSTATE_CHROMA_KEY_CommandType_bits  3
   11237 #define GEN7_3DSTATE_CHROMA_KEY_CommandType_bits  3
   11238 #define GEN6_3DSTATE_CHROMA_KEY_CommandType_bits  3
   11239 
   11240 static inline uint32_t ATTRIBUTE_PURE
   11241 _3DSTATE_CHROMA_KEY_CommandType_bits(const struct gen_device_info *devinfo)
   11242 {
   11243    switch (devinfo->gen) {
   11244    case 10: return 3;
   11245    case 9: return 3;
   11246    case 8: return 3;
   11247    case 7:
   11248       if (devinfo->is_haswell) {
   11249          return 3;
   11250       } else {
   11251          return 3;
   11252       }
   11253    case 6: return 3;
   11254    case 5: return 0;
   11255    case 4:
   11256       if (devinfo->is_g4x) {
   11257          return 0;
   11258       } else {
   11259          return 0;
   11260       }
   11261    default:
   11262       unreachable("Invalid hardware generation");
   11263    }
   11264 }
   11265 
   11266 
   11267 
   11268 #define GEN10_3DSTATE_CHROMA_KEY_CommandType_start  29
   11269 #define GEN9_3DSTATE_CHROMA_KEY_CommandType_start  29
   11270 #define GEN8_3DSTATE_CHROMA_KEY_CommandType_start  29
   11271 #define GEN75_3DSTATE_CHROMA_KEY_CommandType_start  29
   11272 #define GEN7_3DSTATE_CHROMA_KEY_CommandType_start  29
   11273 #define GEN6_3DSTATE_CHROMA_KEY_CommandType_start  29
   11274 
   11275 static inline uint32_t ATTRIBUTE_PURE
   11276 _3DSTATE_CHROMA_KEY_CommandType_start(const struct gen_device_info *devinfo)
   11277 {
   11278    switch (devinfo->gen) {
   11279    case 10: return 29;
   11280    case 9: return 29;
   11281    case 8: return 29;
   11282    case 7:
   11283       if (devinfo->is_haswell) {
   11284          return 29;
   11285       } else {
   11286          return 29;
   11287       }
   11288    case 6: return 29;
   11289    case 5: return 0;
   11290    case 4:
   11291       if (devinfo->is_g4x) {
   11292          return 0;
   11293       } else {
   11294          return 0;
   11295       }
   11296    default:
   11297       unreachable("Invalid hardware generation");
   11298    }
   11299 }
   11300 
   11301 
   11302 
   11303 /* 3DSTATE_CHROMA_KEY::DWord Length */
   11304 
   11305 
   11306 #define GEN10_3DSTATE_CHROMA_KEY_DWordLength_bits  8
   11307 #define GEN9_3DSTATE_CHROMA_KEY_DWordLength_bits  8
   11308 #define GEN8_3DSTATE_CHROMA_KEY_DWordLength_bits  8
   11309 #define GEN75_3DSTATE_CHROMA_KEY_DWordLength_bits  8
   11310 #define GEN7_3DSTATE_CHROMA_KEY_DWordLength_bits  8
   11311 #define GEN6_3DSTATE_CHROMA_KEY_DWordLength_bits  8
   11312 
   11313 static inline uint32_t ATTRIBUTE_PURE
   11314 _3DSTATE_CHROMA_KEY_DWordLength_bits(const struct gen_device_info *devinfo)
   11315 {
   11316    switch (devinfo->gen) {
   11317    case 10: return 8;
   11318    case 9: return 8;
   11319    case 8: return 8;
   11320    case 7:
   11321       if (devinfo->is_haswell) {
   11322          return 8;
   11323       } else {
   11324          return 8;
   11325       }
   11326    case 6: return 8;
   11327    case 5: return 0;
   11328    case 4:
   11329       if (devinfo->is_g4x) {
   11330          return 0;
   11331       } else {
   11332          return 0;
   11333       }
   11334    default:
   11335       unreachable("Invalid hardware generation");
   11336    }
   11337 }
   11338 
   11339 
   11340 
   11341 #define GEN10_3DSTATE_CHROMA_KEY_DWordLength_start  0
   11342 #define GEN9_3DSTATE_CHROMA_KEY_DWordLength_start  0
   11343 #define GEN8_3DSTATE_CHROMA_KEY_DWordLength_start  0
   11344 #define GEN75_3DSTATE_CHROMA_KEY_DWordLength_start  0
   11345 #define GEN7_3DSTATE_CHROMA_KEY_DWordLength_start  0
   11346 #define GEN6_3DSTATE_CHROMA_KEY_DWordLength_start  0
   11347 
   11348 static inline uint32_t ATTRIBUTE_PURE
   11349 _3DSTATE_CHROMA_KEY_DWordLength_start(const struct gen_device_info *devinfo)
   11350 {
   11351    switch (devinfo->gen) {
   11352    case 10: return 0;
   11353    case 9: return 0;
   11354    case 8: return 0;
   11355    case 7:
   11356       if (devinfo->is_haswell) {
   11357          return 0;
   11358       } else {
   11359          return 0;
   11360       }
   11361    case 6: return 0;
   11362    case 5: return 0;
   11363    case 4:
   11364       if (devinfo->is_g4x) {
   11365          return 0;
   11366       } else {
   11367          return 0;
   11368       }
   11369    default:
   11370       unreachable("Invalid hardware generation");
   11371    }
   11372 }
   11373 
   11374 
   11375 
   11376 /* 3DSTATE_CLEAR_PARAMS */
   11377 
   11378 
   11379 #define GEN10_3DSTATE_CLEAR_PARAMS_length  3
   11380 #define GEN9_3DSTATE_CLEAR_PARAMS_length  3
   11381 #define GEN8_3DSTATE_CLEAR_PARAMS_length  3
   11382 #define GEN75_3DSTATE_CLEAR_PARAMS_length  3
   11383 #define GEN7_3DSTATE_CLEAR_PARAMS_length  3
   11384 #define GEN6_3DSTATE_CLEAR_PARAMS_length  2
   11385 #define GEN5_3DSTATE_CLEAR_PARAMS_length  2
   11386 
   11387 static inline uint32_t ATTRIBUTE_PURE
   11388 _3DSTATE_CLEAR_PARAMS_length(const struct gen_device_info *devinfo)
   11389 {
   11390    switch (devinfo->gen) {
   11391    case 10: return 3;
   11392    case 9: return 3;
   11393    case 8: return 3;
   11394    case 7:
   11395       if (devinfo->is_haswell) {
   11396          return 3;
   11397       } else {
   11398          return 3;
   11399       }
   11400    case 6: return 2;
   11401    case 5: return 2;
   11402    case 4:
   11403       if (devinfo->is_g4x) {
   11404          return 0;
   11405       } else {
   11406          return 0;
   11407       }
   11408    default:
   11409       unreachable("Invalid hardware generation");
   11410    }
   11411 }
   11412 
   11413 
   11414 
   11415 /* 3DSTATE_CLEAR_PARAMS::3D Command Opcode */
   11416 
   11417 
   11418 #define GEN10_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits  3
   11419 #define GEN9_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits  3
   11420 #define GEN8_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits  3
   11421 #define GEN75_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits  3
   11422 #define GEN7_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits  3
   11423 #define GEN6_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits  3
   11424 #define GEN5_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits  3
   11425 
   11426 static inline uint32_t ATTRIBUTE_PURE
   11427 _3DSTATE_CLEAR_PARAMS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   11428 {
   11429    switch (devinfo->gen) {
   11430    case 10: return 3;
   11431    case 9: return 3;
   11432    case 8: return 3;
   11433    case 7:
   11434       if (devinfo->is_haswell) {
   11435          return 3;
   11436       } else {
   11437          return 3;
   11438       }
   11439    case 6: return 3;
   11440    case 5: return 3;
   11441    case 4:
   11442       if (devinfo->is_g4x) {
   11443          return 0;
   11444       } else {
   11445          return 0;
   11446       }
   11447    default:
   11448       unreachable("Invalid hardware generation");
   11449    }
   11450 }
   11451 
   11452 
   11453 
   11454 #define GEN10_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start  24
   11455 #define GEN9_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start  24
   11456 #define GEN8_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start  24
   11457 #define GEN75_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start  24
   11458 #define GEN7_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start  24
   11459 #define GEN6_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start  24
   11460 #define GEN5_3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start  24
   11461 
   11462 static inline uint32_t ATTRIBUTE_PURE
   11463 _3DSTATE_CLEAR_PARAMS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   11464 {
   11465    switch (devinfo->gen) {
   11466    case 10: return 24;
   11467    case 9: return 24;
   11468    case 8: return 24;
   11469    case 7:
   11470       if (devinfo->is_haswell) {
   11471          return 24;
   11472       } else {
   11473          return 24;
   11474       }
   11475    case 6: return 24;
   11476    case 5: return 24;
   11477    case 4:
   11478       if (devinfo->is_g4x) {
   11479          return 0;
   11480       } else {
   11481          return 0;
   11482       }
   11483    default:
   11484       unreachable("Invalid hardware generation");
   11485    }
   11486 }
   11487 
   11488 
   11489 
   11490 /* 3DSTATE_CLEAR_PARAMS::3D Command Sub Opcode */
   11491 
   11492 
   11493 #define GEN10_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits  8
   11494 #define GEN9_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits  8
   11495 #define GEN8_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits  8
   11496 #define GEN75_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits  8
   11497 #define GEN7_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits  8
   11498 #define GEN6_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits  8
   11499 #define GEN5_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits  8
   11500 
   11501 static inline uint32_t ATTRIBUTE_PURE
   11502 _3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   11503 {
   11504    switch (devinfo->gen) {
   11505    case 10: return 8;
   11506    case 9: return 8;
   11507    case 8: return 8;
   11508    case 7:
   11509       if (devinfo->is_haswell) {
   11510          return 8;
   11511       } else {
   11512          return 8;
   11513       }
   11514    case 6: return 8;
   11515    case 5: return 8;
   11516    case 4:
   11517       if (devinfo->is_g4x) {
   11518          return 0;
   11519       } else {
   11520          return 0;
   11521       }
   11522    default:
   11523       unreachable("Invalid hardware generation");
   11524    }
   11525 }
   11526 
   11527 
   11528 
   11529 #define GEN10_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start  16
   11530 #define GEN9_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start  16
   11531 #define GEN8_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start  16
   11532 #define GEN75_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start  16
   11533 #define GEN7_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start  16
   11534 #define GEN6_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start  16
   11535 #define GEN5_3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start  16
   11536 
   11537 static inline uint32_t ATTRIBUTE_PURE
   11538 _3DSTATE_CLEAR_PARAMS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   11539 {
   11540    switch (devinfo->gen) {
   11541    case 10: return 16;
   11542    case 9: return 16;
   11543    case 8: return 16;
   11544    case 7:
   11545       if (devinfo->is_haswell) {
   11546          return 16;
   11547       } else {
   11548          return 16;
   11549       }
   11550    case 6: return 16;
   11551    case 5: return 16;
   11552    case 4:
   11553       if (devinfo->is_g4x) {
   11554          return 0;
   11555       } else {
   11556          return 0;
   11557       }
   11558    default:
   11559       unreachable("Invalid hardware generation");
   11560    }
   11561 }
   11562 
   11563 
   11564 
   11565 /* 3DSTATE_CLEAR_PARAMS::Command SubType */
   11566 
   11567 
   11568 #define GEN10_3DSTATE_CLEAR_PARAMS_CommandSubType_bits  2
   11569 #define GEN9_3DSTATE_CLEAR_PARAMS_CommandSubType_bits  2
   11570 #define GEN8_3DSTATE_CLEAR_PARAMS_CommandSubType_bits  2
   11571 #define GEN75_3DSTATE_CLEAR_PARAMS_CommandSubType_bits  2
   11572 #define GEN7_3DSTATE_CLEAR_PARAMS_CommandSubType_bits  2
   11573 #define GEN6_3DSTATE_CLEAR_PARAMS_CommandSubType_bits  2
   11574 #define GEN5_3DSTATE_CLEAR_PARAMS_CommandSubType_bits  2
   11575 
   11576 static inline uint32_t ATTRIBUTE_PURE
   11577 _3DSTATE_CLEAR_PARAMS_CommandSubType_bits(const struct gen_device_info *devinfo)
   11578 {
   11579    switch (devinfo->gen) {
   11580    case 10: return 2;
   11581    case 9: return 2;
   11582    case 8: return 2;
   11583    case 7:
   11584       if (devinfo->is_haswell) {
   11585          return 2;
   11586       } else {
   11587          return 2;
   11588       }
   11589    case 6: return 2;
   11590    case 5: return 2;
   11591    case 4:
   11592       if (devinfo->is_g4x) {
   11593          return 0;
   11594       } else {
   11595          return 0;
   11596       }
   11597    default:
   11598       unreachable("Invalid hardware generation");
   11599    }
   11600 }
   11601 
   11602 
   11603 
   11604 #define GEN10_3DSTATE_CLEAR_PARAMS_CommandSubType_start  27
   11605 #define GEN9_3DSTATE_CLEAR_PARAMS_CommandSubType_start  27
   11606 #define GEN8_3DSTATE_CLEAR_PARAMS_CommandSubType_start  27
   11607 #define GEN75_3DSTATE_CLEAR_PARAMS_CommandSubType_start  27
   11608 #define GEN7_3DSTATE_CLEAR_PARAMS_CommandSubType_start  27
   11609 #define GEN6_3DSTATE_CLEAR_PARAMS_CommandSubType_start  27
   11610 #define GEN5_3DSTATE_CLEAR_PARAMS_CommandSubType_start  27
   11611 
   11612 static inline uint32_t ATTRIBUTE_PURE
   11613 _3DSTATE_CLEAR_PARAMS_CommandSubType_start(const struct gen_device_info *devinfo)
   11614 {
   11615    switch (devinfo->gen) {
   11616    case 10: return 27;
   11617    case 9: return 27;
   11618    case 8: return 27;
   11619    case 7:
   11620       if (devinfo->is_haswell) {
   11621          return 27;
   11622       } else {
   11623          return 27;
   11624       }
   11625    case 6: return 27;
   11626    case 5: return 27;
   11627    case 4:
   11628       if (devinfo->is_g4x) {
   11629          return 0;
   11630       } else {
   11631          return 0;
   11632       }
   11633    default:
   11634       unreachable("Invalid hardware generation");
   11635    }
   11636 }
   11637 
   11638 
   11639 
   11640 /* 3DSTATE_CLEAR_PARAMS::Command Type */
   11641 
   11642 
   11643 #define GEN10_3DSTATE_CLEAR_PARAMS_CommandType_bits  3
   11644 #define GEN9_3DSTATE_CLEAR_PARAMS_CommandType_bits  3
   11645 #define GEN8_3DSTATE_CLEAR_PARAMS_CommandType_bits  3
   11646 #define GEN75_3DSTATE_CLEAR_PARAMS_CommandType_bits  3
   11647 #define GEN7_3DSTATE_CLEAR_PARAMS_CommandType_bits  3
   11648 #define GEN6_3DSTATE_CLEAR_PARAMS_CommandType_bits  3
   11649 #define GEN5_3DSTATE_CLEAR_PARAMS_CommandType_bits  3
   11650 
   11651 static inline uint32_t ATTRIBUTE_PURE
   11652 _3DSTATE_CLEAR_PARAMS_CommandType_bits(const struct gen_device_info *devinfo)
   11653 {
   11654    switch (devinfo->gen) {
   11655    case 10: return 3;
   11656    case 9: return 3;
   11657    case 8: return 3;
   11658    case 7:
   11659       if (devinfo->is_haswell) {
   11660          return 3;
   11661       } else {
   11662          return 3;
   11663       }
   11664    case 6: return 3;
   11665    case 5: return 3;
   11666    case 4:
   11667       if (devinfo->is_g4x) {
   11668          return 0;
   11669       } else {
   11670          return 0;
   11671       }
   11672    default:
   11673       unreachable("Invalid hardware generation");
   11674    }
   11675 }
   11676 
   11677 
   11678 
   11679 #define GEN10_3DSTATE_CLEAR_PARAMS_CommandType_start  29
   11680 #define GEN9_3DSTATE_CLEAR_PARAMS_CommandType_start  29
   11681 #define GEN8_3DSTATE_CLEAR_PARAMS_CommandType_start  29
   11682 #define GEN75_3DSTATE_CLEAR_PARAMS_CommandType_start  29
   11683 #define GEN7_3DSTATE_CLEAR_PARAMS_CommandType_start  29
   11684 #define GEN6_3DSTATE_CLEAR_PARAMS_CommandType_start  29
   11685 #define GEN5_3DSTATE_CLEAR_PARAMS_CommandType_start  29
   11686 
   11687 static inline uint32_t ATTRIBUTE_PURE
   11688 _3DSTATE_CLEAR_PARAMS_CommandType_start(const struct gen_device_info *devinfo)
   11689 {
   11690    switch (devinfo->gen) {
   11691    case 10: return 29;
   11692    case 9: return 29;
   11693    case 8: return 29;
   11694    case 7:
   11695       if (devinfo->is_haswell) {
   11696          return 29;
   11697       } else {
   11698          return 29;
   11699       }
   11700    case 6: return 29;
   11701    case 5: return 29;
   11702    case 4:
   11703       if (devinfo->is_g4x) {
   11704          return 0;
   11705       } else {
   11706          return 0;
   11707       }
   11708    default:
   11709       unreachable("Invalid hardware generation");
   11710    }
   11711 }
   11712 
   11713 
   11714 
   11715 /* 3DSTATE_CLEAR_PARAMS::DWord Length */
   11716 
   11717 
   11718 #define GEN10_3DSTATE_CLEAR_PARAMS_DWordLength_bits  8
   11719 #define GEN9_3DSTATE_CLEAR_PARAMS_DWordLength_bits  8
   11720 #define GEN8_3DSTATE_CLEAR_PARAMS_DWordLength_bits  8
   11721 #define GEN75_3DSTATE_CLEAR_PARAMS_DWordLength_bits  8
   11722 #define GEN7_3DSTATE_CLEAR_PARAMS_DWordLength_bits  8
   11723 #define GEN6_3DSTATE_CLEAR_PARAMS_DWordLength_bits  8
   11724 #define GEN5_3DSTATE_CLEAR_PARAMS_DWordLength_bits  8
   11725 
   11726 static inline uint32_t ATTRIBUTE_PURE
   11727 _3DSTATE_CLEAR_PARAMS_DWordLength_bits(const struct gen_device_info *devinfo)
   11728 {
   11729    switch (devinfo->gen) {
   11730    case 10: return 8;
   11731    case 9: return 8;
   11732    case 8: return 8;
   11733    case 7:
   11734       if (devinfo->is_haswell) {
   11735          return 8;
   11736       } else {
   11737          return 8;
   11738       }
   11739    case 6: return 8;
   11740    case 5: return 8;
   11741    case 4:
   11742       if (devinfo->is_g4x) {
   11743          return 0;
   11744       } else {
   11745          return 0;
   11746       }
   11747    default:
   11748       unreachable("Invalid hardware generation");
   11749    }
   11750 }
   11751 
   11752 
   11753 
   11754 #define GEN10_3DSTATE_CLEAR_PARAMS_DWordLength_start  0
   11755 #define GEN9_3DSTATE_CLEAR_PARAMS_DWordLength_start  0
   11756 #define GEN8_3DSTATE_CLEAR_PARAMS_DWordLength_start  0
   11757 #define GEN75_3DSTATE_CLEAR_PARAMS_DWordLength_start  0
   11758 #define GEN7_3DSTATE_CLEAR_PARAMS_DWordLength_start  0
   11759 #define GEN6_3DSTATE_CLEAR_PARAMS_DWordLength_start  0
   11760 #define GEN5_3DSTATE_CLEAR_PARAMS_DWordLength_start  0
   11761 
   11762 static inline uint32_t ATTRIBUTE_PURE
   11763 _3DSTATE_CLEAR_PARAMS_DWordLength_start(const struct gen_device_info *devinfo)
   11764 {
   11765    switch (devinfo->gen) {
   11766    case 10: return 0;
   11767    case 9: return 0;
   11768    case 8: return 0;
   11769    case 7:
   11770       if (devinfo->is_haswell) {
   11771          return 0;
   11772       } else {
   11773          return 0;
   11774       }
   11775    case 6: return 0;
   11776    case 5: return 0;
   11777    case 4:
   11778       if (devinfo->is_g4x) {
   11779          return 0;
   11780       } else {
   11781          return 0;
   11782       }
   11783    default:
   11784       unreachable("Invalid hardware generation");
   11785    }
   11786 }
   11787 
   11788 
   11789 
   11790 /* 3DSTATE_CLEAR_PARAMS::Depth Clear Value */
   11791 
   11792 
   11793 #define GEN10_3DSTATE_CLEAR_PARAMS_DepthClearValue_bits  32
   11794 #define GEN9_3DSTATE_CLEAR_PARAMS_DepthClearValue_bits  32
   11795 #define GEN8_3DSTATE_CLEAR_PARAMS_DepthClearValue_bits  32
   11796 #define GEN75_3DSTATE_CLEAR_PARAMS_DepthClearValue_bits  32
   11797 #define GEN7_3DSTATE_CLEAR_PARAMS_DepthClearValue_bits  32
   11798 #define GEN6_3DSTATE_CLEAR_PARAMS_DepthClearValue_bits  32
   11799 #define GEN5_3DSTATE_CLEAR_PARAMS_DepthClearValue_bits  32
   11800 
   11801 static inline uint32_t ATTRIBUTE_PURE
   11802 _3DSTATE_CLEAR_PARAMS_DepthClearValue_bits(const struct gen_device_info *devinfo)
   11803 {
   11804    switch (devinfo->gen) {
   11805    case 10: return 32;
   11806    case 9: return 32;
   11807    case 8: return 32;
   11808    case 7:
   11809       if (devinfo->is_haswell) {
   11810          return 32;
   11811       } else {
   11812          return 32;
   11813       }
   11814    case 6: return 32;
   11815    case 5: return 32;
   11816    case 4:
   11817       if (devinfo->is_g4x) {
   11818          return 0;
   11819       } else {
   11820          return 0;
   11821       }
   11822    default:
   11823       unreachable("Invalid hardware generation");
   11824    }
   11825 }
   11826 
   11827 
   11828 
   11829 #define GEN10_3DSTATE_CLEAR_PARAMS_DepthClearValue_start  32
   11830 #define GEN9_3DSTATE_CLEAR_PARAMS_DepthClearValue_start  32
   11831 #define GEN8_3DSTATE_CLEAR_PARAMS_DepthClearValue_start  32
   11832 #define GEN75_3DSTATE_CLEAR_PARAMS_DepthClearValue_start  32
   11833 #define GEN7_3DSTATE_CLEAR_PARAMS_DepthClearValue_start  32
   11834 #define GEN6_3DSTATE_CLEAR_PARAMS_DepthClearValue_start  32
   11835 #define GEN5_3DSTATE_CLEAR_PARAMS_DepthClearValue_start  32
   11836 
   11837 static inline uint32_t ATTRIBUTE_PURE
   11838 _3DSTATE_CLEAR_PARAMS_DepthClearValue_start(const struct gen_device_info *devinfo)
   11839 {
   11840    switch (devinfo->gen) {
   11841    case 10: return 32;
   11842    case 9: return 32;
   11843    case 8: return 32;
   11844    case 7:
   11845       if (devinfo->is_haswell) {
   11846          return 32;
   11847       } else {
   11848          return 32;
   11849       }
   11850    case 6: return 32;
   11851    case 5: return 32;
   11852    case 4:
   11853       if (devinfo->is_g4x) {
   11854          return 0;
   11855       } else {
   11856          return 0;
   11857       }
   11858    default:
   11859       unreachable("Invalid hardware generation");
   11860    }
   11861 }
   11862 
   11863 
   11864 
   11865 /* 3DSTATE_CLEAR_PARAMS::Depth Clear Value Valid */
   11866 
   11867 
   11868 #define GEN10_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits  1
   11869 #define GEN9_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits  1
   11870 #define GEN8_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits  1
   11871 #define GEN75_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits  1
   11872 #define GEN7_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits  1
   11873 #define GEN6_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits  1
   11874 #define GEN5_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits  1
   11875 
   11876 static inline uint32_t ATTRIBUTE_PURE
   11877 _3DSTATE_CLEAR_PARAMS_DepthClearValueValid_bits(const struct gen_device_info *devinfo)
   11878 {
   11879    switch (devinfo->gen) {
   11880    case 10: return 1;
   11881    case 9: return 1;
   11882    case 8: return 1;
   11883    case 7:
   11884       if (devinfo->is_haswell) {
   11885          return 1;
   11886       } else {
   11887          return 1;
   11888       }
   11889    case 6: return 1;
   11890    case 5: return 1;
   11891    case 4:
   11892       if (devinfo->is_g4x) {
   11893          return 0;
   11894       } else {
   11895          return 0;
   11896       }
   11897    default:
   11898       unreachable("Invalid hardware generation");
   11899    }
   11900 }
   11901 
   11902 
   11903 
   11904 #define GEN10_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start  64
   11905 #define GEN9_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start  64
   11906 #define GEN8_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start  64
   11907 #define GEN75_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start  64
   11908 #define GEN7_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start  64
   11909 #define GEN6_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start  15
   11910 #define GEN5_3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start  15
   11911 
   11912 static inline uint32_t ATTRIBUTE_PURE
   11913 _3DSTATE_CLEAR_PARAMS_DepthClearValueValid_start(const struct gen_device_info *devinfo)
   11914 {
   11915    switch (devinfo->gen) {
   11916    case 10: return 64;
   11917    case 9: return 64;
   11918    case 8: return 64;
   11919    case 7:
   11920       if (devinfo->is_haswell) {
   11921          return 64;
   11922       } else {
   11923          return 64;
   11924       }
   11925    case 6: return 15;
   11926    case 5: return 15;
   11927    case 4:
   11928       if (devinfo->is_g4x) {
   11929          return 0;
   11930       } else {
   11931          return 0;
   11932       }
   11933    default:
   11934       unreachable("Invalid hardware generation");
   11935    }
   11936 }
   11937 
   11938 
   11939 
   11940 /* 3DSTATE_CLIP */
   11941 
   11942 
   11943 #define GEN10_3DSTATE_CLIP_length  4
   11944 #define GEN9_3DSTATE_CLIP_length  4
   11945 #define GEN8_3DSTATE_CLIP_length  4
   11946 #define GEN75_3DSTATE_CLIP_length  4
   11947 #define GEN7_3DSTATE_CLIP_length  4
   11948 #define GEN6_3DSTATE_CLIP_length  4
   11949 
   11950 static inline uint32_t ATTRIBUTE_PURE
   11951 _3DSTATE_CLIP_length(const struct gen_device_info *devinfo)
   11952 {
   11953    switch (devinfo->gen) {
   11954    case 10: return 4;
   11955    case 9: return 4;
   11956    case 8: return 4;
   11957    case 7:
   11958       if (devinfo->is_haswell) {
   11959          return 4;
   11960       } else {
   11961          return 4;
   11962       }
   11963    case 6: return 4;
   11964    case 5: return 0;
   11965    case 4:
   11966       if (devinfo->is_g4x) {
   11967          return 0;
   11968       } else {
   11969          return 0;
   11970       }
   11971    default:
   11972       unreachable("Invalid hardware generation");
   11973    }
   11974 }
   11975 
   11976 
   11977 
   11978 /* 3DSTATE_CLIP::3D Command Opcode */
   11979 
   11980 
   11981 #define GEN10_3DSTATE_CLIP_3DCommandOpcode_bits  3
   11982 #define GEN9_3DSTATE_CLIP_3DCommandOpcode_bits  3
   11983 #define GEN8_3DSTATE_CLIP_3DCommandOpcode_bits  3
   11984 #define GEN75_3DSTATE_CLIP_3DCommandOpcode_bits  3
   11985 #define GEN7_3DSTATE_CLIP_3DCommandOpcode_bits  3
   11986 #define GEN6_3DSTATE_CLIP_3DCommandOpcode_bits  3
   11987 
   11988 static inline uint32_t ATTRIBUTE_PURE
   11989 _3DSTATE_CLIP_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   11990 {
   11991    switch (devinfo->gen) {
   11992    case 10: return 3;
   11993    case 9: return 3;
   11994    case 8: return 3;
   11995    case 7:
   11996       if (devinfo->is_haswell) {
   11997          return 3;
   11998       } else {
   11999          return 3;
   12000       }
   12001    case 6: return 3;
   12002    case 5: return 0;
   12003    case 4:
   12004       if (devinfo->is_g4x) {
   12005          return 0;
   12006       } else {
   12007          return 0;
   12008       }
   12009    default:
   12010       unreachable("Invalid hardware generation");
   12011    }
   12012 }
   12013 
   12014 
   12015 
   12016 #define GEN10_3DSTATE_CLIP_3DCommandOpcode_start  24
   12017 #define GEN9_3DSTATE_CLIP_3DCommandOpcode_start  24
   12018 #define GEN8_3DSTATE_CLIP_3DCommandOpcode_start  24
   12019 #define GEN75_3DSTATE_CLIP_3DCommandOpcode_start  24
   12020 #define GEN7_3DSTATE_CLIP_3DCommandOpcode_start  24
   12021 #define GEN6_3DSTATE_CLIP_3DCommandOpcode_start  24
   12022 
   12023 static inline uint32_t ATTRIBUTE_PURE
   12024 _3DSTATE_CLIP_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   12025 {
   12026    switch (devinfo->gen) {
   12027    case 10: return 24;
   12028    case 9: return 24;
   12029    case 8: return 24;
   12030    case 7:
   12031       if (devinfo->is_haswell) {
   12032          return 24;
   12033       } else {
   12034          return 24;
   12035       }
   12036    case 6: return 24;
   12037    case 5: return 0;
   12038    case 4:
   12039       if (devinfo->is_g4x) {
   12040          return 0;
   12041       } else {
   12042          return 0;
   12043       }
   12044    default:
   12045       unreachable("Invalid hardware generation");
   12046    }
   12047 }
   12048 
   12049 
   12050 
   12051 /* 3DSTATE_CLIP::3D Command Sub Opcode */
   12052 
   12053 
   12054 #define GEN10_3DSTATE_CLIP_3DCommandSubOpcode_bits  8
   12055 #define GEN9_3DSTATE_CLIP_3DCommandSubOpcode_bits  8
   12056 #define GEN8_3DSTATE_CLIP_3DCommandSubOpcode_bits  8
   12057 #define GEN75_3DSTATE_CLIP_3DCommandSubOpcode_bits  8
   12058 #define GEN7_3DSTATE_CLIP_3DCommandSubOpcode_bits  8
   12059 #define GEN6_3DSTATE_CLIP_3DCommandSubOpcode_bits  8
   12060 
   12061 static inline uint32_t ATTRIBUTE_PURE
   12062 _3DSTATE_CLIP_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   12063 {
   12064    switch (devinfo->gen) {
   12065    case 10: return 8;
   12066    case 9: return 8;
   12067    case 8: return 8;
   12068    case 7:
   12069       if (devinfo->is_haswell) {
   12070          return 8;
   12071       } else {
   12072          return 8;
   12073       }
   12074    case 6: return 8;
   12075    case 5: return 0;
   12076    case 4:
   12077       if (devinfo->is_g4x) {
   12078          return 0;
   12079       } else {
   12080          return 0;
   12081       }
   12082    default:
   12083       unreachable("Invalid hardware generation");
   12084    }
   12085 }
   12086 
   12087 
   12088 
   12089 #define GEN10_3DSTATE_CLIP_3DCommandSubOpcode_start  16
   12090 #define GEN9_3DSTATE_CLIP_3DCommandSubOpcode_start  16
   12091 #define GEN8_3DSTATE_CLIP_3DCommandSubOpcode_start  16
   12092 #define GEN75_3DSTATE_CLIP_3DCommandSubOpcode_start  16
   12093 #define GEN7_3DSTATE_CLIP_3DCommandSubOpcode_start  16
   12094 #define GEN6_3DSTATE_CLIP_3DCommandSubOpcode_start  16
   12095 
   12096 static inline uint32_t ATTRIBUTE_PURE
   12097 _3DSTATE_CLIP_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   12098 {
   12099    switch (devinfo->gen) {
   12100    case 10: return 16;
   12101    case 9: return 16;
   12102    case 8: return 16;
   12103    case 7:
   12104       if (devinfo->is_haswell) {
   12105          return 16;
   12106       } else {
   12107          return 16;
   12108       }
   12109    case 6: return 16;
   12110    case 5: return 0;
   12111    case 4:
   12112       if (devinfo->is_g4x) {
   12113          return 0;
   12114       } else {
   12115          return 0;
   12116       }
   12117    default:
   12118       unreachable("Invalid hardware generation");
   12119    }
   12120 }
   12121 
   12122 
   12123 
   12124 /* 3DSTATE_CLIP::API Mode */
   12125 
   12126 
   12127 #define GEN10_3DSTATE_CLIP_APIMode_bits  1
   12128 #define GEN9_3DSTATE_CLIP_APIMode_bits  1
   12129 #define GEN8_3DSTATE_CLIP_APIMode_bits  1
   12130 #define GEN75_3DSTATE_CLIP_APIMode_bits  1
   12131 #define GEN7_3DSTATE_CLIP_APIMode_bits  1
   12132 #define GEN6_3DSTATE_CLIP_APIMode_bits  1
   12133 
   12134 static inline uint32_t ATTRIBUTE_PURE
   12135 _3DSTATE_CLIP_APIMode_bits(const struct gen_device_info *devinfo)
   12136 {
   12137    switch (devinfo->gen) {
   12138    case 10: return 1;
   12139    case 9: return 1;
   12140    case 8: return 1;
   12141    case 7:
   12142       if (devinfo->is_haswell) {
   12143          return 1;
   12144       } else {
   12145          return 1;
   12146       }
   12147    case 6: return 1;
   12148    case 5: return 0;
   12149    case 4:
   12150       if (devinfo->is_g4x) {
   12151          return 0;
   12152       } else {
   12153          return 0;
   12154       }
   12155    default:
   12156       unreachable("Invalid hardware generation");
   12157    }
   12158 }
   12159 
   12160 
   12161 
   12162 #define GEN10_3DSTATE_CLIP_APIMode_start  94
   12163 #define GEN9_3DSTATE_CLIP_APIMode_start  94
   12164 #define GEN8_3DSTATE_CLIP_APIMode_start  94
   12165 #define GEN75_3DSTATE_CLIP_APIMode_start  94
   12166 #define GEN7_3DSTATE_CLIP_APIMode_start  94
   12167 #define GEN6_3DSTATE_CLIP_APIMode_start  94
   12168 
   12169 static inline uint32_t ATTRIBUTE_PURE
   12170 _3DSTATE_CLIP_APIMode_start(const struct gen_device_info *devinfo)
   12171 {
   12172    switch (devinfo->gen) {
   12173    case 10: return 94;
   12174    case 9: return 94;
   12175    case 8: return 94;
   12176    case 7:
   12177       if (devinfo->is_haswell) {
   12178          return 94;
   12179       } else {
   12180          return 94;
   12181       }
   12182    case 6: return 94;
   12183    case 5: return 0;
   12184    case 4:
   12185       if (devinfo->is_g4x) {
   12186          return 0;
   12187       } else {
   12188          return 0;
   12189       }
   12190    default:
   12191       unreachable("Invalid hardware generation");
   12192    }
   12193 }
   12194 
   12195 
   12196 
   12197 /* 3DSTATE_CLIP::Clip Enable */
   12198 
   12199 
   12200 #define GEN10_3DSTATE_CLIP_ClipEnable_bits  1
   12201 #define GEN9_3DSTATE_CLIP_ClipEnable_bits  1
   12202 #define GEN8_3DSTATE_CLIP_ClipEnable_bits  1
   12203 #define GEN75_3DSTATE_CLIP_ClipEnable_bits  1
   12204 #define GEN7_3DSTATE_CLIP_ClipEnable_bits  1
   12205 #define GEN6_3DSTATE_CLIP_ClipEnable_bits  1
   12206 
   12207 static inline uint32_t ATTRIBUTE_PURE
   12208 _3DSTATE_CLIP_ClipEnable_bits(const struct gen_device_info *devinfo)
   12209 {
   12210    switch (devinfo->gen) {
   12211    case 10: return 1;
   12212    case 9: return 1;
   12213    case 8: return 1;
   12214    case 7:
   12215       if (devinfo->is_haswell) {
   12216          return 1;
   12217       } else {
   12218          return 1;
   12219       }
   12220    case 6: return 1;
   12221    case 5: return 0;
   12222    case 4:
   12223       if (devinfo->is_g4x) {
   12224          return 0;
   12225       } else {
   12226          return 0;
   12227       }
   12228    default:
   12229       unreachable("Invalid hardware generation");
   12230    }
   12231 }
   12232 
   12233 
   12234 
   12235 #define GEN10_3DSTATE_CLIP_ClipEnable_start  95
   12236 #define GEN9_3DSTATE_CLIP_ClipEnable_start  95
   12237 #define GEN8_3DSTATE_CLIP_ClipEnable_start  95
   12238 #define GEN75_3DSTATE_CLIP_ClipEnable_start  95
   12239 #define GEN7_3DSTATE_CLIP_ClipEnable_start  95
   12240 #define GEN6_3DSTATE_CLIP_ClipEnable_start  95
   12241 
   12242 static inline uint32_t ATTRIBUTE_PURE
   12243 _3DSTATE_CLIP_ClipEnable_start(const struct gen_device_info *devinfo)
   12244 {
   12245    switch (devinfo->gen) {
   12246    case 10: return 95;
   12247    case 9: return 95;
   12248    case 8: return 95;
   12249    case 7:
   12250       if (devinfo->is_haswell) {
   12251          return 95;
   12252       } else {
   12253          return 95;
   12254       }
   12255    case 6: return 95;
   12256    case 5: return 0;
   12257    case 4:
   12258       if (devinfo->is_g4x) {
   12259          return 0;
   12260       } else {
   12261          return 0;
   12262       }
   12263    default:
   12264       unreachable("Invalid hardware generation");
   12265    }
   12266 }
   12267 
   12268 
   12269 
   12270 /* 3DSTATE_CLIP::Clip Mode */
   12271 
   12272 
   12273 #define GEN10_3DSTATE_CLIP_ClipMode_bits  3
   12274 #define GEN9_3DSTATE_CLIP_ClipMode_bits  3
   12275 #define GEN8_3DSTATE_CLIP_ClipMode_bits  3
   12276 #define GEN75_3DSTATE_CLIP_ClipMode_bits  3
   12277 #define GEN7_3DSTATE_CLIP_ClipMode_bits  3
   12278 #define GEN6_3DSTATE_CLIP_ClipMode_bits  3
   12279 
   12280 static inline uint32_t ATTRIBUTE_PURE
   12281 _3DSTATE_CLIP_ClipMode_bits(const struct gen_device_info *devinfo)
   12282 {
   12283    switch (devinfo->gen) {
   12284    case 10: return 3;
   12285    case 9: return 3;
   12286    case 8: return 3;
   12287    case 7:
   12288       if (devinfo->is_haswell) {
   12289          return 3;
   12290       } else {
   12291          return 3;
   12292       }
   12293    case 6: return 3;
   12294    case 5: return 0;
   12295    case 4:
   12296       if (devinfo->is_g4x) {
   12297          return 0;
   12298       } else {
   12299          return 0;
   12300       }
   12301    default:
   12302       unreachable("Invalid hardware generation");
   12303    }
   12304 }
   12305 
   12306 
   12307 
   12308 #define GEN10_3DSTATE_CLIP_ClipMode_start  77
   12309 #define GEN9_3DSTATE_CLIP_ClipMode_start  77
   12310 #define GEN8_3DSTATE_CLIP_ClipMode_start  77
   12311 #define GEN75_3DSTATE_CLIP_ClipMode_start  77
   12312 #define GEN7_3DSTATE_CLIP_ClipMode_start  77
   12313 #define GEN6_3DSTATE_CLIP_ClipMode_start  77
   12314 
   12315 static inline uint32_t ATTRIBUTE_PURE
   12316 _3DSTATE_CLIP_ClipMode_start(const struct gen_device_info *devinfo)
   12317 {
   12318    switch (devinfo->gen) {
   12319    case 10: return 77;
   12320    case 9: return 77;
   12321    case 8: return 77;
   12322    case 7:
   12323       if (devinfo->is_haswell) {
   12324          return 77;
   12325       } else {
   12326          return 77;
   12327       }
   12328    case 6: return 77;
   12329    case 5: return 0;
   12330    case 4:
   12331       if (devinfo->is_g4x) {
   12332          return 0;
   12333       } else {
   12334          return 0;
   12335       }
   12336    default:
   12337       unreachable("Invalid hardware generation");
   12338    }
   12339 }
   12340 
   12341 
   12342 
   12343 /* 3DSTATE_CLIP::Command SubType */
   12344 
   12345 
   12346 #define GEN10_3DSTATE_CLIP_CommandSubType_bits  2
   12347 #define GEN9_3DSTATE_CLIP_CommandSubType_bits  2
   12348 #define GEN8_3DSTATE_CLIP_CommandSubType_bits  2
   12349 #define GEN75_3DSTATE_CLIP_CommandSubType_bits  2
   12350 #define GEN7_3DSTATE_CLIP_CommandSubType_bits  2
   12351 #define GEN6_3DSTATE_CLIP_CommandSubType_bits  2
   12352 
   12353 static inline uint32_t ATTRIBUTE_PURE
   12354 _3DSTATE_CLIP_CommandSubType_bits(const struct gen_device_info *devinfo)
   12355 {
   12356    switch (devinfo->gen) {
   12357    case 10: return 2;
   12358    case 9: return 2;
   12359    case 8: return 2;
   12360    case 7:
   12361       if (devinfo->is_haswell) {
   12362          return 2;
   12363       } else {
   12364          return 2;
   12365       }
   12366    case 6: return 2;
   12367    case 5: return 0;
   12368    case 4:
   12369       if (devinfo->is_g4x) {
   12370          return 0;
   12371       } else {
   12372          return 0;
   12373       }
   12374    default:
   12375       unreachable("Invalid hardware generation");
   12376    }
   12377 }
   12378 
   12379 
   12380 
   12381 #define GEN10_3DSTATE_CLIP_CommandSubType_start  27
   12382 #define GEN9_3DSTATE_CLIP_CommandSubType_start  27
   12383 #define GEN8_3DSTATE_CLIP_CommandSubType_start  27
   12384 #define GEN75_3DSTATE_CLIP_CommandSubType_start  27
   12385 #define GEN7_3DSTATE_CLIP_CommandSubType_start  27
   12386 #define GEN6_3DSTATE_CLIP_CommandSubType_start  27
   12387 
   12388 static inline uint32_t ATTRIBUTE_PURE
   12389 _3DSTATE_CLIP_CommandSubType_start(const struct gen_device_info *devinfo)
   12390 {
   12391    switch (devinfo->gen) {
   12392    case 10: return 27;
   12393    case 9: return 27;
   12394    case 8: return 27;
   12395    case 7:
   12396       if (devinfo->is_haswell) {
   12397          return 27;
   12398       } else {
   12399          return 27;
   12400       }
   12401    case 6: return 27;
   12402    case 5: return 0;
   12403    case 4:
   12404       if (devinfo->is_g4x) {
   12405          return 0;
   12406       } else {
   12407          return 0;
   12408       }
   12409    default:
   12410       unreachable("Invalid hardware generation");
   12411    }
   12412 }
   12413 
   12414 
   12415 
   12416 /* 3DSTATE_CLIP::Command Type */
   12417 
   12418 
   12419 #define GEN10_3DSTATE_CLIP_CommandType_bits  3
   12420 #define GEN9_3DSTATE_CLIP_CommandType_bits  3
   12421 #define GEN8_3DSTATE_CLIP_CommandType_bits  3
   12422 #define GEN75_3DSTATE_CLIP_CommandType_bits  3
   12423 #define GEN7_3DSTATE_CLIP_CommandType_bits  3
   12424 #define GEN6_3DSTATE_CLIP_CommandType_bits  3
   12425 
   12426 static inline uint32_t ATTRIBUTE_PURE
   12427 _3DSTATE_CLIP_CommandType_bits(const struct gen_device_info *devinfo)
   12428 {
   12429    switch (devinfo->gen) {
   12430    case 10: return 3;
   12431    case 9: return 3;
   12432    case 8: return 3;
   12433    case 7:
   12434       if (devinfo->is_haswell) {
   12435          return 3;
   12436       } else {
   12437          return 3;
   12438       }
   12439    case 6: return 3;
   12440    case 5: return 0;
   12441    case 4:
   12442       if (devinfo->is_g4x) {
   12443          return 0;
   12444       } else {
   12445          return 0;
   12446       }
   12447    default:
   12448       unreachable("Invalid hardware generation");
   12449    }
   12450 }
   12451 
   12452 
   12453 
   12454 #define GEN10_3DSTATE_CLIP_CommandType_start  29
   12455 #define GEN9_3DSTATE_CLIP_CommandType_start  29
   12456 #define GEN8_3DSTATE_CLIP_CommandType_start  29
   12457 #define GEN75_3DSTATE_CLIP_CommandType_start  29
   12458 #define GEN7_3DSTATE_CLIP_CommandType_start  29
   12459 #define GEN6_3DSTATE_CLIP_CommandType_start  29
   12460 
   12461 static inline uint32_t ATTRIBUTE_PURE
   12462 _3DSTATE_CLIP_CommandType_start(const struct gen_device_info *devinfo)
   12463 {
   12464    switch (devinfo->gen) {
   12465    case 10: return 29;
   12466    case 9: return 29;
   12467    case 8: return 29;
   12468    case 7:
   12469       if (devinfo->is_haswell) {
   12470          return 29;
   12471       } else {
   12472          return 29;
   12473       }
   12474    case 6: return 29;
   12475    case 5: return 0;
   12476    case 4:
   12477       if (devinfo->is_g4x) {
   12478          return 0;
   12479       } else {
   12480          return 0;
   12481       }
   12482    default:
   12483       unreachable("Invalid hardware generation");
   12484    }
   12485 }
   12486 
   12487 
   12488 
   12489 /* 3DSTATE_CLIP::Cull Mode */
   12490 
   12491 
   12492 #define GEN75_3DSTATE_CLIP_CullMode_bits  2
   12493 #define GEN7_3DSTATE_CLIP_CullMode_bits  2
   12494 
   12495 static inline uint32_t ATTRIBUTE_PURE
   12496 _3DSTATE_CLIP_CullMode_bits(const struct gen_device_info *devinfo)
   12497 {
   12498    switch (devinfo->gen) {
   12499    case 10: return 0;
   12500    case 9: return 0;
   12501    case 8: return 0;
   12502    case 7:
   12503       if (devinfo->is_haswell) {
   12504          return 2;
   12505       } else {
   12506          return 2;
   12507       }
   12508    case 6: return 0;
   12509    case 5: return 0;
   12510    case 4:
   12511       if (devinfo->is_g4x) {
   12512          return 0;
   12513       } else {
   12514          return 0;
   12515       }
   12516    default:
   12517       unreachable("Invalid hardware generation");
   12518    }
   12519 }
   12520 
   12521 
   12522 
   12523 #define GEN75_3DSTATE_CLIP_CullMode_start  48
   12524 #define GEN7_3DSTATE_CLIP_CullMode_start  48
   12525 
   12526 static inline uint32_t ATTRIBUTE_PURE
   12527 _3DSTATE_CLIP_CullMode_start(const struct gen_device_info *devinfo)
   12528 {
   12529    switch (devinfo->gen) {
   12530    case 10: return 0;
   12531    case 9: return 0;
   12532    case 8: return 0;
   12533    case 7:
   12534       if (devinfo->is_haswell) {
   12535          return 48;
   12536       } else {
   12537          return 48;
   12538       }
   12539    case 6: return 0;
   12540    case 5: return 0;
   12541    case 4:
   12542       if (devinfo->is_g4x) {
   12543          return 0;
   12544       } else {
   12545          return 0;
   12546       }
   12547    default:
   12548       unreachable("Invalid hardware generation");
   12549    }
   12550 }
   12551 
   12552 
   12553 
   12554 /* 3DSTATE_CLIP::DWord Length */
   12555 
   12556 
   12557 #define GEN10_3DSTATE_CLIP_DWordLength_bits  8
   12558 #define GEN9_3DSTATE_CLIP_DWordLength_bits  8
   12559 #define GEN8_3DSTATE_CLIP_DWordLength_bits  8
   12560 #define GEN75_3DSTATE_CLIP_DWordLength_bits  8
   12561 #define GEN7_3DSTATE_CLIP_DWordLength_bits  8
   12562 #define GEN6_3DSTATE_CLIP_DWordLength_bits  8
   12563 
   12564 static inline uint32_t ATTRIBUTE_PURE
   12565 _3DSTATE_CLIP_DWordLength_bits(const struct gen_device_info *devinfo)
   12566 {
   12567    switch (devinfo->gen) {
   12568    case 10: return 8;
   12569    case 9: return 8;
   12570    case 8: return 8;
   12571    case 7:
   12572       if (devinfo->is_haswell) {
   12573          return 8;
   12574       } else {
   12575          return 8;
   12576       }
   12577    case 6: return 8;
   12578    case 5: return 0;
   12579    case 4:
   12580       if (devinfo->is_g4x) {
   12581          return 0;
   12582       } else {
   12583          return 0;
   12584       }
   12585    default:
   12586       unreachable("Invalid hardware generation");
   12587    }
   12588 }
   12589 
   12590 
   12591 
   12592 #define GEN10_3DSTATE_CLIP_DWordLength_start  0
   12593 #define GEN9_3DSTATE_CLIP_DWordLength_start  0
   12594 #define GEN8_3DSTATE_CLIP_DWordLength_start  0
   12595 #define GEN75_3DSTATE_CLIP_DWordLength_start  0
   12596 #define GEN7_3DSTATE_CLIP_DWordLength_start  0
   12597 #define GEN6_3DSTATE_CLIP_DWordLength_start  0
   12598 
   12599 static inline uint32_t ATTRIBUTE_PURE
   12600 _3DSTATE_CLIP_DWordLength_start(const struct gen_device_info *devinfo)
   12601 {
   12602    switch (devinfo->gen) {
   12603    case 10: return 0;
   12604    case 9: return 0;
   12605    case 8: return 0;
   12606    case 7:
   12607       if (devinfo->is_haswell) {
   12608          return 0;
   12609       } else {
   12610          return 0;
   12611       }
   12612    case 6: return 0;
   12613    case 5: return 0;
   12614    case 4:
   12615       if (devinfo->is_g4x) {
   12616          return 0;
   12617       } else {
   12618          return 0;
   12619       }
   12620    default:
   12621       unreachable("Invalid hardware generation");
   12622    }
   12623 }
   12624 
   12625 
   12626 
   12627 /* 3DSTATE_CLIP::Early Cull Enable */
   12628 
   12629 
   12630 #define GEN10_3DSTATE_CLIP_EarlyCullEnable_bits  1
   12631 #define GEN9_3DSTATE_CLIP_EarlyCullEnable_bits  1
   12632 #define GEN8_3DSTATE_CLIP_EarlyCullEnable_bits  1
   12633 #define GEN75_3DSTATE_CLIP_EarlyCullEnable_bits  1
   12634 #define GEN7_3DSTATE_CLIP_EarlyCullEnable_bits  1
   12635 
   12636 static inline uint32_t ATTRIBUTE_PURE
   12637 _3DSTATE_CLIP_EarlyCullEnable_bits(const struct gen_device_info *devinfo)
   12638 {
   12639    switch (devinfo->gen) {
   12640    case 10: return 1;
   12641    case 9: return 1;
   12642    case 8: return 1;
   12643    case 7:
   12644       if (devinfo->is_haswell) {
   12645          return 1;
   12646       } else {
   12647          return 1;
   12648       }
   12649    case 6: return 0;
   12650    case 5: return 0;
   12651    case 4:
   12652       if (devinfo->is_g4x) {
   12653          return 0;
   12654       } else {
   12655          return 0;
   12656       }
   12657    default:
   12658       unreachable("Invalid hardware generation");
   12659    }
   12660 }
   12661 
   12662 
   12663 
   12664 #define GEN10_3DSTATE_CLIP_EarlyCullEnable_start  50
   12665 #define GEN9_3DSTATE_CLIP_EarlyCullEnable_start  50
   12666 #define GEN8_3DSTATE_CLIP_EarlyCullEnable_start  50
   12667 #define GEN75_3DSTATE_CLIP_EarlyCullEnable_start  50
   12668 #define GEN7_3DSTATE_CLIP_EarlyCullEnable_start  50
   12669 
   12670 static inline uint32_t ATTRIBUTE_PURE
   12671 _3DSTATE_CLIP_EarlyCullEnable_start(const struct gen_device_info *devinfo)
   12672 {
   12673    switch (devinfo->gen) {
   12674    case 10: return 50;
   12675    case 9: return 50;
   12676    case 8: return 50;
   12677    case 7:
   12678       if (devinfo->is_haswell) {
   12679          return 50;
   12680       } else {
   12681          return 50;
   12682       }
   12683    case 6: return 0;
   12684    case 5: return 0;
   12685    case 4:
   12686       if (devinfo->is_g4x) {
   12687          return 0;
   12688       } else {
   12689          return 0;
   12690       }
   12691    default:
   12692       unreachable("Invalid hardware generation");
   12693    }
   12694 }
   12695 
   12696 
   12697 
   12698 /* 3DSTATE_CLIP::Force Clip Mode */
   12699 
   12700 
   12701 #define GEN10_3DSTATE_CLIP_ForceClipMode_bits  1
   12702 #define GEN9_3DSTATE_CLIP_ForceClipMode_bits  1
   12703 #define GEN8_3DSTATE_CLIP_ForceClipMode_bits  1
   12704 
   12705 static inline uint32_t ATTRIBUTE_PURE
   12706 _3DSTATE_CLIP_ForceClipMode_bits(const struct gen_device_info *devinfo)
   12707 {
   12708    switch (devinfo->gen) {
   12709    case 10: return 1;
   12710    case 9: return 1;
   12711    case 8: return 1;
   12712    case 7:
   12713       if (devinfo->is_haswell) {
   12714          return 0;
   12715       } else {
   12716          return 0;
   12717       }
   12718    case 6: return 0;
   12719    case 5: return 0;
   12720    case 4:
   12721       if (devinfo->is_g4x) {
   12722          return 0;
   12723       } else {
   12724          return 0;
   12725       }
   12726    default:
   12727       unreachable("Invalid hardware generation");
   12728    }
   12729 }
   12730 
   12731 
   12732 
   12733 #define GEN10_3DSTATE_CLIP_ForceClipMode_start  48
   12734 #define GEN9_3DSTATE_CLIP_ForceClipMode_start  48
   12735 #define GEN8_3DSTATE_CLIP_ForceClipMode_start  48
   12736 
   12737 static inline uint32_t ATTRIBUTE_PURE
   12738 _3DSTATE_CLIP_ForceClipMode_start(const struct gen_device_info *devinfo)
   12739 {
   12740    switch (devinfo->gen) {
   12741    case 10: return 48;
   12742    case 9: return 48;
   12743    case 8: return 48;
   12744    case 7:
   12745       if (devinfo->is_haswell) {
   12746          return 0;
   12747       } else {
   12748          return 0;
   12749       }
   12750    case 6: return 0;
   12751    case 5: return 0;
   12752    case 4:
   12753       if (devinfo->is_g4x) {
   12754          return 0;
   12755       } else {
   12756          return 0;
   12757       }
   12758    default:
   12759       unreachable("Invalid hardware generation");
   12760    }
   12761 }
   12762 
   12763 
   12764 
   12765 /* 3DSTATE_CLIP::Force User Clip Distance Clip Test Enable Bitmask */
   12766 
   12767 
   12768 #define GEN10_3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_bits  1
   12769 #define GEN9_3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_bits  1
   12770 #define GEN8_3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_bits  1
   12771 
   12772 static inline uint32_t ATTRIBUTE_PURE
   12773 _3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   12774 {
   12775    switch (devinfo->gen) {
   12776    case 10: return 1;
   12777    case 9: return 1;
   12778    case 8: return 1;
   12779    case 7:
   12780       if (devinfo->is_haswell) {
   12781          return 0;
   12782       } else {
   12783          return 0;
   12784       }
   12785    case 6: return 0;
   12786    case 5: return 0;
   12787    case 4:
   12788       if (devinfo->is_g4x) {
   12789          return 0;
   12790       } else {
   12791          return 0;
   12792       }
   12793    default:
   12794       unreachable("Invalid hardware generation");
   12795    }
   12796 }
   12797 
   12798 
   12799 
   12800 #define GEN10_3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_start  49
   12801 #define GEN9_3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_start  49
   12802 #define GEN8_3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_start  49
   12803 
   12804 static inline uint32_t ATTRIBUTE_PURE
   12805 _3DSTATE_CLIP_ForceUserClipDistanceClipTestEnableBitmask_start(const struct gen_device_info *devinfo)
   12806 {
   12807    switch (devinfo->gen) {
   12808    case 10: return 49;
   12809    case 9: return 49;
   12810    case 8: return 49;
   12811    case 7:
   12812       if (devinfo->is_haswell) {
   12813          return 0;
   12814       } else {
   12815          return 0;
   12816       }
   12817    case 6: return 0;
   12818    case 5: return 0;
   12819    case 4:
   12820       if (devinfo->is_g4x) {
   12821          return 0;
   12822       } else {
   12823          return 0;
   12824       }
   12825    default:
   12826       unreachable("Invalid hardware generation");
   12827    }
   12828 }
   12829 
   12830 
   12831 
   12832 /* 3DSTATE_CLIP::Force User Clip Distance Cull Test Enable Bitmask */
   12833 
   12834 
   12835 #define GEN10_3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_bits  1
   12836 #define GEN9_3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_bits  1
   12837 #define GEN8_3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_bits  1
   12838 
   12839 static inline uint32_t ATTRIBUTE_PURE
   12840 _3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   12841 {
   12842    switch (devinfo->gen) {
   12843    case 10: return 1;
   12844    case 9: return 1;
   12845    case 8: return 1;
   12846    case 7:
   12847       if (devinfo->is_haswell) {
   12848          return 0;
   12849       } else {
   12850          return 0;
   12851       }
   12852    case 6: return 0;
   12853    case 5: return 0;
   12854    case 4:
   12855       if (devinfo->is_g4x) {
   12856          return 0;
   12857       } else {
   12858          return 0;
   12859       }
   12860    default:
   12861       unreachable("Invalid hardware generation");
   12862    }
   12863 }
   12864 
   12865 
   12866 
   12867 #define GEN10_3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_start  52
   12868 #define GEN9_3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_start  52
   12869 #define GEN8_3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_start  52
   12870 
   12871 static inline uint32_t ATTRIBUTE_PURE
   12872 _3DSTATE_CLIP_ForceUserClipDistanceCullTestEnableBitmask_start(const struct gen_device_info *devinfo)
   12873 {
   12874    switch (devinfo->gen) {
   12875    case 10: return 52;
   12876    case 9: return 52;
   12877    case 8: return 52;
   12878    case 7:
   12879       if (devinfo->is_haswell) {
   12880          return 0;
   12881       } else {
   12882          return 0;
   12883       }
   12884    case 6: return 0;
   12885    case 5: return 0;
   12886    case 4:
   12887       if (devinfo->is_g4x) {
   12888          return 0;
   12889       } else {
   12890          return 0;
   12891       }
   12892    default:
   12893       unreachable("Invalid hardware generation");
   12894    }
   12895 }
   12896 
   12897 
   12898 
   12899 /* 3DSTATE_CLIP::Force Zero RTA Index Enable */
   12900 
   12901 
   12902 #define GEN10_3DSTATE_CLIP_ForceZeroRTAIndexEnable_bits  1
   12903 #define GEN9_3DSTATE_CLIP_ForceZeroRTAIndexEnable_bits  1
   12904 #define GEN8_3DSTATE_CLIP_ForceZeroRTAIndexEnable_bits  1
   12905 #define GEN75_3DSTATE_CLIP_ForceZeroRTAIndexEnable_bits  1
   12906 #define GEN7_3DSTATE_CLIP_ForceZeroRTAIndexEnable_bits  1
   12907 #define GEN6_3DSTATE_CLIP_ForceZeroRTAIndexEnable_bits  1
   12908 
   12909 static inline uint32_t ATTRIBUTE_PURE
   12910 _3DSTATE_CLIP_ForceZeroRTAIndexEnable_bits(const struct gen_device_info *devinfo)
   12911 {
   12912    switch (devinfo->gen) {
   12913    case 10: return 1;
   12914    case 9: return 1;
   12915    case 8: return 1;
   12916    case 7:
   12917       if (devinfo->is_haswell) {
   12918          return 1;
   12919       } else {
   12920          return 1;
   12921       }
   12922    case 6: return 1;
   12923    case 5: return 0;
   12924    case 4:
   12925       if (devinfo->is_g4x) {
   12926          return 0;
   12927       } else {
   12928          return 0;
   12929       }
   12930    default:
   12931       unreachable("Invalid hardware generation");
   12932    }
   12933 }
   12934 
   12935 
   12936 
   12937 #define GEN10_3DSTATE_CLIP_ForceZeroRTAIndexEnable_start  101
   12938 #define GEN9_3DSTATE_CLIP_ForceZeroRTAIndexEnable_start  101
   12939 #define GEN8_3DSTATE_CLIP_ForceZeroRTAIndexEnable_start  101
   12940 #define GEN75_3DSTATE_CLIP_ForceZeroRTAIndexEnable_start  101
   12941 #define GEN7_3DSTATE_CLIP_ForceZeroRTAIndexEnable_start  101
   12942 #define GEN6_3DSTATE_CLIP_ForceZeroRTAIndexEnable_start  101
   12943 
   12944 static inline uint32_t ATTRIBUTE_PURE
   12945 _3DSTATE_CLIP_ForceZeroRTAIndexEnable_start(const struct gen_device_info *devinfo)
   12946 {
   12947    switch (devinfo->gen) {
   12948    case 10: return 101;
   12949    case 9: return 101;
   12950    case 8: return 101;
   12951    case 7:
   12952       if (devinfo->is_haswell) {
   12953          return 101;
   12954       } else {
   12955          return 101;
   12956       }
   12957    case 6: return 101;
   12958    case 5: return 0;
   12959    case 4:
   12960       if (devinfo->is_g4x) {
   12961          return 0;
   12962       } else {
   12963          return 0;
   12964       }
   12965    default:
   12966       unreachable("Invalid hardware generation");
   12967    }
   12968 }
   12969 
   12970 
   12971 
   12972 /* 3DSTATE_CLIP::Front Winding */
   12973 
   12974 
   12975 #define GEN75_3DSTATE_CLIP_FrontWinding_bits  1
   12976 #define GEN7_3DSTATE_CLIP_FrontWinding_bits  1
   12977 
   12978 static inline uint32_t ATTRIBUTE_PURE
   12979 _3DSTATE_CLIP_FrontWinding_bits(const struct gen_device_info *devinfo)
   12980 {
   12981    switch (devinfo->gen) {
   12982    case 10: return 0;
   12983    case 9: return 0;
   12984    case 8: return 0;
   12985    case 7:
   12986       if (devinfo->is_haswell) {
   12987          return 1;
   12988       } else {
   12989          return 1;
   12990       }
   12991    case 6: return 0;
   12992    case 5: return 0;
   12993    case 4:
   12994       if (devinfo->is_g4x) {
   12995          return 0;
   12996       } else {
   12997          return 0;
   12998       }
   12999    default:
   13000       unreachable("Invalid hardware generation");
   13001    }
   13002 }
   13003 
   13004 
   13005 
   13006 #define GEN75_3DSTATE_CLIP_FrontWinding_start  52
   13007 #define GEN7_3DSTATE_CLIP_FrontWinding_start  52
   13008 
   13009 static inline uint32_t ATTRIBUTE_PURE
   13010 _3DSTATE_CLIP_FrontWinding_start(const struct gen_device_info *devinfo)
   13011 {
   13012    switch (devinfo->gen) {
   13013    case 10: return 0;
   13014    case 9: return 0;
   13015    case 8: return 0;
   13016    case 7:
   13017       if (devinfo->is_haswell) {
   13018          return 52;
   13019       } else {
   13020          return 52;
   13021       }
   13022    case 6: return 0;
   13023    case 5: return 0;
   13024    case 4:
   13025       if (devinfo->is_g4x) {
   13026          return 0;
   13027       } else {
   13028          return 0;
   13029       }
   13030    default:
   13031       unreachable("Invalid hardware generation");
   13032    }
   13033 }
   13034 
   13035 
   13036 
   13037 /* 3DSTATE_CLIP::Guardband Clip Test Enable */
   13038 
   13039 
   13040 #define GEN10_3DSTATE_CLIP_GuardbandClipTestEnable_bits  1
   13041 #define GEN9_3DSTATE_CLIP_GuardbandClipTestEnable_bits  1
   13042 #define GEN8_3DSTATE_CLIP_GuardbandClipTestEnable_bits  1
   13043 #define GEN75_3DSTATE_CLIP_GuardbandClipTestEnable_bits  1
   13044 #define GEN7_3DSTATE_CLIP_GuardbandClipTestEnable_bits  1
   13045 #define GEN6_3DSTATE_CLIP_GuardbandClipTestEnable_bits  1
   13046 
   13047 static inline uint32_t ATTRIBUTE_PURE
   13048 _3DSTATE_CLIP_GuardbandClipTestEnable_bits(const struct gen_device_info *devinfo)
   13049 {
   13050    switch (devinfo->gen) {
   13051    case 10: return 1;
   13052    case 9: return 1;
   13053    case 8: return 1;
   13054    case 7:
   13055       if (devinfo->is_haswell) {
   13056          return 1;
   13057       } else {
   13058          return 1;
   13059       }
   13060    case 6: return 1;
   13061    case 5: return 0;
   13062    case 4:
   13063       if (devinfo->is_g4x) {
   13064          return 0;
   13065       } else {
   13066          return 0;
   13067       }
   13068    default:
   13069       unreachable("Invalid hardware generation");
   13070    }
   13071 }
   13072 
   13073 
   13074 
   13075 #define GEN10_3DSTATE_CLIP_GuardbandClipTestEnable_start  90
   13076 #define GEN9_3DSTATE_CLIP_GuardbandClipTestEnable_start  90
   13077 #define GEN8_3DSTATE_CLIP_GuardbandClipTestEnable_start  90
   13078 #define GEN75_3DSTATE_CLIP_GuardbandClipTestEnable_start  90
   13079 #define GEN7_3DSTATE_CLIP_GuardbandClipTestEnable_start  90
   13080 #define GEN6_3DSTATE_CLIP_GuardbandClipTestEnable_start  90
   13081 
   13082 static inline uint32_t ATTRIBUTE_PURE
   13083 _3DSTATE_CLIP_GuardbandClipTestEnable_start(const struct gen_device_info *devinfo)
   13084 {
   13085    switch (devinfo->gen) {
   13086    case 10: return 90;
   13087    case 9: return 90;
   13088    case 8: return 90;
   13089    case 7:
   13090       if (devinfo->is_haswell) {
   13091          return 90;
   13092       } else {
   13093          return 90;
   13094       }
   13095    case 6: return 90;
   13096    case 5: return 0;
   13097    case 4:
   13098       if (devinfo->is_g4x) {
   13099          return 0;
   13100       } else {
   13101          return 0;
   13102       }
   13103    default:
   13104       unreachable("Invalid hardware generation");
   13105    }
   13106 }
   13107 
   13108 
   13109 
   13110 /* 3DSTATE_CLIP::Line Strip/List Provoking Vertex Select */
   13111 
   13112 
   13113 #define GEN10_3DSTATE_CLIP_LineStripListProvokingVertexSelect_bits  2
   13114 #define GEN9_3DSTATE_CLIP_LineStripListProvokingVertexSelect_bits  2
   13115 #define GEN8_3DSTATE_CLIP_LineStripListProvokingVertexSelect_bits  2
   13116 #define GEN75_3DSTATE_CLIP_LineStripListProvokingVertexSelect_bits  2
   13117 #define GEN7_3DSTATE_CLIP_LineStripListProvokingVertexSelect_bits  2
   13118 #define GEN6_3DSTATE_CLIP_LineStripListProvokingVertexSelect_bits  2
   13119 
   13120 static inline uint32_t ATTRIBUTE_PURE
   13121 _3DSTATE_CLIP_LineStripListProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   13122 {
   13123    switch (devinfo->gen) {
   13124    case 10: return 2;
   13125    case 9: return 2;
   13126    case 8: return 2;
   13127    case 7:
   13128       if (devinfo->is_haswell) {
   13129          return 2;
   13130       } else {
   13131          return 2;
   13132       }
   13133    case 6: return 2;
   13134    case 5: return 0;
   13135    case 4:
   13136       if (devinfo->is_g4x) {
   13137          return 0;
   13138       } else {
   13139          return 0;
   13140       }
   13141    default:
   13142       unreachable("Invalid hardware generation");
   13143    }
   13144 }
   13145 
   13146 
   13147 
   13148 #define GEN10_3DSTATE_CLIP_LineStripListProvokingVertexSelect_start  66
   13149 #define GEN9_3DSTATE_CLIP_LineStripListProvokingVertexSelect_start  66
   13150 #define GEN8_3DSTATE_CLIP_LineStripListProvokingVertexSelect_start  66
   13151 #define GEN75_3DSTATE_CLIP_LineStripListProvokingVertexSelect_start  66
   13152 #define GEN7_3DSTATE_CLIP_LineStripListProvokingVertexSelect_start  66
   13153 #define GEN6_3DSTATE_CLIP_LineStripListProvokingVertexSelect_start  66
   13154 
   13155 static inline uint32_t ATTRIBUTE_PURE
   13156 _3DSTATE_CLIP_LineStripListProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   13157 {
   13158    switch (devinfo->gen) {
   13159    case 10: return 66;
   13160    case 9: return 66;
   13161    case 8: return 66;
   13162    case 7:
   13163       if (devinfo->is_haswell) {
   13164          return 66;
   13165       } else {
   13166          return 66;
   13167       }
   13168    case 6: return 66;
   13169    case 5: return 0;
   13170    case 4:
   13171       if (devinfo->is_g4x) {
   13172          return 0;
   13173       } else {
   13174          return 0;
   13175       }
   13176    default:
   13177       unreachable("Invalid hardware generation");
   13178    }
   13179 }
   13180 
   13181 
   13182 
   13183 /* 3DSTATE_CLIP::Maximum Point Width */
   13184 
   13185 
   13186 #define GEN10_3DSTATE_CLIP_MaximumPointWidth_bits  11
   13187 #define GEN9_3DSTATE_CLIP_MaximumPointWidth_bits  11
   13188 #define GEN8_3DSTATE_CLIP_MaximumPointWidth_bits  11
   13189 #define GEN75_3DSTATE_CLIP_MaximumPointWidth_bits  11
   13190 #define GEN7_3DSTATE_CLIP_MaximumPointWidth_bits  11
   13191 #define GEN6_3DSTATE_CLIP_MaximumPointWidth_bits  11
   13192 
   13193 static inline uint32_t ATTRIBUTE_PURE
   13194 _3DSTATE_CLIP_MaximumPointWidth_bits(const struct gen_device_info *devinfo)
   13195 {
   13196    switch (devinfo->gen) {
   13197    case 10: return 11;
   13198    case 9: return 11;
   13199    case 8: return 11;
   13200    case 7:
   13201       if (devinfo->is_haswell) {
   13202          return 11;
   13203       } else {
   13204          return 11;
   13205       }
   13206    case 6: return 11;
   13207    case 5: return 0;
   13208    case 4:
   13209       if (devinfo->is_g4x) {
   13210          return 0;
   13211       } else {
   13212          return 0;
   13213       }
   13214    default:
   13215       unreachable("Invalid hardware generation");
   13216    }
   13217 }
   13218 
   13219 
   13220 
   13221 #define GEN10_3DSTATE_CLIP_MaximumPointWidth_start  102
   13222 #define GEN9_3DSTATE_CLIP_MaximumPointWidth_start  102
   13223 #define GEN8_3DSTATE_CLIP_MaximumPointWidth_start  102
   13224 #define GEN75_3DSTATE_CLIP_MaximumPointWidth_start  102
   13225 #define GEN7_3DSTATE_CLIP_MaximumPointWidth_start  102
   13226 #define GEN6_3DSTATE_CLIP_MaximumPointWidth_start  102
   13227 
   13228 static inline uint32_t ATTRIBUTE_PURE
   13229 _3DSTATE_CLIP_MaximumPointWidth_start(const struct gen_device_info *devinfo)
   13230 {
   13231    switch (devinfo->gen) {
   13232    case 10: return 102;
   13233    case 9: return 102;
   13234    case 8: return 102;
   13235    case 7:
   13236       if (devinfo->is_haswell) {
   13237          return 102;
   13238       } else {
   13239          return 102;
   13240       }
   13241    case 6: return 102;
   13242    case 5: return 0;
   13243    case 4:
   13244       if (devinfo->is_g4x) {
   13245          return 0;
   13246       } else {
   13247          return 0;
   13248       }
   13249    default:
   13250       unreachable("Invalid hardware generation");
   13251    }
   13252 }
   13253 
   13254 
   13255 
   13256 /* 3DSTATE_CLIP::Maximum VP Index */
   13257 
   13258 
   13259 #define GEN10_3DSTATE_CLIP_MaximumVPIndex_bits  4
   13260 #define GEN9_3DSTATE_CLIP_MaximumVPIndex_bits  4
   13261 #define GEN8_3DSTATE_CLIP_MaximumVPIndex_bits  4
   13262 #define GEN75_3DSTATE_CLIP_MaximumVPIndex_bits  4
   13263 #define GEN7_3DSTATE_CLIP_MaximumVPIndex_bits  4
   13264 #define GEN6_3DSTATE_CLIP_MaximumVPIndex_bits  4
   13265 
   13266 static inline uint32_t ATTRIBUTE_PURE
   13267 _3DSTATE_CLIP_MaximumVPIndex_bits(const struct gen_device_info *devinfo)
   13268 {
   13269    switch (devinfo->gen) {
   13270    case 10: return 4;
   13271    case 9: return 4;
   13272    case 8: return 4;
   13273    case 7:
   13274       if (devinfo->is_haswell) {
   13275          return 4;
   13276       } else {
   13277          return 4;
   13278       }
   13279    case 6: return 4;
   13280    case 5: return 0;
   13281    case 4:
   13282       if (devinfo->is_g4x) {
   13283          return 0;
   13284       } else {
   13285          return 0;
   13286       }
   13287    default:
   13288       unreachable("Invalid hardware generation");
   13289    }
   13290 }
   13291 
   13292 
   13293 
   13294 #define GEN10_3DSTATE_CLIP_MaximumVPIndex_start  96
   13295 #define GEN9_3DSTATE_CLIP_MaximumVPIndex_start  96
   13296 #define GEN8_3DSTATE_CLIP_MaximumVPIndex_start  96
   13297 #define GEN75_3DSTATE_CLIP_MaximumVPIndex_start  96
   13298 #define GEN7_3DSTATE_CLIP_MaximumVPIndex_start  96
   13299 #define GEN6_3DSTATE_CLIP_MaximumVPIndex_start  96
   13300 
   13301 static inline uint32_t ATTRIBUTE_PURE
   13302 _3DSTATE_CLIP_MaximumVPIndex_start(const struct gen_device_info *devinfo)
   13303 {
   13304    switch (devinfo->gen) {
   13305    case 10: return 96;
   13306    case 9: return 96;
   13307    case 8: return 96;
   13308    case 7:
   13309       if (devinfo->is_haswell) {
   13310          return 96;
   13311       } else {
   13312          return 96;
   13313       }
   13314    case 6: return 96;
   13315    case 5: return 0;
   13316    case 4:
   13317       if (devinfo->is_g4x) {
   13318          return 0;
   13319       } else {
   13320          return 0;
   13321       }
   13322    default:
   13323       unreachable("Invalid hardware generation");
   13324    }
   13325 }
   13326 
   13327 
   13328 
   13329 /* 3DSTATE_CLIP::Minimum Point Width */
   13330 
   13331 
   13332 #define GEN10_3DSTATE_CLIP_MinimumPointWidth_bits  11
   13333 #define GEN9_3DSTATE_CLIP_MinimumPointWidth_bits  11
   13334 #define GEN8_3DSTATE_CLIP_MinimumPointWidth_bits  11
   13335 #define GEN75_3DSTATE_CLIP_MinimumPointWidth_bits  11
   13336 #define GEN7_3DSTATE_CLIP_MinimumPointWidth_bits  11
   13337 #define GEN6_3DSTATE_CLIP_MinimumPointWidth_bits  11
   13338 
   13339 static inline uint32_t ATTRIBUTE_PURE
   13340 _3DSTATE_CLIP_MinimumPointWidth_bits(const struct gen_device_info *devinfo)
   13341 {
   13342    switch (devinfo->gen) {
   13343    case 10: return 11;
   13344    case 9: return 11;
   13345    case 8: return 11;
   13346    case 7:
   13347       if (devinfo->is_haswell) {
   13348          return 11;
   13349       } else {
   13350          return 11;
   13351       }
   13352    case 6: return 11;
   13353    case 5: return 0;
   13354    case 4:
   13355       if (devinfo->is_g4x) {
   13356          return 0;
   13357       } else {
   13358          return 0;
   13359       }
   13360    default:
   13361       unreachable("Invalid hardware generation");
   13362    }
   13363 }
   13364 
   13365 
   13366 
   13367 #define GEN10_3DSTATE_CLIP_MinimumPointWidth_start  113
   13368 #define GEN9_3DSTATE_CLIP_MinimumPointWidth_start  113
   13369 #define GEN8_3DSTATE_CLIP_MinimumPointWidth_start  113
   13370 #define GEN75_3DSTATE_CLIP_MinimumPointWidth_start  113
   13371 #define GEN7_3DSTATE_CLIP_MinimumPointWidth_start  113
   13372 #define GEN6_3DSTATE_CLIP_MinimumPointWidth_start  113
   13373 
   13374 static inline uint32_t ATTRIBUTE_PURE
   13375 _3DSTATE_CLIP_MinimumPointWidth_start(const struct gen_device_info *devinfo)
   13376 {
   13377    switch (devinfo->gen) {
   13378    case 10: return 113;
   13379    case 9: return 113;
   13380    case 8: return 113;
   13381    case 7:
   13382       if (devinfo->is_haswell) {
   13383          return 113;
   13384       } else {
   13385          return 113;
   13386       }
   13387    case 6: return 113;
   13388    case 5: return 0;
   13389    case 4:
   13390       if (devinfo->is_g4x) {
   13391          return 0;
   13392       } else {
   13393          return 0;
   13394       }
   13395    default:
   13396       unreachable("Invalid hardware generation");
   13397    }
   13398 }
   13399 
   13400 
   13401 
   13402 /* 3DSTATE_CLIP::Non-Perspective Barycentric Enable */
   13403 
   13404 
   13405 #define GEN10_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_bits  1
   13406 #define GEN9_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_bits  1
   13407 #define GEN8_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_bits  1
   13408 #define GEN75_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_bits  1
   13409 #define GEN7_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_bits  1
   13410 #define GEN6_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_bits  1
   13411 
   13412 static inline uint32_t ATTRIBUTE_PURE
   13413 _3DSTATE_CLIP_NonPerspectiveBarycentricEnable_bits(const struct gen_device_info *devinfo)
   13414 {
   13415    switch (devinfo->gen) {
   13416    case 10: return 1;
   13417    case 9: return 1;
   13418    case 8: return 1;
   13419    case 7:
   13420       if (devinfo->is_haswell) {
   13421          return 1;
   13422       } else {
   13423          return 1;
   13424       }
   13425    case 6: return 1;
   13426    case 5: return 0;
   13427    case 4:
   13428       if (devinfo->is_g4x) {
   13429          return 0;
   13430       } else {
   13431          return 0;
   13432       }
   13433    default:
   13434       unreachable("Invalid hardware generation");
   13435    }
   13436 }
   13437 
   13438 
   13439 
   13440 #define GEN10_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_start  72
   13441 #define GEN9_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_start  72
   13442 #define GEN8_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_start  72
   13443 #define GEN75_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_start  72
   13444 #define GEN7_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_start  72
   13445 #define GEN6_3DSTATE_CLIP_NonPerspectiveBarycentricEnable_start  72
   13446 
   13447 static inline uint32_t ATTRIBUTE_PURE
   13448 _3DSTATE_CLIP_NonPerspectiveBarycentricEnable_start(const struct gen_device_info *devinfo)
   13449 {
   13450    switch (devinfo->gen) {
   13451    case 10: return 72;
   13452    case 9: return 72;
   13453    case 8: return 72;
   13454    case 7:
   13455       if (devinfo->is_haswell) {
   13456          return 72;
   13457       } else {
   13458          return 72;
   13459       }
   13460    case 6: return 72;
   13461    case 5: return 0;
   13462    case 4:
   13463       if (devinfo->is_g4x) {
   13464          return 0;
   13465       } else {
   13466          return 0;
   13467       }
   13468    default:
   13469       unreachable("Invalid hardware generation");
   13470    }
   13471 }
   13472 
   13473 
   13474 
   13475 /* 3DSTATE_CLIP::Perspective Divide Disable */
   13476 
   13477 
   13478 #define GEN10_3DSTATE_CLIP_PerspectiveDivideDisable_bits  1
   13479 #define GEN9_3DSTATE_CLIP_PerspectiveDivideDisable_bits  1
   13480 #define GEN8_3DSTATE_CLIP_PerspectiveDivideDisable_bits  1
   13481 #define GEN75_3DSTATE_CLIP_PerspectiveDivideDisable_bits  1
   13482 #define GEN7_3DSTATE_CLIP_PerspectiveDivideDisable_bits  1
   13483 #define GEN6_3DSTATE_CLIP_PerspectiveDivideDisable_bits  1
   13484 
   13485 static inline uint32_t ATTRIBUTE_PURE
   13486 _3DSTATE_CLIP_PerspectiveDivideDisable_bits(const struct gen_device_info *devinfo)
   13487 {
   13488    switch (devinfo->gen) {
   13489    case 10: return 1;
   13490    case 9: return 1;
   13491    case 8: return 1;
   13492    case 7:
   13493       if (devinfo->is_haswell) {
   13494          return 1;
   13495       } else {
   13496          return 1;
   13497       }
   13498    case 6: return 1;
   13499    case 5: return 0;
   13500    case 4:
   13501       if (devinfo->is_g4x) {
   13502          return 0;
   13503       } else {
   13504          return 0;
   13505       }
   13506    default:
   13507       unreachable("Invalid hardware generation");
   13508    }
   13509 }
   13510 
   13511 
   13512 
   13513 #define GEN10_3DSTATE_CLIP_PerspectiveDivideDisable_start  73
   13514 #define GEN9_3DSTATE_CLIP_PerspectiveDivideDisable_start  73
   13515 #define GEN8_3DSTATE_CLIP_PerspectiveDivideDisable_start  73
   13516 #define GEN75_3DSTATE_CLIP_PerspectiveDivideDisable_start  73
   13517 #define GEN7_3DSTATE_CLIP_PerspectiveDivideDisable_start  73
   13518 #define GEN6_3DSTATE_CLIP_PerspectiveDivideDisable_start  73
   13519 
   13520 static inline uint32_t ATTRIBUTE_PURE
   13521 _3DSTATE_CLIP_PerspectiveDivideDisable_start(const struct gen_device_info *devinfo)
   13522 {
   13523    switch (devinfo->gen) {
   13524    case 10: return 73;
   13525    case 9: return 73;
   13526    case 8: return 73;
   13527    case 7:
   13528       if (devinfo->is_haswell) {
   13529          return 73;
   13530       } else {
   13531          return 73;
   13532       }
   13533    case 6: return 73;
   13534    case 5: return 0;
   13535    case 4:
   13536       if (devinfo->is_g4x) {
   13537          return 0;
   13538       } else {
   13539          return 0;
   13540       }
   13541    default:
   13542       unreachable("Invalid hardware generation");
   13543    }
   13544 }
   13545 
   13546 
   13547 
   13548 /* 3DSTATE_CLIP::Statistics Enable */
   13549 
   13550 
   13551 #define GEN10_3DSTATE_CLIP_StatisticsEnable_bits  1
   13552 #define GEN9_3DSTATE_CLIP_StatisticsEnable_bits  1
   13553 #define GEN8_3DSTATE_CLIP_StatisticsEnable_bits  1
   13554 #define GEN75_3DSTATE_CLIP_StatisticsEnable_bits  1
   13555 #define GEN7_3DSTATE_CLIP_StatisticsEnable_bits  1
   13556 #define GEN6_3DSTATE_CLIP_StatisticsEnable_bits  1
   13557 
   13558 static inline uint32_t ATTRIBUTE_PURE
   13559 _3DSTATE_CLIP_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   13560 {
   13561    switch (devinfo->gen) {
   13562    case 10: return 1;
   13563    case 9: return 1;
   13564    case 8: return 1;
   13565    case 7:
   13566       if (devinfo->is_haswell) {
   13567          return 1;
   13568       } else {
   13569          return 1;
   13570       }
   13571    case 6: return 1;
   13572    case 5: return 0;
   13573    case 4:
   13574       if (devinfo->is_g4x) {
   13575          return 0;
   13576       } else {
   13577          return 0;
   13578       }
   13579    default:
   13580       unreachable("Invalid hardware generation");
   13581    }
   13582 }
   13583 
   13584 
   13585 
   13586 #define GEN10_3DSTATE_CLIP_StatisticsEnable_start  42
   13587 #define GEN9_3DSTATE_CLIP_StatisticsEnable_start  42
   13588 #define GEN8_3DSTATE_CLIP_StatisticsEnable_start  42
   13589 #define GEN75_3DSTATE_CLIP_StatisticsEnable_start  42
   13590 #define GEN7_3DSTATE_CLIP_StatisticsEnable_start  42
   13591 #define GEN6_3DSTATE_CLIP_StatisticsEnable_start  42
   13592 
   13593 static inline uint32_t ATTRIBUTE_PURE
   13594 _3DSTATE_CLIP_StatisticsEnable_start(const struct gen_device_info *devinfo)
   13595 {
   13596    switch (devinfo->gen) {
   13597    case 10: return 42;
   13598    case 9: return 42;
   13599    case 8: return 42;
   13600    case 7:
   13601       if (devinfo->is_haswell) {
   13602          return 42;
   13603       } else {
   13604          return 42;
   13605       }
   13606    case 6: return 42;
   13607    case 5: return 0;
   13608    case 4:
   13609       if (devinfo->is_g4x) {
   13610          return 0;
   13611       } else {
   13612          return 0;
   13613       }
   13614    default:
   13615       unreachable("Invalid hardware generation");
   13616    }
   13617 }
   13618 
   13619 
   13620 
   13621 /* 3DSTATE_CLIP::Triangle Fan Provoking Vertex Select */
   13622 
   13623 
   13624 #define GEN10_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_bits  2
   13625 #define GEN9_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_bits  2
   13626 #define GEN8_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_bits  2
   13627 #define GEN75_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_bits  2
   13628 #define GEN7_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_bits  2
   13629 #define GEN6_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_bits  2
   13630 
   13631 static inline uint32_t ATTRIBUTE_PURE
   13632 _3DSTATE_CLIP_TriangleFanProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   13633 {
   13634    switch (devinfo->gen) {
   13635    case 10: return 2;
   13636    case 9: return 2;
   13637    case 8: return 2;
   13638    case 7:
   13639       if (devinfo->is_haswell) {
   13640          return 2;
   13641       } else {
   13642          return 2;
   13643       }
   13644    case 6: return 2;
   13645    case 5: return 0;
   13646    case 4:
   13647       if (devinfo->is_g4x) {
   13648          return 0;
   13649       } else {
   13650          return 0;
   13651       }
   13652    default:
   13653       unreachable("Invalid hardware generation");
   13654    }
   13655 }
   13656 
   13657 
   13658 
   13659 #define GEN10_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_start  64
   13660 #define GEN9_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_start  64
   13661 #define GEN8_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_start  64
   13662 #define GEN75_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_start  64
   13663 #define GEN7_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_start  64
   13664 #define GEN6_3DSTATE_CLIP_TriangleFanProvokingVertexSelect_start  64
   13665 
   13666 static inline uint32_t ATTRIBUTE_PURE
   13667 _3DSTATE_CLIP_TriangleFanProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   13668 {
   13669    switch (devinfo->gen) {
   13670    case 10: return 64;
   13671    case 9: return 64;
   13672    case 8: return 64;
   13673    case 7:
   13674       if (devinfo->is_haswell) {
   13675          return 64;
   13676       } else {
   13677          return 64;
   13678       }
   13679    case 6: return 64;
   13680    case 5: return 0;
   13681    case 4:
   13682       if (devinfo->is_g4x) {
   13683          return 0;
   13684       } else {
   13685          return 0;
   13686       }
   13687    default:
   13688       unreachable("Invalid hardware generation");
   13689    }
   13690 }
   13691 
   13692 
   13693 
   13694 /* 3DSTATE_CLIP::Triangle Strip/List Provoking Vertex Select */
   13695 
   13696 
   13697 #define GEN10_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_bits  2
   13698 #define GEN9_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_bits  2
   13699 #define GEN8_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_bits  2
   13700 #define GEN75_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_bits  2
   13701 #define GEN7_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_bits  2
   13702 #define GEN6_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_bits  2
   13703 
   13704 static inline uint32_t ATTRIBUTE_PURE
   13705 _3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   13706 {
   13707    switch (devinfo->gen) {
   13708    case 10: return 2;
   13709    case 9: return 2;
   13710    case 8: return 2;
   13711    case 7:
   13712       if (devinfo->is_haswell) {
   13713          return 2;
   13714       } else {
   13715          return 2;
   13716       }
   13717    case 6: return 2;
   13718    case 5: return 0;
   13719    case 4:
   13720       if (devinfo->is_g4x) {
   13721          return 0;
   13722       } else {
   13723          return 0;
   13724       }
   13725    default:
   13726       unreachable("Invalid hardware generation");
   13727    }
   13728 }
   13729 
   13730 
   13731 
   13732 #define GEN10_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_start  68
   13733 #define GEN9_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_start  68
   13734 #define GEN8_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_start  68
   13735 #define GEN75_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_start  68
   13736 #define GEN7_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_start  68
   13737 #define GEN6_3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_start  68
   13738 
   13739 static inline uint32_t ATTRIBUTE_PURE
   13740 _3DSTATE_CLIP_TriangleStripListProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   13741 {
   13742    switch (devinfo->gen) {
   13743    case 10: return 68;
   13744    case 9: return 68;
   13745    case 8: return 68;
   13746    case 7:
   13747       if (devinfo->is_haswell) {
   13748          return 68;
   13749       } else {
   13750          return 68;
   13751       }
   13752    case 6: return 68;
   13753    case 5: return 0;
   13754    case 4:
   13755       if (devinfo->is_g4x) {
   13756          return 0;
   13757       } else {
   13758          return 0;
   13759       }
   13760    default:
   13761       unreachable("Invalid hardware generation");
   13762    }
   13763 }
   13764 
   13765 
   13766 
   13767 /* 3DSTATE_CLIP::User Clip Distance Clip Test Enable Bitmask */
   13768 
   13769 
   13770 #define GEN10_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_bits  8
   13771 #define GEN9_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_bits  8
   13772 #define GEN8_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_bits  8
   13773 #define GEN75_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_bits  8
   13774 #define GEN7_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_bits  8
   13775 #define GEN6_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_bits  8
   13776 
   13777 static inline uint32_t ATTRIBUTE_PURE
   13778 _3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   13779 {
   13780    switch (devinfo->gen) {
   13781    case 10: return 8;
   13782    case 9: return 8;
   13783    case 8: return 8;
   13784    case 7:
   13785       if (devinfo->is_haswell) {
   13786          return 8;
   13787       } else {
   13788          return 8;
   13789       }
   13790    case 6: return 8;
   13791    case 5: return 0;
   13792    case 4:
   13793       if (devinfo->is_g4x) {
   13794          return 0;
   13795       } else {
   13796          return 0;
   13797       }
   13798    default:
   13799       unreachable("Invalid hardware generation");
   13800    }
   13801 }
   13802 
   13803 
   13804 
   13805 #define GEN10_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_start  80
   13806 #define GEN9_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_start  80
   13807 #define GEN8_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_start  80
   13808 #define GEN75_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_start  80
   13809 #define GEN7_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_start  80
   13810 #define GEN6_3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_start  80
   13811 
   13812 static inline uint32_t ATTRIBUTE_PURE
   13813 _3DSTATE_CLIP_UserClipDistanceClipTestEnableBitmask_start(const struct gen_device_info *devinfo)
   13814 {
   13815    switch (devinfo->gen) {
   13816    case 10: return 80;
   13817    case 9: return 80;
   13818    case 8: return 80;
   13819    case 7:
   13820       if (devinfo->is_haswell) {
   13821          return 80;
   13822       } else {
   13823          return 80;
   13824       }
   13825    case 6: return 80;
   13826    case 5: return 0;
   13827    case 4:
   13828       if (devinfo->is_g4x) {
   13829          return 0;
   13830       } else {
   13831          return 0;
   13832       }
   13833    default:
   13834       unreachable("Invalid hardware generation");
   13835    }
   13836 }
   13837 
   13838 
   13839 
   13840 /* 3DSTATE_CLIP::User Clip Distance Cull Test Enable Bitmask */
   13841 
   13842 
   13843 #define GEN10_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_bits  8
   13844 #define GEN9_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_bits  8
   13845 #define GEN8_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_bits  8
   13846 #define GEN75_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_bits  8
   13847 #define GEN7_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_bits  8
   13848 #define GEN6_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_bits  8
   13849 
   13850 static inline uint32_t ATTRIBUTE_PURE
   13851 _3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   13852 {
   13853    switch (devinfo->gen) {
   13854    case 10: return 8;
   13855    case 9: return 8;
   13856    case 8: return 8;
   13857    case 7:
   13858       if (devinfo->is_haswell) {
   13859          return 8;
   13860       } else {
   13861          return 8;
   13862       }
   13863    case 6: return 8;
   13864    case 5: return 0;
   13865    case 4:
   13866       if (devinfo->is_g4x) {
   13867          return 0;
   13868       } else {
   13869          return 0;
   13870       }
   13871    default:
   13872       unreachable("Invalid hardware generation");
   13873    }
   13874 }
   13875 
   13876 
   13877 
   13878 #define GEN10_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_start  32
   13879 #define GEN9_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_start  32
   13880 #define GEN8_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_start  32
   13881 #define GEN75_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_start  32
   13882 #define GEN7_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_start  32
   13883 #define GEN6_3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_start  32
   13884 
   13885 static inline uint32_t ATTRIBUTE_PURE
   13886 _3DSTATE_CLIP_UserClipDistanceCullTestEnableBitmask_start(const struct gen_device_info *devinfo)
   13887 {
   13888    switch (devinfo->gen) {
   13889    case 10: return 32;
   13890    case 9: return 32;
   13891    case 8: return 32;
   13892    case 7:
   13893       if (devinfo->is_haswell) {
   13894          return 32;
   13895       } else {
   13896          return 32;
   13897       }
   13898    case 6: return 32;
   13899    case 5: return 0;
   13900    case 4:
   13901       if (devinfo->is_g4x) {
   13902          return 0;
   13903       } else {
   13904          return 0;
   13905       }
   13906    default:
   13907       unreachable("Invalid hardware generation");
   13908    }
   13909 }
   13910 
   13911 
   13912 
   13913 /* 3DSTATE_CLIP::Vertex Sub Pixel Precision Select */
   13914 
   13915 
   13916 #define GEN10_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_bits  1
   13917 #define GEN9_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_bits  1
   13918 #define GEN8_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_bits  1
   13919 #define GEN75_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_bits  1
   13920 #define GEN7_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_bits  1
   13921 
   13922 static inline uint32_t ATTRIBUTE_PURE
   13923 _3DSTATE_CLIP_VertexSubPixelPrecisionSelect_bits(const struct gen_device_info *devinfo)
   13924 {
   13925    switch (devinfo->gen) {
   13926    case 10: return 1;
   13927    case 9: return 1;
   13928    case 8: return 1;
   13929    case 7:
   13930       if (devinfo->is_haswell) {
   13931          return 1;
   13932       } else {
   13933          return 1;
   13934       }
   13935    case 6: return 0;
   13936    case 5: return 0;
   13937    case 4:
   13938       if (devinfo->is_g4x) {
   13939          return 0;
   13940       } else {
   13941          return 0;
   13942       }
   13943    default:
   13944       unreachable("Invalid hardware generation");
   13945    }
   13946 }
   13947 
   13948 
   13949 
   13950 #define GEN10_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_start  51
   13951 #define GEN9_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_start  51
   13952 #define GEN8_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_start  51
   13953 #define GEN75_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_start  51
   13954 #define GEN7_3DSTATE_CLIP_VertexSubPixelPrecisionSelect_start  51
   13955 
   13956 static inline uint32_t ATTRIBUTE_PURE
   13957 _3DSTATE_CLIP_VertexSubPixelPrecisionSelect_start(const struct gen_device_info *devinfo)
   13958 {
   13959    switch (devinfo->gen) {
   13960    case 10: return 51;
   13961    case 9: return 51;
   13962    case 8: return 51;
   13963    case 7:
   13964       if (devinfo->is_haswell) {
   13965          return 51;
   13966       } else {
   13967          return 51;
   13968       }
   13969    case 6: return 0;
   13970    case 5: return 0;
   13971    case 4:
   13972       if (devinfo->is_g4x) {
   13973          return 0;
   13974       } else {
   13975          return 0;
   13976       }
   13977    default:
   13978       unreachable("Invalid hardware generation");
   13979    }
   13980 }
   13981 
   13982 
   13983 
   13984 /* 3DSTATE_CLIP::Viewport XY Clip Test Enable */
   13985 
   13986 
   13987 #define GEN10_3DSTATE_CLIP_ViewportXYClipTestEnable_bits  1
   13988 #define GEN9_3DSTATE_CLIP_ViewportXYClipTestEnable_bits  1
   13989 #define GEN8_3DSTATE_CLIP_ViewportXYClipTestEnable_bits  1
   13990 #define GEN75_3DSTATE_CLIP_ViewportXYClipTestEnable_bits  1
   13991 #define GEN7_3DSTATE_CLIP_ViewportXYClipTestEnable_bits  1
   13992 #define GEN6_3DSTATE_CLIP_ViewportXYClipTestEnable_bits  1
   13993 
   13994 static inline uint32_t ATTRIBUTE_PURE
   13995 _3DSTATE_CLIP_ViewportXYClipTestEnable_bits(const struct gen_device_info *devinfo)
   13996 {
   13997    switch (devinfo->gen) {
   13998    case 10: return 1;
   13999    case 9: return 1;
   14000    case 8: return 1;
   14001    case 7:
   14002       if (devinfo->is_haswell) {
   14003          return 1;
   14004       } else {
   14005          return 1;
   14006       }
   14007    case 6: return 1;
   14008    case 5: return 0;
   14009    case 4:
   14010       if (devinfo->is_g4x) {
   14011          return 0;
   14012       } else {
   14013          return 0;
   14014       }
   14015    default:
   14016       unreachable("Invalid hardware generation");
   14017    }
   14018 }
   14019 
   14020 
   14021 
   14022 #define GEN10_3DSTATE_CLIP_ViewportXYClipTestEnable_start  92
   14023 #define GEN9_3DSTATE_CLIP_ViewportXYClipTestEnable_start  92
   14024 #define GEN8_3DSTATE_CLIP_ViewportXYClipTestEnable_start  92
   14025 #define GEN75_3DSTATE_CLIP_ViewportXYClipTestEnable_start  92
   14026 #define GEN7_3DSTATE_CLIP_ViewportXYClipTestEnable_start  92
   14027 #define GEN6_3DSTATE_CLIP_ViewportXYClipTestEnable_start  92
   14028 
   14029 static inline uint32_t ATTRIBUTE_PURE
   14030 _3DSTATE_CLIP_ViewportXYClipTestEnable_start(const struct gen_device_info *devinfo)
   14031 {
   14032    switch (devinfo->gen) {
   14033    case 10: return 92;
   14034    case 9: return 92;
   14035    case 8: return 92;
   14036    case 7:
   14037       if (devinfo->is_haswell) {
   14038          return 92;
   14039       } else {
   14040          return 92;
   14041       }
   14042    case 6: return 92;
   14043    case 5: return 0;
   14044    case 4:
   14045       if (devinfo->is_g4x) {
   14046          return 0;
   14047       } else {
   14048          return 0;
   14049       }
   14050    default:
   14051       unreachable("Invalid hardware generation");
   14052    }
   14053 }
   14054 
   14055 
   14056 
   14057 /* 3DSTATE_CLIP::Viewport Z Clip Test Enable */
   14058 
   14059 
   14060 #define GEN75_3DSTATE_CLIP_ViewportZClipTestEnable_bits  1
   14061 #define GEN7_3DSTATE_CLIP_ViewportZClipTestEnable_bits  1
   14062 #define GEN6_3DSTATE_CLIP_ViewportZClipTestEnable_bits  1
   14063 
   14064 static inline uint32_t ATTRIBUTE_PURE
   14065 _3DSTATE_CLIP_ViewportZClipTestEnable_bits(const struct gen_device_info *devinfo)
   14066 {
   14067    switch (devinfo->gen) {
   14068    case 10: return 0;
   14069    case 9: return 0;
   14070    case 8: return 0;
   14071    case 7:
   14072       if (devinfo->is_haswell) {
   14073          return 1;
   14074       } else {
   14075          return 1;
   14076       }
   14077    case 6: return 1;
   14078    case 5: return 0;
   14079    case 4:
   14080       if (devinfo->is_g4x) {
   14081          return 0;
   14082       } else {
   14083          return 0;
   14084       }
   14085    default:
   14086       unreachable("Invalid hardware generation");
   14087    }
   14088 }
   14089 
   14090 
   14091 
   14092 #define GEN75_3DSTATE_CLIP_ViewportZClipTestEnable_start  91
   14093 #define GEN7_3DSTATE_CLIP_ViewportZClipTestEnable_start  91
   14094 #define GEN6_3DSTATE_CLIP_ViewportZClipTestEnable_start  91
   14095 
   14096 static inline uint32_t ATTRIBUTE_PURE
   14097 _3DSTATE_CLIP_ViewportZClipTestEnable_start(const struct gen_device_info *devinfo)
   14098 {
   14099    switch (devinfo->gen) {
   14100    case 10: return 0;
   14101    case 9: return 0;
   14102    case 8: return 0;
   14103    case 7:
   14104       if (devinfo->is_haswell) {
   14105          return 91;
   14106       } else {
   14107          return 91;
   14108       }
   14109    case 6: return 91;
   14110    case 5: return 0;
   14111    case 4:
   14112       if (devinfo->is_g4x) {
   14113          return 0;
   14114       } else {
   14115          return 0;
   14116       }
   14117    default:
   14118       unreachable("Invalid hardware generation");
   14119    }
   14120 }
   14121 
   14122 
   14123 
   14124 /* 3DSTATE_CONSTANT_BODY */
   14125 
   14126 
   14127 #define GEN10_3DSTATE_CONSTANT_BODY_length  10
   14128 #define GEN9_3DSTATE_CONSTANT_BODY_length  10
   14129 #define GEN8_3DSTATE_CONSTANT_BODY_length  10
   14130 #define GEN75_3DSTATE_CONSTANT_BODY_length  6
   14131 #define GEN7_3DSTATE_CONSTANT_BODY_length  6
   14132 
   14133 static inline uint32_t ATTRIBUTE_PURE
   14134 _3DSTATE_CONSTANT_BODY_length(const struct gen_device_info *devinfo)
   14135 {
   14136    switch (devinfo->gen) {
   14137    case 10: return 10;
   14138    case 9: return 10;
   14139    case 8: return 10;
   14140    case 7:
   14141       if (devinfo->is_haswell) {
   14142          return 6;
   14143       } else {
   14144          return 6;
   14145       }
   14146    case 6: return 0;
   14147    case 5: return 0;
   14148    case 4:
   14149       if (devinfo->is_g4x) {
   14150          return 0;
   14151       } else {
   14152          return 0;
   14153       }
   14154    default:
   14155       unreachable("Invalid hardware generation");
   14156    }
   14157 }
   14158 
   14159 
   14160 
   14161 /* 3DSTATE_CONSTANT_BODY::Buffer */
   14162 
   14163 
   14164 #define GEN10_3DSTATE_CONSTANT_BODY_Buffer_bits  59
   14165 #define GEN9_3DSTATE_CONSTANT_BODY_Buffer_bits  59
   14166 #define GEN8_3DSTATE_CONSTANT_BODY_Buffer_bits  59
   14167 #define GEN75_3DSTATE_CONSTANT_BODY_Buffer_bits  27
   14168 #define GEN7_3DSTATE_CONSTANT_BODY_Buffer_bits  27
   14169 
   14170 static inline uint32_t ATTRIBUTE_PURE
   14171 _3DSTATE_CONSTANT_BODY_Buffer_bits(const struct gen_device_info *devinfo)
   14172 {
   14173    switch (devinfo->gen) {
   14174    case 10: return 59;
   14175    case 9: return 59;
   14176    case 8: return 59;
   14177    case 7:
   14178       if (devinfo->is_haswell) {
   14179          return 27;
   14180       } else {
   14181          return 27;
   14182       }
   14183    case 6: return 0;
   14184    case 5: return 0;
   14185    case 4:
   14186       if (devinfo->is_g4x) {
   14187          return 0;
   14188       } else {
   14189          return 0;
   14190       }
   14191    default:
   14192       unreachable("Invalid hardware generation");
   14193    }
   14194 }
   14195 
   14196 
   14197 
   14198 #define GEN10_3DSTATE_CONSTANT_BODY_Buffer_start  5
   14199 #define GEN9_3DSTATE_CONSTANT_BODY_Buffer_start  5
   14200 #define GEN8_3DSTATE_CONSTANT_BODY_Buffer_start  5
   14201 #define GEN75_3DSTATE_CONSTANT_BODY_Buffer_start  5
   14202 #define GEN7_3DSTATE_CONSTANT_BODY_Buffer_start  5
   14203 
   14204 static inline uint32_t ATTRIBUTE_PURE
   14205 _3DSTATE_CONSTANT_BODY_Buffer_start(const struct gen_device_info *devinfo)
   14206 {
   14207    switch (devinfo->gen) {
   14208    case 10: return 5;
   14209    case 9: return 5;
   14210    case 8: return 5;
   14211    case 7:
   14212       if (devinfo->is_haswell) {
   14213          return 5;
   14214       } else {
   14215          return 5;
   14216       }
   14217    case 6: return 0;
   14218    case 5: return 0;
   14219    case 4:
   14220       if (devinfo->is_g4x) {
   14221          return 0;
   14222       } else {
   14223          return 0;
   14224       }
   14225    default:
   14226       unreachable("Invalid hardware generation");
   14227    }
   14228 }
   14229 
   14230 
   14231 
   14232 /* 3DSTATE_CONSTANT_BODY::Constant Buffer Object Control State */
   14233 
   14234 
   14235 #define GEN75_3DSTATE_CONSTANT_BODY_ConstantBufferObjectControlState_bits  5
   14236 #define GEN7_3DSTATE_CONSTANT_BODY_ConstantBufferObjectControlState_bits  5
   14237 
   14238 static inline uint32_t ATTRIBUTE_PURE
   14239 _3DSTATE_CONSTANT_BODY_ConstantBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   14240 {
   14241    switch (devinfo->gen) {
   14242    case 10: return 0;
   14243    case 9: return 0;
   14244    case 8: return 0;
   14245    case 7:
   14246       if (devinfo->is_haswell) {
   14247          return 5;
   14248       } else {
   14249          return 5;
   14250       }
   14251    case 6: return 0;
   14252    case 5: return 0;
   14253    case 4:
   14254       if (devinfo->is_g4x) {
   14255          return 0;
   14256       } else {
   14257          return 0;
   14258       }
   14259    default:
   14260       unreachable("Invalid hardware generation");
   14261    }
   14262 }
   14263 
   14264 
   14265 
   14266 #define GEN75_3DSTATE_CONSTANT_BODY_ConstantBufferObjectControlState_start  64
   14267 #define GEN7_3DSTATE_CONSTANT_BODY_ConstantBufferObjectControlState_start  64
   14268 
   14269 static inline uint32_t ATTRIBUTE_PURE
   14270 _3DSTATE_CONSTANT_BODY_ConstantBufferObjectControlState_start(const struct gen_device_info *devinfo)
   14271 {
   14272    switch (devinfo->gen) {
   14273    case 10: return 0;
   14274    case 9: return 0;
   14275    case 8: return 0;
   14276    case 7:
   14277       if (devinfo->is_haswell) {
   14278          return 64;
   14279       } else {
   14280          return 64;
   14281       }
   14282    case 6: return 0;
   14283    case 5: return 0;
   14284    case 4:
   14285       if (devinfo->is_g4x) {
   14286          return 0;
   14287       } else {
   14288          return 0;
   14289       }
   14290    default:
   14291       unreachable("Invalid hardware generation");
   14292    }
   14293 }
   14294 
   14295 
   14296 
   14297 /* 3DSTATE_CONSTANT_BODY::Read Length */
   14298 
   14299 
   14300 #define GEN10_3DSTATE_CONSTANT_BODY_ReadLength_bits  16
   14301 #define GEN9_3DSTATE_CONSTANT_BODY_ReadLength_bits  16
   14302 #define GEN8_3DSTATE_CONSTANT_BODY_ReadLength_bits  16
   14303 #define GEN75_3DSTATE_CONSTANT_BODY_ReadLength_bits  16
   14304 #define GEN7_3DSTATE_CONSTANT_BODY_ReadLength_bits  16
   14305 
   14306 static inline uint32_t ATTRIBUTE_PURE
   14307 _3DSTATE_CONSTANT_BODY_ReadLength_bits(const struct gen_device_info *devinfo)
   14308 {
   14309    switch (devinfo->gen) {
   14310    case 10: return 16;
   14311    case 9: return 16;
   14312    case 8: return 16;
   14313    case 7:
   14314       if (devinfo->is_haswell) {
   14315          return 16;
   14316       } else {
   14317          return 16;
   14318       }
   14319    case 6: return 0;
   14320    case 5: return 0;
   14321    case 4:
   14322       if (devinfo->is_g4x) {
   14323          return 0;
   14324       } else {
   14325          return 0;
   14326       }
   14327    default:
   14328       unreachable("Invalid hardware generation");
   14329    }
   14330 }
   14331 
   14332 
   14333 
   14334 #define GEN10_3DSTATE_CONSTANT_BODY_ReadLength_start  0
   14335 #define GEN9_3DSTATE_CONSTANT_BODY_ReadLength_start  0
   14336 #define GEN8_3DSTATE_CONSTANT_BODY_ReadLength_start  0
   14337 #define GEN75_3DSTATE_CONSTANT_BODY_ReadLength_start  0
   14338 #define GEN7_3DSTATE_CONSTANT_BODY_ReadLength_start  0
   14339 
   14340 static inline uint32_t ATTRIBUTE_PURE
   14341 _3DSTATE_CONSTANT_BODY_ReadLength_start(const struct gen_device_info *devinfo)
   14342 {
   14343    switch (devinfo->gen) {
   14344    case 10: return 0;
   14345    case 9: return 0;
   14346    case 8: return 0;
   14347    case 7:
   14348       if (devinfo->is_haswell) {
   14349          return 0;
   14350       } else {
   14351          return 0;
   14352       }
   14353    case 6: return 0;
   14354    case 5: return 0;
   14355    case 4:
   14356       if (devinfo->is_g4x) {
   14357          return 0;
   14358       } else {
   14359          return 0;
   14360       }
   14361    default:
   14362       unreachable("Invalid hardware generation");
   14363    }
   14364 }
   14365 
   14366 
   14367 
   14368 /* 3DSTATE_CONSTANT_COLOR */
   14369 
   14370 
   14371 #define GEN5_3DSTATE_CONSTANT_COLOR_length  5
   14372 #define GEN45_3DSTATE_CONSTANT_COLOR_length  5
   14373 #define GEN4_3DSTATE_CONSTANT_COLOR_length  5
   14374 
   14375 static inline uint32_t ATTRIBUTE_PURE
   14376 _3DSTATE_CONSTANT_COLOR_length(const struct gen_device_info *devinfo)
   14377 {
   14378    switch (devinfo->gen) {
   14379    case 10: return 0;
   14380    case 9: return 0;
   14381    case 8: return 0;
   14382    case 7:
   14383       if (devinfo->is_haswell) {
   14384          return 0;
   14385       } else {
   14386          return 0;
   14387       }
   14388    case 6: return 0;
   14389    case 5: return 5;
   14390    case 4:
   14391       if (devinfo->is_g4x) {
   14392          return 5;
   14393       } else {
   14394          return 5;
   14395       }
   14396    default:
   14397       unreachable("Invalid hardware generation");
   14398    }
   14399 }
   14400 
   14401 
   14402 
   14403 /* 3DSTATE_CONSTANT_COLOR::3D Command Opcode */
   14404 
   14405 
   14406 #define GEN5_3DSTATE_CONSTANT_COLOR_3DCommandOpcode_bits  3
   14407 #define GEN45_3DSTATE_CONSTANT_COLOR_3DCommandOpcode_bits  3
   14408 #define GEN4_3DSTATE_CONSTANT_COLOR_3DCommandOpcode_bits  3
   14409 
   14410 static inline uint32_t ATTRIBUTE_PURE
   14411 _3DSTATE_CONSTANT_COLOR_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   14412 {
   14413    switch (devinfo->gen) {
   14414    case 10: return 0;
   14415    case 9: return 0;
   14416    case 8: return 0;
   14417    case 7:
   14418       if (devinfo->is_haswell) {
   14419          return 0;
   14420       } else {
   14421          return 0;
   14422       }
   14423    case 6: return 0;
   14424    case 5: return 3;
   14425    case 4:
   14426       if (devinfo->is_g4x) {
   14427          return 3;
   14428       } else {
   14429          return 3;
   14430       }
   14431    default:
   14432       unreachable("Invalid hardware generation");
   14433    }
   14434 }
   14435 
   14436 
   14437 
   14438 #define GEN5_3DSTATE_CONSTANT_COLOR_3DCommandOpcode_start  24
   14439 #define GEN45_3DSTATE_CONSTANT_COLOR_3DCommandOpcode_start  24
   14440 #define GEN4_3DSTATE_CONSTANT_COLOR_3DCommandOpcode_start  24
   14441 
   14442 static inline uint32_t ATTRIBUTE_PURE
   14443 _3DSTATE_CONSTANT_COLOR_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   14444 {
   14445    switch (devinfo->gen) {
   14446    case 10: return 0;
   14447    case 9: return 0;
   14448    case 8: return 0;
   14449    case 7:
   14450       if (devinfo->is_haswell) {
   14451          return 0;
   14452       } else {
   14453          return 0;
   14454       }
   14455    case 6: return 0;
   14456    case 5: return 24;
   14457    case 4:
   14458       if (devinfo->is_g4x) {
   14459          return 24;
   14460       } else {
   14461          return 24;
   14462       }
   14463    default:
   14464       unreachable("Invalid hardware generation");
   14465    }
   14466 }
   14467 
   14468 
   14469 
   14470 /* 3DSTATE_CONSTANT_COLOR::3D Command Sub Opcode */
   14471 
   14472 
   14473 #define GEN5_3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_bits  8
   14474 #define GEN45_3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_bits  8
   14475 #define GEN4_3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_bits  8
   14476 
   14477 static inline uint32_t ATTRIBUTE_PURE
   14478 _3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   14479 {
   14480    switch (devinfo->gen) {
   14481    case 10: return 0;
   14482    case 9: return 0;
   14483    case 8: return 0;
   14484    case 7:
   14485       if (devinfo->is_haswell) {
   14486          return 0;
   14487       } else {
   14488          return 0;
   14489       }
   14490    case 6: return 0;
   14491    case 5: return 8;
   14492    case 4:
   14493       if (devinfo->is_g4x) {
   14494          return 8;
   14495       } else {
   14496          return 8;
   14497       }
   14498    default:
   14499       unreachable("Invalid hardware generation");
   14500    }
   14501 }
   14502 
   14503 
   14504 
   14505 #define GEN5_3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_start  16
   14506 #define GEN45_3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_start  16
   14507 #define GEN4_3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_start  16
   14508 
   14509 static inline uint32_t ATTRIBUTE_PURE
   14510 _3DSTATE_CONSTANT_COLOR_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   14511 {
   14512    switch (devinfo->gen) {
   14513    case 10: return 0;
   14514    case 9: return 0;
   14515    case 8: return 0;
   14516    case 7:
   14517       if (devinfo->is_haswell) {
   14518          return 0;
   14519       } else {
   14520          return 0;
   14521       }
   14522    case 6: return 0;
   14523    case 5: return 16;
   14524    case 4:
   14525       if (devinfo->is_g4x) {
   14526          return 16;
   14527       } else {
   14528          return 16;
   14529       }
   14530    default:
   14531       unreachable("Invalid hardware generation");
   14532    }
   14533 }
   14534 
   14535 
   14536 
   14537 /* 3DSTATE_CONSTANT_COLOR::Blend Constant Color Alpha */
   14538 
   14539 
   14540 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_bits  32
   14541 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_bits  32
   14542 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_bits  32
   14543 
   14544 static inline uint32_t ATTRIBUTE_PURE
   14545 _3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_bits(const struct gen_device_info *devinfo)
   14546 {
   14547    switch (devinfo->gen) {
   14548    case 10: return 0;
   14549    case 9: return 0;
   14550    case 8: return 0;
   14551    case 7:
   14552       if (devinfo->is_haswell) {
   14553          return 0;
   14554       } else {
   14555          return 0;
   14556       }
   14557    case 6: return 0;
   14558    case 5: return 32;
   14559    case 4:
   14560       if (devinfo->is_g4x) {
   14561          return 32;
   14562       } else {
   14563          return 32;
   14564       }
   14565    default:
   14566       unreachable("Invalid hardware generation");
   14567    }
   14568 }
   14569 
   14570 
   14571 
   14572 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_start  128
   14573 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_start  128
   14574 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_start  128
   14575 
   14576 static inline uint32_t ATTRIBUTE_PURE
   14577 _3DSTATE_CONSTANT_COLOR_BlendConstantColorAlpha_start(const struct gen_device_info *devinfo)
   14578 {
   14579    switch (devinfo->gen) {
   14580    case 10: return 0;
   14581    case 9: return 0;
   14582    case 8: return 0;
   14583    case 7:
   14584       if (devinfo->is_haswell) {
   14585          return 0;
   14586       } else {
   14587          return 0;
   14588       }
   14589    case 6: return 0;
   14590    case 5: return 128;
   14591    case 4:
   14592       if (devinfo->is_g4x) {
   14593          return 128;
   14594       } else {
   14595          return 128;
   14596       }
   14597    default:
   14598       unreachable("Invalid hardware generation");
   14599    }
   14600 }
   14601 
   14602 
   14603 
   14604 /* 3DSTATE_CONSTANT_COLOR::Blend Constant Color Blue */
   14605 
   14606 
   14607 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_bits  32
   14608 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_bits  32
   14609 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_bits  32
   14610 
   14611 static inline uint32_t ATTRIBUTE_PURE
   14612 _3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_bits(const struct gen_device_info *devinfo)
   14613 {
   14614    switch (devinfo->gen) {
   14615    case 10: return 0;
   14616    case 9: return 0;
   14617    case 8: return 0;
   14618    case 7:
   14619       if (devinfo->is_haswell) {
   14620          return 0;
   14621       } else {
   14622          return 0;
   14623       }
   14624    case 6: return 0;
   14625    case 5: return 32;
   14626    case 4:
   14627       if (devinfo->is_g4x) {
   14628          return 32;
   14629       } else {
   14630          return 32;
   14631       }
   14632    default:
   14633       unreachable("Invalid hardware generation");
   14634    }
   14635 }
   14636 
   14637 
   14638 
   14639 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_start  96
   14640 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_start  96
   14641 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_start  96
   14642 
   14643 static inline uint32_t ATTRIBUTE_PURE
   14644 _3DSTATE_CONSTANT_COLOR_BlendConstantColorBlue_start(const struct gen_device_info *devinfo)
   14645 {
   14646    switch (devinfo->gen) {
   14647    case 10: return 0;
   14648    case 9: return 0;
   14649    case 8: return 0;
   14650    case 7:
   14651       if (devinfo->is_haswell) {
   14652          return 0;
   14653       } else {
   14654          return 0;
   14655       }
   14656    case 6: return 0;
   14657    case 5: return 96;
   14658    case 4:
   14659       if (devinfo->is_g4x) {
   14660          return 96;
   14661       } else {
   14662          return 96;
   14663       }
   14664    default:
   14665       unreachable("Invalid hardware generation");
   14666    }
   14667 }
   14668 
   14669 
   14670 
   14671 /* 3DSTATE_CONSTANT_COLOR::Blend Constant Color Green */
   14672 
   14673 
   14674 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_bits  32
   14675 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_bits  32
   14676 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_bits  32
   14677 
   14678 static inline uint32_t ATTRIBUTE_PURE
   14679 _3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_bits(const struct gen_device_info *devinfo)
   14680 {
   14681    switch (devinfo->gen) {
   14682    case 10: return 0;
   14683    case 9: return 0;
   14684    case 8: return 0;
   14685    case 7:
   14686       if (devinfo->is_haswell) {
   14687          return 0;
   14688       } else {
   14689          return 0;
   14690       }
   14691    case 6: return 0;
   14692    case 5: return 32;
   14693    case 4:
   14694       if (devinfo->is_g4x) {
   14695          return 32;
   14696       } else {
   14697          return 32;
   14698       }
   14699    default:
   14700       unreachable("Invalid hardware generation");
   14701    }
   14702 }
   14703 
   14704 
   14705 
   14706 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_start  64
   14707 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_start  64
   14708 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_start  64
   14709 
   14710 static inline uint32_t ATTRIBUTE_PURE
   14711 _3DSTATE_CONSTANT_COLOR_BlendConstantColorGreen_start(const struct gen_device_info *devinfo)
   14712 {
   14713    switch (devinfo->gen) {
   14714    case 10: return 0;
   14715    case 9: return 0;
   14716    case 8: return 0;
   14717    case 7:
   14718       if (devinfo->is_haswell) {
   14719          return 0;
   14720       } else {
   14721          return 0;
   14722       }
   14723    case 6: return 0;
   14724    case 5: return 64;
   14725    case 4:
   14726       if (devinfo->is_g4x) {
   14727          return 64;
   14728       } else {
   14729          return 64;
   14730       }
   14731    default:
   14732       unreachable("Invalid hardware generation");
   14733    }
   14734 }
   14735 
   14736 
   14737 
   14738 /* 3DSTATE_CONSTANT_COLOR::Blend Constant Color Red */
   14739 
   14740 
   14741 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_bits  32
   14742 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_bits  32
   14743 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_bits  32
   14744 
   14745 static inline uint32_t ATTRIBUTE_PURE
   14746 _3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_bits(const struct gen_device_info *devinfo)
   14747 {
   14748    switch (devinfo->gen) {
   14749    case 10: return 0;
   14750    case 9: return 0;
   14751    case 8: return 0;
   14752    case 7:
   14753       if (devinfo->is_haswell) {
   14754          return 0;
   14755       } else {
   14756          return 0;
   14757       }
   14758    case 6: return 0;
   14759    case 5: return 32;
   14760    case 4:
   14761       if (devinfo->is_g4x) {
   14762          return 32;
   14763       } else {
   14764          return 32;
   14765       }
   14766    default:
   14767       unreachable("Invalid hardware generation");
   14768    }
   14769 }
   14770 
   14771 
   14772 
   14773 #define GEN5_3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_start  32
   14774 #define GEN45_3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_start  32
   14775 #define GEN4_3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_start  32
   14776 
   14777 static inline uint32_t ATTRIBUTE_PURE
   14778 _3DSTATE_CONSTANT_COLOR_BlendConstantColorRed_start(const struct gen_device_info *devinfo)
   14779 {
   14780    switch (devinfo->gen) {
   14781    case 10: return 0;
   14782    case 9: return 0;
   14783    case 8: return 0;
   14784    case 7:
   14785       if (devinfo->is_haswell) {
   14786          return 0;
   14787       } else {
   14788          return 0;
   14789       }
   14790    case 6: return 0;
   14791    case 5: return 32;
   14792    case 4:
   14793       if (devinfo->is_g4x) {
   14794          return 32;
   14795       } else {
   14796          return 32;
   14797       }
   14798    default:
   14799       unreachable("Invalid hardware generation");
   14800    }
   14801 }
   14802 
   14803 
   14804 
   14805 /* 3DSTATE_CONSTANT_COLOR::Command SubType */
   14806 
   14807 
   14808 #define GEN5_3DSTATE_CONSTANT_COLOR_CommandSubType_bits  2
   14809 #define GEN45_3DSTATE_CONSTANT_COLOR_CommandSubType_bits  2
   14810 #define GEN4_3DSTATE_CONSTANT_COLOR_CommandSubType_bits  2
   14811 
   14812 static inline uint32_t ATTRIBUTE_PURE
   14813 _3DSTATE_CONSTANT_COLOR_CommandSubType_bits(const struct gen_device_info *devinfo)
   14814 {
   14815    switch (devinfo->gen) {
   14816    case 10: return 0;
   14817    case 9: return 0;
   14818    case 8: return 0;
   14819    case 7:
   14820       if (devinfo->is_haswell) {
   14821          return 0;
   14822       } else {
   14823          return 0;
   14824       }
   14825    case 6: return 0;
   14826    case 5: return 2;
   14827    case 4:
   14828       if (devinfo->is_g4x) {
   14829          return 2;
   14830       } else {
   14831          return 2;
   14832       }
   14833    default:
   14834       unreachable("Invalid hardware generation");
   14835    }
   14836 }
   14837 
   14838 
   14839 
   14840 #define GEN5_3DSTATE_CONSTANT_COLOR_CommandSubType_start  27
   14841 #define GEN45_3DSTATE_CONSTANT_COLOR_CommandSubType_start  27
   14842 #define GEN4_3DSTATE_CONSTANT_COLOR_CommandSubType_start  27
   14843 
   14844 static inline uint32_t ATTRIBUTE_PURE
   14845 _3DSTATE_CONSTANT_COLOR_CommandSubType_start(const struct gen_device_info *devinfo)
   14846 {
   14847    switch (devinfo->gen) {
   14848    case 10: return 0;
   14849    case 9: return 0;
   14850    case 8: return 0;
   14851    case 7:
   14852       if (devinfo->is_haswell) {
   14853          return 0;
   14854       } else {
   14855          return 0;
   14856       }
   14857    case 6: return 0;
   14858    case 5: return 27;
   14859    case 4:
   14860       if (devinfo->is_g4x) {
   14861          return 27;
   14862       } else {
   14863          return 27;
   14864       }
   14865    default:
   14866       unreachable("Invalid hardware generation");
   14867    }
   14868 }
   14869 
   14870 
   14871 
   14872 /* 3DSTATE_CONSTANT_COLOR::Command Type */
   14873 
   14874 
   14875 #define GEN5_3DSTATE_CONSTANT_COLOR_CommandType_bits  3
   14876 #define GEN45_3DSTATE_CONSTANT_COLOR_CommandType_bits  3
   14877 #define GEN4_3DSTATE_CONSTANT_COLOR_CommandType_bits  3
   14878 
   14879 static inline uint32_t ATTRIBUTE_PURE
   14880 _3DSTATE_CONSTANT_COLOR_CommandType_bits(const struct gen_device_info *devinfo)
   14881 {
   14882    switch (devinfo->gen) {
   14883    case 10: return 0;
   14884    case 9: return 0;
   14885    case 8: return 0;
   14886    case 7:
   14887       if (devinfo->is_haswell) {
   14888          return 0;
   14889       } else {
   14890          return 0;
   14891       }
   14892    case 6: return 0;
   14893    case 5: return 3;
   14894    case 4:
   14895       if (devinfo->is_g4x) {
   14896          return 3;
   14897       } else {
   14898          return 3;
   14899       }
   14900    default:
   14901       unreachable("Invalid hardware generation");
   14902    }
   14903 }
   14904 
   14905 
   14906 
   14907 #define GEN5_3DSTATE_CONSTANT_COLOR_CommandType_start  29
   14908 #define GEN45_3DSTATE_CONSTANT_COLOR_CommandType_start  29
   14909 #define GEN4_3DSTATE_CONSTANT_COLOR_CommandType_start  29
   14910 
   14911 static inline uint32_t ATTRIBUTE_PURE
   14912 _3DSTATE_CONSTANT_COLOR_CommandType_start(const struct gen_device_info *devinfo)
   14913 {
   14914    switch (devinfo->gen) {
   14915    case 10: return 0;
   14916    case 9: return 0;
   14917    case 8: return 0;
   14918    case 7:
   14919       if (devinfo->is_haswell) {
   14920          return 0;
   14921       } else {
   14922          return 0;
   14923       }
   14924    case 6: return 0;
   14925    case 5: return 29;
   14926    case 4:
   14927       if (devinfo->is_g4x) {
   14928          return 29;
   14929       } else {
   14930          return 29;
   14931       }
   14932    default:
   14933       unreachable("Invalid hardware generation");
   14934    }
   14935 }
   14936 
   14937 
   14938 
   14939 /* 3DSTATE_CONSTANT_COLOR::DWord Length */
   14940 
   14941 
   14942 #define GEN5_3DSTATE_CONSTANT_COLOR_DWordLength_bits  8
   14943 #define GEN45_3DSTATE_CONSTANT_COLOR_DWordLength_bits  8
   14944 #define GEN4_3DSTATE_CONSTANT_COLOR_DWordLength_bits  8
   14945 
   14946 static inline uint32_t ATTRIBUTE_PURE
   14947 _3DSTATE_CONSTANT_COLOR_DWordLength_bits(const struct gen_device_info *devinfo)
   14948 {
   14949    switch (devinfo->gen) {
   14950    case 10: return 0;
   14951    case 9: return 0;
   14952    case 8: return 0;
   14953    case 7:
   14954       if (devinfo->is_haswell) {
   14955          return 0;
   14956       } else {
   14957          return 0;
   14958       }
   14959    case 6: return 0;
   14960    case 5: return 8;
   14961    case 4:
   14962       if (devinfo->is_g4x) {
   14963          return 8;
   14964       } else {
   14965          return 8;
   14966       }
   14967    default:
   14968       unreachable("Invalid hardware generation");
   14969    }
   14970 }
   14971 
   14972 
   14973 
   14974 #define GEN5_3DSTATE_CONSTANT_COLOR_DWordLength_start  0
   14975 #define GEN45_3DSTATE_CONSTANT_COLOR_DWordLength_start  0
   14976 #define GEN4_3DSTATE_CONSTANT_COLOR_DWordLength_start  0
   14977 
   14978 static inline uint32_t ATTRIBUTE_PURE
   14979 _3DSTATE_CONSTANT_COLOR_DWordLength_start(const struct gen_device_info *devinfo)
   14980 {
   14981    switch (devinfo->gen) {
   14982    case 10: return 0;
   14983    case 9: return 0;
   14984    case 8: return 0;
   14985    case 7:
   14986       if (devinfo->is_haswell) {
   14987          return 0;
   14988       } else {
   14989          return 0;
   14990       }
   14991    case 6: return 0;
   14992    case 5: return 0;
   14993    case 4:
   14994       if (devinfo->is_g4x) {
   14995          return 0;
   14996       } else {
   14997          return 0;
   14998       }
   14999    default:
   15000       unreachable("Invalid hardware generation");
   15001    }
   15002 }
   15003 
   15004 
   15005 
   15006 /* 3DSTATE_CONSTANT_DS */
   15007 
   15008 
   15009 #define GEN10_3DSTATE_CONSTANT_DS_length  11
   15010 #define GEN9_3DSTATE_CONSTANT_DS_length  11
   15011 #define GEN8_3DSTATE_CONSTANT_DS_length  11
   15012 #define GEN75_3DSTATE_CONSTANT_DS_length  7
   15013 #define GEN7_3DSTATE_CONSTANT_DS_length  7
   15014 
   15015 static inline uint32_t ATTRIBUTE_PURE
   15016 _3DSTATE_CONSTANT_DS_length(const struct gen_device_info *devinfo)
   15017 {
   15018    switch (devinfo->gen) {
   15019    case 10: return 11;
   15020    case 9: return 11;
   15021    case 8: return 11;
   15022    case 7:
   15023       if (devinfo->is_haswell) {
   15024          return 7;
   15025       } else {
   15026          return 7;
   15027       }
   15028    case 6: return 0;
   15029    case 5: return 0;
   15030    case 4:
   15031       if (devinfo->is_g4x) {
   15032          return 0;
   15033       } else {
   15034          return 0;
   15035       }
   15036    default:
   15037       unreachable("Invalid hardware generation");
   15038    }
   15039 }
   15040 
   15041 
   15042 
   15043 /* 3DSTATE_CONSTANT_DS::3D Command Opcode */
   15044 
   15045 
   15046 #define GEN10_3DSTATE_CONSTANT_DS_3DCommandOpcode_bits  3
   15047 #define GEN9_3DSTATE_CONSTANT_DS_3DCommandOpcode_bits  3
   15048 #define GEN8_3DSTATE_CONSTANT_DS_3DCommandOpcode_bits  3
   15049 #define GEN75_3DSTATE_CONSTANT_DS_3DCommandOpcode_bits  3
   15050 #define GEN7_3DSTATE_CONSTANT_DS_3DCommandOpcode_bits  3
   15051 
   15052 static inline uint32_t ATTRIBUTE_PURE
   15053 _3DSTATE_CONSTANT_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   15054 {
   15055    switch (devinfo->gen) {
   15056    case 10: return 3;
   15057    case 9: return 3;
   15058    case 8: return 3;
   15059    case 7:
   15060       if (devinfo->is_haswell) {
   15061          return 3;
   15062       } else {
   15063          return 3;
   15064       }
   15065    case 6: return 0;
   15066    case 5: return 0;
   15067    case 4:
   15068       if (devinfo->is_g4x) {
   15069          return 0;
   15070       } else {
   15071          return 0;
   15072       }
   15073    default:
   15074       unreachable("Invalid hardware generation");
   15075    }
   15076 }
   15077 
   15078 
   15079 
   15080 #define GEN10_3DSTATE_CONSTANT_DS_3DCommandOpcode_start  24
   15081 #define GEN9_3DSTATE_CONSTANT_DS_3DCommandOpcode_start  24
   15082 #define GEN8_3DSTATE_CONSTANT_DS_3DCommandOpcode_start  24
   15083 #define GEN75_3DSTATE_CONSTANT_DS_3DCommandOpcode_start  24
   15084 #define GEN7_3DSTATE_CONSTANT_DS_3DCommandOpcode_start  24
   15085 
   15086 static inline uint32_t ATTRIBUTE_PURE
   15087 _3DSTATE_CONSTANT_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   15088 {
   15089    switch (devinfo->gen) {
   15090    case 10: return 24;
   15091    case 9: return 24;
   15092    case 8: return 24;
   15093    case 7:
   15094       if (devinfo->is_haswell) {
   15095          return 24;
   15096       } else {
   15097          return 24;
   15098       }
   15099    case 6: return 0;
   15100    case 5: return 0;
   15101    case 4:
   15102       if (devinfo->is_g4x) {
   15103          return 0;
   15104       } else {
   15105          return 0;
   15106       }
   15107    default:
   15108       unreachable("Invalid hardware generation");
   15109    }
   15110 }
   15111 
   15112 
   15113 
   15114 /* 3DSTATE_CONSTANT_DS::3D Command Sub Opcode */
   15115 
   15116 
   15117 #define GEN10_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_bits  8
   15118 #define GEN9_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_bits  8
   15119 #define GEN8_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_bits  8
   15120 #define GEN75_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_bits  8
   15121 #define GEN7_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_bits  8
   15122 
   15123 static inline uint32_t ATTRIBUTE_PURE
   15124 _3DSTATE_CONSTANT_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   15125 {
   15126    switch (devinfo->gen) {
   15127    case 10: return 8;
   15128    case 9: return 8;
   15129    case 8: return 8;
   15130    case 7:
   15131       if (devinfo->is_haswell) {
   15132          return 8;
   15133       } else {
   15134          return 8;
   15135       }
   15136    case 6: return 0;
   15137    case 5: return 0;
   15138    case 4:
   15139       if (devinfo->is_g4x) {
   15140          return 0;
   15141       } else {
   15142          return 0;
   15143       }
   15144    default:
   15145       unreachable("Invalid hardware generation");
   15146    }
   15147 }
   15148 
   15149 
   15150 
   15151 #define GEN10_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_start  16
   15152 #define GEN9_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_start  16
   15153 #define GEN8_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_start  16
   15154 #define GEN75_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_start  16
   15155 #define GEN7_3DSTATE_CONSTANT_DS_3DCommandSubOpcode_start  16
   15156 
   15157 static inline uint32_t ATTRIBUTE_PURE
   15158 _3DSTATE_CONSTANT_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   15159 {
   15160    switch (devinfo->gen) {
   15161    case 10: return 16;
   15162    case 9: return 16;
   15163    case 8: return 16;
   15164    case 7:
   15165       if (devinfo->is_haswell) {
   15166          return 16;
   15167       } else {
   15168          return 16;
   15169       }
   15170    case 6: return 0;
   15171    case 5: return 0;
   15172    case 4:
   15173       if (devinfo->is_g4x) {
   15174          return 0;
   15175       } else {
   15176          return 0;
   15177       }
   15178    default:
   15179       unreachable("Invalid hardware generation");
   15180    }
   15181 }
   15182 
   15183 
   15184 
   15185 /* 3DSTATE_CONSTANT_DS::Command SubType */
   15186 
   15187 
   15188 #define GEN10_3DSTATE_CONSTANT_DS_CommandSubType_bits  2
   15189 #define GEN9_3DSTATE_CONSTANT_DS_CommandSubType_bits  2
   15190 #define GEN8_3DSTATE_CONSTANT_DS_CommandSubType_bits  2
   15191 #define GEN75_3DSTATE_CONSTANT_DS_CommandSubType_bits  2
   15192 #define GEN7_3DSTATE_CONSTANT_DS_CommandSubType_bits  2
   15193 
   15194 static inline uint32_t ATTRIBUTE_PURE
   15195 _3DSTATE_CONSTANT_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   15196 {
   15197    switch (devinfo->gen) {
   15198    case 10: return 2;
   15199    case 9: return 2;
   15200    case 8: return 2;
   15201    case 7:
   15202       if (devinfo->is_haswell) {
   15203          return 2;
   15204       } else {
   15205          return 2;
   15206       }
   15207    case 6: return 0;
   15208    case 5: return 0;
   15209    case 4:
   15210       if (devinfo->is_g4x) {
   15211          return 0;
   15212       } else {
   15213          return 0;
   15214       }
   15215    default:
   15216       unreachable("Invalid hardware generation");
   15217    }
   15218 }
   15219 
   15220 
   15221 
   15222 #define GEN10_3DSTATE_CONSTANT_DS_CommandSubType_start  27
   15223 #define GEN9_3DSTATE_CONSTANT_DS_CommandSubType_start  27
   15224 #define GEN8_3DSTATE_CONSTANT_DS_CommandSubType_start  27
   15225 #define GEN75_3DSTATE_CONSTANT_DS_CommandSubType_start  27
   15226 #define GEN7_3DSTATE_CONSTANT_DS_CommandSubType_start  27
   15227 
   15228 static inline uint32_t ATTRIBUTE_PURE
   15229 _3DSTATE_CONSTANT_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   15230 {
   15231    switch (devinfo->gen) {
   15232    case 10: return 27;
   15233    case 9: return 27;
   15234    case 8: return 27;
   15235    case 7:
   15236       if (devinfo->is_haswell) {
   15237          return 27;
   15238       } else {
   15239          return 27;
   15240       }
   15241    case 6: return 0;
   15242    case 5: return 0;
   15243    case 4:
   15244       if (devinfo->is_g4x) {
   15245          return 0;
   15246       } else {
   15247          return 0;
   15248       }
   15249    default:
   15250       unreachable("Invalid hardware generation");
   15251    }
   15252 }
   15253 
   15254 
   15255 
   15256 /* 3DSTATE_CONSTANT_DS::Command Type */
   15257 
   15258 
   15259 #define GEN10_3DSTATE_CONSTANT_DS_CommandType_bits  3
   15260 #define GEN9_3DSTATE_CONSTANT_DS_CommandType_bits  3
   15261 #define GEN8_3DSTATE_CONSTANT_DS_CommandType_bits  3
   15262 #define GEN75_3DSTATE_CONSTANT_DS_CommandType_bits  3
   15263 #define GEN7_3DSTATE_CONSTANT_DS_CommandType_bits  3
   15264 
   15265 static inline uint32_t ATTRIBUTE_PURE
   15266 _3DSTATE_CONSTANT_DS_CommandType_bits(const struct gen_device_info *devinfo)
   15267 {
   15268    switch (devinfo->gen) {
   15269    case 10: return 3;
   15270    case 9: return 3;
   15271    case 8: return 3;
   15272    case 7:
   15273       if (devinfo->is_haswell) {
   15274          return 3;
   15275       } else {
   15276          return 3;
   15277       }
   15278    case 6: return 0;
   15279    case 5: return 0;
   15280    case 4:
   15281       if (devinfo->is_g4x) {
   15282          return 0;
   15283       } else {
   15284          return 0;
   15285       }
   15286    default:
   15287       unreachable("Invalid hardware generation");
   15288    }
   15289 }
   15290 
   15291 
   15292 
   15293 #define GEN10_3DSTATE_CONSTANT_DS_CommandType_start  29
   15294 #define GEN9_3DSTATE_CONSTANT_DS_CommandType_start  29
   15295 #define GEN8_3DSTATE_CONSTANT_DS_CommandType_start  29
   15296 #define GEN75_3DSTATE_CONSTANT_DS_CommandType_start  29
   15297 #define GEN7_3DSTATE_CONSTANT_DS_CommandType_start  29
   15298 
   15299 static inline uint32_t ATTRIBUTE_PURE
   15300 _3DSTATE_CONSTANT_DS_CommandType_start(const struct gen_device_info *devinfo)
   15301 {
   15302    switch (devinfo->gen) {
   15303    case 10: return 29;
   15304    case 9: return 29;
   15305    case 8: return 29;
   15306    case 7:
   15307       if (devinfo->is_haswell) {
   15308          return 29;
   15309       } else {
   15310          return 29;
   15311       }
   15312    case 6: return 0;
   15313    case 5: return 0;
   15314    case 4:
   15315       if (devinfo->is_g4x) {
   15316          return 0;
   15317       } else {
   15318          return 0;
   15319       }
   15320    default:
   15321       unreachable("Invalid hardware generation");
   15322    }
   15323 }
   15324 
   15325 
   15326 
   15327 /* 3DSTATE_CONSTANT_DS::Constant Body */
   15328 
   15329 
   15330 #define GEN10_3DSTATE_CONSTANT_DS_ConstantBody_bits  320
   15331 #define GEN9_3DSTATE_CONSTANT_DS_ConstantBody_bits  320
   15332 #define GEN8_3DSTATE_CONSTANT_DS_ConstantBody_bits  320
   15333 #define GEN75_3DSTATE_CONSTANT_DS_ConstantBody_bits  192
   15334 #define GEN7_3DSTATE_CONSTANT_DS_ConstantBody_bits  192
   15335 
   15336 static inline uint32_t ATTRIBUTE_PURE
   15337 _3DSTATE_CONSTANT_DS_ConstantBody_bits(const struct gen_device_info *devinfo)
   15338 {
   15339    switch (devinfo->gen) {
   15340    case 10: return 320;
   15341    case 9: return 320;
   15342    case 8: return 320;
   15343    case 7:
   15344       if (devinfo->is_haswell) {
   15345          return 192;
   15346       } else {
   15347          return 192;
   15348       }
   15349    case 6: return 0;
   15350    case 5: return 0;
   15351    case 4:
   15352       if (devinfo->is_g4x) {
   15353          return 0;
   15354       } else {
   15355          return 0;
   15356       }
   15357    default:
   15358       unreachable("Invalid hardware generation");
   15359    }
   15360 }
   15361 
   15362 
   15363 
   15364 #define GEN10_3DSTATE_CONSTANT_DS_ConstantBody_start  32
   15365 #define GEN9_3DSTATE_CONSTANT_DS_ConstantBody_start  32
   15366 #define GEN8_3DSTATE_CONSTANT_DS_ConstantBody_start  32
   15367 #define GEN75_3DSTATE_CONSTANT_DS_ConstantBody_start  32
   15368 #define GEN7_3DSTATE_CONSTANT_DS_ConstantBody_start  32
   15369 
   15370 static inline uint32_t ATTRIBUTE_PURE
   15371 _3DSTATE_CONSTANT_DS_ConstantBody_start(const struct gen_device_info *devinfo)
   15372 {
   15373    switch (devinfo->gen) {
   15374    case 10: return 32;
   15375    case 9: return 32;
   15376    case 8: return 32;
   15377    case 7:
   15378       if (devinfo->is_haswell) {
   15379          return 32;
   15380       } else {
   15381          return 32;
   15382       }
   15383    case 6: return 0;
   15384    case 5: return 0;
   15385    case 4:
   15386       if (devinfo->is_g4x) {
   15387          return 0;
   15388       } else {
   15389          return 0;
   15390       }
   15391    default:
   15392       unreachable("Invalid hardware generation");
   15393    }
   15394 }
   15395 
   15396 
   15397 
   15398 /* 3DSTATE_CONSTANT_DS::Constant Buffer Object Control State */
   15399 
   15400 
   15401 #define GEN10_3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_bits  7
   15402 #define GEN9_3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_bits  7
   15403 #define GEN8_3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_bits  7
   15404 
   15405 static inline uint32_t ATTRIBUTE_PURE
   15406 _3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   15407 {
   15408    switch (devinfo->gen) {
   15409    case 10: return 7;
   15410    case 9: return 7;
   15411    case 8: return 7;
   15412    case 7:
   15413       if (devinfo->is_haswell) {
   15414          return 0;
   15415       } else {
   15416          return 0;
   15417       }
   15418    case 6: return 0;
   15419    case 5: return 0;
   15420    case 4:
   15421       if (devinfo->is_g4x) {
   15422          return 0;
   15423       } else {
   15424          return 0;
   15425       }
   15426    default:
   15427       unreachable("Invalid hardware generation");
   15428    }
   15429 }
   15430 
   15431 
   15432 
   15433 #define GEN10_3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_start  8
   15434 #define GEN9_3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_start  8
   15435 #define GEN8_3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_start  8
   15436 
   15437 static inline uint32_t ATTRIBUTE_PURE
   15438 _3DSTATE_CONSTANT_DS_ConstantBufferObjectControlState_start(const struct gen_device_info *devinfo)
   15439 {
   15440    switch (devinfo->gen) {
   15441    case 10: return 8;
   15442    case 9: return 8;
   15443    case 8: return 8;
   15444    case 7:
   15445       if (devinfo->is_haswell) {
   15446          return 0;
   15447       } else {
   15448          return 0;
   15449       }
   15450    case 6: return 0;
   15451    case 5: return 0;
   15452    case 4:
   15453       if (devinfo->is_g4x) {
   15454          return 0;
   15455       } else {
   15456          return 0;
   15457       }
   15458    default:
   15459       unreachable("Invalid hardware generation");
   15460    }
   15461 }
   15462 
   15463 
   15464 
   15465 /* 3DSTATE_CONSTANT_DS::DWord Length */
   15466 
   15467 
   15468 #define GEN10_3DSTATE_CONSTANT_DS_DWordLength_bits  8
   15469 #define GEN9_3DSTATE_CONSTANT_DS_DWordLength_bits  8
   15470 #define GEN8_3DSTATE_CONSTANT_DS_DWordLength_bits  8
   15471 #define GEN75_3DSTATE_CONSTANT_DS_DWordLength_bits  8
   15472 #define GEN7_3DSTATE_CONSTANT_DS_DWordLength_bits  8
   15473 
   15474 static inline uint32_t ATTRIBUTE_PURE
   15475 _3DSTATE_CONSTANT_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   15476 {
   15477    switch (devinfo->gen) {
   15478    case 10: return 8;
   15479    case 9: return 8;
   15480    case 8: return 8;
   15481    case 7:
   15482       if (devinfo->is_haswell) {
   15483          return 8;
   15484       } else {
   15485          return 8;
   15486       }
   15487    case 6: return 0;
   15488    case 5: return 0;
   15489    case 4:
   15490       if (devinfo->is_g4x) {
   15491          return 0;
   15492       } else {
   15493          return 0;
   15494       }
   15495    default:
   15496       unreachable("Invalid hardware generation");
   15497    }
   15498 }
   15499 
   15500 
   15501 
   15502 #define GEN10_3DSTATE_CONSTANT_DS_DWordLength_start  0
   15503 #define GEN9_3DSTATE_CONSTANT_DS_DWordLength_start  0
   15504 #define GEN8_3DSTATE_CONSTANT_DS_DWordLength_start  0
   15505 #define GEN75_3DSTATE_CONSTANT_DS_DWordLength_start  0
   15506 #define GEN7_3DSTATE_CONSTANT_DS_DWordLength_start  0
   15507 
   15508 static inline uint32_t ATTRIBUTE_PURE
   15509 _3DSTATE_CONSTANT_DS_DWordLength_start(const struct gen_device_info *devinfo)
   15510 {
   15511    switch (devinfo->gen) {
   15512    case 10: return 0;
   15513    case 9: return 0;
   15514    case 8: return 0;
   15515    case 7:
   15516       if (devinfo->is_haswell) {
   15517          return 0;
   15518       } else {
   15519          return 0;
   15520       }
   15521    case 6: return 0;
   15522    case 5: return 0;
   15523    case 4:
   15524       if (devinfo->is_g4x) {
   15525          return 0;
   15526       } else {
   15527          return 0;
   15528       }
   15529    default:
   15530       unreachable("Invalid hardware generation");
   15531    }
   15532 }
   15533 
   15534 
   15535 
   15536 /* 3DSTATE_CONSTANT_GS */
   15537 
   15538 
   15539 #define GEN10_3DSTATE_CONSTANT_GS_length  11
   15540 #define GEN9_3DSTATE_CONSTANT_GS_length  11
   15541 #define GEN8_3DSTATE_CONSTANT_GS_length  11
   15542 #define GEN75_3DSTATE_CONSTANT_GS_length  7
   15543 #define GEN7_3DSTATE_CONSTANT_GS_length  7
   15544 #define GEN6_3DSTATE_CONSTANT_GS_length  5
   15545 
   15546 static inline uint32_t ATTRIBUTE_PURE
   15547 _3DSTATE_CONSTANT_GS_length(const struct gen_device_info *devinfo)
   15548 {
   15549    switch (devinfo->gen) {
   15550    case 10: return 11;
   15551    case 9: return 11;
   15552    case 8: return 11;
   15553    case 7:
   15554       if (devinfo->is_haswell) {
   15555          return 7;
   15556       } else {
   15557          return 7;
   15558       }
   15559    case 6: return 5;
   15560    case 5: return 0;
   15561    case 4:
   15562       if (devinfo->is_g4x) {
   15563          return 0;
   15564       } else {
   15565          return 0;
   15566       }
   15567    default:
   15568       unreachable("Invalid hardware generation");
   15569    }
   15570 }
   15571 
   15572 
   15573 
   15574 /* 3DSTATE_CONSTANT_GS::3D Command Opcode */
   15575 
   15576 
   15577 #define GEN10_3DSTATE_CONSTANT_GS_3DCommandOpcode_bits  3
   15578 #define GEN9_3DSTATE_CONSTANT_GS_3DCommandOpcode_bits  3
   15579 #define GEN8_3DSTATE_CONSTANT_GS_3DCommandOpcode_bits  3
   15580 #define GEN75_3DSTATE_CONSTANT_GS_3DCommandOpcode_bits  3
   15581 #define GEN7_3DSTATE_CONSTANT_GS_3DCommandOpcode_bits  3
   15582 #define GEN6_3DSTATE_CONSTANT_GS_3DCommandOpcode_bits  3
   15583 
   15584 static inline uint32_t ATTRIBUTE_PURE
   15585 _3DSTATE_CONSTANT_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   15586 {
   15587    switch (devinfo->gen) {
   15588    case 10: return 3;
   15589    case 9: return 3;
   15590    case 8: return 3;
   15591    case 7:
   15592       if (devinfo->is_haswell) {
   15593          return 3;
   15594       } else {
   15595          return 3;
   15596       }
   15597    case 6: return 3;
   15598    case 5: return 0;
   15599    case 4:
   15600       if (devinfo->is_g4x) {
   15601          return 0;
   15602       } else {
   15603          return 0;
   15604       }
   15605    default:
   15606       unreachable("Invalid hardware generation");
   15607    }
   15608 }
   15609 
   15610 
   15611 
   15612 #define GEN10_3DSTATE_CONSTANT_GS_3DCommandOpcode_start  24
   15613 #define GEN9_3DSTATE_CONSTANT_GS_3DCommandOpcode_start  24
   15614 #define GEN8_3DSTATE_CONSTANT_GS_3DCommandOpcode_start  24
   15615 #define GEN75_3DSTATE_CONSTANT_GS_3DCommandOpcode_start  24
   15616 #define GEN7_3DSTATE_CONSTANT_GS_3DCommandOpcode_start  24
   15617 #define GEN6_3DSTATE_CONSTANT_GS_3DCommandOpcode_start  24
   15618 
   15619 static inline uint32_t ATTRIBUTE_PURE
   15620 _3DSTATE_CONSTANT_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   15621 {
   15622    switch (devinfo->gen) {
   15623    case 10: return 24;
   15624    case 9: return 24;
   15625    case 8: return 24;
   15626    case 7:
   15627       if (devinfo->is_haswell) {
   15628          return 24;
   15629       } else {
   15630          return 24;
   15631       }
   15632    case 6: return 24;
   15633    case 5: return 0;
   15634    case 4:
   15635       if (devinfo->is_g4x) {
   15636          return 0;
   15637       } else {
   15638          return 0;
   15639       }
   15640    default:
   15641       unreachable("Invalid hardware generation");
   15642    }
   15643 }
   15644 
   15645 
   15646 
   15647 /* 3DSTATE_CONSTANT_GS::3D Command Sub Opcode */
   15648 
   15649 
   15650 #define GEN10_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_bits  8
   15651 #define GEN9_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_bits  8
   15652 #define GEN8_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_bits  8
   15653 #define GEN75_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_bits  8
   15654 #define GEN7_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_bits  8
   15655 #define GEN6_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_bits  8
   15656 
   15657 static inline uint32_t ATTRIBUTE_PURE
   15658 _3DSTATE_CONSTANT_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   15659 {
   15660    switch (devinfo->gen) {
   15661    case 10: return 8;
   15662    case 9: return 8;
   15663    case 8: return 8;
   15664    case 7:
   15665       if (devinfo->is_haswell) {
   15666          return 8;
   15667       } else {
   15668          return 8;
   15669       }
   15670    case 6: return 8;
   15671    case 5: return 0;
   15672    case 4:
   15673       if (devinfo->is_g4x) {
   15674          return 0;
   15675       } else {
   15676          return 0;
   15677       }
   15678    default:
   15679       unreachable("Invalid hardware generation");
   15680    }
   15681 }
   15682 
   15683 
   15684 
   15685 #define GEN10_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_start  16
   15686 #define GEN9_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_start  16
   15687 #define GEN8_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_start  16
   15688 #define GEN75_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_start  16
   15689 #define GEN7_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_start  16
   15690 #define GEN6_3DSTATE_CONSTANT_GS_3DCommandSubOpcode_start  16
   15691 
   15692 static inline uint32_t ATTRIBUTE_PURE
   15693 _3DSTATE_CONSTANT_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   15694 {
   15695    switch (devinfo->gen) {
   15696    case 10: return 16;
   15697    case 9: return 16;
   15698    case 8: return 16;
   15699    case 7:
   15700       if (devinfo->is_haswell) {
   15701          return 16;
   15702       } else {
   15703          return 16;
   15704       }
   15705    case 6: return 16;
   15706    case 5: return 0;
   15707    case 4:
   15708       if (devinfo->is_g4x) {
   15709          return 0;
   15710       } else {
   15711          return 0;
   15712       }
   15713    default:
   15714       unreachable("Invalid hardware generation");
   15715    }
   15716 }
   15717 
   15718 
   15719 
   15720 /* 3DSTATE_CONSTANT_GS::Buffer 0 Valid */
   15721 
   15722 
   15723 #define GEN6_3DSTATE_CONSTANT_GS_Buffer0Valid_bits  1
   15724 
   15725 static inline uint32_t ATTRIBUTE_PURE
   15726 _3DSTATE_CONSTANT_GS_Buffer0Valid_bits(const struct gen_device_info *devinfo)
   15727 {
   15728    switch (devinfo->gen) {
   15729    case 10: return 0;
   15730    case 9: return 0;
   15731    case 8: return 0;
   15732    case 7:
   15733       if (devinfo->is_haswell) {
   15734          return 0;
   15735       } else {
   15736          return 0;
   15737       }
   15738    case 6: return 1;
   15739    case 5: return 0;
   15740    case 4:
   15741       if (devinfo->is_g4x) {
   15742          return 0;
   15743       } else {
   15744          return 0;
   15745       }
   15746    default:
   15747       unreachable("Invalid hardware generation");
   15748    }
   15749 }
   15750 
   15751 
   15752 
   15753 #define GEN6_3DSTATE_CONSTANT_GS_Buffer0Valid_start  12
   15754 
   15755 static inline uint32_t ATTRIBUTE_PURE
   15756 _3DSTATE_CONSTANT_GS_Buffer0Valid_start(const struct gen_device_info *devinfo)
   15757 {
   15758    switch (devinfo->gen) {
   15759    case 10: return 0;
   15760    case 9: return 0;
   15761    case 8: return 0;
   15762    case 7:
   15763       if (devinfo->is_haswell) {
   15764          return 0;
   15765       } else {
   15766          return 0;
   15767       }
   15768    case 6: return 12;
   15769    case 5: return 0;
   15770    case 4:
   15771       if (devinfo->is_g4x) {
   15772          return 0;
   15773       } else {
   15774          return 0;
   15775       }
   15776    default:
   15777       unreachable("Invalid hardware generation");
   15778    }
   15779 }
   15780 
   15781 
   15782 
   15783 /* 3DSTATE_CONSTANT_GS::Buffer 1 Valid */
   15784 
   15785 
   15786 #define GEN6_3DSTATE_CONSTANT_GS_Buffer1Valid_bits  1
   15787 
   15788 static inline uint32_t ATTRIBUTE_PURE
   15789 _3DSTATE_CONSTANT_GS_Buffer1Valid_bits(const struct gen_device_info *devinfo)
   15790 {
   15791    switch (devinfo->gen) {
   15792    case 10: return 0;
   15793    case 9: return 0;
   15794    case 8: return 0;
   15795    case 7:
   15796       if (devinfo->is_haswell) {
   15797          return 0;
   15798       } else {
   15799          return 0;
   15800       }
   15801    case 6: return 1;
   15802    case 5: return 0;
   15803    case 4:
   15804       if (devinfo->is_g4x) {
   15805          return 0;
   15806       } else {
   15807          return 0;
   15808       }
   15809    default:
   15810       unreachable("Invalid hardware generation");
   15811    }
   15812 }
   15813 
   15814 
   15815 
   15816 #define GEN6_3DSTATE_CONSTANT_GS_Buffer1Valid_start  13
   15817 
   15818 static inline uint32_t ATTRIBUTE_PURE
   15819 _3DSTATE_CONSTANT_GS_Buffer1Valid_start(const struct gen_device_info *devinfo)
   15820 {
   15821    switch (devinfo->gen) {
   15822    case 10: return 0;
   15823    case 9: return 0;
   15824    case 8: return 0;
   15825    case 7:
   15826       if (devinfo->is_haswell) {
   15827          return 0;
   15828       } else {
   15829          return 0;
   15830       }
   15831    case 6: return 13;
   15832    case 5: return 0;
   15833    case 4:
   15834       if (devinfo->is_g4x) {
   15835          return 0;
   15836       } else {
   15837          return 0;
   15838       }
   15839    default:
   15840       unreachable("Invalid hardware generation");
   15841    }
   15842 }
   15843 
   15844 
   15845 
   15846 /* 3DSTATE_CONSTANT_GS::Buffer 2 Valid */
   15847 
   15848 
   15849 #define GEN6_3DSTATE_CONSTANT_GS_Buffer2Valid_bits  1
   15850 
   15851 static inline uint32_t ATTRIBUTE_PURE
   15852 _3DSTATE_CONSTANT_GS_Buffer2Valid_bits(const struct gen_device_info *devinfo)
   15853 {
   15854    switch (devinfo->gen) {
   15855    case 10: return 0;
   15856    case 9: return 0;
   15857    case 8: return 0;
   15858    case 7:
   15859       if (devinfo->is_haswell) {
   15860          return 0;
   15861       } else {
   15862          return 0;
   15863       }
   15864    case 6: return 1;
   15865    case 5: return 0;
   15866    case 4:
   15867       if (devinfo->is_g4x) {
   15868          return 0;
   15869       } else {
   15870          return 0;
   15871       }
   15872    default:
   15873       unreachable("Invalid hardware generation");
   15874    }
   15875 }
   15876 
   15877 
   15878 
   15879 #define GEN6_3DSTATE_CONSTANT_GS_Buffer2Valid_start  14
   15880 
   15881 static inline uint32_t ATTRIBUTE_PURE
   15882 _3DSTATE_CONSTANT_GS_Buffer2Valid_start(const struct gen_device_info *devinfo)
   15883 {
   15884    switch (devinfo->gen) {
   15885    case 10: return 0;
   15886    case 9: return 0;
   15887    case 8: return 0;
   15888    case 7:
   15889       if (devinfo->is_haswell) {
   15890          return 0;
   15891       } else {
   15892          return 0;
   15893       }
   15894    case 6: return 14;
   15895    case 5: return 0;
   15896    case 4:
   15897       if (devinfo->is_g4x) {
   15898          return 0;
   15899       } else {
   15900          return 0;
   15901       }
   15902    default:
   15903       unreachable("Invalid hardware generation");
   15904    }
   15905 }
   15906 
   15907 
   15908 
   15909 /* 3DSTATE_CONSTANT_GS::Buffer 3 Valid */
   15910 
   15911 
   15912 #define GEN6_3DSTATE_CONSTANT_GS_Buffer3Valid_bits  1
   15913 
   15914 static inline uint32_t ATTRIBUTE_PURE
   15915 _3DSTATE_CONSTANT_GS_Buffer3Valid_bits(const struct gen_device_info *devinfo)
   15916 {
   15917    switch (devinfo->gen) {
   15918    case 10: return 0;
   15919    case 9: return 0;
   15920    case 8: return 0;
   15921    case 7:
   15922       if (devinfo->is_haswell) {
   15923          return 0;
   15924       } else {
   15925          return 0;
   15926       }
   15927    case 6: return 1;
   15928    case 5: return 0;
   15929    case 4:
   15930       if (devinfo->is_g4x) {
   15931          return 0;
   15932       } else {
   15933          return 0;
   15934       }
   15935    default:
   15936       unreachable("Invalid hardware generation");
   15937    }
   15938 }
   15939 
   15940 
   15941 
   15942 #define GEN6_3DSTATE_CONSTANT_GS_Buffer3Valid_start  15
   15943 
   15944 static inline uint32_t ATTRIBUTE_PURE
   15945 _3DSTATE_CONSTANT_GS_Buffer3Valid_start(const struct gen_device_info *devinfo)
   15946 {
   15947    switch (devinfo->gen) {
   15948    case 10: return 0;
   15949    case 9: return 0;
   15950    case 8: return 0;
   15951    case 7:
   15952       if (devinfo->is_haswell) {
   15953          return 0;
   15954       } else {
   15955          return 0;
   15956       }
   15957    case 6: return 15;
   15958    case 5: return 0;
   15959    case 4:
   15960       if (devinfo->is_g4x) {
   15961          return 0;
   15962       } else {
   15963          return 0;
   15964       }
   15965    default:
   15966       unreachable("Invalid hardware generation");
   15967    }
   15968 }
   15969 
   15970 
   15971 
   15972 /* 3DSTATE_CONSTANT_GS::Command SubType */
   15973 
   15974 
   15975 #define GEN10_3DSTATE_CONSTANT_GS_CommandSubType_bits  2
   15976 #define GEN9_3DSTATE_CONSTANT_GS_CommandSubType_bits  2
   15977 #define GEN8_3DSTATE_CONSTANT_GS_CommandSubType_bits  2
   15978 #define GEN75_3DSTATE_CONSTANT_GS_CommandSubType_bits  2
   15979 #define GEN7_3DSTATE_CONSTANT_GS_CommandSubType_bits  2
   15980 #define GEN6_3DSTATE_CONSTANT_GS_CommandSubType_bits  2
   15981 
   15982 static inline uint32_t ATTRIBUTE_PURE
   15983 _3DSTATE_CONSTANT_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   15984 {
   15985    switch (devinfo->gen) {
   15986    case 10: return 2;
   15987    case 9: return 2;
   15988    case 8: return 2;
   15989    case 7:
   15990       if (devinfo->is_haswell) {
   15991          return 2;
   15992       } else {
   15993          return 2;
   15994       }
   15995    case 6: return 2;
   15996    case 5: return 0;
   15997    case 4:
   15998       if (devinfo->is_g4x) {
   15999          return 0;
   16000       } else {
   16001          return 0;
   16002       }
   16003    default:
   16004       unreachable("Invalid hardware generation");
   16005    }
   16006 }
   16007 
   16008 
   16009 
   16010 #define GEN10_3DSTATE_CONSTANT_GS_CommandSubType_start  27
   16011 #define GEN9_3DSTATE_CONSTANT_GS_CommandSubType_start  27
   16012 #define GEN8_3DSTATE_CONSTANT_GS_CommandSubType_start  27
   16013 #define GEN75_3DSTATE_CONSTANT_GS_CommandSubType_start  27
   16014 #define GEN7_3DSTATE_CONSTANT_GS_CommandSubType_start  27
   16015 #define GEN6_3DSTATE_CONSTANT_GS_CommandSubType_start  27
   16016 
   16017 static inline uint32_t ATTRIBUTE_PURE
   16018 _3DSTATE_CONSTANT_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   16019 {
   16020    switch (devinfo->gen) {
   16021    case 10: return 27;
   16022    case 9: return 27;
   16023    case 8: return 27;
   16024    case 7:
   16025       if (devinfo->is_haswell) {
   16026          return 27;
   16027       } else {
   16028          return 27;
   16029       }
   16030    case 6: return 27;
   16031    case 5: return 0;
   16032    case 4:
   16033       if (devinfo->is_g4x) {
   16034          return 0;
   16035       } else {
   16036          return 0;
   16037       }
   16038    default:
   16039       unreachable("Invalid hardware generation");
   16040    }
   16041 }
   16042 
   16043 
   16044 
   16045 /* 3DSTATE_CONSTANT_GS::Command Type */
   16046 
   16047 
   16048 #define GEN10_3DSTATE_CONSTANT_GS_CommandType_bits  3
   16049 #define GEN9_3DSTATE_CONSTANT_GS_CommandType_bits  3
   16050 #define GEN8_3DSTATE_CONSTANT_GS_CommandType_bits  3
   16051 #define GEN75_3DSTATE_CONSTANT_GS_CommandType_bits  3
   16052 #define GEN7_3DSTATE_CONSTANT_GS_CommandType_bits  3
   16053 #define GEN6_3DSTATE_CONSTANT_GS_CommandType_bits  3
   16054 
   16055 static inline uint32_t ATTRIBUTE_PURE
   16056 _3DSTATE_CONSTANT_GS_CommandType_bits(const struct gen_device_info *devinfo)
   16057 {
   16058    switch (devinfo->gen) {
   16059    case 10: return 3;
   16060    case 9: return 3;
   16061    case 8: return 3;
   16062    case 7:
   16063       if (devinfo->is_haswell) {
   16064          return 3;
   16065       } else {
   16066          return 3;
   16067       }
   16068    case 6: return 3;
   16069    case 5: return 0;
   16070    case 4:
   16071       if (devinfo->is_g4x) {
   16072          return 0;
   16073       } else {
   16074          return 0;
   16075       }
   16076    default:
   16077       unreachable("Invalid hardware generation");
   16078    }
   16079 }
   16080 
   16081 
   16082 
   16083 #define GEN10_3DSTATE_CONSTANT_GS_CommandType_start  29
   16084 #define GEN9_3DSTATE_CONSTANT_GS_CommandType_start  29
   16085 #define GEN8_3DSTATE_CONSTANT_GS_CommandType_start  29
   16086 #define GEN75_3DSTATE_CONSTANT_GS_CommandType_start  29
   16087 #define GEN7_3DSTATE_CONSTANT_GS_CommandType_start  29
   16088 #define GEN6_3DSTATE_CONSTANT_GS_CommandType_start  29
   16089 
   16090 static inline uint32_t ATTRIBUTE_PURE
   16091 _3DSTATE_CONSTANT_GS_CommandType_start(const struct gen_device_info *devinfo)
   16092 {
   16093    switch (devinfo->gen) {
   16094    case 10: return 29;
   16095    case 9: return 29;
   16096    case 8: return 29;
   16097    case 7:
   16098       if (devinfo->is_haswell) {
   16099          return 29;
   16100       } else {
   16101          return 29;
   16102       }
   16103    case 6: return 29;
   16104    case 5: return 0;
   16105    case 4:
   16106       if (devinfo->is_g4x) {
   16107          return 0;
   16108       } else {
   16109          return 0;
   16110       }
   16111    default:
   16112       unreachable("Invalid hardware generation");
   16113    }
   16114 }
   16115 
   16116 
   16117 
   16118 /* 3DSTATE_CONSTANT_GS::Constant Body */
   16119 
   16120 
   16121 #define GEN10_3DSTATE_CONSTANT_GS_ConstantBody_bits  320
   16122 #define GEN9_3DSTATE_CONSTANT_GS_ConstantBody_bits  320
   16123 #define GEN8_3DSTATE_CONSTANT_GS_ConstantBody_bits  320
   16124 #define GEN75_3DSTATE_CONSTANT_GS_ConstantBody_bits  192
   16125 #define GEN7_3DSTATE_CONSTANT_GS_ConstantBody_bits  192
   16126 
   16127 static inline uint32_t ATTRIBUTE_PURE
   16128 _3DSTATE_CONSTANT_GS_ConstantBody_bits(const struct gen_device_info *devinfo)
   16129 {
   16130    switch (devinfo->gen) {
   16131    case 10: return 320;
   16132    case 9: return 320;
   16133    case 8: return 320;
   16134    case 7:
   16135       if (devinfo->is_haswell) {
   16136          return 192;
   16137       } else {
   16138          return 192;
   16139       }
   16140    case 6: return 0;
   16141    case 5: return 0;
   16142    case 4:
   16143       if (devinfo->is_g4x) {
   16144          return 0;
   16145       } else {
   16146          return 0;
   16147       }
   16148    default:
   16149       unreachable("Invalid hardware generation");
   16150    }
   16151 }
   16152 
   16153 
   16154 
   16155 #define GEN10_3DSTATE_CONSTANT_GS_ConstantBody_start  32
   16156 #define GEN9_3DSTATE_CONSTANT_GS_ConstantBody_start  32
   16157 #define GEN8_3DSTATE_CONSTANT_GS_ConstantBody_start  32
   16158 #define GEN75_3DSTATE_CONSTANT_GS_ConstantBody_start  32
   16159 #define GEN7_3DSTATE_CONSTANT_GS_ConstantBody_start  32
   16160 
   16161 static inline uint32_t ATTRIBUTE_PURE
   16162 _3DSTATE_CONSTANT_GS_ConstantBody_start(const struct gen_device_info *devinfo)
   16163 {
   16164    switch (devinfo->gen) {
   16165    case 10: return 32;
   16166    case 9: return 32;
   16167    case 8: return 32;
   16168    case 7:
   16169       if (devinfo->is_haswell) {
   16170          return 32;
   16171       } else {
   16172          return 32;
   16173       }
   16174    case 6: return 0;
   16175    case 5: return 0;
   16176    case 4:
   16177       if (devinfo->is_g4x) {
   16178          return 0;
   16179       } else {
   16180          return 0;
   16181       }
   16182    default:
   16183       unreachable("Invalid hardware generation");
   16184    }
   16185 }
   16186 
   16187 
   16188 
   16189 /* 3DSTATE_CONSTANT_GS::Constant Buffer Object Control State */
   16190 
   16191 
   16192 #define GEN10_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_bits  7
   16193 #define GEN9_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_bits  7
   16194 #define GEN8_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_bits  7
   16195 #define GEN6_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_bits  4
   16196 
   16197 static inline uint32_t ATTRIBUTE_PURE
   16198 _3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   16199 {
   16200    switch (devinfo->gen) {
   16201    case 10: return 7;
   16202    case 9: return 7;
   16203    case 8: return 7;
   16204    case 7:
   16205       if (devinfo->is_haswell) {
   16206          return 0;
   16207       } else {
   16208          return 0;
   16209       }
   16210    case 6: return 4;
   16211    case 5: return 0;
   16212    case 4:
   16213       if (devinfo->is_g4x) {
   16214          return 0;
   16215       } else {
   16216          return 0;
   16217       }
   16218    default:
   16219       unreachable("Invalid hardware generation");
   16220    }
   16221 }
   16222 
   16223 
   16224 
   16225 #define GEN10_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_start  8
   16226 #define GEN9_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_start  8
   16227 #define GEN8_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_start  8
   16228 #define GEN6_3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_start  8
   16229 
   16230 static inline uint32_t ATTRIBUTE_PURE
   16231 _3DSTATE_CONSTANT_GS_ConstantBufferObjectControlState_start(const struct gen_device_info *devinfo)
   16232 {
   16233    switch (devinfo->gen) {
   16234    case 10: return 8;
   16235    case 9: return 8;
   16236    case 8: return 8;
   16237    case 7:
   16238       if (devinfo->is_haswell) {
   16239          return 0;
   16240       } else {
   16241          return 0;
   16242       }
   16243    case 6: return 8;
   16244    case 5: return 0;
   16245    case 4:
   16246       if (devinfo->is_g4x) {
   16247          return 0;
   16248       } else {
   16249          return 0;
   16250       }
   16251    default:
   16252       unreachable("Invalid hardware generation");
   16253    }
   16254 }
   16255 
   16256 
   16257 
   16258 /* 3DSTATE_CONSTANT_GS::DWord Length */
   16259 
   16260 
   16261 #define GEN10_3DSTATE_CONSTANT_GS_DWordLength_bits  8
   16262 #define GEN9_3DSTATE_CONSTANT_GS_DWordLength_bits  8
   16263 #define GEN8_3DSTATE_CONSTANT_GS_DWordLength_bits  8
   16264 #define GEN75_3DSTATE_CONSTANT_GS_DWordLength_bits  8
   16265 #define GEN7_3DSTATE_CONSTANT_GS_DWordLength_bits  8
   16266 #define GEN6_3DSTATE_CONSTANT_GS_DWordLength_bits  8
   16267 
   16268 static inline uint32_t ATTRIBUTE_PURE
   16269 _3DSTATE_CONSTANT_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   16270 {
   16271    switch (devinfo->gen) {
   16272    case 10: return 8;
   16273    case 9: return 8;
   16274    case 8: return 8;
   16275    case 7:
   16276       if (devinfo->is_haswell) {
   16277          return 8;
   16278       } else {
   16279          return 8;
   16280       }
   16281    case 6: return 8;
   16282    case 5: return 0;
   16283    case 4:
   16284       if (devinfo->is_g4x) {
   16285          return 0;
   16286       } else {
   16287          return 0;
   16288       }
   16289    default:
   16290       unreachable("Invalid hardware generation");
   16291    }
   16292 }
   16293 
   16294 
   16295 
   16296 #define GEN10_3DSTATE_CONSTANT_GS_DWordLength_start  0
   16297 #define GEN9_3DSTATE_CONSTANT_GS_DWordLength_start  0
   16298 #define GEN8_3DSTATE_CONSTANT_GS_DWordLength_start  0
   16299 #define GEN75_3DSTATE_CONSTANT_GS_DWordLength_start  0
   16300 #define GEN7_3DSTATE_CONSTANT_GS_DWordLength_start  0
   16301 #define GEN6_3DSTATE_CONSTANT_GS_DWordLength_start  0
   16302 
   16303 static inline uint32_t ATTRIBUTE_PURE
   16304 _3DSTATE_CONSTANT_GS_DWordLength_start(const struct gen_device_info *devinfo)
   16305 {
   16306    switch (devinfo->gen) {
   16307    case 10: return 0;
   16308    case 9: return 0;
   16309    case 8: return 0;
   16310    case 7:
   16311       if (devinfo->is_haswell) {
   16312          return 0;
   16313       } else {
   16314          return 0;
   16315       }
   16316    case 6: return 0;
   16317    case 5: return 0;
   16318    case 4:
   16319       if (devinfo->is_g4x) {
   16320          return 0;
   16321       } else {
   16322          return 0;
   16323       }
   16324    default:
   16325       unreachable("Invalid hardware generation");
   16326    }
   16327 }
   16328 
   16329 
   16330 
   16331 /* 3DSTATE_CONSTANT_GS::GS Constant Buffer 0 Read Length */
   16332 
   16333 
   16334 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer0ReadLength_bits  5
   16335 
   16336 static inline uint32_t ATTRIBUTE_PURE
   16337 _3DSTATE_CONSTANT_GS_GSConstantBuffer0ReadLength_bits(const struct gen_device_info *devinfo)
   16338 {
   16339    switch (devinfo->gen) {
   16340    case 10: return 0;
   16341    case 9: return 0;
   16342    case 8: return 0;
   16343    case 7:
   16344       if (devinfo->is_haswell) {
   16345          return 0;
   16346       } else {
   16347          return 0;
   16348       }
   16349    case 6: return 5;
   16350    case 5: return 0;
   16351    case 4:
   16352       if (devinfo->is_g4x) {
   16353          return 0;
   16354       } else {
   16355          return 0;
   16356       }
   16357    default:
   16358       unreachable("Invalid hardware generation");
   16359    }
   16360 }
   16361 
   16362 
   16363 
   16364 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer0ReadLength_start  32
   16365 
   16366 static inline uint32_t ATTRIBUTE_PURE
   16367 _3DSTATE_CONSTANT_GS_GSConstantBuffer0ReadLength_start(const struct gen_device_info *devinfo)
   16368 {
   16369    switch (devinfo->gen) {
   16370    case 10: return 0;
   16371    case 9: return 0;
   16372    case 8: return 0;
   16373    case 7:
   16374       if (devinfo->is_haswell) {
   16375          return 0;
   16376       } else {
   16377          return 0;
   16378       }
   16379    case 6: return 32;
   16380    case 5: return 0;
   16381    case 4:
   16382       if (devinfo->is_g4x) {
   16383          return 0;
   16384       } else {
   16385          return 0;
   16386       }
   16387    default:
   16388       unreachable("Invalid hardware generation");
   16389    }
   16390 }
   16391 
   16392 
   16393 
   16394 /* 3DSTATE_CONSTANT_GS::GS Constant Buffer 1 Read Length */
   16395 
   16396 
   16397 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer1ReadLength_bits  5
   16398 
   16399 static inline uint32_t ATTRIBUTE_PURE
   16400 _3DSTATE_CONSTANT_GS_GSConstantBuffer1ReadLength_bits(const struct gen_device_info *devinfo)
   16401 {
   16402    switch (devinfo->gen) {
   16403    case 10: return 0;
   16404    case 9: return 0;
   16405    case 8: return 0;
   16406    case 7:
   16407       if (devinfo->is_haswell) {
   16408          return 0;
   16409       } else {
   16410          return 0;
   16411       }
   16412    case 6: return 5;
   16413    case 5: return 0;
   16414    case 4:
   16415       if (devinfo->is_g4x) {
   16416          return 0;
   16417       } else {
   16418          return 0;
   16419       }
   16420    default:
   16421       unreachable("Invalid hardware generation");
   16422    }
   16423 }
   16424 
   16425 
   16426 
   16427 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer1ReadLength_start  64
   16428 
   16429 static inline uint32_t ATTRIBUTE_PURE
   16430 _3DSTATE_CONSTANT_GS_GSConstantBuffer1ReadLength_start(const struct gen_device_info *devinfo)
   16431 {
   16432    switch (devinfo->gen) {
   16433    case 10: return 0;
   16434    case 9: return 0;
   16435    case 8: return 0;
   16436    case 7:
   16437       if (devinfo->is_haswell) {
   16438          return 0;
   16439       } else {
   16440          return 0;
   16441       }
   16442    case 6: return 64;
   16443    case 5: return 0;
   16444    case 4:
   16445       if (devinfo->is_g4x) {
   16446          return 0;
   16447       } else {
   16448          return 0;
   16449       }
   16450    default:
   16451       unreachable("Invalid hardware generation");
   16452    }
   16453 }
   16454 
   16455 
   16456 
   16457 /* 3DSTATE_CONSTANT_GS::GS Constant Buffer 2 Read Length */
   16458 
   16459 
   16460 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer2ReadLength_bits  5
   16461 
   16462 static inline uint32_t ATTRIBUTE_PURE
   16463 _3DSTATE_CONSTANT_GS_GSConstantBuffer2ReadLength_bits(const struct gen_device_info *devinfo)
   16464 {
   16465    switch (devinfo->gen) {
   16466    case 10: return 0;
   16467    case 9: return 0;
   16468    case 8: return 0;
   16469    case 7:
   16470       if (devinfo->is_haswell) {
   16471          return 0;
   16472       } else {
   16473          return 0;
   16474       }
   16475    case 6: return 5;
   16476    case 5: return 0;
   16477    case 4:
   16478       if (devinfo->is_g4x) {
   16479          return 0;
   16480       } else {
   16481          return 0;
   16482       }
   16483    default:
   16484       unreachable("Invalid hardware generation");
   16485    }
   16486 }
   16487 
   16488 
   16489 
   16490 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer2ReadLength_start  96
   16491 
   16492 static inline uint32_t ATTRIBUTE_PURE
   16493 _3DSTATE_CONSTANT_GS_GSConstantBuffer2ReadLength_start(const struct gen_device_info *devinfo)
   16494 {
   16495    switch (devinfo->gen) {
   16496    case 10: return 0;
   16497    case 9: return 0;
   16498    case 8: return 0;
   16499    case 7:
   16500       if (devinfo->is_haswell) {
   16501          return 0;
   16502       } else {
   16503          return 0;
   16504       }
   16505    case 6: return 96;
   16506    case 5: return 0;
   16507    case 4:
   16508       if (devinfo->is_g4x) {
   16509          return 0;
   16510       } else {
   16511          return 0;
   16512       }
   16513    default:
   16514       unreachable("Invalid hardware generation");
   16515    }
   16516 }
   16517 
   16518 
   16519 
   16520 /* 3DSTATE_CONSTANT_GS::GS Constant Buffer 3 Read Length */
   16521 
   16522 
   16523 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer3ReadLength_bits  5
   16524 
   16525 static inline uint32_t ATTRIBUTE_PURE
   16526 _3DSTATE_CONSTANT_GS_GSConstantBuffer3ReadLength_bits(const struct gen_device_info *devinfo)
   16527 {
   16528    switch (devinfo->gen) {
   16529    case 10: return 0;
   16530    case 9: return 0;
   16531    case 8: return 0;
   16532    case 7:
   16533       if (devinfo->is_haswell) {
   16534          return 0;
   16535       } else {
   16536          return 0;
   16537       }
   16538    case 6: return 5;
   16539    case 5: return 0;
   16540    case 4:
   16541       if (devinfo->is_g4x) {
   16542          return 0;
   16543       } else {
   16544          return 0;
   16545       }
   16546    default:
   16547       unreachable("Invalid hardware generation");
   16548    }
   16549 }
   16550 
   16551 
   16552 
   16553 #define GEN6_3DSTATE_CONSTANT_GS_GSConstantBuffer3ReadLength_start  128
   16554 
   16555 static inline uint32_t ATTRIBUTE_PURE
   16556 _3DSTATE_CONSTANT_GS_GSConstantBuffer3ReadLength_start(const struct gen_device_info *devinfo)
   16557 {
   16558    switch (devinfo->gen) {
   16559    case 10: return 0;
   16560    case 9: return 0;
   16561    case 8: return 0;
   16562    case 7:
   16563       if (devinfo->is_haswell) {
   16564          return 0;
   16565       } else {
   16566          return 0;
   16567       }
   16568    case 6: return 128;
   16569    case 5: return 0;
   16570    case 4:
   16571       if (devinfo->is_g4x) {
   16572          return 0;
   16573       } else {
   16574          return 0;
   16575       }
   16576    default:
   16577       unreachable("Invalid hardware generation");
   16578    }
   16579 }
   16580 
   16581 
   16582 
   16583 /* 3DSTATE_CONSTANT_GS::Pointer to GS Constant Buffer 0 */
   16584 
   16585 
   16586 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer0_bits  27
   16587 
   16588 static inline uint32_t ATTRIBUTE_PURE
   16589 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer0_bits(const struct gen_device_info *devinfo)
   16590 {
   16591    switch (devinfo->gen) {
   16592    case 10: return 0;
   16593    case 9: return 0;
   16594    case 8: return 0;
   16595    case 7:
   16596       if (devinfo->is_haswell) {
   16597          return 0;
   16598       } else {
   16599          return 0;
   16600       }
   16601    case 6: return 27;
   16602    case 5: return 0;
   16603    case 4:
   16604       if (devinfo->is_g4x) {
   16605          return 0;
   16606       } else {
   16607          return 0;
   16608       }
   16609    default:
   16610       unreachable("Invalid hardware generation");
   16611    }
   16612 }
   16613 
   16614 
   16615 
   16616 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer0_start  37
   16617 
   16618 static inline uint32_t ATTRIBUTE_PURE
   16619 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer0_start(const struct gen_device_info *devinfo)
   16620 {
   16621    switch (devinfo->gen) {
   16622    case 10: return 0;
   16623    case 9: return 0;
   16624    case 8: return 0;
   16625    case 7:
   16626       if (devinfo->is_haswell) {
   16627          return 0;
   16628       } else {
   16629          return 0;
   16630       }
   16631    case 6: return 37;
   16632    case 5: return 0;
   16633    case 4:
   16634       if (devinfo->is_g4x) {
   16635          return 0;
   16636       } else {
   16637          return 0;
   16638       }
   16639    default:
   16640       unreachable("Invalid hardware generation");
   16641    }
   16642 }
   16643 
   16644 
   16645 
   16646 /* 3DSTATE_CONSTANT_GS::Pointer to GS Constant Buffer 1 */
   16647 
   16648 
   16649 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer1_bits  27
   16650 
   16651 static inline uint32_t ATTRIBUTE_PURE
   16652 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer1_bits(const struct gen_device_info *devinfo)
   16653 {
   16654    switch (devinfo->gen) {
   16655    case 10: return 0;
   16656    case 9: return 0;
   16657    case 8: return 0;
   16658    case 7:
   16659       if (devinfo->is_haswell) {
   16660          return 0;
   16661       } else {
   16662          return 0;
   16663       }
   16664    case 6: return 27;
   16665    case 5: return 0;
   16666    case 4:
   16667       if (devinfo->is_g4x) {
   16668          return 0;
   16669       } else {
   16670          return 0;
   16671       }
   16672    default:
   16673       unreachable("Invalid hardware generation");
   16674    }
   16675 }
   16676 
   16677 
   16678 
   16679 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer1_start  69
   16680 
   16681 static inline uint32_t ATTRIBUTE_PURE
   16682 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer1_start(const struct gen_device_info *devinfo)
   16683 {
   16684    switch (devinfo->gen) {
   16685    case 10: return 0;
   16686    case 9: return 0;
   16687    case 8: return 0;
   16688    case 7:
   16689       if (devinfo->is_haswell) {
   16690          return 0;
   16691       } else {
   16692          return 0;
   16693       }
   16694    case 6: return 69;
   16695    case 5: return 0;
   16696    case 4:
   16697       if (devinfo->is_g4x) {
   16698          return 0;
   16699       } else {
   16700          return 0;
   16701       }
   16702    default:
   16703       unreachable("Invalid hardware generation");
   16704    }
   16705 }
   16706 
   16707 
   16708 
   16709 /* 3DSTATE_CONSTANT_GS::Pointer to GS Constant Buffer 2 */
   16710 
   16711 
   16712 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer2_bits  27
   16713 
   16714 static inline uint32_t ATTRIBUTE_PURE
   16715 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer2_bits(const struct gen_device_info *devinfo)
   16716 {
   16717    switch (devinfo->gen) {
   16718    case 10: return 0;
   16719    case 9: return 0;
   16720    case 8: return 0;
   16721    case 7:
   16722       if (devinfo->is_haswell) {
   16723          return 0;
   16724       } else {
   16725          return 0;
   16726       }
   16727    case 6: return 27;
   16728    case 5: return 0;
   16729    case 4:
   16730       if (devinfo->is_g4x) {
   16731          return 0;
   16732       } else {
   16733          return 0;
   16734       }
   16735    default:
   16736       unreachable("Invalid hardware generation");
   16737    }
   16738 }
   16739 
   16740 
   16741 
   16742 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer2_start  101
   16743 
   16744 static inline uint32_t ATTRIBUTE_PURE
   16745 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer2_start(const struct gen_device_info *devinfo)
   16746 {
   16747    switch (devinfo->gen) {
   16748    case 10: return 0;
   16749    case 9: return 0;
   16750    case 8: return 0;
   16751    case 7:
   16752       if (devinfo->is_haswell) {
   16753          return 0;
   16754       } else {
   16755          return 0;
   16756       }
   16757    case 6: return 101;
   16758    case 5: return 0;
   16759    case 4:
   16760       if (devinfo->is_g4x) {
   16761          return 0;
   16762       } else {
   16763          return 0;
   16764       }
   16765    default:
   16766       unreachable("Invalid hardware generation");
   16767    }
   16768 }
   16769 
   16770 
   16771 
   16772 /* 3DSTATE_CONSTANT_GS::Pointer to GS Constant Buffer 3 */
   16773 
   16774 
   16775 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer3_bits  27
   16776 
   16777 static inline uint32_t ATTRIBUTE_PURE
   16778 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer3_bits(const struct gen_device_info *devinfo)
   16779 {
   16780    switch (devinfo->gen) {
   16781    case 10: return 0;
   16782    case 9: return 0;
   16783    case 8: return 0;
   16784    case 7:
   16785       if (devinfo->is_haswell) {
   16786          return 0;
   16787       } else {
   16788          return 0;
   16789       }
   16790    case 6: return 27;
   16791    case 5: return 0;
   16792    case 4:
   16793       if (devinfo->is_g4x) {
   16794          return 0;
   16795       } else {
   16796          return 0;
   16797       }
   16798    default:
   16799       unreachable("Invalid hardware generation");
   16800    }
   16801 }
   16802 
   16803 
   16804 
   16805 #define GEN6_3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer3_start  133
   16806 
   16807 static inline uint32_t ATTRIBUTE_PURE
   16808 _3DSTATE_CONSTANT_GS_PointertoGSConstantBuffer3_start(const struct gen_device_info *devinfo)
   16809 {
   16810    switch (devinfo->gen) {
   16811    case 10: return 0;
   16812    case 9: return 0;
   16813    case 8: return 0;
   16814    case 7:
   16815       if (devinfo->is_haswell) {
   16816          return 0;
   16817       } else {
   16818          return 0;
   16819       }
   16820    case 6: return 133;
   16821    case 5: return 0;
   16822    case 4:
   16823       if (devinfo->is_g4x) {
   16824          return 0;
   16825       } else {
   16826          return 0;
   16827       }
   16828    default:
   16829       unreachable("Invalid hardware generation");
   16830    }
   16831 }
   16832 
   16833 
   16834 
   16835 /* 3DSTATE_CONSTANT_HS */
   16836 
   16837 
   16838 #define GEN10_3DSTATE_CONSTANT_HS_length  11
   16839 #define GEN9_3DSTATE_CONSTANT_HS_length  11
   16840 #define GEN8_3DSTATE_CONSTANT_HS_length  11
   16841 #define GEN75_3DSTATE_CONSTANT_HS_length  7
   16842 #define GEN7_3DSTATE_CONSTANT_HS_length  7
   16843 
   16844 static inline uint32_t ATTRIBUTE_PURE
   16845 _3DSTATE_CONSTANT_HS_length(const struct gen_device_info *devinfo)
   16846 {
   16847    switch (devinfo->gen) {
   16848    case 10: return 11;
   16849    case 9: return 11;
   16850    case 8: return 11;
   16851    case 7:
   16852       if (devinfo->is_haswell) {
   16853          return 7;
   16854       } else {
   16855          return 7;
   16856       }
   16857    case 6: return 0;
   16858    case 5: return 0;
   16859    case 4:
   16860       if (devinfo->is_g4x) {
   16861          return 0;
   16862       } else {
   16863          return 0;
   16864       }
   16865    default:
   16866       unreachable("Invalid hardware generation");
   16867    }
   16868 }
   16869 
   16870 
   16871 
   16872 /* 3DSTATE_CONSTANT_HS::3D Command Opcode */
   16873 
   16874 
   16875 #define GEN10_3DSTATE_CONSTANT_HS_3DCommandOpcode_bits  3
   16876 #define GEN9_3DSTATE_CONSTANT_HS_3DCommandOpcode_bits  3
   16877 #define GEN8_3DSTATE_CONSTANT_HS_3DCommandOpcode_bits  3
   16878 #define GEN75_3DSTATE_CONSTANT_HS_3DCommandOpcode_bits  3
   16879 #define GEN7_3DSTATE_CONSTANT_HS_3DCommandOpcode_bits  3
   16880 
   16881 static inline uint32_t ATTRIBUTE_PURE
   16882 _3DSTATE_CONSTANT_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   16883 {
   16884    switch (devinfo->gen) {
   16885    case 10: return 3;
   16886    case 9: return 3;
   16887    case 8: return 3;
   16888    case 7:
   16889       if (devinfo->is_haswell) {
   16890          return 3;
   16891       } else {
   16892          return 3;
   16893       }
   16894    case 6: return 0;
   16895    case 5: return 0;
   16896    case 4:
   16897       if (devinfo->is_g4x) {
   16898          return 0;
   16899       } else {
   16900          return 0;
   16901       }
   16902    default:
   16903       unreachable("Invalid hardware generation");
   16904    }
   16905 }
   16906 
   16907 
   16908 
   16909 #define GEN10_3DSTATE_CONSTANT_HS_3DCommandOpcode_start  24
   16910 #define GEN9_3DSTATE_CONSTANT_HS_3DCommandOpcode_start  24
   16911 #define GEN8_3DSTATE_CONSTANT_HS_3DCommandOpcode_start  24
   16912 #define GEN75_3DSTATE_CONSTANT_HS_3DCommandOpcode_start  24
   16913 #define GEN7_3DSTATE_CONSTANT_HS_3DCommandOpcode_start  24
   16914 
   16915 static inline uint32_t ATTRIBUTE_PURE
   16916 _3DSTATE_CONSTANT_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   16917 {
   16918    switch (devinfo->gen) {
   16919    case 10: return 24;
   16920    case 9: return 24;
   16921    case 8: return 24;
   16922    case 7:
   16923       if (devinfo->is_haswell) {
   16924          return 24;
   16925       } else {
   16926          return 24;
   16927       }
   16928    case 6: return 0;
   16929    case 5: return 0;
   16930    case 4:
   16931       if (devinfo->is_g4x) {
   16932          return 0;
   16933       } else {
   16934          return 0;
   16935       }
   16936    default:
   16937       unreachable("Invalid hardware generation");
   16938    }
   16939 }
   16940 
   16941 
   16942 
   16943 /* 3DSTATE_CONSTANT_HS::3D Command Sub Opcode */
   16944 
   16945 
   16946 #define GEN10_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_bits  8
   16947 #define GEN9_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_bits  8
   16948 #define GEN8_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_bits  8
   16949 #define GEN75_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_bits  8
   16950 #define GEN7_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_bits  8
   16951 
   16952 static inline uint32_t ATTRIBUTE_PURE
   16953 _3DSTATE_CONSTANT_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   16954 {
   16955    switch (devinfo->gen) {
   16956    case 10: return 8;
   16957    case 9: return 8;
   16958    case 8: return 8;
   16959    case 7:
   16960       if (devinfo->is_haswell) {
   16961          return 8;
   16962       } else {
   16963          return 8;
   16964       }
   16965    case 6: return 0;
   16966    case 5: return 0;
   16967    case 4:
   16968       if (devinfo->is_g4x) {
   16969          return 0;
   16970       } else {
   16971          return 0;
   16972       }
   16973    default:
   16974       unreachable("Invalid hardware generation");
   16975    }
   16976 }
   16977 
   16978 
   16979 
   16980 #define GEN10_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_start  16
   16981 #define GEN9_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_start  16
   16982 #define GEN8_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_start  16
   16983 #define GEN75_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_start  16
   16984 #define GEN7_3DSTATE_CONSTANT_HS_3DCommandSubOpcode_start  16
   16985 
   16986 static inline uint32_t ATTRIBUTE_PURE
   16987 _3DSTATE_CONSTANT_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   16988 {
   16989    switch (devinfo->gen) {
   16990    case 10: return 16;
   16991    case 9: return 16;
   16992    case 8: return 16;
   16993    case 7:
   16994       if (devinfo->is_haswell) {
   16995          return 16;
   16996       } else {
   16997          return 16;
   16998       }
   16999    case 6: return 0;
   17000    case 5: return 0;
   17001    case 4:
   17002       if (devinfo->is_g4x) {
   17003          return 0;
   17004       } else {
   17005          return 0;
   17006       }
   17007    default:
   17008       unreachable("Invalid hardware generation");
   17009    }
   17010 }
   17011 
   17012 
   17013 
   17014 /* 3DSTATE_CONSTANT_HS::Command SubType */
   17015 
   17016 
   17017 #define GEN10_3DSTATE_CONSTANT_HS_CommandSubType_bits  2
   17018 #define GEN9_3DSTATE_CONSTANT_HS_CommandSubType_bits  2
   17019 #define GEN8_3DSTATE_CONSTANT_HS_CommandSubType_bits  2
   17020 #define GEN75_3DSTATE_CONSTANT_HS_CommandSubType_bits  2
   17021 #define GEN7_3DSTATE_CONSTANT_HS_CommandSubType_bits  2
   17022 
   17023 static inline uint32_t ATTRIBUTE_PURE
   17024 _3DSTATE_CONSTANT_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   17025 {
   17026    switch (devinfo->gen) {
   17027    case 10: return 2;
   17028    case 9: return 2;
   17029    case 8: return 2;
   17030    case 7:
   17031       if (devinfo->is_haswell) {
   17032          return 2;
   17033       } else {
   17034          return 2;
   17035       }
   17036    case 6: return 0;
   17037    case 5: return 0;
   17038    case 4:
   17039       if (devinfo->is_g4x) {
   17040          return 0;
   17041       } else {
   17042          return 0;
   17043       }
   17044    default:
   17045       unreachable("Invalid hardware generation");
   17046    }
   17047 }
   17048 
   17049 
   17050 
   17051 #define GEN10_3DSTATE_CONSTANT_HS_CommandSubType_start  27
   17052 #define GEN9_3DSTATE_CONSTANT_HS_CommandSubType_start  27
   17053 #define GEN8_3DSTATE_CONSTANT_HS_CommandSubType_start  27
   17054 #define GEN75_3DSTATE_CONSTANT_HS_CommandSubType_start  27
   17055 #define GEN7_3DSTATE_CONSTANT_HS_CommandSubType_start  27
   17056 
   17057 static inline uint32_t ATTRIBUTE_PURE
   17058 _3DSTATE_CONSTANT_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   17059 {
   17060    switch (devinfo->gen) {
   17061    case 10: return 27;
   17062    case 9: return 27;
   17063    case 8: return 27;
   17064    case 7:
   17065       if (devinfo->is_haswell) {
   17066          return 27;
   17067       } else {
   17068          return 27;
   17069       }
   17070    case 6: return 0;
   17071    case 5: return 0;
   17072    case 4:
   17073       if (devinfo->is_g4x) {
   17074          return 0;
   17075       } else {
   17076          return 0;
   17077       }
   17078    default:
   17079       unreachable("Invalid hardware generation");
   17080    }
   17081 }
   17082 
   17083 
   17084 
   17085 /* 3DSTATE_CONSTANT_HS::Command Type */
   17086 
   17087 
   17088 #define GEN10_3DSTATE_CONSTANT_HS_CommandType_bits  3
   17089 #define GEN9_3DSTATE_CONSTANT_HS_CommandType_bits  3
   17090 #define GEN8_3DSTATE_CONSTANT_HS_CommandType_bits  3
   17091 #define GEN75_3DSTATE_CONSTANT_HS_CommandType_bits  3
   17092 #define GEN7_3DSTATE_CONSTANT_HS_CommandType_bits  3
   17093 
   17094 static inline uint32_t ATTRIBUTE_PURE
   17095 _3DSTATE_CONSTANT_HS_CommandType_bits(const struct gen_device_info *devinfo)
   17096 {
   17097    switch (devinfo->gen) {
   17098    case 10: return 3;
   17099    case 9: return 3;
   17100    case 8: return 3;
   17101    case 7:
   17102       if (devinfo->is_haswell) {
   17103          return 3;
   17104       } else {
   17105          return 3;
   17106       }
   17107    case 6: return 0;
   17108    case 5: return 0;
   17109    case 4:
   17110       if (devinfo->is_g4x) {
   17111          return 0;
   17112       } else {
   17113          return 0;
   17114       }
   17115    default:
   17116       unreachable("Invalid hardware generation");
   17117    }
   17118 }
   17119 
   17120 
   17121 
   17122 #define GEN10_3DSTATE_CONSTANT_HS_CommandType_start  29
   17123 #define GEN9_3DSTATE_CONSTANT_HS_CommandType_start  29
   17124 #define GEN8_3DSTATE_CONSTANT_HS_CommandType_start  29
   17125 #define GEN75_3DSTATE_CONSTANT_HS_CommandType_start  29
   17126 #define GEN7_3DSTATE_CONSTANT_HS_CommandType_start  29
   17127 
   17128 static inline uint32_t ATTRIBUTE_PURE
   17129 _3DSTATE_CONSTANT_HS_CommandType_start(const struct gen_device_info *devinfo)
   17130 {
   17131    switch (devinfo->gen) {
   17132    case 10: return 29;
   17133    case 9: return 29;
   17134    case 8: return 29;
   17135    case 7:
   17136       if (devinfo->is_haswell) {
   17137          return 29;
   17138       } else {
   17139          return 29;
   17140       }
   17141    case 6: return 0;
   17142    case 5: return 0;
   17143    case 4:
   17144       if (devinfo->is_g4x) {
   17145          return 0;
   17146       } else {
   17147          return 0;
   17148       }
   17149    default:
   17150       unreachable("Invalid hardware generation");
   17151    }
   17152 }
   17153 
   17154 
   17155 
   17156 /* 3DSTATE_CONSTANT_HS::Constant Body */
   17157 
   17158 
   17159 #define GEN10_3DSTATE_CONSTANT_HS_ConstantBody_bits  320
   17160 #define GEN9_3DSTATE_CONSTANT_HS_ConstantBody_bits  320
   17161 #define GEN8_3DSTATE_CONSTANT_HS_ConstantBody_bits  320
   17162 #define GEN75_3DSTATE_CONSTANT_HS_ConstantBody_bits  192
   17163 #define GEN7_3DSTATE_CONSTANT_HS_ConstantBody_bits  192
   17164 
   17165 static inline uint32_t ATTRIBUTE_PURE
   17166 _3DSTATE_CONSTANT_HS_ConstantBody_bits(const struct gen_device_info *devinfo)
   17167 {
   17168    switch (devinfo->gen) {
   17169    case 10: return 320;
   17170    case 9: return 320;
   17171    case 8: return 320;
   17172    case 7:
   17173       if (devinfo->is_haswell) {
   17174          return 192;
   17175       } else {
   17176          return 192;
   17177       }
   17178    case 6: return 0;
   17179    case 5: return 0;
   17180    case 4:
   17181       if (devinfo->is_g4x) {
   17182          return 0;
   17183       } else {
   17184          return 0;
   17185       }
   17186    default:
   17187       unreachable("Invalid hardware generation");
   17188    }
   17189 }
   17190 
   17191 
   17192 
   17193 #define GEN10_3DSTATE_CONSTANT_HS_ConstantBody_start  32
   17194 #define GEN9_3DSTATE_CONSTANT_HS_ConstantBody_start  32
   17195 #define GEN8_3DSTATE_CONSTANT_HS_ConstantBody_start  32
   17196 #define GEN75_3DSTATE_CONSTANT_HS_ConstantBody_start  32
   17197 #define GEN7_3DSTATE_CONSTANT_HS_ConstantBody_start  32
   17198 
   17199 static inline uint32_t ATTRIBUTE_PURE
   17200 _3DSTATE_CONSTANT_HS_ConstantBody_start(const struct gen_device_info *devinfo)
   17201 {
   17202    switch (devinfo->gen) {
   17203    case 10: return 32;
   17204    case 9: return 32;
   17205    case 8: return 32;
   17206    case 7:
   17207       if (devinfo->is_haswell) {
   17208          return 32;
   17209       } else {
   17210          return 32;
   17211       }
   17212    case 6: return 0;
   17213    case 5: return 0;
   17214    case 4:
   17215       if (devinfo->is_g4x) {
   17216          return 0;
   17217       } else {
   17218          return 0;
   17219       }
   17220    default:
   17221       unreachable("Invalid hardware generation");
   17222    }
   17223 }
   17224 
   17225 
   17226 
   17227 /* 3DSTATE_CONSTANT_HS::Constant Buffer Object Control State */
   17228 
   17229 
   17230 #define GEN10_3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_bits  7
   17231 #define GEN9_3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_bits  7
   17232 #define GEN8_3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_bits  7
   17233 
   17234 static inline uint32_t ATTRIBUTE_PURE
   17235 _3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   17236 {
   17237    switch (devinfo->gen) {
   17238    case 10: return 7;
   17239    case 9: return 7;
   17240    case 8: return 7;
   17241    case 7:
   17242       if (devinfo->is_haswell) {
   17243          return 0;
   17244       } else {
   17245          return 0;
   17246       }
   17247    case 6: return 0;
   17248    case 5: return 0;
   17249    case 4:
   17250       if (devinfo->is_g4x) {
   17251          return 0;
   17252       } else {
   17253          return 0;
   17254       }
   17255    default:
   17256       unreachable("Invalid hardware generation");
   17257    }
   17258 }
   17259 
   17260 
   17261 
   17262 #define GEN10_3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_start  8
   17263 #define GEN9_3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_start  8
   17264 #define GEN8_3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_start  8
   17265 
   17266 static inline uint32_t ATTRIBUTE_PURE
   17267 _3DSTATE_CONSTANT_HS_ConstantBufferObjectControlState_start(const struct gen_device_info *devinfo)
   17268 {
   17269    switch (devinfo->gen) {
   17270    case 10: return 8;
   17271    case 9: return 8;
   17272    case 8: return 8;
   17273    case 7:
   17274       if (devinfo->is_haswell) {
   17275          return 0;
   17276       } else {
   17277          return 0;
   17278       }
   17279    case 6: return 0;
   17280    case 5: return 0;
   17281    case 4:
   17282       if (devinfo->is_g4x) {
   17283          return 0;
   17284       } else {
   17285          return 0;
   17286       }
   17287    default:
   17288       unreachable("Invalid hardware generation");
   17289    }
   17290 }
   17291 
   17292 
   17293 
   17294 /* 3DSTATE_CONSTANT_HS::DWord Length */
   17295 
   17296 
   17297 #define GEN10_3DSTATE_CONSTANT_HS_DWordLength_bits  8
   17298 #define GEN9_3DSTATE_CONSTANT_HS_DWordLength_bits  8
   17299 #define GEN8_3DSTATE_CONSTANT_HS_DWordLength_bits  8
   17300 #define GEN75_3DSTATE_CONSTANT_HS_DWordLength_bits  8
   17301 #define GEN7_3DSTATE_CONSTANT_HS_DWordLength_bits  8
   17302 
   17303 static inline uint32_t ATTRIBUTE_PURE
   17304 _3DSTATE_CONSTANT_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   17305 {
   17306    switch (devinfo->gen) {
   17307    case 10: return 8;
   17308    case 9: return 8;
   17309    case 8: return 8;
   17310    case 7:
   17311       if (devinfo->is_haswell) {
   17312          return 8;
   17313       } else {
   17314          return 8;
   17315       }
   17316    case 6: return 0;
   17317    case 5: return 0;
   17318    case 4:
   17319       if (devinfo->is_g4x) {
   17320          return 0;
   17321       } else {
   17322          return 0;
   17323       }
   17324    default:
   17325       unreachable("Invalid hardware generation");
   17326    }
   17327 }
   17328 
   17329 
   17330 
   17331 #define GEN10_3DSTATE_CONSTANT_HS_DWordLength_start  0
   17332 #define GEN9_3DSTATE_CONSTANT_HS_DWordLength_start  0
   17333 #define GEN8_3DSTATE_CONSTANT_HS_DWordLength_start  0
   17334 #define GEN75_3DSTATE_CONSTANT_HS_DWordLength_start  0
   17335 #define GEN7_3DSTATE_CONSTANT_HS_DWordLength_start  0
   17336 
   17337 static inline uint32_t ATTRIBUTE_PURE
   17338 _3DSTATE_CONSTANT_HS_DWordLength_start(const struct gen_device_info *devinfo)
   17339 {
   17340    switch (devinfo->gen) {
   17341    case 10: return 0;
   17342    case 9: return 0;
   17343    case 8: return 0;
   17344    case 7:
   17345       if (devinfo->is_haswell) {
   17346          return 0;
   17347       } else {
   17348          return 0;
   17349       }
   17350    case 6: return 0;
   17351    case 5: return 0;
   17352    case 4:
   17353       if (devinfo->is_g4x) {
   17354          return 0;
   17355       } else {
   17356          return 0;
   17357       }
   17358    default:
   17359       unreachable("Invalid hardware generation");
   17360    }
   17361 }
   17362 
   17363 
   17364 
   17365 /* 3DSTATE_CONSTANT_PS */
   17366 
   17367 
   17368 #define GEN10_3DSTATE_CONSTANT_PS_length  11
   17369 #define GEN9_3DSTATE_CONSTANT_PS_length  11
   17370 #define GEN8_3DSTATE_CONSTANT_PS_length  11
   17371 #define GEN75_3DSTATE_CONSTANT_PS_length  7
   17372 #define GEN7_3DSTATE_CONSTANT_PS_length  7
   17373 #define GEN6_3DSTATE_CONSTANT_PS_length  5
   17374 
   17375 static inline uint32_t ATTRIBUTE_PURE
   17376 _3DSTATE_CONSTANT_PS_length(const struct gen_device_info *devinfo)
   17377 {
   17378    switch (devinfo->gen) {
   17379    case 10: return 11;
   17380    case 9: return 11;
   17381    case 8: return 11;
   17382    case 7:
   17383       if (devinfo->is_haswell) {
   17384          return 7;
   17385       } else {
   17386          return 7;
   17387       }
   17388    case 6: return 5;
   17389    case 5: return 0;
   17390    case 4:
   17391       if (devinfo->is_g4x) {
   17392          return 0;
   17393       } else {
   17394          return 0;
   17395       }
   17396    default:
   17397       unreachable("Invalid hardware generation");
   17398    }
   17399 }
   17400 
   17401 
   17402 
   17403 /* 3DSTATE_CONSTANT_PS::3D Command Opcode */
   17404 
   17405 
   17406 #define GEN10_3DSTATE_CONSTANT_PS_3DCommandOpcode_bits  3
   17407 #define GEN9_3DSTATE_CONSTANT_PS_3DCommandOpcode_bits  3
   17408 #define GEN8_3DSTATE_CONSTANT_PS_3DCommandOpcode_bits  3
   17409 #define GEN75_3DSTATE_CONSTANT_PS_3DCommandOpcode_bits  3
   17410 #define GEN7_3DSTATE_CONSTANT_PS_3DCommandOpcode_bits  3
   17411 #define GEN6_3DSTATE_CONSTANT_PS_3DCommandOpcode_bits  3
   17412 
   17413 static inline uint32_t ATTRIBUTE_PURE
   17414 _3DSTATE_CONSTANT_PS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   17415 {
   17416    switch (devinfo->gen) {
   17417    case 10: return 3;
   17418    case 9: return 3;
   17419    case 8: return 3;
   17420    case 7:
   17421       if (devinfo->is_haswell) {
   17422          return 3;
   17423       } else {
   17424          return 3;
   17425       }
   17426    case 6: return 3;
   17427    case 5: return 0;
   17428    case 4:
   17429       if (devinfo->is_g4x) {
   17430          return 0;
   17431       } else {
   17432          return 0;
   17433       }
   17434    default:
   17435       unreachable("Invalid hardware generation");
   17436    }
   17437 }
   17438 
   17439 
   17440 
   17441 #define GEN10_3DSTATE_CONSTANT_PS_3DCommandOpcode_start  24
   17442 #define GEN9_3DSTATE_CONSTANT_PS_3DCommandOpcode_start  24
   17443 #define GEN8_3DSTATE_CONSTANT_PS_3DCommandOpcode_start  24
   17444 #define GEN75_3DSTATE_CONSTANT_PS_3DCommandOpcode_start  24
   17445 #define GEN7_3DSTATE_CONSTANT_PS_3DCommandOpcode_start  24
   17446 #define GEN6_3DSTATE_CONSTANT_PS_3DCommandOpcode_start  24
   17447 
   17448 static inline uint32_t ATTRIBUTE_PURE
   17449 _3DSTATE_CONSTANT_PS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   17450 {
   17451    switch (devinfo->gen) {
   17452    case 10: return 24;
   17453    case 9: return 24;
   17454    case 8: return 24;
   17455    case 7:
   17456       if (devinfo->is_haswell) {
   17457          return 24;
   17458       } else {
   17459          return 24;
   17460       }
   17461    case 6: return 24;
   17462    case 5: return 0;
   17463    case 4:
   17464       if (devinfo->is_g4x) {
   17465          return 0;
   17466       } else {
   17467          return 0;
   17468       }
   17469    default:
   17470       unreachable("Invalid hardware generation");
   17471    }
   17472 }
   17473 
   17474 
   17475 
   17476 /* 3DSTATE_CONSTANT_PS::3D Command Sub Opcode */
   17477 
   17478 
   17479 #define GEN10_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_bits  8
   17480 #define GEN9_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_bits  8
   17481 #define GEN8_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_bits  8
   17482 #define GEN75_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_bits  8
   17483 #define GEN7_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_bits  8
   17484 #define GEN6_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_bits  8
   17485 
   17486 static inline uint32_t ATTRIBUTE_PURE
   17487 _3DSTATE_CONSTANT_PS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   17488 {
   17489    switch (devinfo->gen) {
   17490    case 10: return 8;
   17491    case 9: return 8;
   17492    case 8: return 8;
   17493    case 7:
   17494       if (devinfo->is_haswell) {
   17495          return 8;
   17496       } else {
   17497          return 8;
   17498       }
   17499    case 6: return 8;
   17500    case 5: return 0;
   17501    case 4:
   17502       if (devinfo->is_g4x) {
   17503          return 0;
   17504       } else {
   17505          return 0;
   17506       }
   17507    default:
   17508       unreachable("Invalid hardware generation");
   17509    }
   17510 }
   17511 
   17512 
   17513 
   17514 #define GEN10_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_start  16
   17515 #define GEN9_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_start  16
   17516 #define GEN8_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_start  16
   17517 #define GEN75_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_start  16
   17518 #define GEN7_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_start  16
   17519 #define GEN6_3DSTATE_CONSTANT_PS_3DCommandSubOpcode_start  16
   17520 
   17521 static inline uint32_t ATTRIBUTE_PURE
   17522 _3DSTATE_CONSTANT_PS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   17523 {
   17524    switch (devinfo->gen) {
   17525    case 10: return 16;
   17526    case 9: return 16;
   17527    case 8: return 16;
   17528    case 7:
   17529       if (devinfo->is_haswell) {
   17530          return 16;
   17531       } else {
   17532          return 16;
   17533       }
   17534    case 6: return 16;
   17535    case 5: return 0;
   17536    case 4:
   17537       if (devinfo->is_g4x) {
   17538          return 0;
   17539       } else {
   17540          return 0;
   17541       }
   17542    default:
   17543       unreachable("Invalid hardware generation");
   17544    }
   17545 }
   17546 
   17547 
   17548 
   17549 /* 3DSTATE_CONSTANT_PS::Buffer 0 Valid */
   17550 
   17551 
   17552 #define GEN6_3DSTATE_CONSTANT_PS_Buffer0Valid_bits  1
   17553 
   17554 static inline uint32_t ATTRIBUTE_PURE
   17555 _3DSTATE_CONSTANT_PS_Buffer0Valid_bits(const struct gen_device_info *devinfo)
   17556 {
   17557    switch (devinfo->gen) {
   17558    case 10: return 0;
   17559    case 9: return 0;
   17560    case 8: return 0;
   17561    case 7:
   17562       if (devinfo->is_haswell) {
   17563          return 0;
   17564       } else {
   17565          return 0;
   17566       }
   17567    case 6: return 1;
   17568    case 5: return 0;
   17569    case 4:
   17570       if (devinfo->is_g4x) {
   17571          return 0;
   17572       } else {
   17573          return 0;
   17574       }
   17575    default:
   17576       unreachable("Invalid hardware generation");
   17577    }
   17578 }
   17579 
   17580 
   17581 
   17582 #define GEN6_3DSTATE_CONSTANT_PS_Buffer0Valid_start  12
   17583 
   17584 static inline uint32_t ATTRIBUTE_PURE
   17585 _3DSTATE_CONSTANT_PS_Buffer0Valid_start(const struct gen_device_info *devinfo)
   17586 {
   17587    switch (devinfo->gen) {
   17588    case 10: return 0;
   17589    case 9: return 0;
   17590    case 8: return 0;
   17591    case 7:
   17592       if (devinfo->is_haswell) {
   17593          return 0;
   17594       } else {
   17595          return 0;
   17596       }
   17597    case 6: return 12;
   17598    case 5: return 0;
   17599    case 4:
   17600       if (devinfo->is_g4x) {
   17601          return 0;
   17602       } else {
   17603          return 0;
   17604       }
   17605    default:
   17606       unreachable("Invalid hardware generation");
   17607    }
   17608 }
   17609 
   17610 
   17611 
   17612 /* 3DSTATE_CONSTANT_PS::Buffer 1 Valid */
   17613 
   17614 
   17615 #define GEN6_3DSTATE_CONSTANT_PS_Buffer1Valid_bits  1
   17616 
   17617 static inline uint32_t ATTRIBUTE_PURE
   17618 _3DSTATE_CONSTANT_PS_Buffer1Valid_bits(const struct gen_device_info *devinfo)
   17619 {
   17620    switch (devinfo->gen) {
   17621    case 10: return 0;
   17622    case 9: return 0;
   17623    case 8: return 0;
   17624    case 7:
   17625       if (devinfo->is_haswell) {
   17626          return 0;
   17627       } else {
   17628          return 0;
   17629       }
   17630    case 6: return 1;
   17631    case 5: return 0;
   17632    case 4:
   17633       if (devinfo->is_g4x) {
   17634          return 0;
   17635       } else {
   17636          return 0;
   17637       }
   17638    default:
   17639       unreachable("Invalid hardware generation");
   17640    }
   17641 }
   17642 
   17643 
   17644 
   17645 #define GEN6_3DSTATE_CONSTANT_PS_Buffer1Valid_start  13
   17646 
   17647 static inline uint32_t ATTRIBUTE_PURE
   17648 _3DSTATE_CONSTANT_PS_Buffer1Valid_start(const struct gen_device_info *devinfo)
   17649 {
   17650    switch (devinfo->gen) {
   17651    case 10: return 0;
   17652    case 9: return 0;
   17653    case 8: return 0;
   17654    case 7:
   17655       if (devinfo->is_haswell) {
   17656          return 0;
   17657       } else {
   17658          return 0;
   17659       }
   17660    case 6: return 13;
   17661    case 5: return 0;
   17662    case 4:
   17663       if (devinfo->is_g4x) {
   17664          return 0;
   17665       } else {
   17666          return 0;
   17667       }
   17668    default:
   17669       unreachable("Invalid hardware generation");
   17670    }
   17671 }
   17672 
   17673 
   17674 
   17675 /* 3DSTATE_CONSTANT_PS::Buffer 2 Valid */
   17676 
   17677 
   17678 #define GEN6_3DSTATE_CONSTANT_PS_Buffer2Valid_bits  1
   17679 
   17680 static inline uint32_t ATTRIBUTE_PURE
   17681 _3DSTATE_CONSTANT_PS_Buffer2Valid_bits(const struct gen_device_info *devinfo)
   17682 {
   17683    switch (devinfo->gen) {
   17684    case 10: return 0;
   17685    case 9: return 0;
   17686    case 8: return 0;
   17687    case 7:
   17688       if (devinfo->is_haswell) {
   17689          return 0;
   17690       } else {
   17691          return 0;
   17692       }
   17693    case 6: return 1;
   17694    case 5: return 0;
   17695    case 4:
   17696       if (devinfo->is_g4x) {
   17697          return 0;
   17698       } else {
   17699          return 0;
   17700       }
   17701    default:
   17702       unreachable("Invalid hardware generation");
   17703    }
   17704 }
   17705 
   17706 
   17707 
   17708 #define GEN6_3DSTATE_CONSTANT_PS_Buffer2Valid_start  14
   17709 
   17710 static inline uint32_t ATTRIBUTE_PURE
   17711 _3DSTATE_CONSTANT_PS_Buffer2Valid_start(const struct gen_device_info *devinfo)
   17712 {
   17713    switch (devinfo->gen) {
   17714    case 10: return 0;
   17715    case 9: return 0;
   17716    case 8: return 0;
   17717    case 7:
   17718       if (devinfo->is_haswell) {
   17719          return 0;
   17720       } else {
   17721          return 0;
   17722       }
   17723    case 6: return 14;
   17724    case 5: return 0;
   17725    case 4:
   17726       if (devinfo->is_g4x) {
   17727          return 0;
   17728       } else {
   17729          return 0;
   17730       }
   17731    default:
   17732       unreachable("Invalid hardware generation");
   17733    }
   17734 }
   17735 
   17736 
   17737 
   17738 /* 3DSTATE_CONSTANT_PS::Buffer 3 Valid */
   17739 
   17740 
   17741 #define GEN6_3DSTATE_CONSTANT_PS_Buffer3Valid_bits  1
   17742 
   17743 static inline uint32_t ATTRIBUTE_PURE
   17744 _3DSTATE_CONSTANT_PS_Buffer3Valid_bits(const struct gen_device_info *devinfo)
   17745 {
   17746    switch (devinfo->gen) {
   17747    case 10: return 0;
   17748    case 9: return 0;
   17749    case 8: return 0;
   17750    case 7:
   17751       if (devinfo->is_haswell) {
   17752          return 0;
   17753       } else {
   17754          return 0;
   17755       }
   17756    case 6: return 1;
   17757    case 5: return 0;
   17758    case 4:
   17759       if (devinfo->is_g4x) {
   17760          return 0;
   17761       } else {
   17762          return 0;
   17763       }
   17764    default:
   17765       unreachable("Invalid hardware generation");
   17766    }
   17767 }
   17768 
   17769 
   17770 
   17771 #define GEN6_3DSTATE_CONSTANT_PS_Buffer3Valid_start  15
   17772 
   17773 static inline uint32_t ATTRIBUTE_PURE
   17774 _3DSTATE_CONSTANT_PS_Buffer3Valid_start(const struct gen_device_info *devinfo)
   17775 {
   17776    switch (devinfo->gen) {
   17777    case 10: return 0;
   17778    case 9: return 0;
   17779    case 8: return 0;
   17780    case 7:
   17781       if (devinfo->is_haswell) {
   17782          return 0;
   17783       } else {
   17784          return 0;
   17785       }
   17786    case 6: return 15;
   17787    case 5: return 0;
   17788    case 4:
   17789       if (devinfo->is_g4x) {
   17790          return 0;
   17791       } else {
   17792          return 0;
   17793       }
   17794    default:
   17795       unreachable("Invalid hardware generation");
   17796    }
   17797 }
   17798 
   17799 
   17800 
   17801 /* 3DSTATE_CONSTANT_PS::Command SubType */
   17802 
   17803 
   17804 #define GEN10_3DSTATE_CONSTANT_PS_CommandSubType_bits  2
   17805 #define GEN9_3DSTATE_CONSTANT_PS_CommandSubType_bits  2
   17806 #define GEN8_3DSTATE_CONSTANT_PS_CommandSubType_bits  2
   17807 #define GEN75_3DSTATE_CONSTANT_PS_CommandSubType_bits  2
   17808 #define GEN7_3DSTATE_CONSTANT_PS_CommandSubType_bits  2
   17809 #define GEN6_3DSTATE_CONSTANT_PS_CommandSubType_bits  2
   17810 
   17811 static inline uint32_t ATTRIBUTE_PURE
   17812 _3DSTATE_CONSTANT_PS_CommandSubType_bits(const struct gen_device_info *devinfo)
   17813 {
   17814    switch (devinfo->gen) {
   17815    case 10: return 2;
   17816    case 9: return 2;
   17817    case 8: return 2;
   17818    case 7:
   17819       if (devinfo->is_haswell) {
   17820          return 2;
   17821       } else {
   17822          return 2;
   17823       }
   17824    case 6: return 2;
   17825    case 5: return 0;
   17826    case 4:
   17827       if (devinfo->is_g4x) {
   17828          return 0;
   17829       } else {
   17830          return 0;
   17831       }
   17832    default:
   17833       unreachable("Invalid hardware generation");
   17834    }
   17835 }
   17836 
   17837 
   17838 
   17839 #define GEN10_3DSTATE_CONSTANT_PS_CommandSubType_start  27
   17840 #define GEN9_3DSTATE_CONSTANT_PS_CommandSubType_start  27
   17841 #define GEN8_3DSTATE_CONSTANT_PS_CommandSubType_start  27
   17842 #define GEN75_3DSTATE_CONSTANT_PS_CommandSubType_start  27
   17843 #define GEN7_3DSTATE_CONSTANT_PS_CommandSubType_start  27
   17844 #define GEN6_3DSTATE_CONSTANT_PS_CommandSubType_start  27
   17845 
   17846 static inline uint32_t ATTRIBUTE_PURE
   17847 _3DSTATE_CONSTANT_PS_CommandSubType_start(const struct gen_device_info *devinfo)
   17848 {
   17849    switch (devinfo->gen) {
   17850    case 10: return 27;
   17851    case 9: return 27;
   17852    case 8: return 27;
   17853    case 7:
   17854       if (devinfo->is_haswell) {
   17855          return 27;
   17856       } else {
   17857          return 27;
   17858       }
   17859    case 6: return 27;
   17860    case 5: return 0;
   17861    case 4:
   17862       if (devinfo->is_g4x) {
   17863          return 0;
   17864       } else {
   17865          return 0;
   17866       }
   17867    default:
   17868       unreachable("Invalid hardware generation");
   17869    }
   17870 }
   17871 
   17872 
   17873 
   17874 /* 3DSTATE_CONSTANT_PS::Command Type */
   17875 
   17876 
   17877 #define GEN10_3DSTATE_CONSTANT_PS_CommandType_bits  3
   17878 #define GEN9_3DSTATE_CONSTANT_PS_CommandType_bits  3
   17879 #define GEN8_3DSTATE_CONSTANT_PS_CommandType_bits  3
   17880 #define GEN75_3DSTATE_CONSTANT_PS_CommandType_bits  3
   17881 #define GEN7_3DSTATE_CONSTANT_PS_CommandType_bits  3
   17882 #define GEN6_3DSTATE_CONSTANT_PS_CommandType_bits  3
   17883 
   17884 static inline uint32_t ATTRIBUTE_PURE
   17885 _3DSTATE_CONSTANT_PS_CommandType_bits(const struct gen_device_info *devinfo)
   17886 {
   17887    switch (devinfo->gen) {
   17888    case 10: return 3;
   17889    case 9: return 3;
   17890    case 8: return 3;
   17891    case 7:
   17892       if (devinfo->is_haswell) {
   17893          return 3;
   17894       } else {
   17895          return 3;
   17896       }
   17897    case 6: return 3;
   17898    case 5: return 0;
   17899    case 4:
   17900       if (devinfo->is_g4x) {
   17901          return 0;
   17902       } else {
   17903          return 0;
   17904       }
   17905    default:
   17906       unreachable("Invalid hardware generation");
   17907    }
   17908 }
   17909 
   17910 
   17911 
   17912 #define GEN10_3DSTATE_CONSTANT_PS_CommandType_start  29
   17913 #define GEN9_3DSTATE_CONSTANT_PS_CommandType_start  29
   17914 #define GEN8_3DSTATE_CONSTANT_PS_CommandType_start  29
   17915 #define GEN75_3DSTATE_CONSTANT_PS_CommandType_start  29
   17916 #define GEN7_3DSTATE_CONSTANT_PS_CommandType_start  29
   17917 #define GEN6_3DSTATE_CONSTANT_PS_CommandType_start  29
   17918 
   17919 static inline uint32_t ATTRIBUTE_PURE
   17920 _3DSTATE_CONSTANT_PS_CommandType_start(const struct gen_device_info *devinfo)
   17921 {
   17922    switch (devinfo->gen) {
   17923    case 10: return 29;
   17924    case 9: return 29;
   17925    case 8: return 29;
   17926    case 7:
   17927       if (devinfo->is_haswell) {
   17928          return 29;
   17929       } else {
   17930          return 29;
   17931       }
   17932    case 6: return 29;
   17933    case 5: return 0;
   17934    case 4:
   17935       if (devinfo->is_g4x) {
   17936          return 0;
   17937       } else {
   17938          return 0;
   17939       }
   17940    default:
   17941       unreachable("Invalid hardware generation");
   17942    }
   17943 }
   17944 
   17945 
   17946 
   17947 /* 3DSTATE_CONSTANT_PS::Constant Body */
   17948 
   17949 
   17950 #define GEN10_3DSTATE_CONSTANT_PS_ConstantBody_bits  320
   17951 #define GEN9_3DSTATE_CONSTANT_PS_ConstantBody_bits  320
   17952 #define GEN8_3DSTATE_CONSTANT_PS_ConstantBody_bits  320
   17953 #define GEN75_3DSTATE_CONSTANT_PS_ConstantBody_bits  192
   17954 #define GEN7_3DSTATE_CONSTANT_PS_ConstantBody_bits  192
   17955 
   17956 static inline uint32_t ATTRIBUTE_PURE
   17957 _3DSTATE_CONSTANT_PS_ConstantBody_bits(const struct gen_device_info *devinfo)
   17958 {
   17959    switch (devinfo->gen) {
   17960    case 10: return 320;
   17961    case 9: return 320;
   17962    case 8: return 320;
   17963    case 7:
   17964       if (devinfo->is_haswell) {
   17965          return 192;
   17966       } else {
   17967          return 192;
   17968       }
   17969    case 6: return 0;
   17970    case 5: return 0;
   17971    case 4:
   17972       if (devinfo->is_g4x) {
   17973          return 0;
   17974       } else {
   17975          return 0;
   17976       }
   17977    default:
   17978       unreachable("Invalid hardware generation");
   17979    }
   17980 }
   17981 
   17982 
   17983 
   17984 #define GEN10_3DSTATE_CONSTANT_PS_ConstantBody_start  32
   17985 #define GEN9_3DSTATE_CONSTANT_PS_ConstantBody_start  32
   17986 #define GEN8_3DSTATE_CONSTANT_PS_ConstantBody_start  32
   17987 #define GEN75_3DSTATE_CONSTANT_PS_ConstantBody_start  32
   17988 #define GEN7_3DSTATE_CONSTANT_PS_ConstantBody_start  32
   17989 
   17990 static inline uint32_t ATTRIBUTE_PURE
   17991 _3DSTATE_CONSTANT_PS_ConstantBody_start(const struct gen_device_info *devinfo)
   17992 {
   17993    switch (devinfo->gen) {
   17994    case 10: return 32;
   17995    case 9: return 32;
   17996    case 8: return 32;
   17997    case 7:
   17998       if (devinfo->is_haswell) {
   17999          return 32;
   18000       } else {
   18001          return 32;
   18002       }
   18003    case 6: return 0;
   18004    case 5: return 0;
   18005    case 4:
   18006       if (devinfo->is_g4x) {
   18007          return 0;
   18008       } else {
   18009          return 0;
   18010       }
   18011    default:
   18012       unreachable("Invalid hardware generation");
   18013    }
   18014 }
   18015 
   18016 
   18017 
   18018 /* 3DSTATE_CONSTANT_PS::Constant Buffer Object Control State */
   18019 
   18020 
   18021 #define GEN10_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_bits  7
   18022 #define GEN9_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_bits  7
   18023 #define GEN8_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_bits  7
   18024 #define GEN6_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_bits  4
   18025 
   18026 static inline uint32_t ATTRIBUTE_PURE
   18027 _3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   18028 {
   18029    switch (devinfo->gen) {
   18030    case 10: return 7;
   18031    case 9: return 7;
   18032    case 8: return 7;
   18033    case 7:
   18034       if (devinfo->is_haswell) {
   18035          return 0;
   18036       } else {
   18037          return 0;
   18038       }
   18039    case 6: return 4;
   18040    case 5: return 0;
   18041    case 4:
   18042       if (devinfo->is_g4x) {
   18043          return 0;
   18044       } else {
   18045          return 0;
   18046       }
   18047    default:
   18048       unreachable("Invalid hardware generation");
   18049    }
   18050 }
   18051 
   18052 
   18053 
   18054 #define GEN10_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_start  8
   18055 #define GEN9_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_start  8
   18056 #define GEN8_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_start  8
   18057 #define GEN6_3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_start  8
   18058 
   18059 static inline uint32_t ATTRIBUTE_PURE
   18060 _3DSTATE_CONSTANT_PS_ConstantBufferObjectControlState_start(const struct gen_device_info *devinfo)
   18061 {
   18062    switch (devinfo->gen) {
   18063    case 10: return 8;
   18064    case 9: return 8;
   18065    case 8: return 8;
   18066    case 7:
   18067       if (devinfo->is_haswell) {
   18068          return 0;
   18069       } else {
   18070          return 0;
   18071       }
   18072    case 6: return 8;
   18073    case 5: return 0;
   18074    case 4:
   18075       if (devinfo->is_g4x) {
   18076          return 0;
   18077       } else {
   18078          return 0;
   18079       }
   18080    default:
   18081       unreachable("Invalid hardware generation");
   18082    }
   18083 }
   18084 
   18085 
   18086 
   18087 /* 3DSTATE_CONSTANT_PS::DWord Length */
   18088 
   18089 
   18090 #define GEN10_3DSTATE_CONSTANT_PS_DWordLength_bits  8
   18091 #define GEN9_3DSTATE_CONSTANT_PS_DWordLength_bits  8
   18092 #define GEN8_3DSTATE_CONSTANT_PS_DWordLength_bits  8
   18093 #define GEN75_3DSTATE_CONSTANT_PS_DWordLength_bits  8
   18094 #define GEN7_3DSTATE_CONSTANT_PS_DWordLength_bits  8
   18095 #define GEN6_3DSTATE_CONSTANT_PS_DWordLength_bits  8
   18096 
   18097 static inline uint32_t ATTRIBUTE_PURE
   18098 _3DSTATE_CONSTANT_PS_DWordLength_bits(const struct gen_device_info *devinfo)
   18099 {
   18100    switch (devinfo->gen) {
   18101    case 10: return 8;
   18102    case 9: return 8;
   18103    case 8: return 8;
   18104    case 7:
   18105       if (devinfo->is_haswell) {
   18106          return 8;
   18107       } else {
   18108          return 8;
   18109       }
   18110    case 6: return 8;
   18111    case 5: return 0;
   18112    case 4:
   18113       if (devinfo->is_g4x) {
   18114          return 0;
   18115       } else {
   18116          return 0;
   18117       }
   18118    default:
   18119       unreachable("Invalid hardware generation");
   18120    }
   18121 }
   18122 
   18123 
   18124 
   18125 #define GEN10_3DSTATE_CONSTANT_PS_DWordLength_start  0
   18126 #define GEN9_3DSTATE_CONSTANT_PS_DWordLength_start  0
   18127 #define GEN8_3DSTATE_CONSTANT_PS_DWordLength_start  0
   18128 #define GEN75_3DSTATE_CONSTANT_PS_DWordLength_start  0
   18129 #define GEN7_3DSTATE_CONSTANT_PS_DWordLength_start  0
   18130 #define GEN6_3DSTATE_CONSTANT_PS_DWordLength_start  0
   18131 
   18132 static inline uint32_t ATTRIBUTE_PURE
   18133 _3DSTATE_CONSTANT_PS_DWordLength_start(const struct gen_device_info *devinfo)
   18134 {
   18135    switch (devinfo->gen) {
   18136    case 10: return 0;
   18137    case 9: return 0;
   18138    case 8: return 0;
   18139    case 7:
   18140       if (devinfo->is_haswell) {
   18141          return 0;
   18142       } else {
   18143          return 0;
   18144       }
   18145    case 6: return 0;
   18146    case 5: return 0;
   18147    case 4:
   18148       if (devinfo->is_g4x) {
   18149          return 0;
   18150       } else {
   18151          return 0;
   18152       }
   18153    default:
   18154       unreachable("Invalid hardware generation");
   18155    }
   18156 }
   18157 
   18158 
   18159 
   18160 /* 3DSTATE_CONSTANT_PS::Disable Gather at Set Shader Hint */
   18161 
   18162 
   18163 #define GEN10_3DSTATE_CONSTANT_PS_DisableGatheratSetShaderHint_bits  1
   18164 
   18165 static inline uint32_t ATTRIBUTE_PURE
   18166 _3DSTATE_CONSTANT_PS_DisableGatheratSetShaderHint_bits(const struct gen_device_info *devinfo)
   18167 {
   18168    switch (devinfo->gen) {
   18169    case 10: return 1;
   18170    case 9: return 0;
   18171    case 8: return 0;
   18172    case 7:
   18173       if (devinfo->is_haswell) {
   18174          return 0;
   18175       } else {
   18176          return 0;
   18177       }
   18178    case 6: return 0;
   18179    case 5: return 0;
   18180    case 4:
   18181       if (devinfo->is_g4x) {
   18182          return 0;
   18183       } else {
   18184          return 0;
   18185       }
   18186    default:
   18187       unreachable("Invalid hardware generation");
   18188    }
   18189 }
   18190 
   18191 
   18192 
   18193 #define GEN10_3DSTATE_CONSTANT_PS_DisableGatheratSetShaderHint_start  15
   18194 
   18195 static inline uint32_t ATTRIBUTE_PURE
   18196 _3DSTATE_CONSTANT_PS_DisableGatheratSetShaderHint_start(const struct gen_device_info *devinfo)
   18197 {
   18198    switch (devinfo->gen) {
   18199    case 10: return 15;
   18200    case 9: return 0;
   18201    case 8: return 0;
   18202    case 7:
   18203       if (devinfo->is_haswell) {
   18204          return 0;
   18205       } else {
   18206          return 0;
   18207       }
   18208    case 6: return 0;
   18209    case 5: return 0;
   18210    case 4:
   18211       if (devinfo->is_g4x) {
   18212          return 0;
   18213       } else {
   18214          return 0;
   18215       }
   18216    default:
   18217       unreachable("Invalid hardware generation");
   18218    }
   18219 }
   18220 
   18221 
   18222 
   18223 /* 3DSTATE_CONSTANT_PS::PS Constant Buffer 0 Read Length */
   18224 
   18225 
   18226 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer0ReadLength_bits  5
   18227 
   18228 static inline uint32_t ATTRIBUTE_PURE
   18229 _3DSTATE_CONSTANT_PS_PSConstantBuffer0ReadLength_bits(const struct gen_device_info *devinfo)
   18230 {
   18231    switch (devinfo->gen) {
   18232    case 10: return 0;
   18233    case 9: return 0;
   18234    case 8: return 0;
   18235    case 7:
   18236       if (devinfo->is_haswell) {
   18237          return 0;
   18238       } else {
   18239          return 0;
   18240       }
   18241    case 6: return 5;
   18242    case 5: return 0;
   18243    case 4:
   18244       if (devinfo->is_g4x) {
   18245          return 0;
   18246       } else {
   18247          return 0;
   18248       }
   18249    default:
   18250       unreachable("Invalid hardware generation");
   18251    }
   18252 }
   18253 
   18254 
   18255 
   18256 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer0ReadLength_start  32
   18257 
   18258 static inline uint32_t ATTRIBUTE_PURE
   18259 _3DSTATE_CONSTANT_PS_PSConstantBuffer0ReadLength_start(const struct gen_device_info *devinfo)
   18260 {
   18261    switch (devinfo->gen) {
   18262    case 10: return 0;
   18263    case 9: return 0;
   18264    case 8: return 0;
   18265    case 7:
   18266       if (devinfo->is_haswell) {
   18267          return 0;
   18268       } else {
   18269          return 0;
   18270       }
   18271    case 6: return 32;
   18272    case 5: return 0;
   18273    case 4:
   18274       if (devinfo->is_g4x) {
   18275          return 0;
   18276       } else {
   18277          return 0;
   18278       }
   18279    default:
   18280       unreachable("Invalid hardware generation");
   18281    }
   18282 }
   18283 
   18284 
   18285 
   18286 /* 3DSTATE_CONSTANT_PS::PS Constant Buffer 1 Read Length */
   18287 
   18288 
   18289 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer1ReadLength_bits  5
   18290 
   18291 static inline uint32_t ATTRIBUTE_PURE
   18292 _3DSTATE_CONSTANT_PS_PSConstantBuffer1ReadLength_bits(const struct gen_device_info *devinfo)
   18293 {
   18294    switch (devinfo->gen) {
   18295    case 10: return 0;
   18296    case 9: return 0;
   18297    case 8: return 0;
   18298    case 7:
   18299       if (devinfo->is_haswell) {
   18300          return 0;
   18301       } else {
   18302          return 0;
   18303       }
   18304    case 6: return 5;
   18305    case 5: return 0;
   18306    case 4:
   18307       if (devinfo->is_g4x) {
   18308          return 0;
   18309       } else {
   18310          return 0;
   18311       }
   18312    default:
   18313       unreachable("Invalid hardware generation");
   18314    }
   18315 }
   18316 
   18317 
   18318 
   18319 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer1ReadLength_start  64
   18320 
   18321 static inline uint32_t ATTRIBUTE_PURE
   18322 _3DSTATE_CONSTANT_PS_PSConstantBuffer1ReadLength_start(const struct gen_device_info *devinfo)
   18323 {
   18324    switch (devinfo->gen) {
   18325    case 10: return 0;
   18326    case 9: return 0;
   18327    case 8: return 0;
   18328    case 7:
   18329       if (devinfo->is_haswell) {
   18330          return 0;
   18331       } else {
   18332          return 0;
   18333       }
   18334    case 6: return 64;
   18335    case 5: return 0;
   18336    case 4:
   18337       if (devinfo->is_g4x) {
   18338          return 0;
   18339       } else {
   18340          return 0;
   18341       }
   18342    default:
   18343       unreachable("Invalid hardware generation");
   18344    }
   18345 }
   18346 
   18347 
   18348 
   18349 /* 3DSTATE_CONSTANT_PS::PS Constant Buffer 2 Read Length */
   18350 
   18351 
   18352 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer2ReadLength_bits  5
   18353 
   18354 static inline uint32_t ATTRIBUTE_PURE
   18355 _3DSTATE_CONSTANT_PS_PSConstantBuffer2ReadLength_bits(const struct gen_device_info *devinfo)
   18356 {
   18357    switch (devinfo->gen) {
   18358    case 10: return 0;
   18359    case 9: return 0;
   18360    case 8: return 0;
   18361    case 7:
   18362       if (devinfo->is_haswell) {
   18363          return 0;
   18364       } else {
   18365          return 0;
   18366       }
   18367    case 6: return 5;
   18368    case 5: return 0;
   18369    case 4:
   18370       if (devinfo->is_g4x) {
   18371          return 0;
   18372       } else {
   18373          return 0;
   18374       }
   18375    default:
   18376       unreachable("Invalid hardware generation");
   18377    }
   18378 }
   18379 
   18380 
   18381 
   18382 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer2ReadLength_start  96
   18383 
   18384 static inline uint32_t ATTRIBUTE_PURE
   18385 _3DSTATE_CONSTANT_PS_PSConstantBuffer2ReadLength_start(const struct gen_device_info *devinfo)
   18386 {
   18387    switch (devinfo->gen) {
   18388    case 10: return 0;
   18389    case 9: return 0;
   18390    case 8: return 0;
   18391    case 7:
   18392       if (devinfo->is_haswell) {
   18393          return 0;
   18394       } else {
   18395          return 0;
   18396       }
   18397    case 6: return 96;
   18398    case 5: return 0;
   18399    case 4:
   18400       if (devinfo->is_g4x) {
   18401          return 0;
   18402       } else {
   18403          return 0;
   18404       }
   18405    default:
   18406       unreachable("Invalid hardware generation");
   18407    }
   18408 }
   18409 
   18410 
   18411 
   18412 /* 3DSTATE_CONSTANT_PS::PS Constant Buffer 3 Read Length */
   18413 
   18414 
   18415 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer3ReadLength_bits  5
   18416 
   18417 static inline uint32_t ATTRIBUTE_PURE
   18418 _3DSTATE_CONSTANT_PS_PSConstantBuffer3ReadLength_bits(const struct gen_device_info *devinfo)
   18419 {
   18420    switch (devinfo->gen) {
   18421    case 10: return 0;
   18422    case 9: return 0;
   18423    case 8: return 0;
   18424    case 7:
   18425       if (devinfo->is_haswell) {
   18426          return 0;
   18427       } else {
   18428          return 0;
   18429       }
   18430    case 6: return 5;
   18431    case 5: return 0;
   18432    case 4:
   18433       if (devinfo->is_g4x) {
   18434          return 0;
   18435       } else {
   18436          return 0;
   18437       }
   18438    default:
   18439       unreachable("Invalid hardware generation");
   18440    }
   18441 }
   18442 
   18443 
   18444 
   18445 #define GEN6_3DSTATE_CONSTANT_PS_PSConstantBuffer3ReadLength_start  128
   18446 
   18447 static inline uint32_t ATTRIBUTE_PURE
   18448 _3DSTATE_CONSTANT_PS_PSConstantBuffer3ReadLength_start(const struct gen_device_info *devinfo)
   18449 {
   18450    switch (devinfo->gen) {
   18451    case 10: return 0;
   18452    case 9: return 0;
   18453    case 8: return 0;
   18454    case 7:
   18455       if (devinfo->is_haswell) {
   18456          return 0;
   18457       } else {
   18458          return 0;
   18459       }
   18460    case 6: return 128;
   18461    case 5: return 0;
   18462    case 4:
   18463       if (devinfo->is_g4x) {
   18464          return 0;
   18465       } else {
   18466          return 0;
   18467       }
   18468    default:
   18469       unreachable("Invalid hardware generation");
   18470    }
   18471 }
   18472 
   18473 
   18474 
   18475 /* 3DSTATE_CONSTANT_PS::Pointer to PS Constant Buffer 0 */
   18476 
   18477 
   18478 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer0_bits  27
   18479 
   18480 static inline uint32_t ATTRIBUTE_PURE
   18481 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer0_bits(const struct gen_device_info *devinfo)
   18482 {
   18483    switch (devinfo->gen) {
   18484    case 10: return 0;
   18485    case 9: return 0;
   18486    case 8: return 0;
   18487    case 7:
   18488       if (devinfo->is_haswell) {
   18489          return 0;
   18490       } else {
   18491          return 0;
   18492       }
   18493    case 6: return 27;
   18494    case 5: return 0;
   18495    case 4:
   18496       if (devinfo->is_g4x) {
   18497          return 0;
   18498       } else {
   18499          return 0;
   18500       }
   18501    default:
   18502       unreachable("Invalid hardware generation");
   18503    }
   18504 }
   18505 
   18506 
   18507 
   18508 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer0_start  37
   18509 
   18510 static inline uint32_t ATTRIBUTE_PURE
   18511 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer0_start(const struct gen_device_info *devinfo)
   18512 {
   18513    switch (devinfo->gen) {
   18514    case 10: return 0;
   18515    case 9: return 0;
   18516    case 8: return 0;
   18517    case 7:
   18518       if (devinfo->is_haswell) {
   18519          return 0;
   18520       } else {
   18521          return 0;
   18522       }
   18523    case 6: return 37;
   18524    case 5: return 0;
   18525    case 4:
   18526       if (devinfo->is_g4x) {
   18527          return 0;
   18528       } else {
   18529          return 0;
   18530       }
   18531    default:
   18532       unreachable("Invalid hardware generation");
   18533    }
   18534 }
   18535 
   18536 
   18537 
   18538 /* 3DSTATE_CONSTANT_PS::Pointer to PS Constant Buffer 1 */
   18539 
   18540 
   18541 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer1_bits  27
   18542 
   18543 static inline uint32_t ATTRIBUTE_PURE
   18544 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer1_bits(const struct gen_device_info *devinfo)
   18545 {
   18546    switch (devinfo->gen) {
   18547    case 10: return 0;
   18548    case 9: return 0;
   18549    case 8: return 0;
   18550    case 7:
   18551       if (devinfo->is_haswell) {
   18552          return 0;
   18553       } else {
   18554          return 0;
   18555       }
   18556    case 6: return 27;
   18557    case 5: return 0;
   18558    case 4:
   18559       if (devinfo->is_g4x) {
   18560          return 0;
   18561       } else {
   18562          return 0;
   18563       }
   18564    default:
   18565       unreachable("Invalid hardware generation");
   18566    }
   18567 }
   18568 
   18569 
   18570 
   18571 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer1_start  69
   18572 
   18573 static inline uint32_t ATTRIBUTE_PURE
   18574 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer1_start(const struct gen_device_info *devinfo)
   18575 {
   18576    switch (devinfo->gen) {
   18577    case 10: return 0;
   18578    case 9: return 0;
   18579    case 8: return 0;
   18580    case 7:
   18581       if (devinfo->is_haswell) {
   18582          return 0;
   18583       } else {
   18584          return 0;
   18585       }
   18586    case 6: return 69;
   18587    case 5: return 0;
   18588    case 4:
   18589       if (devinfo->is_g4x) {
   18590          return 0;
   18591       } else {
   18592          return 0;
   18593       }
   18594    default:
   18595       unreachable("Invalid hardware generation");
   18596    }
   18597 }
   18598 
   18599 
   18600 
   18601 /* 3DSTATE_CONSTANT_PS::Pointer to PS Constant Buffer 2 */
   18602 
   18603 
   18604 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer2_bits  27
   18605 
   18606 static inline uint32_t ATTRIBUTE_PURE
   18607 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer2_bits(const struct gen_device_info *devinfo)
   18608 {
   18609    switch (devinfo->gen) {
   18610    case 10: return 0;
   18611    case 9: return 0;
   18612    case 8: return 0;
   18613    case 7:
   18614       if (devinfo->is_haswell) {
   18615          return 0;
   18616       } else {
   18617          return 0;
   18618       }
   18619    case 6: return 27;
   18620    case 5: return 0;
   18621    case 4:
   18622       if (devinfo->is_g4x) {
   18623          return 0;
   18624       } else {
   18625          return 0;
   18626       }
   18627    default:
   18628       unreachable("Invalid hardware generation");
   18629    }
   18630 }
   18631 
   18632 
   18633 
   18634 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer2_start  101
   18635 
   18636 static inline uint32_t ATTRIBUTE_PURE
   18637 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer2_start(const struct gen_device_info *devinfo)
   18638 {
   18639    switch (devinfo->gen) {
   18640    case 10: return 0;
   18641    case 9: return 0;
   18642    case 8: return 0;
   18643    case 7:
   18644       if (devinfo->is_haswell) {
   18645          return 0;
   18646       } else {
   18647          return 0;
   18648       }
   18649    case 6: return 101;
   18650    case 5: return 0;
   18651    case 4:
   18652       if (devinfo->is_g4x) {
   18653          return 0;
   18654       } else {
   18655          return 0;
   18656       }
   18657    default:
   18658       unreachable("Invalid hardware generation");
   18659    }
   18660 }
   18661 
   18662 
   18663 
   18664 /* 3DSTATE_CONSTANT_PS::Pointer to PS Constant Buffer 3 */
   18665 
   18666 
   18667 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer3_bits  27
   18668 
   18669 static inline uint32_t ATTRIBUTE_PURE
   18670 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer3_bits(const struct gen_device_info *devinfo)
   18671 {
   18672    switch (devinfo->gen) {
   18673    case 10: return 0;
   18674    case 9: return 0;
   18675    case 8: return 0;
   18676    case 7:
   18677       if (devinfo->is_haswell) {
   18678          return 0;
   18679       } else {
   18680          return 0;
   18681       }
   18682    case 6: return 27;
   18683    case 5: return 0;
   18684    case 4:
   18685       if (devinfo->is_g4x) {
   18686          return 0;
   18687       } else {
   18688          return 0;
   18689       }
   18690    default:
   18691       unreachable("Invalid hardware generation");
   18692    }
   18693 }
   18694 
   18695 
   18696 
   18697 #define GEN6_3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer3_start  133
   18698 
   18699 static inline uint32_t ATTRIBUTE_PURE
   18700 _3DSTATE_CONSTANT_PS_PointertoPSConstantBuffer3_start(const struct gen_device_info *devinfo)
   18701 {
   18702    switch (devinfo->gen) {
   18703    case 10: return 0;
   18704    case 9: return 0;
   18705    case 8: return 0;
   18706    case 7:
   18707       if (devinfo->is_haswell) {
   18708          return 0;
   18709       } else {
   18710          return 0;
   18711       }
   18712    case 6: return 133;
   18713    case 5: return 0;
   18714    case 4:
   18715       if (devinfo->is_g4x) {
   18716          return 0;
   18717       } else {
   18718          return 0;
   18719       }
   18720    default:
   18721       unreachable("Invalid hardware generation");
   18722    }
   18723 }
   18724 
   18725 
   18726 
   18727 /* 3DSTATE_CONSTANT_VS */
   18728 
   18729 
   18730 #define GEN10_3DSTATE_CONSTANT_VS_length  11
   18731 #define GEN9_3DSTATE_CONSTANT_VS_length  11
   18732 #define GEN8_3DSTATE_CONSTANT_VS_length  11
   18733 #define GEN75_3DSTATE_CONSTANT_VS_length  7
   18734 #define GEN7_3DSTATE_CONSTANT_VS_length  7
   18735 #define GEN6_3DSTATE_CONSTANT_VS_length  5
   18736 
   18737 static inline uint32_t ATTRIBUTE_PURE
   18738 _3DSTATE_CONSTANT_VS_length(const struct gen_device_info *devinfo)
   18739 {
   18740    switch (devinfo->gen) {
   18741    case 10: return 11;
   18742    case 9: return 11;
   18743    case 8: return 11;
   18744    case 7:
   18745       if (devinfo->is_haswell) {
   18746          return 7;
   18747       } else {
   18748          return 7;
   18749       }
   18750    case 6: return 5;
   18751    case 5: return 0;
   18752    case 4:
   18753       if (devinfo->is_g4x) {
   18754          return 0;
   18755       } else {
   18756          return 0;
   18757       }
   18758    default:
   18759       unreachable("Invalid hardware generation");
   18760    }
   18761 }
   18762 
   18763 
   18764 
   18765 /* 3DSTATE_CONSTANT_VS::3D Command Opcode */
   18766 
   18767 
   18768 #define GEN10_3DSTATE_CONSTANT_VS_3DCommandOpcode_bits  3
   18769 #define GEN9_3DSTATE_CONSTANT_VS_3DCommandOpcode_bits  3
   18770 #define GEN8_3DSTATE_CONSTANT_VS_3DCommandOpcode_bits  3
   18771 #define GEN75_3DSTATE_CONSTANT_VS_3DCommandOpcode_bits  3
   18772 #define GEN7_3DSTATE_CONSTANT_VS_3DCommandOpcode_bits  3
   18773 #define GEN6_3DSTATE_CONSTANT_VS_3DCommandOpcode_bits  3
   18774 
   18775 static inline uint32_t ATTRIBUTE_PURE
   18776 _3DSTATE_CONSTANT_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   18777 {
   18778    switch (devinfo->gen) {
   18779    case 10: return 3;
   18780    case 9: return 3;
   18781    case 8: return 3;
   18782    case 7:
   18783       if (devinfo->is_haswell) {
   18784          return 3;
   18785       } else {
   18786          return 3;
   18787       }
   18788    case 6: return 3;
   18789    case 5: return 0;
   18790    case 4:
   18791       if (devinfo->is_g4x) {
   18792          return 0;
   18793       } else {
   18794          return 0;
   18795       }
   18796    default:
   18797       unreachable("Invalid hardware generation");
   18798    }
   18799 }
   18800 
   18801 
   18802 
   18803 #define GEN10_3DSTATE_CONSTANT_VS_3DCommandOpcode_start  24
   18804 #define GEN9_3DSTATE_CONSTANT_VS_3DCommandOpcode_start  24
   18805 #define GEN8_3DSTATE_CONSTANT_VS_3DCommandOpcode_start  24
   18806 #define GEN75_3DSTATE_CONSTANT_VS_3DCommandOpcode_start  24
   18807 #define GEN7_3DSTATE_CONSTANT_VS_3DCommandOpcode_start  24
   18808 #define GEN6_3DSTATE_CONSTANT_VS_3DCommandOpcode_start  24
   18809 
   18810 static inline uint32_t ATTRIBUTE_PURE
   18811 _3DSTATE_CONSTANT_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   18812 {
   18813    switch (devinfo->gen) {
   18814    case 10: return 24;
   18815    case 9: return 24;
   18816    case 8: return 24;
   18817    case 7:
   18818       if (devinfo->is_haswell) {
   18819          return 24;
   18820       } else {
   18821          return 24;
   18822       }
   18823    case 6: return 24;
   18824    case 5: return 0;
   18825    case 4:
   18826       if (devinfo->is_g4x) {
   18827          return 0;
   18828       } else {
   18829          return 0;
   18830       }
   18831    default:
   18832       unreachable("Invalid hardware generation");
   18833    }
   18834 }
   18835 
   18836 
   18837 
   18838 /* 3DSTATE_CONSTANT_VS::3D Command Sub Opcode */
   18839 
   18840 
   18841 #define GEN10_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_bits  8
   18842 #define GEN9_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_bits  8
   18843 #define GEN8_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_bits  8
   18844 #define GEN75_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_bits  8
   18845 #define GEN7_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_bits  8
   18846 #define GEN6_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_bits  8
   18847 
   18848 static inline uint32_t ATTRIBUTE_PURE
   18849 _3DSTATE_CONSTANT_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   18850 {
   18851    switch (devinfo->gen) {
   18852    case 10: return 8;
   18853    case 9: return 8;
   18854    case 8: return 8;
   18855    case 7:
   18856       if (devinfo->is_haswell) {
   18857          return 8;
   18858       } else {
   18859          return 8;
   18860       }
   18861    case 6: return 8;
   18862    case 5: return 0;
   18863    case 4:
   18864       if (devinfo->is_g4x) {
   18865          return 0;
   18866       } else {
   18867          return 0;
   18868       }
   18869    default:
   18870       unreachable("Invalid hardware generation");
   18871    }
   18872 }
   18873 
   18874 
   18875 
   18876 #define GEN10_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_start  16
   18877 #define GEN9_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_start  16
   18878 #define GEN8_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_start  16
   18879 #define GEN75_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_start  16
   18880 #define GEN7_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_start  16
   18881 #define GEN6_3DSTATE_CONSTANT_VS_3DCommandSubOpcode_start  16
   18882 
   18883 static inline uint32_t ATTRIBUTE_PURE
   18884 _3DSTATE_CONSTANT_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   18885 {
   18886    switch (devinfo->gen) {
   18887    case 10: return 16;
   18888    case 9: return 16;
   18889    case 8: return 16;
   18890    case 7:
   18891       if (devinfo->is_haswell) {
   18892          return 16;
   18893       } else {
   18894          return 16;
   18895       }
   18896    case 6: return 16;
   18897    case 5: return 0;
   18898    case 4:
   18899       if (devinfo->is_g4x) {
   18900          return 0;
   18901       } else {
   18902          return 0;
   18903       }
   18904    default:
   18905       unreachable("Invalid hardware generation");
   18906    }
   18907 }
   18908 
   18909 
   18910 
   18911 /* 3DSTATE_CONSTANT_VS::Buffer 0 Valid */
   18912 
   18913 
   18914 #define GEN6_3DSTATE_CONSTANT_VS_Buffer0Valid_bits  1
   18915 
   18916 static inline uint32_t ATTRIBUTE_PURE
   18917 _3DSTATE_CONSTANT_VS_Buffer0Valid_bits(const struct gen_device_info *devinfo)
   18918 {
   18919    switch (devinfo->gen) {
   18920    case 10: return 0;
   18921    case 9: return 0;
   18922    case 8: return 0;
   18923    case 7:
   18924       if (devinfo->is_haswell) {
   18925          return 0;
   18926       } else {
   18927          return 0;
   18928       }
   18929    case 6: return 1;
   18930    case 5: return 0;
   18931    case 4:
   18932       if (devinfo->is_g4x) {
   18933          return 0;
   18934       } else {
   18935          return 0;
   18936       }
   18937    default:
   18938       unreachable("Invalid hardware generation");
   18939    }
   18940 }
   18941 
   18942 
   18943 
   18944 #define GEN6_3DSTATE_CONSTANT_VS_Buffer0Valid_start  12
   18945 
   18946 static inline uint32_t ATTRIBUTE_PURE
   18947 _3DSTATE_CONSTANT_VS_Buffer0Valid_start(const struct gen_device_info *devinfo)
   18948 {
   18949    switch (devinfo->gen) {
   18950    case 10: return 0;
   18951    case 9: return 0;
   18952    case 8: return 0;
   18953    case 7:
   18954       if (devinfo->is_haswell) {
   18955          return 0;
   18956       } else {
   18957          return 0;
   18958       }
   18959    case 6: return 12;
   18960    case 5: return 0;
   18961    case 4:
   18962       if (devinfo->is_g4x) {
   18963          return 0;
   18964       } else {
   18965          return 0;
   18966       }
   18967    default:
   18968       unreachable("Invalid hardware generation");
   18969    }
   18970 }
   18971 
   18972 
   18973 
   18974 /* 3DSTATE_CONSTANT_VS::Buffer 1 Valid */
   18975 
   18976 
   18977 #define GEN6_3DSTATE_CONSTANT_VS_Buffer1Valid_bits  1
   18978 
   18979 static inline uint32_t ATTRIBUTE_PURE
   18980 _3DSTATE_CONSTANT_VS_Buffer1Valid_bits(const struct gen_device_info *devinfo)
   18981 {
   18982    switch (devinfo->gen) {
   18983    case 10: return 0;
   18984    case 9: return 0;
   18985    case 8: return 0;
   18986    case 7:
   18987       if (devinfo->is_haswell) {
   18988          return 0;
   18989       } else {
   18990          return 0;
   18991       }
   18992    case 6: return 1;
   18993    case 5: return 0;
   18994    case 4:
   18995       if (devinfo->is_g4x) {
   18996          return 0;
   18997       } else {
   18998          return 0;
   18999       }
   19000    default:
   19001       unreachable("Invalid hardware generation");
   19002    }
   19003 }
   19004 
   19005 
   19006 
   19007 #define GEN6_3DSTATE_CONSTANT_VS_Buffer1Valid_start  13
   19008 
   19009 static inline uint32_t ATTRIBUTE_PURE
   19010 _3DSTATE_CONSTANT_VS_Buffer1Valid_start(const struct gen_device_info *devinfo)
   19011 {
   19012    switch (devinfo->gen) {
   19013    case 10: return 0;
   19014    case 9: return 0;
   19015    case 8: return 0;
   19016    case 7:
   19017       if (devinfo->is_haswell) {
   19018          return 0;
   19019       } else {
   19020          return 0;
   19021       }
   19022    case 6: return 13;
   19023    case 5: return 0;
   19024    case 4:
   19025       if (devinfo->is_g4x) {
   19026          return 0;
   19027       } else {
   19028          return 0;
   19029       }
   19030    default:
   19031       unreachable("Invalid hardware generation");
   19032    }
   19033 }
   19034 
   19035 
   19036 
   19037 /* 3DSTATE_CONSTANT_VS::Buffer 2 Valid */
   19038 
   19039 
   19040 #define GEN6_3DSTATE_CONSTANT_VS_Buffer2Valid_bits  1
   19041 
   19042 static inline uint32_t ATTRIBUTE_PURE
   19043 _3DSTATE_CONSTANT_VS_Buffer2Valid_bits(const struct gen_device_info *devinfo)
   19044 {
   19045    switch (devinfo->gen) {
   19046    case 10: return 0;
   19047    case 9: return 0;
   19048    case 8: return 0;
   19049    case 7:
   19050       if (devinfo->is_haswell) {
   19051          return 0;
   19052       } else {
   19053          return 0;
   19054       }
   19055    case 6: return 1;
   19056    case 5: return 0;
   19057    case 4:
   19058       if (devinfo->is_g4x) {
   19059          return 0;
   19060       } else {
   19061          return 0;
   19062       }
   19063    default:
   19064       unreachable("Invalid hardware generation");
   19065    }
   19066 }
   19067 
   19068 
   19069 
   19070 #define GEN6_3DSTATE_CONSTANT_VS_Buffer2Valid_start  14
   19071 
   19072 static inline uint32_t ATTRIBUTE_PURE
   19073 _3DSTATE_CONSTANT_VS_Buffer2Valid_start(const struct gen_device_info *devinfo)
   19074 {
   19075    switch (devinfo->gen) {
   19076    case 10: return 0;
   19077    case 9: return 0;
   19078    case 8: return 0;
   19079    case 7:
   19080       if (devinfo->is_haswell) {
   19081          return 0;
   19082       } else {
   19083          return 0;
   19084       }
   19085    case 6: return 14;
   19086    case 5: return 0;
   19087    case 4:
   19088       if (devinfo->is_g4x) {
   19089          return 0;
   19090       } else {
   19091          return 0;
   19092       }
   19093    default:
   19094       unreachable("Invalid hardware generation");
   19095    }
   19096 }
   19097 
   19098 
   19099 
   19100 /* 3DSTATE_CONSTANT_VS::Buffer 3 Valid */
   19101 
   19102 
   19103 #define GEN6_3DSTATE_CONSTANT_VS_Buffer3Valid_bits  1
   19104 
   19105 static inline uint32_t ATTRIBUTE_PURE
   19106 _3DSTATE_CONSTANT_VS_Buffer3Valid_bits(const struct gen_device_info *devinfo)
   19107 {
   19108    switch (devinfo->gen) {
   19109    case 10: return 0;
   19110    case 9: return 0;
   19111    case 8: return 0;
   19112    case 7:
   19113       if (devinfo->is_haswell) {
   19114          return 0;
   19115       } else {
   19116          return 0;
   19117       }
   19118    case 6: return 1;
   19119    case 5: return 0;
   19120    case 4:
   19121       if (devinfo->is_g4x) {
   19122          return 0;
   19123       } else {
   19124          return 0;
   19125       }
   19126    default:
   19127       unreachable("Invalid hardware generation");
   19128    }
   19129 }
   19130 
   19131 
   19132 
   19133 #define GEN6_3DSTATE_CONSTANT_VS_Buffer3Valid_start  15
   19134 
   19135 static inline uint32_t ATTRIBUTE_PURE
   19136 _3DSTATE_CONSTANT_VS_Buffer3Valid_start(const struct gen_device_info *devinfo)
   19137 {
   19138    switch (devinfo->gen) {
   19139    case 10: return 0;
   19140    case 9: return 0;
   19141    case 8: return 0;
   19142    case 7:
   19143       if (devinfo->is_haswell) {
   19144          return 0;
   19145       } else {
   19146          return 0;
   19147       }
   19148    case 6: return 15;
   19149    case 5: return 0;
   19150    case 4:
   19151       if (devinfo->is_g4x) {
   19152          return 0;
   19153       } else {
   19154          return 0;
   19155       }
   19156    default:
   19157       unreachable("Invalid hardware generation");
   19158    }
   19159 }
   19160 
   19161 
   19162 
   19163 /* 3DSTATE_CONSTANT_VS::Command SubType */
   19164 
   19165 
   19166 #define GEN10_3DSTATE_CONSTANT_VS_CommandSubType_bits  2
   19167 #define GEN9_3DSTATE_CONSTANT_VS_CommandSubType_bits  2
   19168 #define GEN8_3DSTATE_CONSTANT_VS_CommandSubType_bits  2
   19169 #define GEN75_3DSTATE_CONSTANT_VS_CommandSubType_bits  2
   19170 #define GEN7_3DSTATE_CONSTANT_VS_CommandSubType_bits  2
   19171 #define GEN6_3DSTATE_CONSTANT_VS_CommandSubType_bits  2
   19172 
   19173 static inline uint32_t ATTRIBUTE_PURE
   19174 _3DSTATE_CONSTANT_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   19175 {
   19176    switch (devinfo->gen) {
   19177    case 10: return 2;
   19178    case 9: return 2;
   19179    case 8: return 2;
   19180    case 7:
   19181       if (devinfo->is_haswell) {
   19182          return 2;
   19183       } else {
   19184          return 2;
   19185       }
   19186    case 6: return 2;
   19187    case 5: return 0;
   19188    case 4:
   19189       if (devinfo->is_g4x) {
   19190          return 0;
   19191       } else {
   19192          return 0;
   19193       }
   19194    default:
   19195       unreachable("Invalid hardware generation");
   19196    }
   19197 }
   19198 
   19199 
   19200 
   19201 #define GEN10_3DSTATE_CONSTANT_VS_CommandSubType_start  27
   19202 #define GEN9_3DSTATE_CONSTANT_VS_CommandSubType_start  27
   19203 #define GEN8_3DSTATE_CONSTANT_VS_CommandSubType_start  27
   19204 #define GEN75_3DSTATE_CONSTANT_VS_CommandSubType_start  27
   19205 #define GEN7_3DSTATE_CONSTANT_VS_CommandSubType_start  27
   19206 #define GEN6_3DSTATE_CONSTANT_VS_CommandSubType_start  27
   19207 
   19208 static inline uint32_t ATTRIBUTE_PURE
   19209 _3DSTATE_CONSTANT_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   19210 {
   19211    switch (devinfo->gen) {
   19212    case 10: return 27;
   19213    case 9: return 27;
   19214    case 8: return 27;
   19215    case 7:
   19216       if (devinfo->is_haswell) {
   19217          return 27;
   19218       } else {
   19219          return 27;
   19220       }
   19221    case 6: return 27;
   19222    case 5: return 0;
   19223    case 4:
   19224       if (devinfo->is_g4x) {
   19225          return 0;
   19226       } else {
   19227          return 0;
   19228       }
   19229    default:
   19230       unreachable("Invalid hardware generation");
   19231    }
   19232 }
   19233 
   19234 
   19235 
   19236 /* 3DSTATE_CONSTANT_VS::Command Type */
   19237 
   19238 
   19239 #define GEN10_3DSTATE_CONSTANT_VS_CommandType_bits  3
   19240 #define GEN9_3DSTATE_CONSTANT_VS_CommandType_bits  3
   19241 #define GEN8_3DSTATE_CONSTANT_VS_CommandType_bits  3
   19242 #define GEN75_3DSTATE_CONSTANT_VS_CommandType_bits  3
   19243 #define GEN7_3DSTATE_CONSTANT_VS_CommandType_bits  3
   19244 #define GEN6_3DSTATE_CONSTANT_VS_CommandType_bits  3
   19245 
   19246 static inline uint32_t ATTRIBUTE_PURE
   19247 _3DSTATE_CONSTANT_VS_CommandType_bits(const struct gen_device_info *devinfo)
   19248 {
   19249    switch (devinfo->gen) {
   19250    case 10: return 3;
   19251    case 9: return 3;
   19252    case 8: return 3;
   19253    case 7:
   19254       if (devinfo->is_haswell) {
   19255          return 3;
   19256       } else {
   19257          return 3;
   19258       }
   19259    case 6: return 3;
   19260    case 5: return 0;
   19261    case 4:
   19262       if (devinfo->is_g4x) {
   19263          return 0;
   19264       } else {
   19265          return 0;
   19266       }
   19267    default:
   19268       unreachable("Invalid hardware generation");
   19269    }
   19270 }
   19271 
   19272 
   19273 
   19274 #define GEN10_3DSTATE_CONSTANT_VS_CommandType_start  29
   19275 #define GEN9_3DSTATE_CONSTANT_VS_CommandType_start  29
   19276 #define GEN8_3DSTATE_CONSTANT_VS_CommandType_start  29
   19277 #define GEN75_3DSTATE_CONSTANT_VS_CommandType_start  29
   19278 #define GEN7_3DSTATE_CONSTANT_VS_CommandType_start  29
   19279 #define GEN6_3DSTATE_CONSTANT_VS_CommandType_start  29
   19280 
   19281 static inline uint32_t ATTRIBUTE_PURE
   19282 _3DSTATE_CONSTANT_VS_CommandType_start(const struct gen_device_info *devinfo)
   19283 {
   19284    switch (devinfo->gen) {
   19285    case 10: return 29;
   19286    case 9: return 29;
   19287    case 8: return 29;
   19288    case 7:
   19289       if (devinfo->is_haswell) {
   19290          return 29;
   19291       } else {
   19292          return 29;
   19293       }
   19294    case 6: return 29;
   19295    case 5: return 0;
   19296    case 4:
   19297       if (devinfo->is_g4x) {
   19298          return 0;
   19299       } else {
   19300          return 0;
   19301       }
   19302    default:
   19303       unreachable("Invalid hardware generation");
   19304    }
   19305 }
   19306 
   19307 
   19308 
   19309 /* 3DSTATE_CONSTANT_VS::Constant Body */
   19310 
   19311 
   19312 #define GEN10_3DSTATE_CONSTANT_VS_ConstantBody_bits  320
   19313 #define GEN9_3DSTATE_CONSTANT_VS_ConstantBody_bits  320
   19314 #define GEN8_3DSTATE_CONSTANT_VS_ConstantBody_bits  320
   19315 #define GEN75_3DSTATE_CONSTANT_VS_ConstantBody_bits  192
   19316 #define GEN7_3DSTATE_CONSTANT_VS_ConstantBody_bits  192
   19317 
   19318 static inline uint32_t ATTRIBUTE_PURE
   19319 _3DSTATE_CONSTANT_VS_ConstantBody_bits(const struct gen_device_info *devinfo)
   19320 {
   19321    switch (devinfo->gen) {
   19322    case 10: return 320;
   19323    case 9: return 320;
   19324    case 8: return 320;
   19325    case 7:
   19326       if (devinfo->is_haswell) {
   19327          return 192;
   19328       } else {
   19329          return 192;
   19330       }
   19331    case 6: return 0;
   19332    case 5: return 0;
   19333    case 4:
   19334       if (devinfo->is_g4x) {
   19335          return 0;
   19336       } else {
   19337          return 0;
   19338       }
   19339    default:
   19340       unreachable("Invalid hardware generation");
   19341    }
   19342 }
   19343 
   19344 
   19345 
   19346 #define GEN10_3DSTATE_CONSTANT_VS_ConstantBody_start  32
   19347 #define GEN9_3DSTATE_CONSTANT_VS_ConstantBody_start  32
   19348 #define GEN8_3DSTATE_CONSTANT_VS_ConstantBody_start  32
   19349 #define GEN75_3DSTATE_CONSTANT_VS_ConstantBody_start  32
   19350 #define GEN7_3DSTATE_CONSTANT_VS_ConstantBody_start  32
   19351 
   19352 static inline uint32_t ATTRIBUTE_PURE
   19353 _3DSTATE_CONSTANT_VS_ConstantBody_start(const struct gen_device_info *devinfo)
   19354 {
   19355    switch (devinfo->gen) {
   19356    case 10: return 32;
   19357    case 9: return 32;
   19358    case 8: return 32;
   19359    case 7:
   19360       if (devinfo->is_haswell) {
   19361          return 32;
   19362       } else {
   19363          return 32;
   19364       }
   19365    case 6: return 0;
   19366    case 5: return 0;
   19367    case 4:
   19368       if (devinfo->is_g4x) {
   19369          return 0;
   19370       } else {
   19371          return 0;
   19372       }
   19373    default:
   19374       unreachable("Invalid hardware generation");
   19375    }
   19376 }
   19377 
   19378 
   19379 
   19380 /* 3DSTATE_CONSTANT_VS::Constant Buffer Object Control State */
   19381 
   19382 
   19383 #define GEN10_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_bits  7
   19384 #define GEN9_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_bits  7
   19385 #define GEN8_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_bits  7
   19386 #define GEN6_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_bits  4
   19387 
   19388 static inline uint32_t ATTRIBUTE_PURE
   19389 _3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   19390 {
   19391    switch (devinfo->gen) {
   19392    case 10: return 7;
   19393    case 9: return 7;
   19394    case 8: return 7;
   19395    case 7:
   19396       if (devinfo->is_haswell) {
   19397          return 0;
   19398       } else {
   19399          return 0;
   19400       }
   19401    case 6: return 4;
   19402    case 5: return 0;
   19403    case 4:
   19404       if (devinfo->is_g4x) {
   19405          return 0;
   19406       } else {
   19407          return 0;
   19408       }
   19409    default:
   19410       unreachable("Invalid hardware generation");
   19411    }
   19412 }
   19413 
   19414 
   19415 
   19416 #define GEN10_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_start  8
   19417 #define GEN9_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_start  8
   19418 #define GEN8_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_start  8
   19419 #define GEN6_3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_start  8
   19420 
   19421 static inline uint32_t ATTRIBUTE_PURE
   19422 _3DSTATE_CONSTANT_VS_ConstantBufferObjectControlState_start(const struct gen_device_info *devinfo)
   19423 {
   19424    switch (devinfo->gen) {
   19425    case 10: return 8;
   19426    case 9: return 8;
   19427    case 8: return 8;
   19428    case 7:
   19429       if (devinfo->is_haswell) {
   19430          return 0;
   19431       } else {
   19432          return 0;
   19433       }
   19434    case 6: return 8;
   19435    case 5: return 0;
   19436    case 4:
   19437       if (devinfo->is_g4x) {
   19438          return 0;
   19439       } else {
   19440          return 0;
   19441       }
   19442    default:
   19443       unreachable("Invalid hardware generation");
   19444    }
   19445 }
   19446 
   19447 
   19448 
   19449 /* 3DSTATE_CONSTANT_VS::DWord Length */
   19450 
   19451 
   19452 #define GEN10_3DSTATE_CONSTANT_VS_DWordLength_bits  8
   19453 #define GEN9_3DSTATE_CONSTANT_VS_DWordLength_bits  8
   19454 #define GEN8_3DSTATE_CONSTANT_VS_DWordLength_bits  8
   19455 #define GEN75_3DSTATE_CONSTANT_VS_DWordLength_bits  8
   19456 #define GEN7_3DSTATE_CONSTANT_VS_DWordLength_bits  8
   19457 #define GEN6_3DSTATE_CONSTANT_VS_DWordLength_bits  8
   19458 
   19459 static inline uint32_t ATTRIBUTE_PURE
   19460 _3DSTATE_CONSTANT_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   19461 {
   19462    switch (devinfo->gen) {
   19463    case 10: return 8;
   19464    case 9: return 8;
   19465    case 8: return 8;
   19466    case 7:
   19467       if (devinfo->is_haswell) {
   19468          return 8;
   19469       } else {
   19470          return 8;
   19471       }
   19472    case 6: return 8;
   19473    case 5: return 0;
   19474    case 4:
   19475       if (devinfo->is_g4x) {
   19476          return 0;
   19477       } else {
   19478          return 0;
   19479       }
   19480    default:
   19481       unreachable("Invalid hardware generation");
   19482    }
   19483 }
   19484 
   19485 
   19486 
   19487 #define GEN10_3DSTATE_CONSTANT_VS_DWordLength_start  0
   19488 #define GEN9_3DSTATE_CONSTANT_VS_DWordLength_start  0
   19489 #define GEN8_3DSTATE_CONSTANT_VS_DWordLength_start  0
   19490 #define GEN75_3DSTATE_CONSTANT_VS_DWordLength_start  0
   19491 #define GEN7_3DSTATE_CONSTANT_VS_DWordLength_start  0
   19492 #define GEN6_3DSTATE_CONSTANT_VS_DWordLength_start  0
   19493 
   19494 static inline uint32_t ATTRIBUTE_PURE
   19495 _3DSTATE_CONSTANT_VS_DWordLength_start(const struct gen_device_info *devinfo)
   19496 {
   19497    switch (devinfo->gen) {
   19498    case 10: return 0;
   19499    case 9: return 0;
   19500    case 8: return 0;
   19501    case 7:
   19502       if (devinfo->is_haswell) {
   19503          return 0;
   19504       } else {
   19505          return 0;
   19506       }
   19507    case 6: return 0;
   19508    case 5: return 0;
   19509    case 4:
   19510       if (devinfo->is_g4x) {
   19511          return 0;
   19512       } else {
   19513          return 0;
   19514       }
   19515    default:
   19516       unreachable("Invalid hardware generation");
   19517    }
   19518 }
   19519 
   19520 
   19521 
   19522 /* 3DSTATE_CONSTANT_VS::Pointer to VS Constant Buffer 0 */
   19523 
   19524 
   19525 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer0_bits  27
   19526 
   19527 static inline uint32_t ATTRIBUTE_PURE
   19528 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer0_bits(const struct gen_device_info *devinfo)
   19529 {
   19530    switch (devinfo->gen) {
   19531    case 10: return 0;
   19532    case 9: return 0;
   19533    case 8: return 0;
   19534    case 7:
   19535       if (devinfo->is_haswell) {
   19536          return 0;
   19537       } else {
   19538          return 0;
   19539       }
   19540    case 6: return 27;
   19541    case 5: return 0;
   19542    case 4:
   19543       if (devinfo->is_g4x) {
   19544          return 0;
   19545       } else {
   19546          return 0;
   19547       }
   19548    default:
   19549       unreachable("Invalid hardware generation");
   19550    }
   19551 }
   19552 
   19553 
   19554 
   19555 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer0_start  37
   19556 
   19557 static inline uint32_t ATTRIBUTE_PURE
   19558 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer0_start(const struct gen_device_info *devinfo)
   19559 {
   19560    switch (devinfo->gen) {
   19561    case 10: return 0;
   19562    case 9: return 0;
   19563    case 8: return 0;
   19564    case 7:
   19565       if (devinfo->is_haswell) {
   19566          return 0;
   19567       } else {
   19568          return 0;
   19569       }
   19570    case 6: return 37;
   19571    case 5: return 0;
   19572    case 4:
   19573       if (devinfo->is_g4x) {
   19574          return 0;
   19575       } else {
   19576          return 0;
   19577       }
   19578    default:
   19579       unreachable("Invalid hardware generation");
   19580    }
   19581 }
   19582 
   19583 
   19584 
   19585 /* 3DSTATE_CONSTANT_VS::Pointer to VS Constant Buffer 1 */
   19586 
   19587 
   19588 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer1_bits  27
   19589 
   19590 static inline uint32_t ATTRIBUTE_PURE
   19591 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer1_bits(const struct gen_device_info *devinfo)
   19592 {
   19593    switch (devinfo->gen) {
   19594    case 10: return 0;
   19595    case 9: return 0;
   19596    case 8: return 0;
   19597    case 7:
   19598       if (devinfo->is_haswell) {
   19599          return 0;
   19600       } else {
   19601          return 0;
   19602       }
   19603    case 6: return 27;
   19604    case 5: return 0;
   19605    case 4:
   19606       if (devinfo->is_g4x) {
   19607          return 0;
   19608       } else {
   19609          return 0;
   19610       }
   19611    default:
   19612       unreachable("Invalid hardware generation");
   19613    }
   19614 }
   19615 
   19616 
   19617 
   19618 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer1_start  69
   19619 
   19620 static inline uint32_t ATTRIBUTE_PURE
   19621 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer1_start(const struct gen_device_info *devinfo)
   19622 {
   19623    switch (devinfo->gen) {
   19624    case 10: return 0;
   19625    case 9: return 0;
   19626    case 8: return 0;
   19627    case 7:
   19628       if (devinfo->is_haswell) {
   19629          return 0;
   19630       } else {
   19631          return 0;
   19632       }
   19633    case 6: return 69;
   19634    case 5: return 0;
   19635    case 4:
   19636       if (devinfo->is_g4x) {
   19637          return 0;
   19638       } else {
   19639          return 0;
   19640       }
   19641    default:
   19642       unreachable("Invalid hardware generation");
   19643    }
   19644 }
   19645 
   19646 
   19647 
   19648 /* 3DSTATE_CONSTANT_VS::Pointer to VS Constant Buffer 2 */
   19649 
   19650 
   19651 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer2_bits  27
   19652 
   19653 static inline uint32_t ATTRIBUTE_PURE
   19654 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer2_bits(const struct gen_device_info *devinfo)
   19655 {
   19656    switch (devinfo->gen) {
   19657    case 10: return 0;
   19658    case 9: return 0;
   19659    case 8: return 0;
   19660    case 7:
   19661       if (devinfo->is_haswell) {
   19662          return 0;
   19663       } else {
   19664          return 0;
   19665       }
   19666    case 6: return 27;
   19667    case 5: return 0;
   19668    case 4:
   19669       if (devinfo->is_g4x) {
   19670          return 0;
   19671       } else {
   19672          return 0;
   19673       }
   19674    default:
   19675       unreachable("Invalid hardware generation");
   19676    }
   19677 }
   19678 
   19679 
   19680 
   19681 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer2_start  101
   19682 
   19683 static inline uint32_t ATTRIBUTE_PURE
   19684 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer2_start(const struct gen_device_info *devinfo)
   19685 {
   19686    switch (devinfo->gen) {
   19687    case 10: return 0;
   19688    case 9: return 0;
   19689    case 8: return 0;
   19690    case 7:
   19691       if (devinfo->is_haswell) {
   19692          return 0;
   19693       } else {
   19694          return 0;
   19695       }
   19696    case 6: return 101;
   19697    case 5: return 0;
   19698    case 4:
   19699       if (devinfo->is_g4x) {
   19700          return 0;
   19701       } else {
   19702          return 0;
   19703       }
   19704    default:
   19705       unreachable("Invalid hardware generation");
   19706    }
   19707 }
   19708 
   19709 
   19710 
   19711 /* 3DSTATE_CONSTANT_VS::Pointer to VS Constant Buffer 3 */
   19712 
   19713 
   19714 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer3_bits  27
   19715 
   19716 static inline uint32_t ATTRIBUTE_PURE
   19717 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer3_bits(const struct gen_device_info *devinfo)
   19718 {
   19719    switch (devinfo->gen) {
   19720    case 10: return 0;
   19721    case 9: return 0;
   19722    case 8: return 0;
   19723    case 7:
   19724       if (devinfo->is_haswell) {
   19725          return 0;
   19726       } else {
   19727          return 0;
   19728       }
   19729    case 6: return 27;
   19730    case 5: return 0;
   19731    case 4:
   19732       if (devinfo->is_g4x) {
   19733          return 0;
   19734       } else {
   19735          return 0;
   19736       }
   19737    default:
   19738       unreachable("Invalid hardware generation");
   19739    }
   19740 }
   19741 
   19742 
   19743 
   19744 #define GEN6_3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer3_start  133
   19745 
   19746 static inline uint32_t ATTRIBUTE_PURE
   19747 _3DSTATE_CONSTANT_VS_PointertoVSConstantBuffer3_start(const struct gen_device_info *devinfo)
   19748 {
   19749    switch (devinfo->gen) {
   19750    case 10: return 0;
   19751    case 9: return 0;
   19752    case 8: return 0;
   19753    case 7:
   19754       if (devinfo->is_haswell) {
   19755          return 0;
   19756       } else {
   19757          return 0;
   19758       }
   19759    case 6: return 133;
   19760    case 5: return 0;
   19761    case 4:
   19762       if (devinfo->is_g4x) {
   19763          return 0;
   19764       } else {
   19765          return 0;
   19766       }
   19767    default:
   19768       unreachable("Invalid hardware generation");
   19769    }
   19770 }
   19771 
   19772 
   19773 
   19774 /* 3DSTATE_CONSTANT_VS::VS Constant Buffer 0 Read Length */
   19775 
   19776 
   19777 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer0ReadLength_bits  5
   19778 
   19779 static inline uint32_t ATTRIBUTE_PURE
   19780 _3DSTATE_CONSTANT_VS_VSConstantBuffer0ReadLength_bits(const struct gen_device_info *devinfo)
   19781 {
   19782    switch (devinfo->gen) {
   19783    case 10: return 0;
   19784    case 9: return 0;
   19785    case 8: return 0;
   19786    case 7:
   19787       if (devinfo->is_haswell) {
   19788          return 0;
   19789       } else {
   19790          return 0;
   19791       }
   19792    case 6: return 5;
   19793    case 5: return 0;
   19794    case 4:
   19795       if (devinfo->is_g4x) {
   19796          return 0;
   19797       } else {
   19798          return 0;
   19799       }
   19800    default:
   19801       unreachable("Invalid hardware generation");
   19802    }
   19803 }
   19804 
   19805 
   19806 
   19807 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer0ReadLength_start  32
   19808 
   19809 static inline uint32_t ATTRIBUTE_PURE
   19810 _3DSTATE_CONSTANT_VS_VSConstantBuffer0ReadLength_start(const struct gen_device_info *devinfo)
   19811 {
   19812    switch (devinfo->gen) {
   19813    case 10: return 0;
   19814    case 9: return 0;
   19815    case 8: return 0;
   19816    case 7:
   19817       if (devinfo->is_haswell) {
   19818          return 0;
   19819       } else {
   19820          return 0;
   19821       }
   19822    case 6: return 32;
   19823    case 5: return 0;
   19824    case 4:
   19825       if (devinfo->is_g4x) {
   19826          return 0;
   19827       } else {
   19828          return 0;
   19829       }
   19830    default:
   19831       unreachable("Invalid hardware generation");
   19832    }
   19833 }
   19834 
   19835 
   19836 
   19837 /* 3DSTATE_CONSTANT_VS::VS Constant Buffer 1 Read Length */
   19838 
   19839 
   19840 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer1ReadLength_bits  5
   19841 
   19842 static inline uint32_t ATTRIBUTE_PURE
   19843 _3DSTATE_CONSTANT_VS_VSConstantBuffer1ReadLength_bits(const struct gen_device_info *devinfo)
   19844 {
   19845    switch (devinfo->gen) {
   19846    case 10: return 0;
   19847    case 9: return 0;
   19848    case 8: return 0;
   19849    case 7:
   19850       if (devinfo->is_haswell) {
   19851          return 0;
   19852       } else {
   19853          return 0;
   19854       }
   19855    case 6: return 5;
   19856    case 5: return 0;
   19857    case 4:
   19858       if (devinfo->is_g4x) {
   19859          return 0;
   19860       } else {
   19861          return 0;
   19862       }
   19863    default:
   19864       unreachable("Invalid hardware generation");
   19865    }
   19866 }
   19867 
   19868 
   19869 
   19870 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer1ReadLength_start  64
   19871 
   19872 static inline uint32_t ATTRIBUTE_PURE
   19873 _3DSTATE_CONSTANT_VS_VSConstantBuffer1ReadLength_start(const struct gen_device_info *devinfo)
   19874 {
   19875    switch (devinfo->gen) {
   19876    case 10: return 0;
   19877    case 9: return 0;
   19878    case 8: return 0;
   19879    case 7:
   19880       if (devinfo->is_haswell) {
   19881          return 0;
   19882       } else {
   19883          return 0;
   19884       }
   19885    case 6: return 64;
   19886    case 5: return 0;
   19887    case 4:
   19888       if (devinfo->is_g4x) {
   19889          return 0;
   19890       } else {
   19891          return 0;
   19892       }
   19893    default:
   19894       unreachable("Invalid hardware generation");
   19895    }
   19896 }
   19897 
   19898 
   19899 
   19900 /* 3DSTATE_CONSTANT_VS::VS Constant Buffer 2 Read Length */
   19901 
   19902 
   19903 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer2ReadLength_bits  5
   19904 
   19905 static inline uint32_t ATTRIBUTE_PURE
   19906 _3DSTATE_CONSTANT_VS_VSConstantBuffer2ReadLength_bits(const struct gen_device_info *devinfo)
   19907 {
   19908    switch (devinfo->gen) {
   19909    case 10: return 0;
   19910    case 9: return 0;
   19911    case 8: return 0;
   19912    case 7:
   19913       if (devinfo->is_haswell) {
   19914          return 0;
   19915       } else {
   19916          return 0;
   19917       }
   19918    case 6: return 5;
   19919    case 5: return 0;
   19920    case 4:
   19921       if (devinfo->is_g4x) {
   19922          return 0;
   19923       } else {
   19924          return 0;
   19925       }
   19926    default:
   19927       unreachable("Invalid hardware generation");
   19928    }
   19929 }
   19930 
   19931 
   19932 
   19933 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer2ReadLength_start  96
   19934 
   19935 static inline uint32_t ATTRIBUTE_PURE
   19936 _3DSTATE_CONSTANT_VS_VSConstantBuffer2ReadLength_start(const struct gen_device_info *devinfo)
   19937 {
   19938    switch (devinfo->gen) {
   19939    case 10: return 0;
   19940    case 9: return 0;
   19941    case 8: return 0;
   19942    case 7:
   19943       if (devinfo->is_haswell) {
   19944          return 0;
   19945       } else {
   19946          return 0;
   19947       }
   19948    case 6: return 96;
   19949    case 5: return 0;
   19950    case 4:
   19951       if (devinfo->is_g4x) {
   19952          return 0;
   19953       } else {
   19954          return 0;
   19955       }
   19956    default:
   19957       unreachable("Invalid hardware generation");
   19958    }
   19959 }
   19960 
   19961 
   19962 
   19963 /* 3DSTATE_CONSTANT_VS::VS Constant Buffer 3 Read Length */
   19964 
   19965 
   19966 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer3ReadLength_bits  5
   19967 
   19968 static inline uint32_t ATTRIBUTE_PURE
   19969 _3DSTATE_CONSTANT_VS_VSConstantBuffer3ReadLength_bits(const struct gen_device_info *devinfo)
   19970 {
   19971    switch (devinfo->gen) {
   19972    case 10: return 0;
   19973    case 9: return 0;
   19974    case 8: return 0;
   19975    case 7:
   19976       if (devinfo->is_haswell) {
   19977          return 0;
   19978       } else {
   19979          return 0;
   19980       }
   19981    case 6: return 5;
   19982    case 5: return 0;
   19983    case 4:
   19984       if (devinfo->is_g4x) {
   19985          return 0;
   19986       } else {
   19987          return 0;
   19988       }
   19989    default:
   19990       unreachable("Invalid hardware generation");
   19991    }
   19992 }
   19993 
   19994 
   19995 
   19996 #define GEN6_3DSTATE_CONSTANT_VS_VSConstantBuffer3ReadLength_start  128
   19997 
   19998 static inline uint32_t ATTRIBUTE_PURE
   19999 _3DSTATE_CONSTANT_VS_VSConstantBuffer3ReadLength_start(const struct gen_device_info *devinfo)
   20000 {
   20001    switch (devinfo->gen) {
   20002    case 10: return 0;
   20003    case 9: return 0;
   20004    case 8: return 0;
   20005    case 7:
   20006       if (devinfo->is_haswell) {
   20007          return 0;
   20008       } else {
   20009          return 0;
   20010       }
   20011    case 6: return 128;
   20012    case 5: return 0;
   20013    case 4:
   20014       if (devinfo->is_g4x) {
   20015          return 0;
   20016       } else {
   20017          return 0;
   20018       }
   20019    default:
   20020       unreachable("Invalid hardware generation");
   20021    }
   20022 }
   20023 
   20024 
   20025 
   20026 /* 3DSTATE_DEPTH_BUFFER */
   20027 
   20028 
   20029 #define GEN10_3DSTATE_DEPTH_BUFFER_length  8
   20030 #define GEN9_3DSTATE_DEPTH_BUFFER_length  8
   20031 #define GEN8_3DSTATE_DEPTH_BUFFER_length  8
   20032 #define GEN75_3DSTATE_DEPTH_BUFFER_length  7
   20033 #define GEN7_3DSTATE_DEPTH_BUFFER_length  7
   20034 #define GEN6_3DSTATE_DEPTH_BUFFER_length  7
   20035 #define GEN5_3DSTATE_DEPTH_BUFFER_length  6
   20036 #define GEN45_3DSTATE_DEPTH_BUFFER_length  6
   20037 #define GEN4_3DSTATE_DEPTH_BUFFER_length  5
   20038 
   20039 static inline uint32_t ATTRIBUTE_PURE
   20040 _3DSTATE_DEPTH_BUFFER_length(const struct gen_device_info *devinfo)
   20041 {
   20042    switch (devinfo->gen) {
   20043    case 10: return 8;
   20044    case 9: return 8;
   20045    case 8: return 8;
   20046    case 7:
   20047       if (devinfo->is_haswell) {
   20048          return 7;
   20049       } else {
   20050          return 7;
   20051       }
   20052    case 6: return 7;
   20053    case 5: return 6;
   20054    case 4:
   20055       if (devinfo->is_g4x) {
   20056          return 6;
   20057       } else {
   20058          return 5;
   20059       }
   20060    default:
   20061       unreachable("Invalid hardware generation");
   20062    }
   20063 }
   20064 
   20065 
   20066 
   20067 /* 3DSTATE_DEPTH_BUFFER::3D Command Opcode */
   20068 
   20069 
   20070 #define GEN10_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20071 #define GEN9_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20072 #define GEN8_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20073 #define GEN75_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20074 #define GEN7_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20075 #define GEN6_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20076 #define GEN5_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20077 #define GEN45_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20078 #define GEN4_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits  3
   20079 
   20080 static inline uint32_t ATTRIBUTE_PURE
   20081 _3DSTATE_DEPTH_BUFFER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   20082 {
   20083    switch (devinfo->gen) {
   20084    case 10: return 3;
   20085    case 9: return 3;
   20086    case 8: return 3;
   20087    case 7:
   20088       if (devinfo->is_haswell) {
   20089          return 3;
   20090       } else {
   20091          return 3;
   20092       }
   20093    case 6: return 3;
   20094    case 5: return 3;
   20095    case 4:
   20096       if (devinfo->is_g4x) {
   20097          return 3;
   20098       } else {
   20099          return 3;
   20100       }
   20101    default:
   20102       unreachable("Invalid hardware generation");
   20103    }
   20104 }
   20105 
   20106 
   20107 
   20108 #define GEN10_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20109 #define GEN9_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20110 #define GEN8_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20111 #define GEN75_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20112 #define GEN7_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20113 #define GEN6_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20114 #define GEN5_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20115 #define GEN45_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20116 #define GEN4_3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start  24
   20117 
   20118 static inline uint32_t ATTRIBUTE_PURE
   20119 _3DSTATE_DEPTH_BUFFER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   20120 {
   20121    switch (devinfo->gen) {
   20122    case 10: return 24;
   20123    case 9: return 24;
   20124    case 8: return 24;
   20125    case 7:
   20126       if (devinfo->is_haswell) {
   20127          return 24;
   20128       } else {
   20129          return 24;
   20130       }
   20131    case 6: return 24;
   20132    case 5: return 24;
   20133    case 4:
   20134       if (devinfo->is_g4x) {
   20135          return 24;
   20136       } else {
   20137          return 24;
   20138       }
   20139    default:
   20140       unreachable("Invalid hardware generation");
   20141    }
   20142 }
   20143 
   20144 
   20145 
   20146 /* 3DSTATE_DEPTH_BUFFER::3D Command Sub Opcode */
   20147 
   20148 
   20149 #define GEN10_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20150 #define GEN9_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20151 #define GEN8_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20152 #define GEN75_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20153 #define GEN7_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20154 #define GEN6_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20155 #define GEN5_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20156 #define GEN45_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20157 #define GEN4_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   20158 
   20159 static inline uint32_t ATTRIBUTE_PURE
   20160 _3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   20161 {
   20162    switch (devinfo->gen) {
   20163    case 10: return 8;
   20164    case 9: return 8;
   20165    case 8: return 8;
   20166    case 7:
   20167       if (devinfo->is_haswell) {
   20168          return 8;
   20169       } else {
   20170          return 8;
   20171       }
   20172    case 6: return 8;
   20173    case 5: return 8;
   20174    case 4:
   20175       if (devinfo->is_g4x) {
   20176          return 8;
   20177       } else {
   20178          return 8;
   20179       }
   20180    default:
   20181       unreachable("Invalid hardware generation");
   20182    }
   20183 }
   20184 
   20185 
   20186 
   20187 #define GEN10_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20188 #define GEN9_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20189 #define GEN8_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20190 #define GEN75_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20191 #define GEN7_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20192 #define GEN6_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20193 #define GEN5_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20194 #define GEN45_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20195 #define GEN4_3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   20196 
   20197 static inline uint32_t ATTRIBUTE_PURE
   20198 _3DSTATE_DEPTH_BUFFER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   20199 {
   20200    switch (devinfo->gen) {
   20201    case 10: return 16;
   20202    case 9: return 16;
   20203    case 8: return 16;
   20204    case 7:
   20205       if (devinfo->is_haswell) {
   20206          return 16;
   20207       } else {
   20208          return 16;
   20209       }
   20210    case 6: return 16;
   20211    case 5: return 16;
   20212    case 4:
   20213       if (devinfo->is_g4x) {
   20214          return 16;
   20215       } else {
   20216          return 16;
   20217       }
   20218    default:
   20219       unreachable("Invalid hardware generation");
   20220    }
   20221 }
   20222 
   20223 
   20224 
   20225 /* 3DSTATE_DEPTH_BUFFER::Command SubType */
   20226 
   20227 
   20228 #define GEN10_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20229 #define GEN9_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20230 #define GEN8_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20231 #define GEN75_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20232 #define GEN7_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20233 #define GEN6_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20234 #define GEN5_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20235 #define GEN45_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20236 #define GEN4_3DSTATE_DEPTH_BUFFER_CommandSubType_bits  2
   20237 
   20238 static inline uint32_t ATTRIBUTE_PURE
   20239 _3DSTATE_DEPTH_BUFFER_CommandSubType_bits(const struct gen_device_info *devinfo)
   20240 {
   20241    switch (devinfo->gen) {
   20242    case 10: return 2;
   20243    case 9: return 2;
   20244    case 8: return 2;
   20245    case 7:
   20246       if (devinfo->is_haswell) {
   20247          return 2;
   20248       } else {
   20249          return 2;
   20250       }
   20251    case 6: return 2;
   20252    case 5: return 2;
   20253    case 4:
   20254       if (devinfo->is_g4x) {
   20255          return 2;
   20256       } else {
   20257          return 2;
   20258       }
   20259    default:
   20260       unreachable("Invalid hardware generation");
   20261    }
   20262 }
   20263 
   20264 
   20265 
   20266 #define GEN10_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20267 #define GEN9_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20268 #define GEN8_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20269 #define GEN75_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20270 #define GEN7_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20271 #define GEN6_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20272 #define GEN5_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20273 #define GEN45_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20274 #define GEN4_3DSTATE_DEPTH_BUFFER_CommandSubType_start  27
   20275 
   20276 static inline uint32_t ATTRIBUTE_PURE
   20277 _3DSTATE_DEPTH_BUFFER_CommandSubType_start(const struct gen_device_info *devinfo)
   20278 {
   20279    switch (devinfo->gen) {
   20280    case 10: return 27;
   20281    case 9: return 27;
   20282    case 8: return 27;
   20283    case 7:
   20284       if (devinfo->is_haswell) {
   20285          return 27;
   20286       } else {
   20287          return 27;
   20288       }
   20289    case 6: return 27;
   20290    case 5: return 27;
   20291    case 4:
   20292       if (devinfo->is_g4x) {
   20293          return 27;
   20294       } else {
   20295          return 27;
   20296       }
   20297    default:
   20298       unreachable("Invalid hardware generation");
   20299    }
   20300 }
   20301 
   20302 
   20303 
   20304 /* 3DSTATE_DEPTH_BUFFER::Command Type */
   20305 
   20306 
   20307 #define GEN10_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20308 #define GEN9_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20309 #define GEN8_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20310 #define GEN75_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20311 #define GEN7_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20312 #define GEN6_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20313 #define GEN5_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20314 #define GEN45_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20315 #define GEN4_3DSTATE_DEPTH_BUFFER_CommandType_bits  3
   20316 
   20317 static inline uint32_t ATTRIBUTE_PURE
   20318 _3DSTATE_DEPTH_BUFFER_CommandType_bits(const struct gen_device_info *devinfo)
   20319 {
   20320    switch (devinfo->gen) {
   20321    case 10: return 3;
   20322    case 9: return 3;
   20323    case 8: return 3;
   20324    case 7:
   20325       if (devinfo->is_haswell) {
   20326          return 3;
   20327       } else {
   20328          return 3;
   20329       }
   20330    case 6: return 3;
   20331    case 5: return 3;
   20332    case 4:
   20333       if (devinfo->is_g4x) {
   20334          return 3;
   20335       } else {
   20336          return 3;
   20337       }
   20338    default:
   20339       unreachable("Invalid hardware generation");
   20340    }
   20341 }
   20342 
   20343 
   20344 
   20345 #define GEN10_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20346 #define GEN9_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20347 #define GEN8_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20348 #define GEN75_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20349 #define GEN7_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20350 #define GEN6_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20351 #define GEN5_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20352 #define GEN45_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20353 #define GEN4_3DSTATE_DEPTH_BUFFER_CommandType_start  29
   20354 
   20355 static inline uint32_t ATTRIBUTE_PURE
   20356 _3DSTATE_DEPTH_BUFFER_CommandType_start(const struct gen_device_info *devinfo)
   20357 {
   20358    switch (devinfo->gen) {
   20359    case 10: return 29;
   20360    case 9: return 29;
   20361    case 8: return 29;
   20362    case 7:
   20363       if (devinfo->is_haswell) {
   20364          return 29;
   20365       } else {
   20366          return 29;
   20367       }
   20368    case 6: return 29;
   20369    case 5: return 29;
   20370    case 4:
   20371       if (devinfo->is_g4x) {
   20372          return 29;
   20373       } else {
   20374          return 29;
   20375       }
   20376    default:
   20377       unreachable("Invalid hardware generation");
   20378    }
   20379 }
   20380 
   20381 
   20382 
   20383 /* 3DSTATE_DEPTH_BUFFER::DWord Length */
   20384 
   20385 
   20386 #define GEN10_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20387 #define GEN9_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20388 #define GEN8_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20389 #define GEN75_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20390 #define GEN7_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20391 #define GEN6_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20392 #define GEN5_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20393 #define GEN45_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20394 #define GEN4_3DSTATE_DEPTH_BUFFER_DWordLength_bits  8
   20395 
   20396 static inline uint32_t ATTRIBUTE_PURE
   20397 _3DSTATE_DEPTH_BUFFER_DWordLength_bits(const struct gen_device_info *devinfo)
   20398 {
   20399    switch (devinfo->gen) {
   20400    case 10: return 8;
   20401    case 9: return 8;
   20402    case 8: return 8;
   20403    case 7:
   20404       if (devinfo->is_haswell) {
   20405          return 8;
   20406       } else {
   20407          return 8;
   20408       }
   20409    case 6: return 8;
   20410    case 5: return 8;
   20411    case 4:
   20412       if (devinfo->is_g4x) {
   20413          return 8;
   20414       } else {
   20415          return 8;
   20416       }
   20417    default:
   20418       unreachable("Invalid hardware generation");
   20419    }
   20420 }
   20421 
   20422 
   20423 
   20424 #define GEN10_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20425 #define GEN9_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20426 #define GEN8_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20427 #define GEN75_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20428 #define GEN7_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20429 #define GEN6_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20430 #define GEN5_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20431 #define GEN45_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20432 #define GEN4_3DSTATE_DEPTH_BUFFER_DWordLength_start  0
   20433 
   20434 static inline uint32_t ATTRIBUTE_PURE
   20435 _3DSTATE_DEPTH_BUFFER_DWordLength_start(const struct gen_device_info *devinfo)
   20436 {
   20437    switch (devinfo->gen) {
   20438    case 10: return 0;
   20439    case 9: return 0;
   20440    case 8: return 0;
   20441    case 7:
   20442       if (devinfo->is_haswell) {
   20443          return 0;
   20444       } else {
   20445          return 0;
   20446       }
   20447    case 6: return 0;
   20448    case 5: return 0;
   20449    case 4:
   20450       if (devinfo->is_g4x) {
   20451          return 0;
   20452       } else {
   20453          return 0;
   20454       }
   20455    default:
   20456       unreachable("Invalid hardware generation");
   20457    }
   20458 }
   20459 
   20460 
   20461 
   20462 /* 3DSTATE_DEPTH_BUFFER::Depth */
   20463 
   20464 
   20465 #define GEN10_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20466 #define GEN9_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20467 #define GEN8_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20468 #define GEN75_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20469 #define GEN7_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20470 #define GEN6_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20471 #define GEN5_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20472 #define GEN45_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20473 #define GEN4_3DSTATE_DEPTH_BUFFER_Depth_bits  11
   20474 
   20475 static inline uint32_t ATTRIBUTE_PURE
   20476 _3DSTATE_DEPTH_BUFFER_Depth_bits(const struct gen_device_info *devinfo)
   20477 {
   20478    switch (devinfo->gen) {
   20479    case 10: return 11;
   20480    case 9: return 11;
   20481    case 8: return 11;
   20482    case 7:
   20483       if (devinfo->is_haswell) {
   20484          return 11;
   20485       } else {
   20486          return 11;
   20487       }
   20488    case 6: return 11;
   20489    case 5: return 11;
   20490    case 4:
   20491       if (devinfo->is_g4x) {
   20492          return 11;
   20493       } else {
   20494          return 11;
   20495       }
   20496    default:
   20497       unreachable("Invalid hardware generation");
   20498    }
   20499 }
   20500 
   20501 
   20502 
   20503 #define GEN10_3DSTATE_DEPTH_BUFFER_Depth_start  181
   20504 #define GEN9_3DSTATE_DEPTH_BUFFER_Depth_start  181
   20505 #define GEN8_3DSTATE_DEPTH_BUFFER_Depth_start  181
   20506 #define GEN75_3DSTATE_DEPTH_BUFFER_Depth_start  149
   20507 #define GEN7_3DSTATE_DEPTH_BUFFER_Depth_start  149
   20508 #define GEN6_3DSTATE_DEPTH_BUFFER_Depth_start  149
   20509 #define GEN5_3DSTATE_DEPTH_BUFFER_Depth_start  149
   20510 #define GEN45_3DSTATE_DEPTH_BUFFER_Depth_start  149
   20511 #define GEN4_3DSTATE_DEPTH_BUFFER_Depth_start  149
   20512 
   20513 static inline uint32_t ATTRIBUTE_PURE
   20514 _3DSTATE_DEPTH_BUFFER_Depth_start(const struct gen_device_info *devinfo)
   20515 {
   20516    switch (devinfo->gen) {
   20517    case 10: return 181;
   20518    case 9: return 181;
   20519    case 8: return 181;
   20520    case 7:
   20521       if (devinfo->is_haswell) {
   20522          return 149;
   20523       } else {
   20524          return 149;
   20525       }
   20526    case 6: return 149;
   20527    case 5: return 149;
   20528    case 4:
   20529       if (devinfo->is_g4x) {
   20530          return 149;
   20531       } else {
   20532          return 149;
   20533       }
   20534    default:
   20535       unreachable("Invalid hardware generation");
   20536    }
   20537 }
   20538 
   20539 
   20540 
   20541 /* 3DSTATE_DEPTH_BUFFER::Depth Buffer Coordinate Offset Disable */
   20542 
   20543 
   20544 #define GEN45_3DSTATE_DEPTH_BUFFER_DepthBufferCoordinateOffsetDisable_bits  1
   20545 #define GEN4_3DSTATE_DEPTH_BUFFER_DepthBufferCoordinateOffsetDisable_bits  1
   20546 
   20547 static inline uint32_t ATTRIBUTE_PURE
   20548 _3DSTATE_DEPTH_BUFFER_DepthBufferCoordinateOffsetDisable_bits(const struct gen_device_info *devinfo)
   20549 {
   20550    switch (devinfo->gen) {
   20551    case 10: return 0;
   20552    case 9: return 0;
   20553    case 8: return 0;
   20554    case 7:
   20555       if (devinfo->is_haswell) {
   20556          return 0;
   20557       } else {
   20558          return 0;
   20559       }
   20560    case 6: return 0;
   20561    case 5: return 0;
   20562    case 4:
   20563       if (devinfo->is_g4x) {
   20564          return 1;
   20565       } else {
   20566          return 1;
   20567       }
   20568    default:
   20569       unreachable("Invalid hardware generation");
   20570    }
   20571 }
   20572 
   20573 
   20574 
   20575 #define GEN45_3DSTATE_DEPTH_BUFFER_DepthBufferCoordinateOffsetDisable_start  57
   20576 #define GEN4_3DSTATE_DEPTH_BUFFER_DepthBufferCoordinateOffsetDisable_start  57
   20577 
   20578 static inline uint32_t ATTRIBUTE_PURE
   20579 _3DSTATE_DEPTH_BUFFER_DepthBufferCoordinateOffsetDisable_start(const struct gen_device_info *devinfo)
   20580 {
   20581    switch (devinfo->gen) {
   20582    case 10: return 0;
   20583    case 9: return 0;
   20584    case 8: return 0;
   20585    case 7:
   20586       if (devinfo->is_haswell) {
   20587          return 0;
   20588       } else {
   20589          return 0;
   20590       }
   20591    case 6: return 0;
   20592    case 5: return 0;
   20593    case 4:
   20594       if (devinfo->is_g4x) {
   20595          return 57;
   20596       } else {
   20597          return 57;
   20598       }
   20599    default:
   20600       unreachable("Invalid hardware generation");
   20601    }
   20602 }
   20603 
   20604 
   20605 
   20606 /* 3DSTATE_DEPTH_BUFFER::Depth Buffer MOCS */
   20607 
   20608 
   20609 #define GEN10_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_bits  7
   20610 #define GEN9_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_bits  7
   20611 #define GEN8_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_bits  7
   20612 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_bits  4
   20613 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_bits  4
   20614 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_bits  5
   20615 
   20616 static inline uint32_t ATTRIBUTE_PURE
   20617 _3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_bits(const struct gen_device_info *devinfo)
   20618 {
   20619    switch (devinfo->gen) {
   20620    case 10: return 7;
   20621    case 9: return 7;
   20622    case 8: return 7;
   20623    case 7:
   20624       if (devinfo->is_haswell) {
   20625          return 4;
   20626       } else {
   20627          return 4;
   20628       }
   20629    case 6: return 5;
   20630    case 5: return 0;
   20631    case 4:
   20632       if (devinfo->is_g4x) {
   20633          return 0;
   20634       } else {
   20635          return 0;
   20636       }
   20637    default:
   20638       unreachable("Invalid hardware generation");
   20639    }
   20640 }
   20641 
   20642 
   20643 
   20644 #define GEN10_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_start  160
   20645 #define GEN9_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_start  160
   20646 #define GEN8_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_start  160
   20647 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_start  128
   20648 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_start  128
   20649 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_start  219
   20650 
   20651 static inline uint32_t ATTRIBUTE_PURE
   20652 _3DSTATE_DEPTH_BUFFER_DepthBufferMOCS_start(const struct gen_device_info *devinfo)
   20653 {
   20654    switch (devinfo->gen) {
   20655    case 10: return 160;
   20656    case 9: return 160;
   20657    case 8: return 160;
   20658    case 7:
   20659       if (devinfo->is_haswell) {
   20660          return 128;
   20661       } else {
   20662          return 128;
   20663       }
   20664    case 6: return 219;
   20665    case 5: return 0;
   20666    case 4:
   20667       if (devinfo->is_g4x) {
   20668          return 0;
   20669       } else {
   20670          return 0;
   20671       }
   20672    default:
   20673       unreachable("Invalid hardware generation");
   20674    }
   20675 }
   20676 
   20677 
   20678 
   20679 /* 3DSTATE_DEPTH_BUFFER::Depth Buffer Object Control State */
   20680 
   20681 
   20682 #define GEN10_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_bits  7
   20683 #define GEN9_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_bits  7
   20684 #define GEN8_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_bits  7
   20685 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_bits  4
   20686 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_bits  4
   20687 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_bits  5
   20688 
   20689 static inline uint32_t ATTRIBUTE_PURE
   20690 _3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   20691 {
   20692    switch (devinfo->gen) {
   20693    case 10: return 7;
   20694    case 9: return 7;
   20695    case 8: return 7;
   20696    case 7:
   20697       if (devinfo->is_haswell) {
   20698          return 4;
   20699       } else {
   20700          return 4;
   20701       }
   20702    case 6: return 5;
   20703    case 5: return 0;
   20704    case 4:
   20705       if (devinfo->is_g4x) {
   20706          return 0;
   20707       } else {
   20708          return 0;
   20709       }
   20710    default:
   20711       unreachable("Invalid hardware generation");
   20712    }
   20713 }
   20714 
   20715 
   20716 
   20717 #define GEN10_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_start  160
   20718 #define GEN9_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_start  160
   20719 #define GEN8_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_start  160
   20720 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_start  128
   20721 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_start  128
   20722 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_start  219
   20723 
   20724 static inline uint32_t ATTRIBUTE_PURE
   20725 _3DSTATE_DEPTH_BUFFER_DepthBufferObjectControlState_start(const struct gen_device_info *devinfo)
   20726 {
   20727    switch (devinfo->gen) {
   20728    case 10: return 160;
   20729    case 9: return 160;
   20730    case 8: return 160;
   20731    case 7:
   20732       if (devinfo->is_haswell) {
   20733          return 128;
   20734       } else {
   20735          return 128;
   20736       }
   20737    case 6: return 219;
   20738    case 5: return 0;
   20739    case 4:
   20740       if (devinfo->is_g4x) {
   20741          return 0;
   20742       } else {
   20743          return 0;
   20744       }
   20745    default:
   20746       unreachable("Invalid hardware generation");
   20747    }
   20748 }
   20749 
   20750 
   20751 
   20752 /* 3DSTATE_DEPTH_BUFFER::Depth Coordinate Offset X */
   20753 
   20754 
   20755 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_bits  16
   20756 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_bits  16
   20757 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_bits  16
   20758 #define GEN5_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_bits  16
   20759 #define GEN45_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_bits  16
   20760 
   20761 static inline uint32_t ATTRIBUTE_PURE
   20762 _3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_bits(const struct gen_device_info *devinfo)
   20763 {
   20764    switch (devinfo->gen) {
   20765    case 10: return 0;
   20766    case 9: return 0;
   20767    case 8: return 0;
   20768    case 7:
   20769       if (devinfo->is_haswell) {
   20770          return 16;
   20771       } else {
   20772          return 16;
   20773       }
   20774    case 6: return 16;
   20775    case 5: return 16;
   20776    case 4:
   20777       if (devinfo->is_g4x) {
   20778          return 16;
   20779       } else {
   20780          return 0;
   20781       }
   20782    default:
   20783       unreachable("Invalid hardware generation");
   20784    }
   20785 }
   20786 
   20787 
   20788 
   20789 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_start  160
   20790 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_start  160
   20791 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_start  160
   20792 #define GEN5_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_start  160
   20793 #define GEN45_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_start  160
   20794 
   20795 static inline uint32_t ATTRIBUTE_PURE
   20796 _3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetX_start(const struct gen_device_info *devinfo)
   20797 {
   20798    switch (devinfo->gen) {
   20799    case 10: return 0;
   20800    case 9: return 0;
   20801    case 8: return 0;
   20802    case 7:
   20803       if (devinfo->is_haswell) {
   20804          return 160;
   20805       } else {
   20806          return 160;
   20807       }
   20808    case 6: return 160;
   20809    case 5: return 160;
   20810    case 4:
   20811       if (devinfo->is_g4x) {
   20812          return 160;
   20813       } else {
   20814          return 0;
   20815       }
   20816    default:
   20817       unreachable("Invalid hardware generation");
   20818    }
   20819 }
   20820 
   20821 
   20822 
   20823 /* 3DSTATE_DEPTH_BUFFER::Depth Coordinate Offset Y */
   20824 
   20825 
   20826 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_bits  16
   20827 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_bits  16
   20828 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_bits  16
   20829 #define GEN5_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_bits  16
   20830 #define GEN45_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_bits  16
   20831 
   20832 static inline uint32_t ATTRIBUTE_PURE
   20833 _3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_bits(const struct gen_device_info *devinfo)
   20834 {
   20835    switch (devinfo->gen) {
   20836    case 10: return 0;
   20837    case 9: return 0;
   20838    case 8: return 0;
   20839    case 7:
   20840       if (devinfo->is_haswell) {
   20841          return 16;
   20842       } else {
   20843          return 16;
   20844       }
   20845    case 6: return 16;
   20846    case 5: return 16;
   20847    case 4:
   20848       if (devinfo->is_g4x) {
   20849          return 16;
   20850       } else {
   20851          return 0;
   20852       }
   20853    default:
   20854       unreachable("Invalid hardware generation");
   20855    }
   20856 }
   20857 
   20858 
   20859 
   20860 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_start  176
   20861 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_start  176
   20862 #define GEN6_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_start  176
   20863 #define GEN5_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_start  176
   20864 #define GEN45_3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_start  176
   20865 
   20866 static inline uint32_t ATTRIBUTE_PURE
   20867 _3DSTATE_DEPTH_BUFFER_DepthCoordinateOffsetY_start(const struct gen_device_info *devinfo)
   20868 {
   20869    switch (devinfo->gen) {
   20870    case 10: return 0;
   20871    case 9: return 0;
   20872    case 8: return 0;
   20873    case 7:
   20874       if (devinfo->is_haswell) {
   20875          return 176;
   20876       } else {
   20877          return 176;
   20878       }
   20879    case 6: return 176;
   20880    case 5: return 176;
   20881    case 4:
   20882       if (devinfo->is_g4x) {
   20883          return 176;
   20884       } else {
   20885          return 0;
   20886       }
   20887    default:
   20888       unreachable("Invalid hardware generation");
   20889    }
   20890 }
   20891 
   20892 
   20893 
   20894 /* 3DSTATE_DEPTH_BUFFER::Depth Write Enable */
   20895 
   20896 
   20897 #define GEN10_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_bits  1
   20898 #define GEN9_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_bits  1
   20899 #define GEN8_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_bits  1
   20900 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_bits  1
   20901 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_bits  1
   20902 
   20903 static inline uint32_t ATTRIBUTE_PURE
   20904 _3DSTATE_DEPTH_BUFFER_DepthWriteEnable_bits(const struct gen_device_info *devinfo)
   20905 {
   20906    switch (devinfo->gen) {
   20907    case 10: return 1;
   20908    case 9: return 1;
   20909    case 8: return 1;
   20910    case 7:
   20911       if (devinfo->is_haswell) {
   20912          return 1;
   20913       } else {
   20914          return 1;
   20915       }
   20916    case 6: return 0;
   20917    case 5: return 0;
   20918    case 4:
   20919       if (devinfo->is_g4x) {
   20920          return 0;
   20921       } else {
   20922          return 0;
   20923       }
   20924    default:
   20925       unreachable("Invalid hardware generation");
   20926    }
   20927 }
   20928 
   20929 
   20930 
   20931 #define GEN10_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_start  60
   20932 #define GEN9_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_start  60
   20933 #define GEN8_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_start  60
   20934 #define GEN75_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_start  60
   20935 #define GEN7_3DSTATE_DEPTH_BUFFER_DepthWriteEnable_start  60
   20936 
   20937 static inline uint32_t ATTRIBUTE_PURE
   20938 _3DSTATE_DEPTH_BUFFER_DepthWriteEnable_start(const struct gen_device_info *devinfo)
   20939 {
   20940    switch (devinfo->gen) {
   20941    case 10: return 60;
   20942    case 9: return 60;
   20943    case 8: return 60;
   20944    case 7:
   20945       if (devinfo->is_haswell) {
   20946          return 60;
   20947       } else {
   20948          return 60;
   20949       }
   20950    case 6: return 0;
   20951    case 5: return 0;
   20952    case 4:
   20953       if (devinfo->is_g4x) {
   20954          return 0;
   20955       } else {
   20956          return 0;
   20957       }
   20958    default:
   20959       unreachable("Invalid hardware generation");
   20960    }
   20961 }
   20962 
   20963 
   20964 
   20965 /* 3DSTATE_DEPTH_BUFFER::Height */
   20966 
   20967 
   20968 #define GEN10_3DSTATE_DEPTH_BUFFER_Height_bits  14
   20969 #define GEN9_3DSTATE_DEPTH_BUFFER_Height_bits  14
   20970 #define GEN8_3DSTATE_DEPTH_BUFFER_Height_bits  14
   20971 #define GEN75_3DSTATE_DEPTH_BUFFER_Height_bits  14
   20972 #define GEN7_3DSTATE_DEPTH_BUFFER_Height_bits  14
   20973 #define GEN6_3DSTATE_DEPTH_BUFFER_Height_bits  13
   20974 #define GEN5_3DSTATE_DEPTH_BUFFER_Height_bits  13
   20975 #define GEN45_3DSTATE_DEPTH_BUFFER_Height_bits  13
   20976 #define GEN4_3DSTATE_DEPTH_BUFFER_Height_bits  13
   20977 
   20978 static inline uint32_t ATTRIBUTE_PURE
   20979 _3DSTATE_DEPTH_BUFFER_Height_bits(const struct gen_device_info *devinfo)
   20980 {
   20981    switch (devinfo->gen) {
   20982    case 10: return 14;
   20983    case 9: return 14;
   20984    case 8: return 14;
   20985    case 7:
   20986       if (devinfo->is_haswell) {
   20987          return 14;
   20988       } else {
   20989          return 14;
   20990       }
   20991    case 6: return 13;
   20992    case 5: return 13;
   20993    case 4:
   20994       if (devinfo->is_g4x) {
   20995          return 13;
   20996       } else {
   20997          return 13;
   20998       }
   20999    default:
   21000       unreachable("Invalid hardware generation");
   21001    }
   21002 }
   21003 
   21004 
   21005 
   21006 #define GEN10_3DSTATE_DEPTH_BUFFER_Height_start  146
   21007 #define GEN9_3DSTATE_DEPTH_BUFFER_Height_start  146
   21008 #define GEN8_3DSTATE_DEPTH_BUFFER_Height_start  146
   21009 #define GEN75_3DSTATE_DEPTH_BUFFER_Height_start  114
   21010 #define GEN7_3DSTATE_DEPTH_BUFFER_Height_start  114
   21011 #define GEN6_3DSTATE_DEPTH_BUFFER_Height_start  115
   21012 #define GEN5_3DSTATE_DEPTH_BUFFER_Height_start  115
   21013 #define GEN45_3DSTATE_DEPTH_BUFFER_Height_start  115
   21014 #define GEN4_3DSTATE_DEPTH_BUFFER_Height_start  115
   21015 
   21016 static inline uint32_t ATTRIBUTE_PURE
   21017 _3DSTATE_DEPTH_BUFFER_Height_start(const struct gen_device_info *devinfo)
   21018 {
   21019    switch (devinfo->gen) {
   21020    case 10: return 146;
   21021    case 9: return 146;
   21022    case 8: return 146;
   21023    case 7:
   21024       if (devinfo->is_haswell) {
   21025          return 114;
   21026       } else {
   21027          return 114;
   21028       }
   21029    case 6: return 115;
   21030    case 5: return 115;
   21031    case 4:
   21032       if (devinfo->is_g4x) {
   21033          return 115;
   21034       } else {
   21035          return 115;
   21036       }
   21037    default:
   21038       unreachable("Invalid hardware generation");
   21039    }
   21040 }
   21041 
   21042 
   21043 
   21044 /* 3DSTATE_DEPTH_BUFFER::Hierarchical Depth Buffer Enable */
   21045 
   21046 
   21047 #define GEN10_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits  1
   21048 #define GEN9_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits  1
   21049 #define GEN8_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits  1
   21050 #define GEN75_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits  1
   21051 #define GEN7_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits  1
   21052 #define GEN6_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits  1
   21053 #define GEN5_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits  1
   21054 
   21055 static inline uint32_t ATTRIBUTE_PURE
   21056 _3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_bits(const struct gen_device_info *devinfo)
   21057 {
   21058    switch (devinfo->gen) {
   21059    case 10: return 1;
   21060    case 9: return 1;
   21061    case 8: return 1;
   21062    case 7:
   21063       if (devinfo->is_haswell) {
   21064          return 1;
   21065       } else {
   21066          return 1;
   21067       }
   21068    case 6: return 1;
   21069    case 5: return 1;
   21070    case 4:
   21071       if (devinfo->is_g4x) {
   21072          return 0;
   21073       } else {
   21074          return 0;
   21075       }
   21076    default:
   21077       unreachable("Invalid hardware generation");
   21078    }
   21079 }
   21080 
   21081 
   21082 
   21083 #define GEN10_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start  54
   21084 #define GEN9_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start  54
   21085 #define GEN8_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start  54
   21086 #define GEN75_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start  54
   21087 #define GEN7_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start  54
   21088 #define GEN6_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start  54
   21089 #define GEN5_3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start  54
   21090 
   21091 static inline uint32_t ATTRIBUTE_PURE
   21092 _3DSTATE_DEPTH_BUFFER_HierarchicalDepthBufferEnable_start(const struct gen_device_info *devinfo)
   21093 {
   21094    switch (devinfo->gen) {
   21095    case 10: return 54;
   21096    case 9: return 54;
   21097    case 8: return 54;
   21098    case 7:
   21099       if (devinfo->is_haswell) {
   21100          return 54;
   21101       } else {
   21102          return 54;
   21103       }
   21104    case 6: return 54;
   21105    case 5: return 54;
   21106    case 4:
   21107       if (devinfo->is_g4x) {
   21108          return 0;
   21109       } else {
   21110          return 0;
   21111       }
   21112    default:
   21113       unreachable("Invalid hardware generation");
   21114    }
   21115 }
   21116 
   21117 
   21118 
   21119 /* 3DSTATE_DEPTH_BUFFER::LOD */
   21120 
   21121 
   21122 #define GEN10_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21123 #define GEN9_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21124 #define GEN8_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21125 #define GEN75_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21126 #define GEN7_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21127 #define GEN6_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21128 #define GEN5_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21129 #define GEN45_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21130 #define GEN4_3DSTATE_DEPTH_BUFFER_LOD_bits  4
   21131 
   21132 static inline uint32_t ATTRIBUTE_PURE
   21133 _3DSTATE_DEPTH_BUFFER_LOD_bits(const struct gen_device_info *devinfo)
   21134 {
   21135    switch (devinfo->gen) {
   21136    case 10: return 4;
   21137    case 9: return 4;
   21138    case 8: return 4;
   21139    case 7:
   21140       if (devinfo->is_haswell) {
   21141          return 4;
   21142       } else {
   21143          return 4;
   21144       }
   21145    case 6: return 4;
   21146    case 5: return 4;
   21147    case 4:
   21148       if (devinfo->is_g4x) {
   21149          return 4;
   21150       } else {
   21151          return 4;
   21152       }
   21153    default:
   21154       unreachable("Invalid hardware generation");
   21155    }
   21156 }
   21157 
   21158 
   21159 
   21160 #define GEN10_3DSTATE_DEPTH_BUFFER_LOD_start  128
   21161 #define GEN9_3DSTATE_DEPTH_BUFFER_LOD_start  128
   21162 #define GEN8_3DSTATE_DEPTH_BUFFER_LOD_start  128
   21163 #define GEN75_3DSTATE_DEPTH_BUFFER_LOD_start  96
   21164 #define GEN7_3DSTATE_DEPTH_BUFFER_LOD_start  96
   21165 #define GEN6_3DSTATE_DEPTH_BUFFER_LOD_start  98
   21166 #define GEN5_3DSTATE_DEPTH_BUFFER_LOD_start  98
   21167 #define GEN45_3DSTATE_DEPTH_BUFFER_LOD_start  98
   21168 #define GEN4_3DSTATE_DEPTH_BUFFER_LOD_start  98
   21169 
   21170 static inline uint32_t ATTRIBUTE_PURE
   21171 _3DSTATE_DEPTH_BUFFER_LOD_start(const struct gen_device_info *devinfo)
   21172 {
   21173    switch (devinfo->gen) {
   21174    case 10: return 128;
   21175    case 9: return 128;
   21176    case 8: return 128;
   21177    case 7:
   21178       if (devinfo->is_haswell) {
   21179          return 96;
   21180       } else {
   21181          return 96;
   21182       }
   21183    case 6: return 98;
   21184    case 5: return 98;
   21185    case 4:
   21186       if (devinfo->is_g4x) {
   21187          return 98;
   21188       } else {
   21189          return 98;
   21190       }
   21191    default:
   21192       unreachable("Invalid hardware generation");
   21193    }
   21194 }
   21195 
   21196 
   21197 
   21198 /* 3DSTATE_DEPTH_BUFFER::MIP Map Layout Mode */
   21199 
   21200 
   21201 #define GEN6_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_bits  1
   21202 #define GEN5_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_bits  1
   21203 #define GEN45_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_bits  1
   21204 #define GEN4_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_bits  1
   21205 
   21206 static inline uint32_t ATTRIBUTE_PURE
   21207 _3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_bits(const struct gen_device_info *devinfo)
   21208 {
   21209    switch (devinfo->gen) {
   21210    case 10: return 0;
   21211    case 9: return 0;
   21212    case 8: return 0;
   21213    case 7:
   21214       if (devinfo->is_haswell) {
   21215          return 0;
   21216       } else {
   21217          return 0;
   21218       }
   21219    case 6: return 1;
   21220    case 5: return 1;
   21221    case 4:
   21222       if (devinfo->is_g4x) {
   21223          return 1;
   21224       } else {
   21225          return 1;
   21226       }
   21227    default:
   21228       unreachable("Invalid hardware generation");
   21229    }
   21230 }
   21231 
   21232 
   21233 
   21234 #define GEN6_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_start  97
   21235 #define GEN5_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_start  97
   21236 #define GEN45_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_start  97
   21237 #define GEN4_3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_start  97
   21238 
   21239 static inline uint32_t ATTRIBUTE_PURE
   21240 _3DSTATE_DEPTH_BUFFER_MIPMapLayoutMode_start(const struct gen_device_info *devinfo)
   21241 {
   21242    switch (devinfo->gen) {
   21243    case 10: return 0;
   21244    case 9: return 0;
   21245    case 8: return 0;
   21246    case 7:
   21247       if (devinfo->is_haswell) {
   21248          return 0;
   21249       } else {
   21250          return 0;
   21251       }
   21252    case 6: return 97;
   21253    case 5: return 97;
   21254    case 4:
   21255       if (devinfo->is_g4x) {
   21256          return 97;
   21257       } else {
   21258          return 97;
   21259       }
   21260    default:
   21261       unreachable("Invalid hardware generation");
   21262    }
   21263 }
   21264 
   21265 
   21266 
   21267 /* 3DSTATE_DEPTH_BUFFER::Minimum Array Element */
   21268 
   21269 
   21270 #define GEN10_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21271 #define GEN9_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21272 #define GEN8_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21273 #define GEN75_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21274 #define GEN7_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21275 #define GEN6_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21276 #define GEN5_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21277 #define GEN45_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21278 #define GEN4_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits  11
   21279 
   21280 static inline uint32_t ATTRIBUTE_PURE
   21281 _3DSTATE_DEPTH_BUFFER_MinimumArrayElement_bits(const struct gen_device_info *devinfo)
   21282 {
   21283    switch (devinfo->gen) {
   21284    case 10: return 11;
   21285    case 9: return 11;
   21286    case 8: return 11;
   21287    case 7:
   21288       if (devinfo->is_haswell) {
   21289          return 11;
   21290       } else {
   21291          return 11;
   21292       }
   21293    case 6: return 11;
   21294    case 5: return 11;
   21295    case 4:
   21296       if (devinfo->is_g4x) {
   21297          return 11;
   21298       } else {
   21299          return 11;
   21300       }
   21301    default:
   21302       unreachable("Invalid hardware generation");
   21303    }
   21304 }
   21305 
   21306 
   21307 
   21308 #define GEN10_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  170
   21309 #define GEN9_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  170
   21310 #define GEN8_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  170
   21311 #define GEN75_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  138
   21312 #define GEN7_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  138
   21313 #define GEN6_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  138
   21314 #define GEN5_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  138
   21315 #define GEN45_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  138
   21316 #define GEN4_3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start  138
   21317 
   21318 static inline uint32_t ATTRIBUTE_PURE
   21319 _3DSTATE_DEPTH_BUFFER_MinimumArrayElement_start(const struct gen_device_info *devinfo)
   21320 {
   21321    switch (devinfo->gen) {
   21322    case 10: return 170;
   21323    case 9: return 170;
   21324    case 8: return 170;
   21325    case 7:
   21326       if (devinfo->is_haswell) {
   21327          return 138;
   21328       } else {
   21329          return 138;
   21330       }
   21331    case 6: return 138;
   21332    case 5: return 138;
   21333    case 4:
   21334       if (devinfo->is_g4x) {
   21335          return 138;
   21336       } else {
   21337          return 138;
   21338       }
   21339    default:
   21340       unreachable("Invalid hardware generation");
   21341    }
   21342 }
   21343 
   21344 
   21345 
   21346 /* 3DSTATE_DEPTH_BUFFER::Mip Tail Start LOD */
   21347 
   21348 
   21349 #define GEN10_3DSTATE_DEPTH_BUFFER_MipTailStartLOD_bits  4
   21350 #define GEN9_3DSTATE_DEPTH_BUFFER_MipTailStartLOD_bits  4
   21351 
   21352 static inline uint32_t ATTRIBUTE_PURE
   21353 _3DSTATE_DEPTH_BUFFER_MipTailStartLOD_bits(const struct gen_device_info *devinfo)
   21354 {
   21355    switch (devinfo->gen) {
   21356    case 10: return 4;
   21357    case 9: return 4;
   21358    case 8: return 0;
   21359    case 7:
   21360       if (devinfo->is_haswell) {
   21361          return 0;
   21362       } else {
   21363          return 0;
   21364       }
   21365    case 6: return 0;
   21366    case 5: return 0;
   21367    case 4:
   21368       if (devinfo->is_g4x) {
   21369          return 0;
   21370       } else {
   21371          return 0;
   21372       }
   21373    default:
   21374       unreachable("Invalid hardware generation");
   21375    }
   21376 }
   21377 
   21378 
   21379 
   21380 #define GEN10_3DSTATE_DEPTH_BUFFER_MipTailStartLOD_start  218
   21381 #define GEN9_3DSTATE_DEPTH_BUFFER_MipTailStartLOD_start  218
   21382 
   21383 static inline uint32_t ATTRIBUTE_PURE
   21384 _3DSTATE_DEPTH_BUFFER_MipTailStartLOD_start(const struct gen_device_info *devinfo)
   21385 {
   21386    switch (devinfo->gen) {
   21387    case 10: return 218;
   21388    case 9: return 218;
   21389    case 8: return 0;
   21390    case 7:
   21391       if (devinfo->is_haswell) {
   21392          return 0;
   21393       } else {
   21394          return 0;
   21395       }
   21396    case 6: return 0;
   21397    case 5: return 0;
   21398    case 4:
   21399       if (devinfo->is_g4x) {
   21400          return 0;
   21401       } else {
   21402          return 0;
   21403       }
   21404    default:
   21405       unreachable("Invalid hardware generation");
   21406    }
   21407 }
   21408 
   21409 
   21410 
   21411 /* 3DSTATE_DEPTH_BUFFER::Render Target View Extent */
   21412 
   21413 
   21414 #define GEN10_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  11
   21415 #define GEN9_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  11
   21416 #define GEN8_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  11
   21417 #define GEN75_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  11
   21418 #define GEN7_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  11
   21419 #define GEN6_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  9
   21420 #define GEN5_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  9
   21421 #define GEN45_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  9
   21422 #define GEN4_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits  9
   21423 
   21424 static inline uint32_t ATTRIBUTE_PURE
   21425 _3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_bits(const struct gen_device_info *devinfo)
   21426 {
   21427    switch (devinfo->gen) {
   21428    case 10: return 11;
   21429    case 9: return 11;
   21430    case 8: return 11;
   21431    case 7:
   21432       if (devinfo->is_haswell) {
   21433          return 11;
   21434       } else {
   21435          return 11;
   21436       }
   21437    case 6: return 9;
   21438    case 5: return 9;
   21439    case 4:
   21440       if (devinfo->is_g4x) {
   21441          return 9;
   21442       } else {
   21443          return 9;
   21444       }
   21445    default:
   21446       unreachable("Invalid hardware generation");
   21447    }
   21448 }
   21449 
   21450 
   21451 
   21452 #define GEN10_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  245
   21453 #define GEN9_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  245
   21454 #define GEN8_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  245
   21455 #define GEN75_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  213
   21456 #define GEN7_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  213
   21457 #define GEN6_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  129
   21458 #define GEN5_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  129
   21459 #define GEN45_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  129
   21460 #define GEN4_3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start  129
   21461 
   21462 static inline uint32_t ATTRIBUTE_PURE
   21463 _3DSTATE_DEPTH_BUFFER_RenderTargetViewExtent_start(const struct gen_device_info *devinfo)
   21464 {
   21465    switch (devinfo->gen) {
   21466    case 10: return 245;
   21467    case 9: return 245;
   21468    case 8: return 245;
   21469    case 7:
   21470       if (devinfo->is_haswell) {
   21471          return 213;
   21472       } else {
   21473          return 213;
   21474       }
   21475    case 6: return 129;
   21476    case 5: return 129;
   21477    case 4:
   21478       if (devinfo->is_g4x) {
   21479          return 129;
   21480       } else {
   21481          return 129;
   21482       }
   21483    default:
   21484       unreachable("Invalid hardware generation");
   21485    }
   21486 }
   21487 
   21488 
   21489 
   21490 /* 3DSTATE_DEPTH_BUFFER::Separate Stencil Buffer Enable */
   21491 
   21492 
   21493 #define GEN6_3DSTATE_DEPTH_BUFFER_SeparateStencilBufferEnable_bits  1
   21494 #define GEN5_3DSTATE_DEPTH_BUFFER_SeparateStencilBufferEnable_bits  1
   21495 
   21496 static inline uint32_t ATTRIBUTE_PURE
   21497 _3DSTATE_DEPTH_BUFFER_SeparateStencilBufferEnable_bits(const struct gen_device_info *devinfo)
   21498 {
   21499    switch (devinfo->gen) {
   21500    case 10: return 0;
   21501    case 9: return 0;
   21502    case 8: return 0;
   21503    case 7:
   21504       if (devinfo->is_haswell) {
   21505          return 0;
   21506       } else {
   21507          return 0;
   21508       }
   21509    case 6: return 1;
   21510    case 5: return 1;
   21511    case 4:
   21512       if (devinfo->is_g4x) {
   21513          return 0;
   21514       } else {
   21515          return 0;
   21516       }
   21517    default:
   21518       unreachable("Invalid hardware generation");
   21519    }
   21520 }
   21521 
   21522 
   21523 
   21524 #define GEN6_3DSTATE_DEPTH_BUFFER_SeparateStencilBufferEnable_start  53
   21525 #define GEN5_3DSTATE_DEPTH_BUFFER_SeparateStencilBufferEnable_start  53
   21526 
   21527 static inline uint32_t ATTRIBUTE_PURE
   21528 _3DSTATE_DEPTH_BUFFER_SeparateStencilBufferEnable_start(const struct gen_device_info *devinfo)
   21529 {
   21530    switch (devinfo->gen) {
   21531    case 10: return 0;
   21532    case 9: return 0;
   21533    case 8: return 0;
   21534    case 7:
   21535       if (devinfo->is_haswell) {
   21536          return 0;
   21537       } else {
   21538          return 0;
   21539       }
   21540    case 6: return 53;
   21541    case 5: return 53;
   21542    case 4:
   21543       if (devinfo->is_g4x) {
   21544          return 0;
   21545       } else {
   21546          return 0;
   21547       }
   21548    default:
   21549       unreachable("Invalid hardware generation");
   21550    }
   21551 }
   21552 
   21553 
   21554 
   21555 /* 3DSTATE_DEPTH_BUFFER::Software Tiled Rendering Mode */
   21556 
   21557 
   21558 #define GEN6_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_bits  2
   21559 #define GEN5_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_bits  2
   21560 #define GEN45_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_bits  2
   21561 #define GEN4_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_bits  2
   21562 
   21563 static inline uint32_t ATTRIBUTE_PURE
   21564 _3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_bits(const struct gen_device_info *devinfo)
   21565 {
   21566    switch (devinfo->gen) {
   21567    case 10: return 0;
   21568    case 9: return 0;
   21569    case 8: return 0;
   21570    case 7:
   21571       if (devinfo->is_haswell) {
   21572          return 0;
   21573       } else {
   21574          return 0;
   21575       }
   21576    case 6: return 2;
   21577    case 5: return 2;
   21578    case 4:
   21579       if (devinfo->is_g4x) {
   21580          return 2;
   21581       } else {
   21582          return 2;
   21583       }
   21584    default:
   21585       unreachable("Invalid hardware generation");
   21586    }
   21587 }
   21588 
   21589 
   21590 
   21591 #define GEN6_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_start  55
   21592 #define GEN5_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_start  55
   21593 #define GEN45_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_start  55
   21594 #define GEN4_3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_start  55
   21595 
   21596 static inline uint32_t ATTRIBUTE_PURE
   21597 _3DSTATE_DEPTH_BUFFER_SoftwareTiledRenderingMode_start(const struct gen_device_info *devinfo)
   21598 {
   21599    switch (devinfo->gen) {
   21600    case 10: return 0;
   21601    case 9: return 0;
   21602    case 8: return 0;
   21603    case 7:
   21604       if (devinfo->is_haswell) {
   21605          return 0;
   21606       } else {
   21607          return 0;
   21608       }
   21609    case 6: return 55;
   21610    case 5: return 55;
   21611    case 4:
   21612       if (devinfo->is_g4x) {
   21613          return 55;
   21614       } else {
   21615          return 55;
   21616       }
   21617    default:
   21618       unreachable("Invalid hardware generation");
   21619    }
   21620 }
   21621 
   21622 
   21623 
   21624 /* 3DSTATE_DEPTH_BUFFER::Stencil Write Enable */
   21625 
   21626 
   21627 #define GEN10_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_bits  1
   21628 #define GEN9_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_bits  1
   21629 #define GEN8_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_bits  1
   21630 #define GEN75_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_bits  1
   21631 #define GEN7_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_bits  1
   21632 
   21633 static inline uint32_t ATTRIBUTE_PURE
   21634 _3DSTATE_DEPTH_BUFFER_StencilWriteEnable_bits(const struct gen_device_info *devinfo)
   21635 {
   21636    switch (devinfo->gen) {
   21637    case 10: return 1;
   21638    case 9: return 1;
   21639    case 8: return 1;
   21640    case 7:
   21641       if (devinfo->is_haswell) {
   21642          return 1;
   21643       } else {
   21644          return 1;
   21645       }
   21646    case 6: return 0;
   21647    case 5: return 0;
   21648    case 4:
   21649       if (devinfo->is_g4x) {
   21650          return 0;
   21651       } else {
   21652          return 0;
   21653       }
   21654    default:
   21655       unreachable("Invalid hardware generation");
   21656    }
   21657 }
   21658 
   21659 
   21660 
   21661 #define GEN10_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_start  59
   21662 #define GEN9_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_start  59
   21663 #define GEN8_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_start  59
   21664 #define GEN75_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_start  59
   21665 #define GEN7_3DSTATE_DEPTH_BUFFER_StencilWriteEnable_start  59
   21666 
   21667 static inline uint32_t ATTRIBUTE_PURE
   21668 _3DSTATE_DEPTH_BUFFER_StencilWriteEnable_start(const struct gen_device_info *devinfo)
   21669 {
   21670    switch (devinfo->gen) {
   21671    case 10: return 59;
   21672    case 9: return 59;
   21673    case 8: return 59;
   21674    case 7:
   21675       if (devinfo->is_haswell) {
   21676          return 59;
   21677       } else {
   21678          return 59;
   21679       }
   21680    case 6: return 0;
   21681    case 5: return 0;
   21682    case 4:
   21683       if (devinfo->is_g4x) {
   21684          return 0;
   21685       } else {
   21686          return 0;
   21687       }
   21688    default:
   21689       unreachable("Invalid hardware generation");
   21690    }
   21691 }
   21692 
   21693 
   21694 
   21695 /* 3DSTATE_DEPTH_BUFFER::Surface Base Address */
   21696 
   21697 
   21698 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  64
   21699 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  64
   21700 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  64
   21701 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   21702 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   21703 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   21704 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   21705 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   21706 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   21707 
   21708 static inline uint32_t ATTRIBUTE_PURE
   21709 _3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_bits(const struct gen_device_info *devinfo)
   21710 {
   21711    switch (devinfo->gen) {
   21712    case 10: return 64;
   21713    case 9: return 64;
   21714    case 8: return 64;
   21715    case 7:
   21716       if (devinfo->is_haswell) {
   21717          return 32;
   21718       } else {
   21719          return 32;
   21720       }
   21721    case 6: return 32;
   21722    case 5: return 32;
   21723    case 4:
   21724       if (devinfo->is_g4x) {
   21725          return 32;
   21726       } else {
   21727          return 32;
   21728       }
   21729    default:
   21730       unreachable("Invalid hardware generation");
   21731    }
   21732 }
   21733 
   21734 
   21735 
   21736 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21737 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21738 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21739 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21740 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21741 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21742 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21743 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21744 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   21745 
   21746 static inline uint32_t ATTRIBUTE_PURE
   21747 _3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start(const struct gen_device_info *devinfo)
   21748 {
   21749    switch (devinfo->gen) {
   21750    case 10: return 64;
   21751    case 9: return 64;
   21752    case 8: return 64;
   21753    case 7:
   21754       if (devinfo->is_haswell) {
   21755          return 64;
   21756       } else {
   21757          return 64;
   21758       }
   21759    case 6: return 64;
   21760    case 5: return 64;
   21761    case 4:
   21762       if (devinfo->is_g4x) {
   21763          return 64;
   21764       } else {
   21765          return 64;
   21766       }
   21767    default:
   21768       unreachable("Invalid hardware generation");
   21769    }
   21770 }
   21771 
   21772 
   21773 
   21774 /* 3DSTATE_DEPTH_BUFFER::Surface Format */
   21775 
   21776 
   21777 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21778 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21779 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21780 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21781 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21782 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21783 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21784 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21785 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits  3
   21786 
   21787 static inline uint32_t ATTRIBUTE_PURE
   21788 _3DSTATE_DEPTH_BUFFER_SurfaceFormat_bits(const struct gen_device_info *devinfo)
   21789 {
   21790    switch (devinfo->gen) {
   21791    case 10: return 3;
   21792    case 9: return 3;
   21793    case 8: return 3;
   21794    case 7:
   21795       if (devinfo->is_haswell) {
   21796          return 3;
   21797       } else {
   21798          return 3;
   21799       }
   21800    case 6: return 3;
   21801    case 5: return 3;
   21802    case 4:
   21803       if (devinfo->is_g4x) {
   21804          return 3;
   21805       } else {
   21806          return 3;
   21807       }
   21808    default:
   21809       unreachable("Invalid hardware generation");
   21810    }
   21811 }
   21812 
   21813 
   21814 
   21815 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21816 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21817 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21818 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21819 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21820 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21821 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21822 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21823 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfaceFormat_start  50
   21824 
   21825 static inline uint32_t ATTRIBUTE_PURE
   21826 _3DSTATE_DEPTH_BUFFER_SurfaceFormat_start(const struct gen_device_info *devinfo)
   21827 {
   21828    switch (devinfo->gen) {
   21829    case 10: return 50;
   21830    case 9: return 50;
   21831    case 8: return 50;
   21832    case 7:
   21833       if (devinfo->is_haswell) {
   21834          return 50;
   21835       } else {
   21836          return 50;
   21837       }
   21838    case 6: return 50;
   21839    case 5: return 50;
   21840    case 4:
   21841       if (devinfo->is_g4x) {
   21842          return 50;
   21843       } else {
   21844          return 50;
   21845       }
   21846    default:
   21847       unreachable("Invalid hardware generation");
   21848    }
   21849 }
   21850 
   21851 
   21852 
   21853 /* 3DSTATE_DEPTH_BUFFER::Surface Pitch */
   21854 
   21855 
   21856 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  18
   21857 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  18
   21858 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  18
   21859 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  18
   21860 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  18
   21861 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  17
   21862 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  17
   21863 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  17
   21864 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfacePitch_bits  17
   21865 
   21866 static inline uint32_t ATTRIBUTE_PURE
   21867 _3DSTATE_DEPTH_BUFFER_SurfacePitch_bits(const struct gen_device_info *devinfo)
   21868 {
   21869    switch (devinfo->gen) {
   21870    case 10: return 18;
   21871    case 9: return 18;
   21872    case 8: return 18;
   21873    case 7:
   21874       if (devinfo->is_haswell) {
   21875          return 18;
   21876       } else {
   21877          return 18;
   21878       }
   21879    case 6: return 17;
   21880    case 5: return 17;
   21881    case 4:
   21882       if (devinfo->is_g4x) {
   21883          return 17;
   21884       } else {
   21885          return 17;
   21886       }
   21887    default:
   21888       unreachable("Invalid hardware generation");
   21889    }
   21890 }
   21891 
   21892 
   21893 
   21894 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21895 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21896 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21897 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21898 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21899 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21900 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21901 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21902 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfacePitch_start  32
   21903 
   21904 static inline uint32_t ATTRIBUTE_PURE
   21905 _3DSTATE_DEPTH_BUFFER_SurfacePitch_start(const struct gen_device_info *devinfo)
   21906 {
   21907    switch (devinfo->gen) {
   21908    case 10: return 32;
   21909    case 9: return 32;
   21910    case 8: return 32;
   21911    case 7:
   21912       if (devinfo->is_haswell) {
   21913          return 32;
   21914       } else {
   21915          return 32;
   21916       }
   21917    case 6: return 32;
   21918    case 5: return 32;
   21919    case 4:
   21920       if (devinfo->is_g4x) {
   21921          return 32;
   21922       } else {
   21923          return 32;
   21924       }
   21925    default:
   21926       unreachable("Invalid hardware generation");
   21927    }
   21928 }
   21929 
   21930 
   21931 
   21932 /* 3DSTATE_DEPTH_BUFFER::Surface QPitch */
   21933 
   21934 
   21935 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceQPitch_bits  15
   21936 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceQPitch_bits  15
   21937 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceQPitch_bits  15
   21938 
   21939 static inline uint32_t ATTRIBUTE_PURE
   21940 _3DSTATE_DEPTH_BUFFER_SurfaceQPitch_bits(const struct gen_device_info *devinfo)
   21941 {
   21942    switch (devinfo->gen) {
   21943    case 10: return 15;
   21944    case 9: return 15;
   21945    case 8: return 15;
   21946    case 7:
   21947       if (devinfo->is_haswell) {
   21948          return 0;
   21949       } else {
   21950          return 0;
   21951       }
   21952    case 6: return 0;
   21953    case 5: return 0;
   21954    case 4:
   21955       if (devinfo->is_g4x) {
   21956          return 0;
   21957       } else {
   21958          return 0;
   21959       }
   21960    default:
   21961       unreachable("Invalid hardware generation");
   21962    }
   21963 }
   21964 
   21965 
   21966 
   21967 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceQPitch_start  224
   21968 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceQPitch_start  224
   21969 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceQPitch_start  224
   21970 
   21971 static inline uint32_t ATTRIBUTE_PURE
   21972 _3DSTATE_DEPTH_BUFFER_SurfaceQPitch_start(const struct gen_device_info *devinfo)
   21973 {
   21974    switch (devinfo->gen) {
   21975    case 10: return 224;
   21976    case 9: return 224;
   21977    case 8: return 224;
   21978    case 7:
   21979       if (devinfo->is_haswell) {
   21980          return 0;
   21981       } else {
   21982          return 0;
   21983       }
   21984    case 6: return 0;
   21985    case 5: return 0;
   21986    case 4:
   21987       if (devinfo->is_g4x) {
   21988          return 0;
   21989       } else {
   21990          return 0;
   21991       }
   21992    default:
   21993       unreachable("Invalid hardware generation");
   21994    }
   21995 }
   21996 
   21997 
   21998 
   21999 /* 3DSTATE_DEPTH_BUFFER::Surface Type */
   22000 
   22001 
   22002 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22003 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22004 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22005 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22006 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22007 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22008 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22009 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22010 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfaceType_bits  3
   22011 
   22012 static inline uint32_t ATTRIBUTE_PURE
   22013 _3DSTATE_DEPTH_BUFFER_SurfaceType_bits(const struct gen_device_info *devinfo)
   22014 {
   22015    switch (devinfo->gen) {
   22016    case 10: return 3;
   22017    case 9: return 3;
   22018    case 8: return 3;
   22019    case 7:
   22020       if (devinfo->is_haswell) {
   22021          return 3;
   22022       } else {
   22023          return 3;
   22024       }
   22025    case 6: return 3;
   22026    case 5: return 3;
   22027    case 4:
   22028       if (devinfo->is_g4x) {
   22029          return 3;
   22030       } else {
   22031          return 3;
   22032       }
   22033    default:
   22034       unreachable("Invalid hardware generation");
   22035    }
   22036 }
   22037 
   22038 
   22039 
   22040 #define GEN10_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22041 #define GEN9_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22042 #define GEN8_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22043 #define GEN75_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22044 #define GEN7_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22045 #define GEN6_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22046 #define GEN5_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22047 #define GEN45_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22048 #define GEN4_3DSTATE_DEPTH_BUFFER_SurfaceType_start  61
   22049 
   22050 static inline uint32_t ATTRIBUTE_PURE
   22051 _3DSTATE_DEPTH_BUFFER_SurfaceType_start(const struct gen_device_info *devinfo)
   22052 {
   22053    switch (devinfo->gen) {
   22054    case 10: return 61;
   22055    case 9: return 61;
   22056    case 8: return 61;
   22057    case 7:
   22058       if (devinfo->is_haswell) {
   22059          return 61;
   22060       } else {
   22061          return 61;
   22062       }
   22063    case 6: return 61;
   22064    case 5: return 61;
   22065    case 4:
   22066       if (devinfo->is_g4x) {
   22067          return 61;
   22068       } else {
   22069          return 61;
   22070       }
   22071    default:
   22072       unreachable("Invalid hardware generation");
   22073    }
   22074 }
   22075 
   22076 
   22077 
   22078 /* 3DSTATE_DEPTH_BUFFER::Tile Walk */
   22079 
   22080 
   22081 #define GEN6_3DSTATE_DEPTH_BUFFER_TileWalk_bits  1
   22082 #define GEN5_3DSTATE_DEPTH_BUFFER_TileWalk_bits  1
   22083 #define GEN45_3DSTATE_DEPTH_BUFFER_TileWalk_bits  1
   22084 #define GEN4_3DSTATE_DEPTH_BUFFER_TileWalk_bits  1
   22085 
   22086 static inline uint32_t ATTRIBUTE_PURE
   22087 _3DSTATE_DEPTH_BUFFER_TileWalk_bits(const struct gen_device_info *devinfo)
   22088 {
   22089    switch (devinfo->gen) {
   22090    case 10: return 0;
   22091    case 9: return 0;
   22092    case 8: return 0;
   22093    case 7:
   22094       if (devinfo->is_haswell) {
   22095          return 0;
   22096       } else {
   22097          return 0;
   22098       }
   22099    case 6: return 1;
   22100    case 5: return 1;
   22101    case 4:
   22102       if (devinfo->is_g4x) {
   22103          return 1;
   22104       } else {
   22105          return 1;
   22106       }
   22107    default:
   22108       unreachable("Invalid hardware generation");
   22109    }
   22110 }
   22111 
   22112 
   22113 
   22114 #define GEN6_3DSTATE_DEPTH_BUFFER_TileWalk_start  58
   22115 #define GEN5_3DSTATE_DEPTH_BUFFER_TileWalk_start  58
   22116 #define GEN45_3DSTATE_DEPTH_BUFFER_TileWalk_start  58
   22117 #define GEN4_3DSTATE_DEPTH_BUFFER_TileWalk_start  58
   22118 
   22119 static inline uint32_t ATTRIBUTE_PURE
   22120 _3DSTATE_DEPTH_BUFFER_TileWalk_start(const struct gen_device_info *devinfo)
   22121 {
   22122    switch (devinfo->gen) {
   22123    case 10: return 0;
   22124    case 9: return 0;
   22125    case 8: return 0;
   22126    case 7:
   22127       if (devinfo->is_haswell) {
   22128          return 0;
   22129       } else {
   22130          return 0;
   22131       }
   22132    case 6: return 58;
   22133    case 5: return 58;
   22134    case 4:
   22135       if (devinfo->is_g4x) {
   22136          return 58;
   22137       } else {
   22138          return 58;
   22139       }
   22140    default:
   22141       unreachable("Invalid hardware generation");
   22142    }
   22143 }
   22144 
   22145 
   22146 
   22147 /* 3DSTATE_DEPTH_BUFFER::Tiled Resource Mode */
   22148 
   22149 
   22150 #define GEN10_3DSTATE_DEPTH_BUFFER_TiledResourceMode_bits  2
   22151 #define GEN9_3DSTATE_DEPTH_BUFFER_TiledResourceMode_bits  2
   22152 
   22153 static inline uint32_t ATTRIBUTE_PURE
   22154 _3DSTATE_DEPTH_BUFFER_TiledResourceMode_bits(const struct gen_device_info *devinfo)
   22155 {
   22156    switch (devinfo->gen) {
   22157    case 10: return 2;
   22158    case 9: return 2;
   22159    case 8: return 0;
   22160    case 7:
   22161       if (devinfo->is_haswell) {
   22162          return 0;
   22163       } else {
   22164          return 0;
   22165       }
   22166    case 6: return 0;
   22167    case 5: return 0;
   22168    case 4:
   22169       if (devinfo->is_g4x) {
   22170          return 0;
   22171       } else {
   22172          return 0;
   22173       }
   22174    default:
   22175       unreachable("Invalid hardware generation");
   22176    }
   22177 }
   22178 
   22179 
   22180 
   22181 #define GEN10_3DSTATE_DEPTH_BUFFER_TiledResourceMode_start  222
   22182 #define GEN9_3DSTATE_DEPTH_BUFFER_TiledResourceMode_start  222
   22183 
   22184 static inline uint32_t ATTRIBUTE_PURE
   22185 _3DSTATE_DEPTH_BUFFER_TiledResourceMode_start(const struct gen_device_info *devinfo)
   22186 {
   22187    switch (devinfo->gen) {
   22188    case 10: return 222;
   22189    case 9: return 222;
   22190    case 8: return 0;
   22191    case 7:
   22192       if (devinfo->is_haswell) {
   22193          return 0;
   22194       } else {
   22195          return 0;
   22196       }
   22197    case 6: return 0;
   22198    case 5: return 0;
   22199    case 4:
   22200       if (devinfo->is_g4x) {
   22201          return 0;
   22202       } else {
   22203          return 0;
   22204       }
   22205    default:
   22206       unreachable("Invalid hardware generation");
   22207    }
   22208 }
   22209 
   22210 
   22211 
   22212 /* 3DSTATE_DEPTH_BUFFER::Tiled Surface */
   22213 
   22214 
   22215 #define GEN6_3DSTATE_DEPTH_BUFFER_TiledSurface_bits  1
   22216 #define GEN5_3DSTATE_DEPTH_BUFFER_TiledSurface_bits  1
   22217 #define GEN45_3DSTATE_DEPTH_BUFFER_TiledSurface_bits  1
   22218 #define GEN4_3DSTATE_DEPTH_BUFFER_TiledSurface_bits  1
   22219 
   22220 static inline uint32_t ATTRIBUTE_PURE
   22221 _3DSTATE_DEPTH_BUFFER_TiledSurface_bits(const struct gen_device_info *devinfo)
   22222 {
   22223    switch (devinfo->gen) {
   22224    case 10: return 0;
   22225    case 9: return 0;
   22226    case 8: return 0;
   22227    case 7:
   22228       if (devinfo->is_haswell) {
   22229          return 0;
   22230       } else {
   22231          return 0;
   22232       }
   22233    case 6: return 1;
   22234    case 5: return 1;
   22235    case 4:
   22236       if (devinfo->is_g4x) {
   22237          return 1;
   22238       } else {
   22239          return 1;
   22240       }
   22241    default:
   22242       unreachable("Invalid hardware generation");
   22243    }
   22244 }
   22245 
   22246 
   22247 
   22248 #define GEN6_3DSTATE_DEPTH_BUFFER_TiledSurface_start  59
   22249 #define GEN5_3DSTATE_DEPTH_BUFFER_TiledSurface_start  59
   22250 #define GEN45_3DSTATE_DEPTH_BUFFER_TiledSurface_start  59
   22251 #define GEN4_3DSTATE_DEPTH_BUFFER_TiledSurface_start  59
   22252 
   22253 static inline uint32_t ATTRIBUTE_PURE
   22254 _3DSTATE_DEPTH_BUFFER_TiledSurface_start(const struct gen_device_info *devinfo)
   22255 {
   22256    switch (devinfo->gen) {
   22257    case 10: return 0;
   22258    case 9: return 0;
   22259    case 8: return 0;
   22260    case 7:
   22261       if (devinfo->is_haswell) {
   22262          return 0;
   22263       } else {
   22264          return 0;
   22265       }
   22266    case 6: return 59;
   22267    case 5: return 59;
   22268    case 4:
   22269       if (devinfo->is_g4x) {
   22270          return 59;
   22271       } else {
   22272          return 59;
   22273       }
   22274    default:
   22275       unreachable("Invalid hardware generation");
   22276    }
   22277 }
   22278 
   22279 
   22280 
   22281 /* 3DSTATE_DEPTH_BUFFER::Width */
   22282 
   22283 
   22284 #define GEN10_3DSTATE_DEPTH_BUFFER_Width_bits  14
   22285 #define GEN9_3DSTATE_DEPTH_BUFFER_Width_bits  14
   22286 #define GEN8_3DSTATE_DEPTH_BUFFER_Width_bits  14
   22287 #define GEN75_3DSTATE_DEPTH_BUFFER_Width_bits  14
   22288 #define GEN7_3DSTATE_DEPTH_BUFFER_Width_bits  14
   22289 #define GEN6_3DSTATE_DEPTH_BUFFER_Width_bits  13
   22290 #define GEN5_3DSTATE_DEPTH_BUFFER_Width_bits  13
   22291 #define GEN45_3DSTATE_DEPTH_BUFFER_Width_bits  13
   22292 #define GEN4_3DSTATE_DEPTH_BUFFER_Width_bits  13
   22293 
   22294 static inline uint32_t ATTRIBUTE_PURE
   22295 _3DSTATE_DEPTH_BUFFER_Width_bits(const struct gen_device_info *devinfo)
   22296 {
   22297    switch (devinfo->gen) {
   22298    case 10: return 14;
   22299    case 9: return 14;
   22300    case 8: return 14;
   22301    case 7:
   22302       if (devinfo->is_haswell) {
   22303          return 14;
   22304       } else {
   22305          return 14;
   22306       }
   22307    case 6: return 13;
   22308    case 5: return 13;
   22309    case 4:
   22310       if (devinfo->is_g4x) {
   22311          return 13;
   22312       } else {
   22313          return 13;
   22314       }
   22315    default:
   22316       unreachable("Invalid hardware generation");
   22317    }
   22318 }
   22319 
   22320 
   22321 
   22322 #define GEN10_3DSTATE_DEPTH_BUFFER_Width_start  132
   22323 #define GEN9_3DSTATE_DEPTH_BUFFER_Width_start  132
   22324 #define GEN8_3DSTATE_DEPTH_BUFFER_Width_start  132
   22325 #define GEN75_3DSTATE_DEPTH_BUFFER_Width_start  100
   22326 #define GEN7_3DSTATE_DEPTH_BUFFER_Width_start  100
   22327 #define GEN6_3DSTATE_DEPTH_BUFFER_Width_start  102
   22328 #define GEN5_3DSTATE_DEPTH_BUFFER_Width_start  102
   22329 #define GEN45_3DSTATE_DEPTH_BUFFER_Width_start  102
   22330 #define GEN4_3DSTATE_DEPTH_BUFFER_Width_start  102
   22331 
   22332 static inline uint32_t ATTRIBUTE_PURE
   22333 _3DSTATE_DEPTH_BUFFER_Width_start(const struct gen_device_info *devinfo)
   22334 {
   22335    switch (devinfo->gen) {
   22336    case 10: return 132;
   22337    case 9: return 132;
   22338    case 8: return 132;
   22339    case 7:
   22340       if (devinfo->is_haswell) {
   22341          return 100;
   22342       } else {
   22343          return 100;
   22344       }
   22345    case 6: return 102;
   22346    case 5: return 102;
   22347    case 4:
   22348       if (devinfo->is_g4x) {
   22349          return 102;
   22350       } else {
   22351          return 102;
   22352       }
   22353    default:
   22354       unreachable("Invalid hardware generation");
   22355    }
   22356 }
   22357 
   22358 
   22359 
   22360 /* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS */
   22361 
   22362 
   22363 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_length  2
   22364 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_length  2
   22365 
   22366 static inline uint32_t ATTRIBUTE_PURE
   22367 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_length(const struct gen_device_info *devinfo)
   22368 {
   22369    switch (devinfo->gen) {
   22370    case 10: return 0;
   22371    case 9: return 0;
   22372    case 8: return 0;
   22373    case 7:
   22374       if (devinfo->is_haswell) {
   22375          return 2;
   22376       } else {
   22377          return 2;
   22378       }
   22379    case 6: return 0;
   22380    case 5: return 0;
   22381    case 4:
   22382       if (devinfo->is_g4x) {
   22383          return 0;
   22384       } else {
   22385          return 0;
   22386       }
   22387    default:
   22388       unreachable("Invalid hardware generation");
   22389    }
   22390 }
   22391 
   22392 
   22393 
   22394 /* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS::3D Command Opcode */
   22395 
   22396 
   22397 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandOpcode_bits  3
   22398 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandOpcode_bits  3
   22399 
   22400 static inline uint32_t ATTRIBUTE_PURE
   22401 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   22402 {
   22403    switch (devinfo->gen) {
   22404    case 10: return 0;
   22405    case 9: return 0;
   22406    case 8: return 0;
   22407    case 7:
   22408       if (devinfo->is_haswell) {
   22409          return 3;
   22410       } else {
   22411          return 3;
   22412       }
   22413    case 6: return 0;
   22414    case 5: return 0;
   22415    case 4:
   22416       if (devinfo->is_g4x) {
   22417          return 0;
   22418       } else {
   22419          return 0;
   22420       }
   22421    default:
   22422       unreachable("Invalid hardware generation");
   22423    }
   22424 }
   22425 
   22426 
   22427 
   22428 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandOpcode_start  24
   22429 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandOpcode_start  24
   22430 
   22431 static inline uint32_t ATTRIBUTE_PURE
   22432 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   22433 {
   22434    switch (devinfo->gen) {
   22435    case 10: return 0;
   22436    case 9: return 0;
   22437    case 8: return 0;
   22438    case 7:
   22439       if (devinfo->is_haswell) {
   22440          return 24;
   22441       } else {
   22442          return 24;
   22443       }
   22444    case 6: return 0;
   22445    case 5: return 0;
   22446    case 4:
   22447       if (devinfo->is_g4x) {
   22448          return 0;
   22449       } else {
   22450          return 0;
   22451       }
   22452    default:
   22453       unreachable("Invalid hardware generation");
   22454    }
   22455 }
   22456 
   22457 
   22458 
   22459 /* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS::3D Command Sub Opcode */
   22460 
   22461 
   22462 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandSubOpcode_bits  8
   22463 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandSubOpcode_bits  8
   22464 
   22465 static inline uint32_t ATTRIBUTE_PURE
   22466 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   22467 {
   22468    switch (devinfo->gen) {
   22469    case 10: return 0;
   22470    case 9: return 0;
   22471    case 8: return 0;
   22472    case 7:
   22473       if (devinfo->is_haswell) {
   22474          return 8;
   22475       } else {
   22476          return 8;
   22477       }
   22478    case 6: return 0;
   22479    case 5: return 0;
   22480    case 4:
   22481       if (devinfo->is_g4x) {
   22482          return 0;
   22483       } else {
   22484          return 0;
   22485       }
   22486    default:
   22487       unreachable("Invalid hardware generation");
   22488    }
   22489 }
   22490 
   22491 
   22492 
   22493 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandSubOpcode_start  16
   22494 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandSubOpcode_start  16
   22495 
   22496 static inline uint32_t ATTRIBUTE_PURE
   22497 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   22498 {
   22499    switch (devinfo->gen) {
   22500    case 10: return 0;
   22501    case 9: return 0;
   22502    case 8: return 0;
   22503    case 7:
   22504       if (devinfo->is_haswell) {
   22505          return 16;
   22506       } else {
   22507          return 16;
   22508       }
   22509    case 6: return 0;
   22510    case 5: return 0;
   22511    case 4:
   22512       if (devinfo->is_g4x) {
   22513          return 0;
   22514       } else {
   22515          return 0;
   22516       }
   22517    default:
   22518       unreachable("Invalid hardware generation");
   22519    }
   22520 }
   22521 
   22522 
   22523 
   22524 /* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS::Command SubType */
   22525 
   22526 
   22527 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandSubType_bits  2
   22528 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandSubType_bits  2
   22529 
   22530 static inline uint32_t ATTRIBUTE_PURE
   22531 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   22532 {
   22533    switch (devinfo->gen) {
   22534    case 10: return 0;
   22535    case 9: return 0;
   22536    case 8: return 0;
   22537    case 7:
   22538       if (devinfo->is_haswell) {
   22539          return 2;
   22540       } else {
   22541          return 2;
   22542       }
   22543    case 6: return 0;
   22544    case 5: return 0;
   22545    case 4:
   22546       if (devinfo->is_g4x) {
   22547          return 0;
   22548       } else {
   22549          return 0;
   22550       }
   22551    default:
   22552       unreachable("Invalid hardware generation");
   22553    }
   22554 }
   22555 
   22556 
   22557 
   22558 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandSubType_start  27
   22559 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandSubType_start  27
   22560 
   22561 static inline uint32_t ATTRIBUTE_PURE
   22562 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   22563 {
   22564    switch (devinfo->gen) {
   22565    case 10: return 0;
   22566    case 9: return 0;
   22567    case 8: return 0;
   22568    case 7:
   22569       if (devinfo->is_haswell) {
   22570          return 27;
   22571       } else {
   22572          return 27;
   22573       }
   22574    case 6: return 0;
   22575    case 5: return 0;
   22576    case 4:
   22577       if (devinfo->is_g4x) {
   22578          return 0;
   22579       } else {
   22580          return 0;
   22581       }
   22582    default:
   22583       unreachable("Invalid hardware generation");
   22584    }
   22585 }
   22586 
   22587 
   22588 
   22589 /* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS::Command Type */
   22590 
   22591 
   22592 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandType_bits  3
   22593 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandType_bits  3
   22594 
   22595 static inline uint32_t ATTRIBUTE_PURE
   22596 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   22597 {
   22598    switch (devinfo->gen) {
   22599    case 10: return 0;
   22600    case 9: return 0;
   22601    case 8: return 0;
   22602    case 7:
   22603       if (devinfo->is_haswell) {
   22604          return 3;
   22605       } else {
   22606          return 3;
   22607       }
   22608    case 6: return 0;
   22609    case 5: return 0;
   22610    case 4:
   22611       if (devinfo->is_g4x) {
   22612          return 0;
   22613       } else {
   22614          return 0;
   22615       }
   22616    default:
   22617       unreachable("Invalid hardware generation");
   22618    }
   22619 }
   22620 
   22621 
   22622 
   22623 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandType_start  29
   22624 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandType_start  29
   22625 
   22626 static inline uint32_t ATTRIBUTE_PURE
   22627 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   22628 {
   22629    switch (devinfo->gen) {
   22630    case 10: return 0;
   22631    case 9: return 0;
   22632    case 8: return 0;
   22633    case 7:
   22634       if (devinfo->is_haswell) {
   22635          return 29;
   22636       } else {
   22637          return 29;
   22638       }
   22639    case 6: return 0;
   22640    case 5: return 0;
   22641    case 4:
   22642       if (devinfo->is_g4x) {
   22643          return 0;
   22644       } else {
   22645          return 0;
   22646       }
   22647    default:
   22648       unreachable("Invalid hardware generation");
   22649    }
   22650 }
   22651 
   22652 
   22653 
   22654 /* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS::DWord Length */
   22655 
   22656 
   22657 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_DWordLength_bits  8
   22658 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_DWordLength_bits  8
   22659 
   22660 static inline uint32_t ATTRIBUTE_PURE
   22661 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   22662 {
   22663    switch (devinfo->gen) {
   22664    case 10: return 0;
   22665    case 9: return 0;
   22666    case 8: return 0;
   22667    case 7:
   22668       if (devinfo->is_haswell) {
   22669          return 8;
   22670       } else {
   22671          return 8;
   22672       }
   22673    case 6: return 0;
   22674    case 5: return 0;
   22675    case 4:
   22676       if (devinfo->is_g4x) {
   22677          return 0;
   22678       } else {
   22679          return 0;
   22680       }
   22681    default:
   22682       unreachable("Invalid hardware generation");
   22683    }
   22684 }
   22685 
   22686 
   22687 
   22688 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_DWordLength_start  0
   22689 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_DWordLength_start  0
   22690 
   22691 static inline uint32_t ATTRIBUTE_PURE
   22692 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   22693 {
   22694    switch (devinfo->gen) {
   22695    case 10: return 0;
   22696    case 9: return 0;
   22697    case 8: return 0;
   22698    case 7:
   22699       if (devinfo->is_haswell) {
   22700          return 0;
   22701       } else {
   22702          return 0;
   22703       }
   22704    case 6: return 0;
   22705    case 5: return 0;
   22706    case 4:
   22707       if (devinfo->is_g4x) {
   22708          return 0;
   22709       } else {
   22710          return 0;
   22711       }
   22712    default:
   22713       unreachable("Invalid hardware generation");
   22714    }
   22715 }
   22716 
   22717 
   22718 
   22719 /* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS::Pointer to DEPTH_STENCIL_STATE */
   22720 
   22721 
   22722 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_bits  26
   22723 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_bits  26
   22724 
   22725 static inline uint32_t ATTRIBUTE_PURE
   22726 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_bits(const struct gen_device_info *devinfo)
   22727 {
   22728    switch (devinfo->gen) {
   22729    case 10: return 0;
   22730    case 9: return 0;
   22731    case 8: return 0;
   22732    case 7:
   22733       if (devinfo->is_haswell) {
   22734          return 26;
   22735       } else {
   22736          return 26;
   22737       }
   22738    case 6: return 0;
   22739    case 5: return 0;
   22740    case 4:
   22741       if (devinfo->is_g4x) {
   22742          return 0;
   22743       } else {
   22744          return 0;
   22745       }
   22746    default:
   22747       unreachable("Invalid hardware generation");
   22748    }
   22749 }
   22750 
   22751 
   22752 
   22753 #define GEN75_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_start  38
   22754 #define GEN7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_start  38
   22755 
   22756 static inline uint32_t ATTRIBUTE_PURE
   22757 _3DSTATE_DEPTH_STENCIL_STATE_POINTERS_PointertoDEPTH_STENCIL_STATE_start(const struct gen_device_info *devinfo)
   22758 {
   22759    switch (devinfo->gen) {
   22760    case 10: return 0;
   22761    case 9: return 0;
   22762    case 8: return 0;
   22763    case 7:
   22764       if (devinfo->is_haswell) {
   22765          return 38;
   22766       } else {
   22767          return 38;
   22768       }
   22769    case 6: return 0;
   22770    case 5: return 0;
   22771    case 4:
   22772       if (devinfo->is_g4x) {
   22773          return 0;
   22774       } else {
   22775          return 0;
   22776       }
   22777    default:
   22778       unreachable("Invalid hardware generation");
   22779    }
   22780 }
   22781 
   22782 
   22783 
   22784 /* 3DSTATE_DRAWING_RECTANGLE */
   22785 
   22786 
   22787 #define GEN10_3DSTATE_DRAWING_RECTANGLE_length  4
   22788 #define GEN9_3DSTATE_DRAWING_RECTANGLE_length  4
   22789 #define GEN8_3DSTATE_DRAWING_RECTANGLE_length  4
   22790 #define GEN75_3DSTATE_DRAWING_RECTANGLE_length  4
   22791 #define GEN7_3DSTATE_DRAWING_RECTANGLE_length  4
   22792 #define GEN6_3DSTATE_DRAWING_RECTANGLE_length  4
   22793 #define GEN5_3DSTATE_DRAWING_RECTANGLE_length  4
   22794 #define GEN45_3DSTATE_DRAWING_RECTANGLE_length  4
   22795 #define GEN4_3DSTATE_DRAWING_RECTANGLE_length  4
   22796 
   22797 static inline uint32_t ATTRIBUTE_PURE
   22798 _3DSTATE_DRAWING_RECTANGLE_length(const struct gen_device_info *devinfo)
   22799 {
   22800    switch (devinfo->gen) {
   22801    case 10: return 4;
   22802    case 9: return 4;
   22803    case 8: return 4;
   22804    case 7:
   22805       if (devinfo->is_haswell) {
   22806          return 4;
   22807       } else {
   22808          return 4;
   22809       }
   22810    case 6: return 4;
   22811    case 5: return 4;
   22812    case 4:
   22813       if (devinfo->is_g4x) {
   22814          return 4;
   22815       } else {
   22816          return 4;
   22817       }
   22818    default:
   22819       unreachable("Invalid hardware generation");
   22820    }
   22821 }
   22822 
   22823 
   22824 
   22825 /* 3DSTATE_DRAWING_RECTANGLE::3D Command Opcode */
   22826 
   22827 
   22828 #define GEN10_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22829 #define GEN9_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22830 #define GEN8_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22831 #define GEN75_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22832 #define GEN7_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22833 #define GEN6_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22834 #define GEN5_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22835 #define GEN45_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22836 #define GEN4_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits  3
   22837 
   22838 static inline uint32_t ATTRIBUTE_PURE
   22839 _3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   22840 {
   22841    switch (devinfo->gen) {
   22842    case 10: return 3;
   22843    case 9: return 3;
   22844    case 8: return 3;
   22845    case 7:
   22846       if (devinfo->is_haswell) {
   22847          return 3;
   22848       } else {
   22849          return 3;
   22850       }
   22851    case 6: return 3;
   22852    case 5: return 3;
   22853    case 4:
   22854       if (devinfo->is_g4x) {
   22855          return 3;
   22856       } else {
   22857          return 3;
   22858       }
   22859    default:
   22860       unreachable("Invalid hardware generation");
   22861    }
   22862 }
   22863 
   22864 
   22865 
   22866 #define GEN10_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22867 #define GEN9_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22868 #define GEN8_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22869 #define GEN75_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22870 #define GEN7_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22871 #define GEN6_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22872 #define GEN5_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22873 #define GEN45_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22874 #define GEN4_3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start  24
   22875 
   22876 static inline uint32_t ATTRIBUTE_PURE
   22877 _3DSTATE_DRAWING_RECTANGLE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   22878 {
   22879    switch (devinfo->gen) {
   22880    case 10: return 24;
   22881    case 9: return 24;
   22882    case 8: return 24;
   22883    case 7:
   22884       if (devinfo->is_haswell) {
   22885          return 24;
   22886       } else {
   22887          return 24;
   22888       }
   22889    case 6: return 24;
   22890    case 5: return 24;
   22891    case 4:
   22892       if (devinfo->is_g4x) {
   22893          return 24;
   22894       } else {
   22895          return 24;
   22896       }
   22897    default:
   22898       unreachable("Invalid hardware generation");
   22899    }
   22900 }
   22901 
   22902 
   22903 
   22904 /* 3DSTATE_DRAWING_RECTANGLE::3D Command Sub Opcode */
   22905 
   22906 
   22907 #define GEN10_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22908 #define GEN9_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22909 #define GEN8_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22910 #define GEN75_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22911 #define GEN7_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22912 #define GEN6_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22913 #define GEN5_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22914 #define GEN45_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22915 #define GEN4_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits  8
   22916 
   22917 static inline uint32_t ATTRIBUTE_PURE
   22918 _3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   22919 {
   22920    switch (devinfo->gen) {
   22921    case 10: return 8;
   22922    case 9: return 8;
   22923    case 8: return 8;
   22924    case 7:
   22925       if (devinfo->is_haswell) {
   22926          return 8;
   22927       } else {
   22928          return 8;
   22929       }
   22930    case 6: return 8;
   22931    case 5: return 8;
   22932    case 4:
   22933       if (devinfo->is_g4x) {
   22934          return 8;
   22935       } else {
   22936          return 8;
   22937       }
   22938    default:
   22939       unreachable("Invalid hardware generation");
   22940    }
   22941 }
   22942 
   22943 
   22944 
   22945 #define GEN10_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22946 #define GEN9_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22947 #define GEN8_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22948 #define GEN75_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22949 #define GEN7_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22950 #define GEN6_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22951 #define GEN5_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22952 #define GEN45_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22953 #define GEN4_3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start  16
   22954 
   22955 static inline uint32_t ATTRIBUTE_PURE
   22956 _3DSTATE_DRAWING_RECTANGLE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   22957 {
   22958    switch (devinfo->gen) {
   22959    case 10: return 16;
   22960    case 9: return 16;
   22961    case 8: return 16;
   22962    case 7:
   22963       if (devinfo->is_haswell) {
   22964          return 16;
   22965       } else {
   22966          return 16;
   22967       }
   22968    case 6: return 16;
   22969    case 5: return 16;
   22970    case 4:
   22971       if (devinfo->is_g4x) {
   22972          return 16;
   22973       } else {
   22974          return 16;
   22975       }
   22976    default:
   22977       unreachable("Invalid hardware generation");
   22978    }
   22979 }
   22980 
   22981 
   22982 
   22983 /* 3DSTATE_DRAWING_RECTANGLE::Clipped Drawing Rectangle X Max */
   22984 
   22985 
   22986 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22987 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22988 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22989 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22990 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22991 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22992 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22993 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22994 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits  16
   22995 
   22996 static inline uint32_t ATTRIBUTE_PURE
   22997 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_bits(const struct gen_device_info *devinfo)
   22998 {
   22999    switch (devinfo->gen) {
   23000    case 10: return 16;
   23001    case 9: return 16;
   23002    case 8: return 16;
   23003    case 7:
   23004       if (devinfo->is_haswell) {
   23005          return 16;
   23006       } else {
   23007          return 16;
   23008       }
   23009    case 6: return 16;
   23010    case 5: return 16;
   23011    case 4:
   23012       if (devinfo->is_g4x) {
   23013          return 16;
   23014       } else {
   23015          return 16;
   23016       }
   23017    default:
   23018       unreachable("Invalid hardware generation");
   23019    }
   23020 }
   23021 
   23022 
   23023 
   23024 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23025 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23026 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23027 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23028 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23029 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23030 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23031 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23032 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start  64
   23033 
   23034 static inline uint32_t ATTRIBUTE_PURE
   23035 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMax_start(const struct gen_device_info *devinfo)
   23036 {
   23037    switch (devinfo->gen) {
   23038    case 10: return 64;
   23039    case 9: return 64;
   23040    case 8: return 64;
   23041    case 7:
   23042       if (devinfo->is_haswell) {
   23043          return 64;
   23044       } else {
   23045          return 64;
   23046       }
   23047    case 6: return 64;
   23048    case 5: return 64;
   23049    case 4:
   23050       if (devinfo->is_g4x) {
   23051          return 64;
   23052       } else {
   23053          return 64;
   23054       }
   23055    default:
   23056       unreachable("Invalid hardware generation");
   23057    }
   23058 }
   23059 
   23060 
   23061 
   23062 /* 3DSTATE_DRAWING_RECTANGLE::Clipped Drawing Rectangle X Min */
   23063 
   23064 
   23065 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23066 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23067 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23068 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23069 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23070 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23071 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23072 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23073 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits  16
   23074 
   23075 static inline uint32_t ATTRIBUTE_PURE
   23076 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_bits(const struct gen_device_info *devinfo)
   23077 {
   23078    switch (devinfo->gen) {
   23079    case 10: return 16;
   23080    case 9: return 16;
   23081    case 8: return 16;
   23082    case 7:
   23083       if (devinfo->is_haswell) {
   23084          return 16;
   23085       } else {
   23086          return 16;
   23087       }
   23088    case 6: return 16;
   23089    case 5: return 16;
   23090    case 4:
   23091       if (devinfo->is_g4x) {
   23092          return 16;
   23093       } else {
   23094          return 16;
   23095       }
   23096    default:
   23097       unreachable("Invalid hardware generation");
   23098    }
   23099 }
   23100 
   23101 
   23102 
   23103 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23104 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23105 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23106 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23107 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23108 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23109 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23110 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23111 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start  32
   23112 
   23113 static inline uint32_t ATTRIBUTE_PURE
   23114 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleXMin_start(const struct gen_device_info *devinfo)
   23115 {
   23116    switch (devinfo->gen) {
   23117    case 10: return 32;
   23118    case 9: return 32;
   23119    case 8: return 32;
   23120    case 7:
   23121       if (devinfo->is_haswell) {
   23122          return 32;
   23123       } else {
   23124          return 32;
   23125       }
   23126    case 6: return 32;
   23127    case 5: return 32;
   23128    case 4:
   23129       if (devinfo->is_g4x) {
   23130          return 32;
   23131       } else {
   23132          return 32;
   23133       }
   23134    default:
   23135       unreachable("Invalid hardware generation");
   23136    }
   23137 }
   23138 
   23139 
   23140 
   23141 /* 3DSTATE_DRAWING_RECTANGLE::Clipped Drawing Rectangle Y Max */
   23142 
   23143 
   23144 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23145 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23146 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23147 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23148 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23149 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23150 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23151 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23152 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits  16
   23153 
   23154 static inline uint32_t ATTRIBUTE_PURE
   23155 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_bits(const struct gen_device_info *devinfo)
   23156 {
   23157    switch (devinfo->gen) {
   23158    case 10: return 16;
   23159    case 9: return 16;
   23160    case 8: return 16;
   23161    case 7:
   23162       if (devinfo->is_haswell) {
   23163          return 16;
   23164       } else {
   23165          return 16;
   23166       }
   23167    case 6: return 16;
   23168    case 5: return 16;
   23169    case 4:
   23170       if (devinfo->is_g4x) {
   23171          return 16;
   23172       } else {
   23173          return 16;
   23174       }
   23175    default:
   23176       unreachable("Invalid hardware generation");
   23177    }
   23178 }
   23179 
   23180 
   23181 
   23182 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23183 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23184 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23185 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23186 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23187 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23188 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23189 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23190 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start  80
   23191 
   23192 static inline uint32_t ATTRIBUTE_PURE
   23193 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMax_start(const struct gen_device_info *devinfo)
   23194 {
   23195    switch (devinfo->gen) {
   23196    case 10: return 80;
   23197    case 9: return 80;
   23198    case 8: return 80;
   23199    case 7:
   23200       if (devinfo->is_haswell) {
   23201          return 80;
   23202       } else {
   23203          return 80;
   23204       }
   23205    case 6: return 80;
   23206    case 5: return 80;
   23207    case 4:
   23208       if (devinfo->is_g4x) {
   23209          return 80;
   23210       } else {
   23211          return 80;
   23212       }
   23213    default:
   23214       unreachable("Invalid hardware generation");
   23215    }
   23216 }
   23217 
   23218 
   23219 
   23220 /* 3DSTATE_DRAWING_RECTANGLE::Clipped Drawing Rectangle Y Min */
   23221 
   23222 
   23223 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23224 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23225 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23226 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23227 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23228 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23229 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23230 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23231 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits  16
   23232 
   23233 static inline uint32_t ATTRIBUTE_PURE
   23234 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_bits(const struct gen_device_info *devinfo)
   23235 {
   23236    switch (devinfo->gen) {
   23237    case 10: return 16;
   23238    case 9: return 16;
   23239    case 8: return 16;
   23240    case 7:
   23241       if (devinfo->is_haswell) {
   23242          return 16;
   23243       } else {
   23244          return 16;
   23245       }
   23246    case 6: return 16;
   23247    case 5: return 16;
   23248    case 4:
   23249       if (devinfo->is_g4x) {
   23250          return 16;
   23251       } else {
   23252          return 16;
   23253       }
   23254    default:
   23255       unreachable("Invalid hardware generation");
   23256    }
   23257 }
   23258 
   23259 
   23260 
   23261 #define GEN10_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23262 #define GEN9_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23263 #define GEN8_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23264 #define GEN75_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23265 #define GEN7_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23266 #define GEN6_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23267 #define GEN5_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23268 #define GEN45_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23269 #define GEN4_3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start  48
   23270 
   23271 static inline uint32_t ATTRIBUTE_PURE
   23272 _3DSTATE_DRAWING_RECTANGLE_ClippedDrawingRectangleYMin_start(const struct gen_device_info *devinfo)
   23273 {
   23274    switch (devinfo->gen) {
   23275    case 10: return 48;
   23276    case 9: return 48;
   23277    case 8: return 48;
   23278    case 7:
   23279       if (devinfo->is_haswell) {
   23280          return 48;
   23281       } else {
   23282          return 48;
   23283       }
   23284    case 6: return 48;
   23285    case 5: return 48;
   23286    case 4:
   23287       if (devinfo->is_g4x) {
   23288          return 48;
   23289       } else {
   23290          return 48;
   23291       }
   23292    default:
   23293       unreachable("Invalid hardware generation");
   23294    }
   23295 }
   23296 
   23297 
   23298 
   23299 /* 3DSTATE_DRAWING_RECTANGLE::Command SubType */
   23300 
   23301 
   23302 #define GEN10_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23303 #define GEN9_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23304 #define GEN8_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23305 #define GEN75_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23306 #define GEN7_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23307 #define GEN6_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23308 #define GEN5_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23309 #define GEN45_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23310 #define GEN4_3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits  2
   23311 
   23312 static inline uint32_t ATTRIBUTE_PURE
   23313 _3DSTATE_DRAWING_RECTANGLE_CommandSubType_bits(const struct gen_device_info *devinfo)
   23314 {
   23315    switch (devinfo->gen) {
   23316    case 10: return 2;
   23317    case 9: return 2;
   23318    case 8: return 2;
   23319    case 7:
   23320       if (devinfo->is_haswell) {
   23321          return 2;
   23322       } else {
   23323          return 2;
   23324       }
   23325    case 6: return 2;
   23326    case 5: return 2;
   23327    case 4:
   23328       if (devinfo->is_g4x) {
   23329          return 2;
   23330       } else {
   23331          return 2;
   23332       }
   23333    default:
   23334       unreachable("Invalid hardware generation");
   23335    }
   23336 }
   23337 
   23338 
   23339 
   23340 #define GEN10_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23341 #define GEN9_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23342 #define GEN8_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23343 #define GEN75_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23344 #define GEN7_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23345 #define GEN6_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23346 #define GEN5_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23347 #define GEN45_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23348 #define GEN4_3DSTATE_DRAWING_RECTANGLE_CommandSubType_start  27
   23349 
   23350 static inline uint32_t ATTRIBUTE_PURE
   23351 _3DSTATE_DRAWING_RECTANGLE_CommandSubType_start(const struct gen_device_info *devinfo)
   23352 {
   23353    switch (devinfo->gen) {
   23354    case 10: return 27;
   23355    case 9: return 27;
   23356    case 8: return 27;
   23357    case 7:
   23358       if (devinfo->is_haswell) {
   23359          return 27;
   23360       } else {
   23361          return 27;
   23362       }
   23363    case 6: return 27;
   23364    case 5: return 27;
   23365    case 4:
   23366       if (devinfo->is_g4x) {
   23367          return 27;
   23368       } else {
   23369          return 27;
   23370       }
   23371    default:
   23372       unreachable("Invalid hardware generation");
   23373    }
   23374 }
   23375 
   23376 
   23377 
   23378 /* 3DSTATE_DRAWING_RECTANGLE::Command Type */
   23379 
   23380 
   23381 #define GEN10_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23382 #define GEN9_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23383 #define GEN8_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23384 #define GEN75_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23385 #define GEN7_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23386 #define GEN6_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23387 #define GEN5_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23388 #define GEN45_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23389 #define GEN4_3DSTATE_DRAWING_RECTANGLE_CommandType_bits  3
   23390 
   23391 static inline uint32_t ATTRIBUTE_PURE
   23392 _3DSTATE_DRAWING_RECTANGLE_CommandType_bits(const struct gen_device_info *devinfo)
   23393 {
   23394    switch (devinfo->gen) {
   23395    case 10: return 3;
   23396    case 9: return 3;
   23397    case 8: return 3;
   23398    case 7:
   23399       if (devinfo->is_haswell) {
   23400          return 3;
   23401       } else {
   23402          return 3;
   23403       }
   23404    case 6: return 3;
   23405    case 5: return 3;
   23406    case 4:
   23407       if (devinfo->is_g4x) {
   23408          return 3;
   23409       } else {
   23410          return 3;
   23411       }
   23412    default:
   23413       unreachable("Invalid hardware generation");
   23414    }
   23415 }
   23416 
   23417 
   23418 
   23419 #define GEN10_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23420 #define GEN9_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23421 #define GEN8_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23422 #define GEN75_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23423 #define GEN7_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23424 #define GEN6_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23425 #define GEN5_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23426 #define GEN45_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23427 #define GEN4_3DSTATE_DRAWING_RECTANGLE_CommandType_start  29
   23428 
   23429 static inline uint32_t ATTRIBUTE_PURE
   23430 _3DSTATE_DRAWING_RECTANGLE_CommandType_start(const struct gen_device_info *devinfo)
   23431 {
   23432    switch (devinfo->gen) {
   23433    case 10: return 29;
   23434    case 9: return 29;
   23435    case 8: return 29;
   23436    case 7:
   23437       if (devinfo->is_haswell) {
   23438          return 29;
   23439       } else {
   23440          return 29;
   23441       }
   23442    case 6: return 29;
   23443    case 5: return 29;
   23444    case 4:
   23445       if (devinfo->is_g4x) {
   23446          return 29;
   23447       } else {
   23448          return 29;
   23449       }
   23450    default:
   23451       unreachable("Invalid hardware generation");
   23452    }
   23453 }
   23454 
   23455 
   23456 
   23457 /* 3DSTATE_DRAWING_RECTANGLE::Core Mode Select */
   23458 
   23459 
   23460 #define GEN10_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_bits  2
   23461 #define GEN9_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_bits  2
   23462 #define GEN8_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_bits  2
   23463 #define GEN75_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_bits  2
   23464 
   23465 static inline uint32_t ATTRIBUTE_PURE
   23466 _3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_bits(const struct gen_device_info *devinfo)
   23467 {
   23468    switch (devinfo->gen) {
   23469    case 10: return 2;
   23470    case 9: return 2;
   23471    case 8: return 2;
   23472    case 7:
   23473       if (devinfo->is_haswell) {
   23474          return 2;
   23475       } else {
   23476          return 0;
   23477       }
   23478    case 6: return 0;
   23479    case 5: return 0;
   23480    case 4:
   23481       if (devinfo->is_g4x) {
   23482          return 0;
   23483       } else {
   23484          return 0;
   23485       }
   23486    default:
   23487       unreachable("Invalid hardware generation");
   23488    }
   23489 }
   23490 
   23491 
   23492 
   23493 #define GEN10_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_start  14
   23494 #define GEN9_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_start  14
   23495 #define GEN8_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_start  14
   23496 #define GEN75_3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_start  14
   23497 
   23498 static inline uint32_t ATTRIBUTE_PURE
   23499 _3DSTATE_DRAWING_RECTANGLE_CoreModeSelect_start(const struct gen_device_info *devinfo)
   23500 {
   23501    switch (devinfo->gen) {
   23502    case 10: return 14;
   23503    case 9: return 14;
   23504    case 8: return 14;
   23505    case 7:
   23506       if (devinfo->is_haswell) {
   23507          return 14;
   23508       } else {
   23509          return 0;
   23510       }
   23511    case 6: return 0;
   23512    case 5: return 0;
   23513    case 4:
   23514       if (devinfo->is_g4x) {
   23515          return 0;
   23516       } else {
   23517          return 0;
   23518       }
   23519    default:
   23520       unreachable("Invalid hardware generation");
   23521    }
   23522 }
   23523 
   23524 
   23525 
   23526 /* 3DSTATE_DRAWING_RECTANGLE::DWord Length */
   23527 
   23528 
   23529 #define GEN10_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23530 #define GEN9_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23531 #define GEN8_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23532 #define GEN75_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23533 #define GEN7_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23534 #define GEN6_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23535 #define GEN5_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23536 #define GEN45_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23537 #define GEN4_3DSTATE_DRAWING_RECTANGLE_DWordLength_bits  8
   23538 
   23539 static inline uint32_t ATTRIBUTE_PURE
   23540 _3DSTATE_DRAWING_RECTANGLE_DWordLength_bits(const struct gen_device_info *devinfo)
   23541 {
   23542    switch (devinfo->gen) {
   23543    case 10: return 8;
   23544    case 9: return 8;
   23545    case 8: return 8;
   23546    case 7:
   23547       if (devinfo->is_haswell) {
   23548          return 8;
   23549       } else {
   23550          return 8;
   23551       }
   23552    case 6: return 8;
   23553    case 5: return 8;
   23554    case 4:
   23555       if (devinfo->is_g4x) {
   23556          return 8;
   23557       } else {
   23558          return 8;
   23559       }
   23560    default:
   23561       unreachable("Invalid hardware generation");
   23562    }
   23563 }
   23564 
   23565 
   23566 
   23567 #define GEN10_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23568 #define GEN9_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23569 #define GEN8_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23570 #define GEN75_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23571 #define GEN7_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23572 #define GEN6_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23573 #define GEN5_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23574 #define GEN45_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23575 #define GEN4_3DSTATE_DRAWING_RECTANGLE_DWordLength_start  0
   23576 
   23577 static inline uint32_t ATTRIBUTE_PURE
   23578 _3DSTATE_DRAWING_RECTANGLE_DWordLength_start(const struct gen_device_info *devinfo)
   23579 {
   23580    switch (devinfo->gen) {
   23581    case 10: return 0;
   23582    case 9: return 0;
   23583    case 8: return 0;
   23584    case 7:
   23585       if (devinfo->is_haswell) {
   23586          return 0;
   23587       } else {
   23588          return 0;
   23589       }
   23590    case 6: return 0;
   23591    case 5: return 0;
   23592    case 4:
   23593       if (devinfo->is_g4x) {
   23594          return 0;
   23595       } else {
   23596          return 0;
   23597       }
   23598    default:
   23599       unreachable("Invalid hardware generation");
   23600    }
   23601 }
   23602 
   23603 
   23604 
   23605 /* 3DSTATE_DRAWING_RECTANGLE::Drawing Rectangle Origin X */
   23606 
   23607 
   23608 #define GEN10_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23609 #define GEN9_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23610 #define GEN8_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23611 #define GEN75_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23612 #define GEN7_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23613 #define GEN6_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23614 #define GEN5_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23615 #define GEN45_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23616 #define GEN4_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits  16
   23617 
   23618 static inline uint32_t ATTRIBUTE_PURE
   23619 _3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_bits(const struct gen_device_info *devinfo)
   23620 {
   23621    switch (devinfo->gen) {
   23622    case 10: return 16;
   23623    case 9: return 16;
   23624    case 8: return 16;
   23625    case 7:
   23626       if (devinfo->is_haswell) {
   23627          return 16;
   23628       } else {
   23629          return 16;
   23630       }
   23631    case 6: return 16;
   23632    case 5: return 16;
   23633    case 4:
   23634       if (devinfo->is_g4x) {
   23635          return 16;
   23636       } else {
   23637          return 16;
   23638       }
   23639    default:
   23640       unreachable("Invalid hardware generation");
   23641    }
   23642 }
   23643 
   23644 
   23645 
   23646 #define GEN10_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23647 #define GEN9_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23648 #define GEN8_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23649 #define GEN75_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23650 #define GEN7_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23651 #define GEN6_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23652 #define GEN5_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23653 #define GEN45_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23654 #define GEN4_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start  96
   23655 
   23656 static inline uint32_t ATTRIBUTE_PURE
   23657 _3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginX_start(const struct gen_device_info *devinfo)
   23658 {
   23659    switch (devinfo->gen) {
   23660    case 10: return 96;
   23661    case 9: return 96;
   23662    case 8: return 96;
   23663    case 7:
   23664       if (devinfo->is_haswell) {
   23665          return 96;
   23666       } else {
   23667          return 96;
   23668       }
   23669    case 6: return 96;
   23670    case 5: return 96;
   23671    case 4:
   23672       if (devinfo->is_g4x) {
   23673          return 96;
   23674       } else {
   23675          return 96;
   23676       }
   23677    default:
   23678       unreachable("Invalid hardware generation");
   23679    }
   23680 }
   23681 
   23682 
   23683 
   23684 /* 3DSTATE_DRAWING_RECTANGLE::Drawing Rectangle Origin Y */
   23685 
   23686 
   23687 #define GEN10_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23688 #define GEN9_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23689 #define GEN8_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23690 #define GEN75_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23691 #define GEN7_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23692 #define GEN6_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23693 #define GEN5_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23694 #define GEN45_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23695 #define GEN4_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits  16
   23696 
   23697 static inline uint32_t ATTRIBUTE_PURE
   23698 _3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_bits(const struct gen_device_info *devinfo)
   23699 {
   23700    switch (devinfo->gen) {
   23701    case 10: return 16;
   23702    case 9: return 16;
   23703    case 8: return 16;
   23704    case 7:
   23705       if (devinfo->is_haswell) {
   23706          return 16;
   23707       } else {
   23708          return 16;
   23709       }
   23710    case 6: return 16;
   23711    case 5: return 16;
   23712    case 4:
   23713       if (devinfo->is_g4x) {
   23714          return 16;
   23715       } else {
   23716          return 16;
   23717       }
   23718    default:
   23719       unreachable("Invalid hardware generation");
   23720    }
   23721 }
   23722 
   23723 
   23724 
   23725 #define GEN10_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23726 #define GEN9_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23727 #define GEN8_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23728 #define GEN75_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23729 #define GEN7_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23730 #define GEN6_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23731 #define GEN5_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23732 #define GEN45_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23733 #define GEN4_3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start  112
   23734 
   23735 static inline uint32_t ATTRIBUTE_PURE
   23736 _3DSTATE_DRAWING_RECTANGLE_DrawingRectangleOriginY_start(const struct gen_device_info *devinfo)
   23737 {
   23738    switch (devinfo->gen) {
   23739    case 10: return 112;
   23740    case 9: return 112;
   23741    case 8: return 112;
   23742    case 7:
   23743       if (devinfo->is_haswell) {
   23744          return 112;
   23745       } else {
   23746          return 112;
   23747       }
   23748    case 6: return 112;
   23749    case 5: return 112;
   23750    case 4:
   23751       if (devinfo->is_g4x) {
   23752          return 112;
   23753       } else {
   23754          return 112;
   23755       }
   23756    default:
   23757       unreachable("Invalid hardware generation");
   23758    }
   23759 }
   23760 
   23761 
   23762 
   23763 /* 3DSTATE_DS */
   23764 
   23765 
   23766 #define GEN10_3DSTATE_DS_length  11
   23767 #define GEN9_3DSTATE_DS_length  11
   23768 #define GEN8_3DSTATE_DS_length  9
   23769 #define GEN75_3DSTATE_DS_length  6
   23770 #define GEN7_3DSTATE_DS_length  6
   23771 
   23772 static inline uint32_t ATTRIBUTE_PURE
   23773 _3DSTATE_DS_length(const struct gen_device_info *devinfo)
   23774 {
   23775    switch (devinfo->gen) {
   23776    case 10: return 11;
   23777    case 9: return 11;
   23778    case 8: return 9;
   23779    case 7:
   23780       if (devinfo->is_haswell) {
   23781          return 6;
   23782       } else {
   23783          return 6;
   23784       }
   23785    case 6: return 0;
   23786    case 5: return 0;
   23787    case 4:
   23788       if (devinfo->is_g4x) {
   23789          return 0;
   23790       } else {
   23791          return 0;
   23792       }
   23793    default:
   23794       unreachable("Invalid hardware generation");
   23795    }
   23796 }
   23797 
   23798 
   23799 
   23800 /* 3DSTATE_DS::3D Command Opcode */
   23801 
   23802 
   23803 #define GEN10_3DSTATE_DS_3DCommandOpcode_bits  3
   23804 #define GEN9_3DSTATE_DS_3DCommandOpcode_bits  3
   23805 #define GEN8_3DSTATE_DS_3DCommandOpcode_bits  3
   23806 #define GEN75_3DSTATE_DS_3DCommandOpcode_bits  3
   23807 #define GEN7_3DSTATE_DS_3DCommandOpcode_bits  3
   23808 
   23809 static inline uint32_t ATTRIBUTE_PURE
   23810 _3DSTATE_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   23811 {
   23812    switch (devinfo->gen) {
   23813    case 10: return 3;
   23814    case 9: return 3;
   23815    case 8: return 3;
   23816    case 7:
   23817       if (devinfo->is_haswell) {
   23818          return 3;
   23819       } else {
   23820          return 3;
   23821       }
   23822    case 6: return 0;
   23823    case 5: return 0;
   23824    case 4:
   23825       if (devinfo->is_g4x) {
   23826          return 0;
   23827       } else {
   23828          return 0;
   23829       }
   23830    default:
   23831       unreachable("Invalid hardware generation");
   23832    }
   23833 }
   23834 
   23835 
   23836 
   23837 #define GEN10_3DSTATE_DS_3DCommandOpcode_start  24
   23838 #define GEN9_3DSTATE_DS_3DCommandOpcode_start  24
   23839 #define GEN8_3DSTATE_DS_3DCommandOpcode_start  24
   23840 #define GEN75_3DSTATE_DS_3DCommandOpcode_start  24
   23841 #define GEN7_3DSTATE_DS_3DCommandOpcode_start  24
   23842 
   23843 static inline uint32_t ATTRIBUTE_PURE
   23844 _3DSTATE_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   23845 {
   23846    switch (devinfo->gen) {
   23847    case 10: return 24;
   23848    case 9: return 24;
   23849    case 8: return 24;
   23850    case 7:
   23851       if (devinfo->is_haswell) {
   23852          return 24;
   23853       } else {
   23854          return 24;
   23855       }
   23856    case 6: return 0;
   23857    case 5: return 0;
   23858    case 4:
   23859       if (devinfo->is_g4x) {
   23860          return 0;
   23861       } else {
   23862          return 0;
   23863       }
   23864    default:
   23865       unreachable("Invalid hardware generation");
   23866    }
   23867 }
   23868 
   23869 
   23870 
   23871 /* 3DSTATE_DS::3D Command Sub Opcode */
   23872 
   23873 
   23874 #define GEN10_3DSTATE_DS_3DCommandSubOpcode_bits  8
   23875 #define GEN9_3DSTATE_DS_3DCommandSubOpcode_bits  8
   23876 #define GEN8_3DSTATE_DS_3DCommandSubOpcode_bits  8
   23877 #define GEN75_3DSTATE_DS_3DCommandSubOpcode_bits  8
   23878 #define GEN7_3DSTATE_DS_3DCommandSubOpcode_bits  8
   23879 
   23880 static inline uint32_t ATTRIBUTE_PURE
   23881 _3DSTATE_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   23882 {
   23883    switch (devinfo->gen) {
   23884    case 10: return 8;
   23885    case 9: return 8;
   23886    case 8: return 8;
   23887    case 7:
   23888       if (devinfo->is_haswell) {
   23889          return 8;
   23890       } else {
   23891          return 8;
   23892       }
   23893    case 6: return 0;
   23894    case 5: return 0;
   23895    case 4:
   23896       if (devinfo->is_g4x) {
   23897          return 0;
   23898       } else {
   23899          return 0;
   23900       }
   23901    default:
   23902       unreachable("Invalid hardware generation");
   23903    }
   23904 }
   23905 
   23906 
   23907 
   23908 #define GEN10_3DSTATE_DS_3DCommandSubOpcode_start  16
   23909 #define GEN9_3DSTATE_DS_3DCommandSubOpcode_start  16
   23910 #define GEN8_3DSTATE_DS_3DCommandSubOpcode_start  16
   23911 #define GEN75_3DSTATE_DS_3DCommandSubOpcode_start  16
   23912 #define GEN7_3DSTATE_DS_3DCommandSubOpcode_start  16
   23913 
   23914 static inline uint32_t ATTRIBUTE_PURE
   23915 _3DSTATE_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   23916 {
   23917    switch (devinfo->gen) {
   23918    case 10: return 16;
   23919    case 9: return 16;
   23920    case 8: return 16;
   23921    case 7:
   23922       if (devinfo->is_haswell) {
   23923          return 16;
   23924       } else {
   23925          return 16;
   23926       }
   23927    case 6: return 0;
   23928    case 5: return 0;
   23929    case 4:
   23930       if (devinfo->is_g4x) {
   23931          return 0;
   23932       } else {
   23933          return 0;
   23934       }
   23935    default:
   23936       unreachable("Invalid hardware generation");
   23937    }
   23938 }
   23939 
   23940 
   23941 
   23942 /* 3DSTATE_DS::Accesses UAV */
   23943 
   23944 
   23945 #define GEN10_3DSTATE_DS_AccessesUAV_bits  1
   23946 #define GEN9_3DSTATE_DS_AccessesUAV_bits  1
   23947 #define GEN8_3DSTATE_DS_AccessesUAV_bits  1
   23948 #define GEN75_3DSTATE_DS_AccessesUAV_bits  1
   23949 
   23950 static inline uint32_t ATTRIBUTE_PURE
   23951 _3DSTATE_DS_AccessesUAV_bits(const struct gen_device_info *devinfo)
   23952 {
   23953    switch (devinfo->gen) {
   23954    case 10: return 1;
   23955    case 9: return 1;
   23956    case 8: return 1;
   23957    case 7:
   23958       if (devinfo->is_haswell) {
   23959          return 1;
   23960       } else {
   23961          return 0;
   23962       }
   23963    case 6: return 0;
   23964    case 5: return 0;
   23965    case 4:
   23966       if (devinfo->is_g4x) {
   23967          return 0;
   23968       } else {
   23969          return 0;
   23970       }
   23971    default:
   23972       unreachable("Invalid hardware generation");
   23973    }
   23974 }
   23975 
   23976 
   23977 
   23978 #define GEN10_3DSTATE_DS_AccessesUAV_start  110
   23979 #define GEN9_3DSTATE_DS_AccessesUAV_start  110
   23980 #define GEN8_3DSTATE_DS_AccessesUAV_start  110
   23981 #define GEN75_3DSTATE_DS_AccessesUAV_start  78
   23982 
   23983 static inline uint32_t ATTRIBUTE_PURE
   23984 _3DSTATE_DS_AccessesUAV_start(const struct gen_device_info *devinfo)
   23985 {
   23986    switch (devinfo->gen) {
   23987    case 10: return 110;
   23988    case 9: return 110;
   23989    case 8: return 110;
   23990    case 7:
   23991       if (devinfo->is_haswell) {
   23992          return 78;
   23993       } else {
   23994          return 0;
   23995       }
   23996    case 6: return 0;
   23997    case 5: return 0;
   23998    case 4:
   23999       if (devinfo->is_g4x) {
   24000          return 0;
   24001       } else {
   24002          return 0;
   24003       }
   24004    default:
   24005       unreachable("Invalid hardware generation");
   24006    }
   24007 }
   24008 
   24009 
   24010 
   24011 /* 3DSTATE_DS::Binding Table Entry Count */
   24012 
   24013 
   24014 #define GEN10_3DSTATE_DS_BindingTableEntryCount_bits  8
   24015 #define GEN9_3DSTATE_DS_BindingTableEntryCount_bits  8
   24016 #define GEN8_3DSTATE_DS_BindingTableEntryCount_bits  8
   24017 #define GEN75_3DSTATE_DS_BindingTableEntryCount_bits  8
   24018 #define GEN7_3DSTATE_DS_BindingTableEntryCount_bits  8
   24019 
   24020 static inline uint32_t ATTRIBUTE_PURE
   24021 _3DSTATE_DS_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   24022 {
   24023    switch (devinfo->gen) {
   24024    case 10: return 8;
   24025    case 9: return 8;
   24026    case 8: return 8;
   24027    case 7:
   24028       if (devinfo->is_haswell) {
   24029          return 8;
   24030       } else {
   24031          return 8;
   24032       }
   24033    case 6: return 0;
   24034    case 5: return 0;
   24035    case 4:
   24036       if (devinfo->is_g4x) {
   24037          return 0;
   24038       } else {
   24039          return 0;
   24040       }
   24041    default:
   24042       unreachable("Invalid hardware generation");
   24043    }
   24044 }
   24045 
   24046 
   24047 
   24048 #define GEN10_3DSTATE_DS_BindingTableEntryCount_start  114
   24049 #define GEN9_3DSTATE_DS_BindingTableEntryCount_start  114
   24050 #define GEN8_3DSTATE_DS_BindingTableEntryCount_start  114
   24051 #define GEN75_3DSTATE_DS_BindingTableEntryCount_start  82
   24052 #define GEN7_3DSTATE_DS_BindingTableEntryCount_start  82
   24053 
   24054 static inline uint32_t ATTRIBUTE_PURE
   24055 _3DSTATE_DS_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   24056 {
   24057    switch (devinfo->gen) {
   24058    case 10: return 114;
   24059    case 9: return 114;
   24060    case 8: return 114;
   24061    case 7:
   24062       if (devinfo->is_haswell) {
   24063          return 82;
   24064       } else {
   24065          return 82;
   24066       }
   24067    case 6: return 0;
   24068    case 5: return 0;
   24069    case 4:
   24070       if (devinfo->is_g4x) {
   24071          return 0;
   24072       } else {
   24073          return 0;
   24074       }
   24075    default:
   24076       unreachable("Invalid hardware generation");
   24077    }
   24078 }
   24079 
   24080 
   24081 
   24082 /* 3DSTATE_DS::Cache Disable */
   24083 
   24084 
   24085 #define GEN10_3DSTATE_DS_CacheDisable_bits  1
   24086 #define GEN9_3DSTATE_DS_CacheDisable_bits  1
   24087 #define GEN8_3DSTATE_DS_CacheDisable_bits  1
   24088 
   24089 static inline uint32_t ATTRIBUTE_PURE
   24090 _3DSTATE_DS_CacheDisable_bits(const struct gen_device_info *devinfo)
   24091 {
   24092    switch (devinfo->gen) {
   24093    case 10: return 1;
   24094    case 9: return 1;
   24095    case 8: return 1;
   24096    case 7:
   24097       if (devinfo->is_haswell) {
   24098          return 0;
   24099       } else {
   24100          return 0;
   24101       }
   24102    case 6: return 0;
   24103    case 5: return 0;
   24104    case 4:
   24105       if (devinfo->is_g4x) {
   24106          return 0;
   24107       } else {
   24108          return 0;
   24109       }
   24110    default:
   24111       unreachable("Invalid hardware generation");
   24112    }
   24113 }
   24114 
   24115 
   24116 
   24117 #define GEN10_3DSTATE_DS_CacheDisable_start  225
   24118 #define GEN9_3DSTATE_DS_CacheDisable_start  225
   24119 #define GEN8_3DSTATE_DS_CacheDisable_start  225
   24120 
   24121 static inline uint32_t ATTRIBUTE_PURE
   24122 _3DSTATE_DS_CacheDisable_start(const struct gen_device_info *devinfo)
   24123 {
   24124    switch (devinfo->gen) {
   24125    case 10: return 225;
   24126    case 9: return 225;
   24127    case 8: return 225;
   24128    case 7:
   24129       if (devinfo->is_haswell) {
   24130          return 0;
   24131       } else {
   24132          return 0;
   24133       }
   24134    case 6: return 0;
   24135    case 5: return 0;
   24136    case 4:
   24137       if (devinfo->is_g4x) {
   24138          return 0;
   24139       } else {
   24140          return 0;
   24141       }
   24142    default:
   24143       unreachable("Invalid hardware generation");
   24144    }
   24145 }
   24146 
   24147 
   24148 
   24149 /* 3DSTATE_DS::Command SubType */
   24150 
   24151 
   24152 #define GEN10_3DSTATE_DS_CommandSubType_bits  2
   24153 #define GEN9_3DSTATE_DS_CommandSubType_bits  2
   24154 #define GEN8_3DSTATE_DS_CommandSubType_bits  2
   24155 #define GEN75_3DSTATE_DS_CommandSubType_bits  2
   24156 #define GEN7_3DSTATE_DS_CommandSubType_bits  2
   24157 
   24158 static inline uint32_t ATTRIBUTE_PURE
   24159 _3DSTATE_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   24160 {
   24161    switch (devinfo->gen) {
   24162    case 10: return 2;
   24163    case 9: return 2;
   24164    case 8: return 2;
   24165    case 7:
   24166       if (devinfo->is_haswell) {
   24167          return 2;
   24168       } else {
   24169          return 2;
   24170       }
   24171    case 6: return 0;
   24172    case 5: return 0;
   24173    case 4:
   24174       if (devinfo->is_g4x) {
   24175          return 0;
   24176       } else {
   24177          return 0;
   24178       }
   24179    default:
   24180       unreachable("Invalid hardware generation");
   24181    }
   24182 }
   24183 
   24184 
   24185 
   24186 #define GEN10_3DSTATE_DS_CommandSubType_start  27
   24187 #define GEN9_3DSTATE_DS_CommandSubType_start  27
   24188 #define GEN8_3DSTATE_DS_CommandSubType_start  27
   24189 #define GEN75_3DSTATE_DS_CommandSubType_start  27
   24190 #define GEN7_3DSTATE_DS_CommandSubType_start  27
   24191 
   24192 static inline uint32_t ATTRIBUTE_PURE
   24193 _3DSTATE_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   24194 {
   24195    switch (devinfo->gen) {
   24196    case 10: return 27;
   24197    case 9: return 27;
   24198    case 8: return 27;
   24199    case 7:
   24200       if (devinfo->is_haswell) {
   24201          return 27;
   24202       } else {
   24203          return 27;
   24204       }
   24205    case 6: return 0;
   24206    case 5: return 0;
   24207    case 4:
   24208       if (devinfo->is_g4x) {
   24209          return 0;
   24210       } else {
   24211          return 0;
   24212       }
   24213    default:
   24214       unreachable("Invalid hardware generation");
   24215    }
   24216 }
   24217 
   24218 
   24219 
   24220 /* 3DSTATE_DS::Command Type */
   24221 
   24222 
   24223 #define GEN10_3DSTATE_DS_CommandType_bits  3
   24224 #define GEN9_3DSTATE_DS_CommandType_bits  3
   24225 #define GEN8_3DSTATE_DS_CommandType_bits  3
   24226 #define GEN75_3DSTATE_DS_CommandType_bits  3
   24227 #define GEN7_3DSTATE_DS_CommandType_bits  3
   24228 
   24229 static inline uint32_t ATTRIBUTE_PURE
   24230 _3DSTATE_DS_CommandType_bits(const struct gen_device_info *devinfo)
   24231 {
   24232    switch (devinfo->gen) {
   24233    case 10: return 3;
   24234    case 9: return 3;
   24235    case 8: return 3;
   24236    case 7:
   24237       if (devinfo->is_haswell) {
   24238          return 3;
   24239       } else {
   24240          return 3;
   24241       }
   24242    case 6: return 0;
   24243    case 5: return 0;
   24244    case 4:
   24245       if (devinfo->is_g4x) {
   24246          return 0;
   24247       } else {
   24248          return 0;
   24249       }
   24250    default:
   24251       unreachable("Invalid hardware generation");
   24252    }
   24253 }
   24254 
   24255 
   24256 
   24257 #define GEN10_3DSTATE_DS_CommandType_start  29
   24258 #define GEN9_3DSTATE_DS_CommandType_start  29
   24259 #define GEN8_3DSTATE_DS_CommandType_start  29
   24260 #define GEN75_3DSTATE_DS_CommandType_start  29
   24261 #define GEN7_3DSTATE_DS_CommandType_start  29
   24262 
   24263 static inline uint32_t ATTRIBUTE_PURE
   24264 _3DSTATE_DS_CommandType_start(const struct gen_device_info *devinfo)
   24265 {
   24266    switch (devinfo->gen) {
   24267    case 10: return 29;
   24268    case 9: return 29;
   24269    case 8: return 29;
   24270    case 7:
   24271       if (devinfo->is_haswell) {
   24272          return 29;
   24273       } else {
   24274          return 29;
   24275       }
   24276    case 6: return 0;
   24277    case 5: return 0;
   24278    case 4:
   24279       if (devinfo->is_g4x) {
   24280          return 0;
   24281       } else {
   24282          return 0;
   24283       }
   24284    default:
   24285       unreachable("Invalid hardware generation");
   24286    }
   24287 }
   24288 
   24289 
   24290 
   24291 /* 3DSTATE_DS::Compute W Coordinate Enable */
   24292 
   24293 
   24294 #define GEN10_3DSTATE_DS_ComputeWCoordinateEnable_bits  1
   24295 #define GEN9_3DSTATE_DS_ComputeWCoordinateEnable_bits  1
   24296 #define GEN8_3DSTATE_DS_ComputeWCoordinateEnable_bits  1
   24297 #define GEN75_3DSTATE_DS_ComputeWCoordinateEnable_bits  1
   24298 #define GEN7_3DSTATE_DS_ComputeWCoordinateEnable_bits  1
   24299 
   24300 static inline uint32_t ATTRIBUTE_PURE
   24301 _3DSTATE_DS_ComputeWCoordinateEnable_bits(const struct gen_device_info *devinfo)
   24302 {
   24303    switch (devinfo->gen) {
   24304    case 10: return 1;
   24305    case 9: return 1;
   24306    case 8: return 1;
   24307    case 7:
   24308       if (devinfo->is_haswell) {
   24309          return 1;
   24310       } else {
   24311          return 1;
   24312       }
   24313    case 6: return 0;
   24314    case 5: return 0;
   24315    case 4:
   24316       if (devinfo->is_g4x) {
   24317          return 0;
   24318       } else {
   24319          return 0;
   24320       }
   24321    default:
   24322       unreachable("Invalid hardware generation");
   24323    }
   24324 }
   24325 
   24326 
   24327 
   24328 #define GEN10_3DSTATE_DS_ComputeWCoordinateEnable_start  226
   24329 #define GEN9_3DSTATE_DS_ComputeWCoordinateEnable_start  226
   24330 #define GEN8_3DSTATE_DS_ComputeWCoordinateEnable_start  226
   24331 #define GEN75_3DSTATE_DS_ComputeWCoordinateEnable_start  162
   24332 #define GEN7_3DSTATE_DS_ComputeWCoordinateEnable_start  162
   24333 
   24334 static inline uint32_t ATTRIBUTE_PURE
   24335 _3DSTATE_DS_ComputeWCoordinateEnable_start(const struct gen_device_info *devinfo)
   24336 {
   24337    switch (devinfo->gen) {
   24338    case 10: return 226;
   24339    case 9: return 226;
   24340    case 8: return 226;
   24341    case 7:
   24342       if (devinfo->is_haswell) {
   24343          return 162;
   24344       } else {
   24345          return 162;
   24346       }
   24347    case 6: return 0;
   24348    case 5: return 0;
   24349    case 4:
   24350       if (devinfo->is_g4x) {
   24351          return 0;
   24352       } else {
   24353          return 0;
   24354       }
   24355    default:
   24356       unreachable("Invalid hardware generation");
   24357    }
   24358 }
   24359 
   24360 
   24361 
   24362 /* 3DSTATE_DS::DS Cache Disable */
   24363 
   24364 
   24365 #define GEN75_3DSTATE_DS_DSCacheDisable_bits  1
   24366 #define GEN7_3DSTATE_DS_DSCacheDisable_bits  1
   24367 
   24368 static inline uint32_t ATTRIBUTE_PURE
   24369 _3DSTATE_DS_DSCacheDisable_bits(const struct gen_device_info *devinfo)
   24370 {
   24371    switch (devinfo->gen) {
   24372    case 10: return 0;
   24373    case 9: return 0;
   24374    case 8: return 0;
   24375    case 7:
   24376       if (devinfo->is_haswell) {
   24377          return 1;
   24378       } else {
   24379          return 1;
   24380       }
   24381    case 6: return 0;
   24382    case 5: return 0;
   24383    case 4:
   24384       if (devinfo->is_g4x) {
   24385          return 0;
   24386       } else {
   24387          return 0;
   24388       }
   24389    default:
   24390       unreachable("Invalid hardware generation");
   24391    }
   24392 }
   24393 
   24394 
   24395 
   24396 #define GEN75_3DSTATE_DS_DSCacheDisable_start  161
   24397 #define GEN7_3DSTATE_DS_DSCacheDisable_start  161
   24398 
   24399 static inline uint32_t ATTRIBUTE_PURE
   24400 _3DSTATE_DS_DSCacheDisable_start(const struct gen_device_info *devinfo)
   24401 {
   24402    switch (devinfo->gen) {
   24403    case 10: return 0;
   24404    case 9: return 0;
   24405    case 8: return 0;
   24406    case 7:
   24407       if (devinfo->is_haswell) {
   24408          return 161;
   24409       } else {
   24410          return 161;
   24411       }
   24412    case 6: return 0;
   24413    case 5: return 0;
   24414    case 4:
   24415       if (devinfo->is_g4x) {
   24416          return 0;
   24417       } else {
   24418          return 0;
   24419       }
   24420    default:
   24421       unreachable("Invalid hardware generation");
   24422    }
   24423 }
   24424 
   24425 
   24426 
   24427 /* 3DSTATE_DS::DUAL_PATCH Kernel Start Pointer */
   24428 
   24429 
   24430 #define GEN10_3DSTATE_DS_DUAL_PATCHKernelStartPointer_bits  58
   24431 #define GEN9_3DSTATE_DS_DUAL_PATCHKernelStartPointer_bits  58
   24432 
   24433 static inline uint32_t ATTRIBUTE_PURE
   24434 _3DSTATE_DS_DUAL_PATCHKernelStartPointer_bits(const struct gen_device_info *devinfo)
   24435 {
   24436    switch (devinfo->gen) {
   24437    case 10: return 58;
   24438    case 9: return 58;
   24439    case 8: return 0;
   24440    case 7:
   24441       if (devinfo->is_haswell) {
   24442          return 0;
   24443       } else {
   24444          return 0;
   24445       }
   24446    case 6: return 0;
   24447    case 5: return 0;
   24448    case 4:
   24449       if (devinfo->is_g4x) {
   24450          return 0;
   24451       } else {
   24452          return 0;
   24453       }
   24454    default:
   24455       unreachable("Invalid hardware generation");
   24456    }
   24457 }
   24458 
   24459 
   24460 
   24461 #define GEN10_3DSTATE_DS_DUAL_PATCHKernelStartPointer_start  294
   24462 #define GEN9_3DSTATE_DS_DUAL_PATCHKernelStartPointer_start  294
   24463 
   24464 static inline uint32_t ATTRIBUTE_PURE
   24465 _3DSTATE_DS_DUAL_PATCHKernelStartPointer_start(const struct gen_device_info *devinfo)
   24466 {
   24467    switch (devinfo->gen) {
   24468    case 10: return 294;
   24469    case 9: return 294;
   24470    case 8: return 0;
   24471    case 7:
   24472       if (devinfo->is_haswell) {
   24473          return 0;
   24474       } else {
   24475          return 0;
   24476       }
   24477    case 6: return 0;
   24478    case 5: return 0;
   24479    case 4:
   24480       if (devinfo->is_g4x) {
   24481          return 0;
   24482       } else {
   24483          return 0;
   24484       }
   24485    default:
   24486       unreachable("Invalid hardware generation");
   24487    }
   24488 }
   24489 
   24490 
   24491 
   24492 /* 3DSTATE_DS::DWord Length */
   24493 
   24494 
   24495 #define GEN10_3DSTATE_DS_DWordLength_bits  8
   24496 #define GEN9_3DSTATE_DS_DWordLength_bits  8
   24497 #define GEN8_3DSTATE_DS_DWordLength_bits  8
   24498 #define GEN75_3DSTATE_DS_DWordLength_bits  8
   24499 #define GEN7_3DSTATE_DS_DWordLength_bits  8
   24500 
   24501 static inline uint32_t ATTRIBUTE_PURE
   24502 _3DSTATE_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   24503 {
   24504    switch (devinfo->gen) {
   24505    case 10: return 8;
   24506    case 9: return 8;
   24507    case 8: return 8;
   24508    case 7:
   24509       if (devinfo->is_haswell) {
   24510          return 8;
   24511       } else {
   24512          return 8;
   24513       }
   24514    case 6: return 0;
   24515    case 5: return 0;
   24516    case 4:
   24517       if (devinfo->is_g4x) {
   24518          return 0;
   24519       } else {
   24520          return 0;
   24521       }
   24522    default:
   24523       unreachable("Invalid hardware generation");
   24524    }
   24525 }
   24526 
   24527 
   24528 
   24529 #define GEN10_3DSTATE_DS_DWordLength_start  0
   24530 #define GEN9_3DSTATE_DS_DWordLength_start  0
   24531 #define GEN8_3DSTATE_DS_DWordLength_start  0
   24532 #define GEN75_3DSTATE_DS_DWordLength_start  0
   24533 #define GEN7_3DSTATE_DS_DWordLength_start  0
   24534 
   24535 static inline uint32_t ATTRIBUTE_PURE
   24536 _3DSTATE_DS_DWordLength_start(const struct gen_device_info *devinfo)
   24537 {
   24538    switch (devinfo->gen) {
   24539    case 10: return 0;
   24540    case 9: return 0;
   24541    case 8: return 0;
   24542    case 7:
   24543       if (devinfo->is_haswell) {
   24544          return 0;
   24545       } else {
   24546          return 0;
   24547       }
   24548    case 6: return 0;
   24549    case 5: return 0;
   24550    case 4:
   24551       if (devinfo->is_g4x) {
   24552          return 0;
   24553       } else {
   24554          return 0;
   24555       }
   24556    default:
   24557       unreachable("Invalid hardware generation");
   24558    }
   24559 }
   24560 
   24561 
   24562 
   24563 /* 3DSTATE_DS::Dispatch GRF Start Register For URB Data */
   24564 
   24565 
   24566 #define GEN10_3DSTATE_DS_DispatchGRFStartRegisterForURBData_bits  5
   24567 #define GEN9_3DSTATE_DS_DispatchGRFStartRegisterForURBData_bits  5
   24568 #define GEN8_3DSTATE_DS_DispatchGRFStartRegisterForURBData_bits  5
   24569 #define GEN75_3DSTATE_DS_DispatchGRFStartRegisterForURBData_bits  5
   24570 #define GEN7_3DSTATE_DS_DispatchGRFStartRegisterForURBData_bits  5
   24571 
   24572 static inline uint32_t ATTRIBUTE_PURE
   24573 _3DSTATE_DS_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   24574 {
   24575    switch (devinfo->gen) {
   24576    case 10: return 5;
   24577    case 9: return 5;
   24578    case 8: return 5;
   24579    case 7:
   24580       if (devinfo->is_haswell) {
   24581          return 5;
   24582       } else {
   24583          return 5;
   24584       }
   24585    case 6: return 0;
   24586    case 5: return 0;
   24587    case 4:
   24588       if (devinfo->is_g4x) {
   24589          return 0;
   24590       } else {
   24591          return 0;
   24592       }
   24593    default:
   24594       unreachable("Invalid hardware generation");
   24595    }
   24596 }
   24597 
   24598 
   24599 
   24600 #define GEN10_3DSTATE_DS_DispatchGRFStartRegisterForURBData_start  212
   24601 #define GEN9_3DSTATE_DS_DispatchGRFStartRegisterForURBData_start  212
   24602 #define GEN8_3DSTATE_DS_DispatchGRFStartRegisterForURBData_start  212
   24603 #define GEN75_3DSTATE_DS_DispatchGRFStartRegisterForURBData_start  148
   24604 #define GEN7_3DSTATE_DS_DispatchGRFStartRegisterForURBData_start  148
   24605 
   24606 static inline uint32_t ATTRIBUTE_PURE
   24607 _3DSTATE_DS_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   24608 {
   24609    switch (devinfo->gen) {
   24610    case 10: return 212;
   24611    case 9: return 212;
   24612    case 8: return 212;
   24613    case 7:
   24614       if (devinfo->is_haswell) {
   24615          return 148;
   24616       } else {
   24617          return 148;
   24618       }
   24619    case 6: return 0;
   24620    case 5: return 0;
   24621    case 4:
   24622       if (devinfo->is_g4x) {
   24623          return 0;
   24624       } else {
   24625          return 0;
   24626       }
   24627    default:
   24628       unreachable("Invalid hardware generation");
   24629    }
   24630 }
   24631 
   24632 
   24633 
   24634 /* 3DSTATE_DS::Dispatch Mode */
   24635 
   24636 
   24637 #define GEN10_3DSTATE_DS_DispatchMode_bits  2
   24638 #define GEN9_3DSTATE_DS_DispatchMode_bits  2
   24639 #define GEN8_3DSTATE_DS_DispatchMode_bits  1
   24640 
   24641 static inline uint32_t ATTRIBUTE_PURE
   24642 _3DSTATE_DS_DispatchMode_bits(const struct gen_device_info *devinfo)
   24643 {
   24644    switch (devinfo->gen) {
   24645    case 10: return 2;
   24646    case 9: return 2;
   24647    case 8: return 1;
   24648    case 7:
   24649       if (devinfo->is_haswell) {
   24650          return 0;
   24651       } else {
   24652          return 0;
   24653       }
   24654    case 6: return 0;
   24655    case 5: return 0;
   24656    case 4:
   24657       if (devinfo->is_g4x) {
   24658          return 0;
   24659       } else {
   24660          return 0;
   24661       }
   24662    default:
   24663       unreachable("Invalid hardware generation");
   24664    }
   24665 }
   24666 
   24667 
   24668 
   24669 #define GEN10_3DSTATE_DS_DispatchMode_start  227
   24670 #define GEN9_3DSTATE_DS_DispatchMode_start  227
   24671 #define GEN8_3DSTATE_DS_DispatchMode_start  227
   24672 
   24673 static inline uint32_t ATTRIBUTE_PURE
   24674 _3DSTATE_DS_DispatchMode_start(const struct gen_device_info *devinfo)
   24675 {
   24676    switch (devinfo->gen) {
   24677    case 10: return 227;
   24678    case 9: return 227;
   24679    case 8: return 227;
   24680    case 7:
   24681       if (devinfo->is_haswell) {
   24682          return 0;
   24683       } else {
   24684          return 0;
   24685       }
   24686    case 6: return 0;
   24687    case 5: return 0;
   24688    case 4:
   24689       if (devinfo->is_g4x) {
   24690          return 0;
   24691       } else {
   24692          return 0;
   24693       }
   24694    default:
   24695       unreachable("Invalid hardware generation");
   24696    }
   24697 }
   24698 
   24699 
   24700 
   24701 /* 3DSTATE_DS::Enable */
   24702 
   24703 
   24704 #define GEN10_3DSTATE_DS_Enable_bits  1
   24705 #define GEN9_3DSTATE_DS_Enable_bits  1
   24706 #define GEN8_3DSTATE_DS_Enable_bits  1
   24707 #define GEN75_3DSTATE_DS_Enable_bits  1
   24708 #define GEN7_3DSTATE_DS_Enable_bits  1
   24709 
   24710 static inline uint32_t ATTRIBUTE_PURE
   24711 _3DSTATE_DS_Enable_bits(const struct gen_device_info *devinfo)
   24712 {
   24713    switch (devinfo->gen) {
   24714    case 10: return 1;
   24715    case 9: return 1;
   24716    case 8: return 1;
   24717    case 7:
   24718       if (devinfo->is_haswell) {
   24719          return 1;
   24720       } else {
   24721          return 1;
   24722       }
   24723    case 6: return 0;
   24724    case 5: return 0;
   24725    case 4:
   24726       if (devinfo->is_g4x) {
   24727          return 0;
   24728       } else {
   24729          return 0;
   24730       }
   24731    default:
   24732       unreachable("Invalid hardware generation");
   24733    }
   24734 }
   24735 
   24736 
   24737 
   24738 #define GEN10_3DSTATE_DS_Enable_start  224
   24739 #define GEN9_3DSTATE_DS_Enable_start  224
   24740 #define GEN8_3DSTATE_DS_Enable_start  224
   24741 #define GEN75_3DSTATE_DS_Enable_start  160
   24742 #define GEN7_3DSTATE_DS_Enable_start  160
   24743 
   24744 static inline uint32_t ATTRIBUTE_PURE
   24745 _3DSTATE_DS_Enable_start(const struct gen_device_info *devinfo)
   24746 {
   24747    switch (devinfo->gen) {
   24748    case 10: return 224;
   24749    case 9: return 224;
   24750    case 8: return 224;
   24751    case 7:
   24752       if (devinfo->is_haswell) {
   24753          return 160;
   24754       } else {
   24755          return 160;
   24756       }
   24757    case 6: return 0;
   24758    case 5: return 0;
   24759    case 4:
   24760       if (devinfo->is_g4x) {
   24761          return 0;
   24762       } else {
   24763          return 0;
   24764       }
   24765    default:
   24766       unreachable("Invalid hardware generation");
   24767    }
   24768 }
   24769 
   24770 
   24771 
   24772 /* 3DSTATE_DS::Floating Point Mode */
   24773 
   24774 
   24775 #define GEN10_3DSTATE_DS_FloatingPointMode_bits  1
   24776 #define GEN9_3DSTATE_DS_FloatingPointMode_bits  1
   24777 #define GEN8_3DSTATE_DS_FloatingPointMode_bits  1
   24778 #define GEN75_3DSTATE_DS_FloatingPointMode_bits  1
   24779 #define GEN7_3DSTATE_DS_FloatingPointMode_bits  1
   24780 
   24781 static inline uint32_t ATTRIBUTE_PURE
   24782 _3DSTATE_DS_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   24783 {
   24784    switch (devinfo->gen) {
   24785    case 10: return 1;
   24786    case 9: return 1;
   24787    case 8: return 1;
   24788    case 7:
   24789       if (devinfo->is_haswell) {
   24790          return 1;
   24791       } else {
   24792          return 1;
   24793       }
   24794    case 6: return 0;
   24795    case 5: return 0;
   24796    case 4:
   24797       if (devinfo->is_g4x) {
   24798          return 0;
   24799       } else {
   24800          return 0;
   24801       }
   24802    default:
   24803       unreachable("Invalid hardware generation");
   24804    }
   24805 }
   24806 
   24807 
   24808 
   24809 #define GEN10_3DSTATE_DS_FloatingPointMode_start  112
   24810 #define GEN9_3DSTATE_DS_FloatingPointMode_start  112
   24811 #define GEN8_3DSTATE_DS_FloatingPointMode_start  112
   24812 #define GEN75_3DSTATE_DS_FloatingPointMode_start  80
   24813 #define GEN7_3DSTATE_DS_FloatingPointMode_start  80
   24814 
   24815 static inline uint32_t ATTRIBUTE_PURE
   24816 _3DSTATE_DS_FloatingPointMode_start(const struct gen_device_info *devinfo)
   24817 {
   24818    switch (devinfo->gen) {
   24819    case 10: return 112;
   24820    case 9: return 112;
   24821    case 8: return 112;
   24822    case 7:
   24823       if (devinfo->is_haswell) {
   24824          return 80;
   24825       } else {
   24826          return 80;
   24827       }
   24828    case 6: return 0;
   24829    case 5: return 0;
   24830    case 4:
   24831       if (devinfo->is_g4x) {
   24832          return 0;
   24833       } else {
   24834          return 0;
   24835       }
   24836    default:
   24837       unreachable("Invalid hardware generation");
   24838    }
   24839 }
   24840 
   24841 
   24842 
   24843 /* 3DSTATE_DS::Illegal Opcode Exception Enable */
   24844 
   24845 
   24846 #define GEN10_3DSTATE_DS_IllegalOpcodeExceptionEnable_bits  1
   24847 #define GEN9_3DSTATE_DS_IllegalOpcodeExceptionEnable_bits  1
   24848 #define GEN8_3DSTATE_DS_IllegalOpcodeExceptionEnable_bits  1
   24849 #define GEN75_3DSTATE_DS_IllegalOpcodeExceptionEnable_bits  1
   24850 #define GEN7_3DSTATE_DS_IllegalOpcodeExceptionEnable_bits  1
   24851 
   24852 static inline uint32_t ATTRIBUTE_PURE
   24853 _3DSTATE_DS_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   24854 {
   24855    switch (devinfo->gen) {
   24856    case 10: return 1;
   24857    case 9: return 1;
   24858    case 8: return 1;
   24859    case 7:
   24860       if (devinfo->is_haswell) {
   24861          return 1;
   24862       } else {
   24863          return 1;
   24864       }
   24865    case 6: return 0;
   24866    case 5: return 0;
   24867    case 4:
   24868       if (devinfo->is_g4x) {
   24869          return 0;
   24870       } else {
   24871          return 0;
   24872       }
   24873    default:
   24874       unreachable("Invalid hardware generation");
   24875    }
   24876 }
   24877 
   24878 
   24879 
   24880 #define GEN10_3DSTATE_DS_IllegalOpcodeExceptionEnable_start  109
   24881 #define GEN9_3DSTATE_DS_IllegalOpcodeExceptionEnable_start  109
   24882 #define GEN8_3DSTATE_DS_IllegalOpcodeExceptionEnable_start  109
   24883 #define GEN75_3DSTATE_DS_IllegalOpcodeExceptionEnable_start  77
   24884 #define GEN7_3DSTATE_DS_IllegalOpcodeExceptionEnable_start  77
   24885 
   24886 static inline uint32_t ATTRIBUTE_PURE
   24887 _3DSTATE_DS_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   24888 {
   24889    switch (devinfo->gen) {
   24890    case 10: return 109;
   24891    case 9: return 109;
   24892    case 8: return 109;
   24893    case 7:
   24894       if (devinfo->is_haswell) {
   24895          return 77;
   24896       } else {
   24897          return 77;
   24898       }
   24899    case 6: return 0;
   24900    case 5: return 0;
   24901    case 4:
   24902       if (devinfo->is_g4x) {
   24903          return 0;
   24904       } else {
   24905          return 0;
   24906       }
   24907    default:
   24908       unreachable("Invalid hardware generation");
   24909    }
   24910 }
   24911 
   24912 
   24913 
   24914 /* 3DSTATE_DS::Kernel Start Pointer */
   24915 
   24916 
   24917 #define GEN10_3DSTATE_DS_KernelStartPointer_bits  58
   24918 #define GEN9_3DSTATE_DS_KernelStartPointer_bits  58
   24919 #define GEN8_3DSTATE_DS_KernelStartPointer_bits  58
   24920 #define GEN75_3DSTATE_DS_KernelStartPointer_bits  26
   24921 #define GEN7_3DSTATE_DS_KernelStartPointer_bits  26
   24922 
   24923 static inline uint32_t ATTRIBUTE_PURE
   24924 _3DSTATE_DS_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   24925 {
   24926    switch (devinfo->gen) {
   24927    case 10: return 58;
   24928    case 9: return 58;
   24929    case 8: return 58;
   24930    case 7:
   24931       if (devinfo->is_haswell) {
   24932          return 26;
   24933       } else {
   24934          return 26;
   24935       }
   24936    case 6: return 0;
   24937    case 5: return 0;
   24938    case 4:
   24939       if (devinfo->is_g4x) {
   24940          return 0;
   24941       } else {
   24942          return 0;
   24943       }
   24944    default:
   24945       unreachable("Invalid hardware generation");
   24946    }
   24947 }
   24948 
   24949 
   24950 
   24951 #define GEN10_3DSTATE_DS_KernelStartPointer_start  38
   24952 #define GEN9_3DSTATE_DS_KernelStartPointer_start  38
   24953 #define GEN8_3DSTATE_DS_KernelStartPointer_start  38
   24954 #define GEN75_3DSTATE_DS_KernelStartPointer_start  38
   24955 #define GEN7_3DSTATE_DS_KernelStartPointer_start  38
   24956 
   24957 static inline uint32_t ATTRIBUTE_PURE
   24958 _3DSTATE_DS_KernelStartPointer_start(const struct gen_device_info *devinfo)
   24959 {
   24960    switch (devinfo->gen) {
   24961    case 10: return 38;
   24962    case 9: return 38;
   24963    case 8: return 38;
   24964    case 7:
   24965       if (devinfo->is_haswell) {
   24966          return 38;
   24967       } else {
   24968          return 38;
   24969       }
   24970    case 6: return 0;
   24971    case 5: return 0;
   24972    case 4:
   24973       if (devinfo->is_g4x) {
   24974          return 0;
   24975       } else {
   24976          return 0;
   24977       }
   24978    default:
   24979       unreachable("Invalid hardware generation");
   24980    }
   24981 }
   24982 
   24983 
   24984 
   24985 /* 3DSTATE_DS::Maximum Number of Threads */
   24986 
   24987 
   24988 #define GEN10_3DSTATE_DS_MaximumNumberofThreads_bits  10
   24989 #define GEN9_3DSTATE_DS_MaximumNumberofThreads_bits  9
   24990 #define GEN8_3DSTATE_DS_MaximumNumberofThreads_bits  9
   24991 #define GEN75_3DSTATE_DS_MaximumNumberofThreads_bits  9
   24992 #define GEN7_3DSTATE_DS_MaximumNumberofThreads_bits  7
   24993 
   24994 static inline uint32_t ATTRIBUTE_PURE
   24995 _3DSTATE_DS_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   24996 {
   24997    switch (devinfo->gen) {
   24998    case 10: return 10;
   24999    case 9: return 9;
   25000    case 8: return 9;
   25001    case 7:
   25002       if (devinfo->is_haswell) {
   25003          return 9;
   25004       } else {
   25005          return 7;
   25006       }
   25007    case 6: return 0;
   25008    case 5: return 0;
   25009    case 4:
   25010       if (devinfo->is_g4x) {
   25011          return 0;
   25012       } else {
   25013          return 0;
   25014       }
   25015    default:
   25016       unreachable("Invalid hardware generation");
   25017    }
   25018 }
   25019 
   25020 
   25021 
   25022 #define GEN10_3DSTATE_DS_MaximumNumberofThreads_start  245
   25023 #define GEN9_3DSTATE_DS_MaximumNumberofThreads_start  245
   25024 #define GEN8_3DSTATE_DS_MaximumNumberofThreads_start  245
   25025 #define GEN75_3DSTATE_DS_MaximumNumberofThreads_start  181
   25026 #define GEN7_3DSTATE_DS_MaximumNumberofThreads_start  185
   25027 
   25028 static inline uint32_t ATTRIBUTE_PURE
   25029 _3DSTATE_DS_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   25030 {
   25031    switch (devinfo->gen) {
   25032    case 10: return 245;
   25033    case 9: return 245;
   25034    case 8: return 245;
   25035    case 7:
   25036       if (devinfo->is_haswell) {
   25037          return 181;
   25038       } else {
   25039          return 185;
   25040       }
   25041    case 6: return 0;
   25042    case 5: return 0;
   25043    case 4:
   25044       if (devinfo->is_g4x) {
   25045          return 0;
   25046       } else {
   25047          return 0;
   25048       }
   25049    default:
   25050       unreachable("Invalid hardware generation");
   25051    }
   25052 }
   25053 
   25054 
   25055 
   25056 /* 3DSTATE_DS::Patch URB Entry Read Length */
   25057 
   25058 
   25059 #define GEN10_3DSTATE_DS_PatchURBEntryReadLength_bits  7
   25060 #define GEN9_3DSTATE_DS_PatchURBEntryReadLength_bits  7
   25061 #define GEN8_3DSTATE_DS_PatchURBEntryReadLength_bits  7
   25062 #define GEN75_3DSTATE_DS_PatchURBEntryReadLength_bits  7
   25063 #define GEN7_3DSTATE_DS_PatchURBEntryReadLength_bits  7
   25064 
   25065 static inline uint32_t ATTRIBUTE_PURE
   25066 _3DSTATE_DS_PatchURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   25067 {
   25068    switch (devinfo->gen) {
   25069    case 10: return 7;
   25070    case 9: return 7;
   25071    case 8: return 7;
   25072    case 7:
   25073       if (devinfo->is_haswell) {
   25074          return 7;
   25075       } else {
   25076          return 7;
   25077       }
   25078    case 6: return 0;
   25079    case 5: return 0;
   25080    case 4:
   25081       if (devinfo->is_g4x) {
   25082          return 0;
   25083       } else {
   25084          return 0;
   25085       }
   25086    default:
   25087       unreachable("Invalid hardware generation");
   25088    }
   25089 }
   25090 
   25091 
   25092 
   25093 #define GEN10_3DSTATE_DS_PatchURBEntryReadLength_start  203
   25094 #define GEN9_3DSTATE_DS_PatchURBEntryReadLength_start  203
   25095 #define GEN8_3DSTATE_DS_PatchURBEntryReadLength_start  203
   25096 #define GEN75_3DSTATE_DS_PatchURBEntryReadLength_start  139
   25097 #define GEN7_3DSTATE_DS_PatchURBEntryReadLength_start  139
   25098 
   25099 static inline uint32_t ATTRIBUTE_PURE
   25100 _3DSTATE_DS_PatchURBEntryReadLength_start(const struct gen_device_info *devinfo)
   25101 {
   25102    switch (devinfo->gen) {
   25103    case 10: return 203;
   25104    case 9: return 203;
   25105    case 8: return 203;
   25106    case 7:
   25107       if (devinfo->is_haswell) {
   25108          return 139;
   25109       } else {
   25110          return 139;
   25111       }
   25112    case 6: return 0;
   25113    case 5: return 0;
   25114    case 4:
   25115       if (devinfo->is_g4x) {
   25116          return 0;
   25117       } else {
   25118          return 0;
   25119       }
   25120    default:
   25121       unreachable("Invalid hardware generation");
   25122    }
   25123 }
   25124 
   25125 
   25126 
   25127 /* 3DSTATE_DS::Patch URB Entry Read Offset */
   25128 
   25129 
   25130 #define GEN10_3DSTATE_DS_PatchURBEntryReadOffset_bits  6
   25131 #define GEN9_3DSTATE_DS_PatchURBEntryReadOffset_bits  6
   25132 #define GEN8_3DSTATE_DS_PatchURBEntryReadOffset_bits  6
   25133 #define GEN75_3DSTATE_DS_PatchURBEntryReadOffset_bits  6
   25134 #define GEN7_3DSTATE_DS_PatchURBEntryReadOffset_bits  6
   25135 
   25136 static inline uint32_t ATTRIBUTE_PURE
   25137 _3DSTATE_DS_PatchURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   25138 {
   25139    switch (devinfo->gen) {
   25140    case 10: return 6;
   25141    case 9: return 6;
   25142    case 8: return 6;
   25143    case 7:
   25144       if (devinfo->is_haswell) {
   25145          return 6;
   25146       } else {
   25147          return 6;
   25148       }
   25149    case 6: return 0;
   25150    case 5: return 0;
   25151    case 4:
   25152       if (devinfo->is_g4x) {
   25153          return 0;
   25154       } else {
   25155          return 0;
   25156       }
   25157    default:
   25158       unreachable("Invalid hardware generation");
   25159    }
   25160 }
   25161 
   25162 
   25163 
   25164 #define GEN10_3DSTATE_DS_PatchURBEntryReadOffset_start  196
   25165 #define GEN9_3DSTATE_DS_PatchURBEntryReadOffset_start  196
   25166 #define GEN8_3DSTATE_DS_PatchURBEntryReadOffset_start  196
   25167 #define GEN75_3DSTATE_DS_PatchURBEntryReadOffset_start  132
   25168 #define GEN7_3DSTATE_DS_PatchURBEntryReadOffset_start  132
   25169 
   25170 static inline uint32_t ATTRIBUTE_PURE
   25171 _3DSTATE_DS_PatchURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   25172 {
   25173    switch (devinfo->gen) {
   25174    case 10: return 196;
   25175    case 9: return 196;
   25176    case 8: return 196;
   25177    case 7:
   25178       if (devinfo->is_haswell) {
   25179          return 132;
   25180       } else {
   25181          return 132;
   25182       }
   25183    case 6: return 0;
   25184    case 5: return 0;
   25185    case 4:
   25186       if (devinfo->is_g4x) {
   25187          return 0;
   25188       } else {
   25189          return 0;
   25190       }
   25191    default:
   25192       unreachable("Invalid hardware generation");
   25193    }
   25194 }
   25195 
   25196 
   25197 
   25198 /* 3DSTATE_DS::Per-Thread Scratch Space */
   25199 
   25200 
   25201 #define GEN10_3DSTATE_DS_PerThreadScratchSpace_bits  4
   25202 #define GEN9_3DSTATE_DS_PerThreadScratchSpace_bits  4
   25203 #define GEN8_3DSTATE_DS_PerThreadScratchSpace_bits  4
   25204 #define GEN75_3DSTATE_DS_PerThreadScratchSpace_bits  4
   25205 #define GEN7_3DSTATE_DS_PerThreadScratchSpace_bits  4
   25206 
   25207 static inline uint32_t ATTRIBUTE_PURE
   25208 _3DSTATE_DS_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   25209 {
   25210    switch (devinfo->gen) {
   25211    case 10: return 4;
   25212    case 9: return 4;
   25213    case 8: return 4;
   25214    case 7:
   25215       if (devinfo->is_haswell) {
   25216          return 4;
   25217       } else {
   25218          return 4;
   25219       }
   25220    case 6: return 0;
   25221    case 5: return 0;
   25222    case 4:
   25223       if (devinfo->is_g4x) {
   25224          return 0;
   25225       } else {
   25226          return 0;
   25227       }
   25228    default:
   25229       unreachable("Invalid hardware generation");
   25230    }
   25231 }
   25232 
   25233 
   25234 
   25235 #define GEN10_3DSTATE_DS_PerThreadScratchSpace_start  128
   25236 #define GEN9_3DSTATE_DS_PerThreadScratchSpace_start  128
   25237 #define GEN8_3DSTATE_DS_PerThreadScratchSpace_start  128
   25238 #define GEN75_3DSTATE_DS_PerThreadScratchSpace_start  96
   25239 #define GEN7_3DSTATE_DS_PerThreadScratchSpace_start  96
   25240 
   25241 static inline uint32_t ATTRIBUTE_PURE
   25242 _3DSTATE_DS_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   25243 {
   25244    switch (devinfo->gen) {
   25245    case 10: return 128;
   25246    case 9: return 128;
   25247    case 8: return 128;
   25248    case 7:
   25249       if (devinfo->is_haswell) {
   25250          return 96;
   25251       } else {
   25252          return 96;
   25253       }
   25254    case 6: return 0;
   25255    case 5: return 0;
   25256    case 4:
   25257       if (devinfo->is_g4x) {
   25258          return 0;
   25259       } else {
   25260          return 0;
   25261       }
   25262    default:
   25263       unreachable("Invalid hardware generation");
   25264    }
   25265 }
   25266 
   25267 
   25268 
   25269 /* 3DSTATE_DS::Sampler Count */
   25270 
   25271 
   25272 #define GEN10_3DSTATE_DS_SamplerCount_bits  3
   25273 #define GEN9_3DSTATE_DS_SamplerCount_bits  3
   25274 #define GEN8_3DSTATE_DS_SamplerCount_bits  3
   25275 #define GEN75_3DSTATE_DS_SamplerCount_bits  3
   25276 #define GEN7_3DSTATE_DS_SamplerCount_bits  3
   25277 
   25278 static inline uint32_t ATTRIBUTE_PURE
   25279 _3DSTATE_DS_SamplerCount_bits(const struct gen_device_info *devinfo)
   25280 {
   25281    switch (devinfo->gen) {
   25282    case 10: return 3;
   25283    case 9: return 3;
   25284    case 8: return 3;
   25285    case 7:
   25286       if (devinfo->is_haswell) {
   25287          return 3;
   25288       } else {
   25289          return 3;
   25290       }
   25291    case 6: return 0;
   25292    case 5: return 0;
   25293    case 4:
   25294       if (devinfo->is_g4x) {
   25295          return 0;
   25296       } else {
   25297          return 0;
   25298       }
   25299    default:
   25300       unreachable("Invalid hardware generation");
   25301    }
   25302 }
   25303 
   25304 
   25305 
   25306 #define GEN10_3DSTATE_DS_SamplerCount_start  123
   25307 #define GEN9_3DSTATE_DS_SamplerCount_start  123
   25308 #define GEN8_3DSTATE_DS_SamplerCount_start  123
   25309 #define GEN75_3DSTATE_DS_SamplerCount_start  91
   25310 #define GEN7_3DSTATE_DS_SamplerCount_start  91
   25311 
   25312 static inline uint32_t ATTRIBUTE_PURE
   25313 _3DSTATE_DS_SamplerCount_start(const struct gen_device_info *devinfo)
   25314 {
   25315    switch (devinfo->gen) {
   25316    case 10: return 123;
   25317    case 9: return 123;
   25318    case 8: return 123;
   25319    case 7:
   25320       if (devinfo->is_haswell) {
   25321          return 91;
   25322       } else {
   25323          return 91;
   25324       }
   25325    case 6: return 0;
   25326    case 5: return 0;
   25327    case 4:
   25328       if (devinfo->is_g4x) {
   25329          return 0;
   25330       } else {
   25331          return 0;
   25332       }
   25333    default:
   25334       unreachable("Invalid hardware generation");
   25335    }
   25336 }
   25337 
   25338 
   25339 
   25340 /* 3DSTATE_DS::Scratch Space Base Pointer */
   25341 
   25342 
   25343 #define GEN10_3DSTATE_DS_ScratchSpaceBasePointer_bits  54
   25344 #define GEN9_3DSTATE_DS_ScratchSpaceBasePointer_bits  54
   25345 #define GEN8_3DSTATE_DS_ScratchSpaceBasePointer_bits  54
   25346 #define GEN75_3DSTATE_DS_ScratchSpaceBasePointer_bits  22
   25347 #define GEN7_3DSTATE_DS_ScratchSpaceBasePointer_bits  22
   25348 
   25349 static inline uint32_t ATTRIBUTE_PURE
   25350 _3DSTATE_DS_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   25351 {
   25352    switch (devinfo->gen) {
   25353    case 10: return 54;
   25354    case 9: return 54;
   25355    case 8: return 54;
   25356    case 7:
   25357       if (devinfo->is_haswell) {
   25358          return 22;
   25359       } else {
   25360          return 22;
   25361       }
   25362    case 6: return 0;
   25363    case 5: return 0;
   25364    case 4:
   25365       if (devinfo->is_g4x) {
   25366          return 0;
   25367       } else {
   25368          return 0;
   25369       }
   25370    default:
   25371       unreachable("Invalid hardware generation");
   25372    }
   25373 }
   25374 
   25375 
   25376 
   25377 #define GEN10_3DSTATE_DS_ScratchSpaceBasePointer_start  138
   25378 #define GEN9_3DSTATE_DS_ScratchSpaceBasePointer_start  138
   25379 #define GEN8_3DSTATE_DS_ScratchSpaceBasePointer_start  138
   25380 #define GEN75_3DSTATE_DS_ScratchSpaceBasePointer_start  106
   25381 #define GEN7_3DSTATE_DS_ScratchSpaceBasePointer_start  106
   25382 
   25383 static inline uint32_t ATTRIBUTE_PURE
   25384 _3DSTATE_DS_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   25385 {
   25386    switch (devinfo->gen) {
   25387    case 10: return 138;
   25388    case 9: return 138;
   25389    case 8: return 138;
   25390    case 7:
   25391       if (devinfo->is_haswell) {
   25392          return 106;
   25393       } else {
   25394          return 106;
   25395       }
   25396    case 6: return 0;
   25397    case 5: return 0;
   25398    case 4:
   25399       if (devinfo->is_g4x) {
   25400          return 0;
   25401       } else {
   25402          return 0;
   25403       }
   25404    default:
   25405       unreachable("Invalid hardware generation");
   25406    }
   25407 }
   25408 
   25409 
   25410 
   25411 /* 3DSTATE_DS::Single Domain Point Dispatch */
   25412 
   25413 
   25414 #define GEN8_3DSTATE_DS_SingleDomainPointDispatch_bits  1
   25415 #define GEN75_3DSTATE_DS_SingleDomainPointDispatch_bits  1
   25416 #define GEN7_3DSTATE_DS_SingleDomainPointDispatch_bits  1
   25417 
   25418 static inline uint32_t ATTRIBUTE_PURE
   25419 _3DSTATE_DS_SingleDomainPointDispatch_bits(const struct gen_device_info *devinfo)
   25420 {
   25421    switch (devinfo->gen) {
   25422    case 10: return 0;
   25423    case 9: return 0;
   25424    case 8: return 1;
   25425    case 7:
   25426       if (devinfo->is_haswell) {
   25427          return 1;
   25428       } else {
   25429          return 1;
   25430       }
   25431    case 6: return 0;
   25432    case 5: return 0;
   25433    case 4:
   25434       if (devinfo->is_g4x) {
   25435          return 0;
   25436       } else {
   25437          return 0;
   25438       }
   25439    default:
   25440       unreachable("Invalid hardware generation");
   25441    }
   25442 }
   25443 
   25444 
   25445 
   25446 #define GEN8_3DSTATE_DS_SingleDomainPointDispatch_start  127
   25447 #define GEN75_3DSTATE_DS_SingleDomainPointDispatch_start  95
   25448 #define GEN7_3DSTATE_DS_SingleDomainPointDispatch_start  95
   25449 
   25450 static inline uint32_t ATTRIBUTE_PURE
   25451 _3DSTATE_DS_SingleDomainPointDispatch_start(const struct gen_device_info *devinfo)
   25452 {
   25453    switch (devinfo->gen) {
   25454    case 10: return 0;
   25455    case 9: return 0;
   25456    case 8: return 127;
   25457    case 7:
   25458       if (devinfo->is_haswell) {
   25459          return 95;
   25460       } else {
   25461          return 95;
   25462       }
   25463    case 6: return 0;
   25464    case 5: return 0;
   25465    case 4:
   25466       if (devinfo->is_g4x) {
   25467          return 0;
   25468       } else {
   25469          return 0;
   25470       }
   25471    default:
   25472       unreachable("Invalid hardware generation");
   25473    }
   25474 }
   25475 
   25476 
   25477 
   25478 /* 3DSTATE_DS::Software Exception Enable */
   25479 
   25480 
   25481 #define GEN10_3DSTATE_DS_SoftwareExceptionEnable_bits  1
   25482 #define GEN9_3DSTATE_DS_SoftwareExceptionEnable_bits  1
   25483 #define GEN8_3DSTATE_DS_SoftwareExceptionEnable_bits  1
   25484 #define GEN75_3DSTATE_DS_SoftwareExceptionEnable_bits  1
   25485 #define GEN7_3DSTATE_DS_SoftwareExceptionEnable_bits  1
   25486 
   25487 static inline uint32_t ATTRIBUTE_PURE
   25488 _3DSTATE_DS_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   25489 {
   25490    switch (devinfo->gen) {
   25491    case 10: return 1;
   25492    case 9: return 1;
   25493    case 8: return 1;
   25494    case 7:
   25495       if (devinfo->is_haswell) {
   25496          return 1;
   25497       } else {
   25498          return 1;
   25499       }
   25500    case 6: return 0;
   25501    case 5: return 0;
   25502    case 4:
   25503       if (devinfo->is_g4x) {
   25504          return 0;
   25505       } else {
   25506          return 0;
   25507       }
   25508    default:
   25509       unreachable("Invalid hardware generation");
   25510    }
   25511 }
   25512 
   25513 
   25514 
   25515 #define GEN10_3DSTATE_DS_SoftwareExceptionEnable_start  103
   25516 #define GEN9_3DSTATE_DS_SoftwareExceptionEnable_start  103
   25517 #define GEN8_3DSTATE_DS_SoftwareExceptionEnable_start  103
   25518 #define GEN75_3DSTATE_DS_SoftwareExceptionEnable_start  71
   25519 #define GEN7_3DSTATE_DS_SoftwareExceptionEnable_start  71
   25520 
   25521 static inline uint32_t ATTRIBUTE_PURE
   25522 _3DSTATE_DS_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   25523 {
   25524    switch (devinfo->gen) {
   25525    case 10: return 103;
   25526    case 9: return 103;
   25527    case 8: return 103;
   25528    case 7:
   25529       if (devinfo->is_haswell) {
   25530          return 71;
   25531       } else {
   25532          return 71;
   25533       }
   25534    case 6: return 0;
   25535    case 5: return 0;
   25536    case 4:
   25537       if (devinfo->is_g4x) {
   25538          return 0;
   25539       } else {
   25540          return 0;
   25541       }
   25542    default:
   25543       unreachable("Invalid hardware generation");
   25544    }
   25545 }
   25546 
   25547 
   25548 
   25549 /* 3DSTATE_DS::Statistics Enable */
   25550 
   25551 
   25552 #define GEN10_3DSTATE_DS_StatisticsEnable_bits  1
   25553 #define GEN9_3DSTATE_DS_StatisticsEnable_bits  1
   25554 #define GEN8_3DSTATE_DS_StatisticsEnable_bits  1
   25555 #define GEN75_3DSTATE_DS_StatisticsEnable_bits  1
   25556 #define GEN7_3DSTATE_DS_StatisticsEnable_bits  1
   25557 
   25558 static inline uint32_t ATTRIBUTE_PURE
   25559 _3DSTATE_DS_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   25560 {
   25561    switch (devinfo->gen) {
   25562    case 10: return 1;
   25563    case 9: return 1;
   25564    case 8: return 1;
   25565    case 7:
   25566       if (devinfo->is_haswell) {
   25567          return 1;
   25568       } else {
   25569          return 1;
   25570       }
   25571    case 6: return 0;
   25572    case 5: return 0;
   25573    case 4:
   25574       if (devinfo->is_g4x) {
   25575          return 0;
   25576       } else {
   25577          return 0;
   25578       }
   25579    default:
   25580       unreachable("Invalid hardware generation");
   25581    }
   25582 }
   25583 
   25584 
   25585 
   25586 #define GEN10_3DSTATE_DS_StatisticsEnable_start  234
   25587 #define GEN9_3DSTATE_DS_StatisticsEnable_start  234
   25588 #define GEN8_3DSTATE_DS_StatisticsEnable_start  234
   25589 #define GEN75_3DSTATE_DS_StatisticsEnable_start  170
   25590 #define GEN7_3DSTATE_DS_StatisticsEnable_start  170
   25591 
   25592 static inline uint32_t ATTRIBUTE_PURE
   25593 _3DSTATE_DS_StatisticsEnable_start(const struct gen_device_info *devinfo)
   25594 {
   25595    switch (devinfo->gen) {
   25596    case 10: return 234;
   25597    case 9: return 234;
   25598    case 8: return 234;
   25599    case 7:
   25600       if (devinfo->is_haswell) {
   25601          return 170;
   25602       } else {
   25603          return 170;
   25604       }
   25605    case 6: return 0;
   25606    case 5: return 0;
   25607    case 4:
   25608       if (devinfo->is_g4x) {
   25609          return 0;
   25610       } else {
   25611          return 0;
   25612       }
   25613    default:
   25614       unreachable("Invalid hardware generation");
   25615    }
   25616 }
   25617 
   25618 
   25619 
   25620 /* 3DSTATE_DS::Thread Dispatch Priority */
   25621 
   25622 
   25623 #define GEN10_3DSTATE_DS_ThreadDispatchPriority_bits  1
   25624 #define GEN9_3DSTATE_DS_ThreadDispatchPriority_bits  1
   25625 #define GEN8_3DSTATE_DS_ThreadDispatchPriority_bits  1
   25626 #define GEN75_3DSTATE_DS_ThreadDispatchPriority_bits  1
   25627 
   25628 static inline uint32_t ATTRIBUTE_PURE
   25629 _3DSTATE_DS_ThreadDispatchPriority_bits(const struct gen_device_info *devinfo)
   25630 {
   25631    switch (devinfo->gen) {
   25632    case 10: return 1;
   25633    case 9: return 1;
   25634    case 8: return 1;
   25635    case 7:
   25636       if (devinfo->is_haswell) {
   25637          return 1;
   25638       } else {
   25639          return 0;
   25640       }
   25641    case 6: return 0;
   25642    case 5: return 0;
   25643    case 4:
   25644       if (devinfo->is_g4x) {
   25645          return 0;
   25646       } else {
   25647          return 0;
   25648       }
   25649    default:
   25650       unreachable("Invalid hardware generation");
   25651    }
   25652 }
   25653 
   25654 
   25655 
   25656 #define GEN10_3DSTATE_DS_ThreadDispatchPriority_start  113
   25657 #define GEN9_3DSTATE_DS_ThreadDispatchPriority_start  113
   25658 #define GEN8_3DSTATE_DS_ThreadDispatchPriority_start  113
   25659 #define GEN75_3DSTATE_DS_ThreadDispatchPriority_start  81
   25660 
   25661 static inline uint32_t ATTRIBUTE_PURE
   25662 _3DSTATE_DS_ThreadDispatchPriority_start(const struct gen_device_info *devinfo)
   25663 {
   25664    switch (devinfo->gen) {
   25665    case 10: return 113;
   25666    case 9: return 113;
   25667    case 8: return 113;
   25668    case 7:
   25669       if (devinfo->is_haswell) {
   25670          return 81;
   25671       } else {
   25672          return 0;
   25673       }
   25674    case 6: return 0;
   25675    case 5: return 0;
   25676    case 4:
   25677       if (devinfo->is_g4x) {
   25678          return 0;
   25679       } else {
   25680          return 0;
   25681       }
   25682    default:
   25683       unreachable("Invalid hardware generation");
   25684    }
   25685 }
   25686 
   25687 
   25688 
   25689 /* 3DSTATE_DS::User Clip Distance Clip Test Enable Bitmask */
   25690 
   25691 
   25692 #define GEN10_3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_bits  8
   25693 #define GEN9_3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_bits  8
   25694 #define GEN8_3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_bits  8
   25695 
   25696 static inline uint32_t ATTRIBUTE_PURE
   25697 _3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   25698 {
   25699    switch (devinfo->gen) {
   25700    case 10: return 8;
   25701    case 9: return 8;
   25702    case 8: return 8;
   25703    case 7:
   25704       if (devinfo->is_haswell) {
   25705          return 0;
   25706       } else {
   25707          return 0;
   25708       }
   25709    case 6: return 0;
   25710    case 5: return 0;
   25711    case 4:
   25712       if (devinfo->is_g4x) {
   25713          return 0;
   25714       } else {
   25715          return 0;
   25716       }
   25717    default:
   25718       unreachable("Invalid hardware generation");
   25719    }
   25720 }
   25721 
   25722 
   25723 
   25724 #define GEN10_3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_start  264
   25725 #define GEN9_3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_start  264
   25726 #define GEN8_3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_start  264
   25727 
   25728 static inline uint32_t ATTRIBUTE_PURE
   25729 _3DSTATE_DS_UserClipDistanceClipTestEnableBitmask_start(const struct gen_device_info *devinfo)
   25730 {
   25731    switch (devinfo->gen) {
   25732    case 10: return 264;
   25733    case 9: return 264;
   25734    case 8: return 264;
   25735    case 7:
   25736       if (devinfo->is_haswell) {
   25737          return 0;
   25738       } else {
   25739          return 0;
   25740       }
   25741    case 6: return 0;
   25742    case 5: return 0;
   25743    case 4:
   25744       if (devinfo->is_g4x) {
   25745          return 0;
   25746       } else {
   25747          return 0;
   25748       }
   25749    default:
   25750       unreachable("Invalid hardware generation");
   25751    }
   25752 }
   25753 
   25754 
   25755 
   25756 /* 3DSTATE_DS::User Clip Distance Cull Test Enable Bitmask */
   25757 
   25758 
   25759 #define GEN10_3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_bits  8
   25760 #define GEN9_3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_bits  8
   25761 #define GEN8_3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_bits  8
   25762 
   25763 static inline uint32_t ATTRIBUTE_PURE
   25764 _3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   25765 {
   25766    switch (devinfo->gen) {
   25767    case 10: return 8;
   25768    case 9: return 8;
   25769    case 8: return 8;
   25770    case 7:
   25771       if (devinfo->is_haswell) {
   25772          return 0;
   25773       } else {
   25774          return 0;
   25775       }
   25776    case 6: return 0;
   25777    case 5: return 0;
   25778    case 4:
   25779       if (devinfo->is_g4x) {
   25780          return 0;
   25781       } else {
   25782          return 0;
   25783       }
   25784    default:
   25785       unreachable("Invalid hardware generation");
   25786    }
   25787 }
   25788 
   25789 
   25790 
   25791 #define GEN10_3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_start  256
   25792 #define GEN9_3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_start  256
   25793 #define GEN8_3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_start  256
   25794 
   25795 static inline uint32_t ATTRIBUTE_PURE
   25796 _3DSTATE_DS_UserClipDistanceCullTestEnableBitmask_start(const struct gen_device_info *devinfo)
   25797 {
   25798    switch (devinfo->gen) {
   25799    case 10: return 256;
   25800    case 9: return 256;
   25801    case 8: return 256;
   25802    case 7:
   25803       if (devinfo->is_haswell) {
   25804          return 0;
   25805       } else {
   25806          return 0;
   25807       }
   25808    case 6: return 0;
   25809    case 5: return 0;
   25810    case 4:
   25811       if (devinfo->is_g4x) {
   25812          return 0;
   25813       } else {
   25814          return 0;
   25815       }
   25816    default:
   25817       unreachable("Invalid hardware generation");
   25818    }
   25819 }
   25820 
   25821 
   25822 
   25823 /* 3DSTATE_DS::Vector Mask Enable */
   25824 
   25825 
   25826 #define GEN10_3DSTATE_DS_VectorMaskEnable_bits  1
   25827 #define GEN9_3DSTATE_DS_VectorMaskEnable_bits  1
   25828 #define GEN8_3DSTATE_DS_VectorMaskEnable_bits  1
   25829 #define GEN75_3DSTATE_DS_VectorMaskEnable_bits  1
   25830 #define GEN7_3DSTATE_DS_VectorMaskEnable_bits  1
   25831 
   25832 static inline uint32_t ATTRIBUTE_PURE
   25833 _3DSTATE_DS_VectorMaskEnable_bits(const struct gen_device_info *devinfo)
   25834 {
   25835    switch (devinfo->gen) {
   25836    case 10: return 1;
   25837    case 9: return 1;
   25838    case 8: return 1;
   25839    case 7:
   25840       if (devinfo->is_haswell) {
   25841          return 1;
   25842       } else {
   25843          return 1;
   25844       }
   25845    case 6: return 0;
   25846    case 5: return 0;
   25847    case 4:
   25848       if (devinfo->is_g4x) {
   25849          return 0;
   25850       } else {
   25851          return 0;
   25852       }
   25853    default:
   25854       unreachable("Invalid hardware generation");
   25855    }
   25856 }
   25857 
   25858 
   25859 
   25860 #define GEN10_3DSTATE_DS_VectorMaskEnable_start  126
   25861 #define GEN9_3DSTATE_DS_VectorMaskEnable_start  126
   25862 #define GEN8_3DSTATE_DS_VectorMaskEnable_start  126
   25863 #define GEN75_3DSTATE_DS_VectorMaskEnable_start  94
   25864 #define GEN7_3DSTATE_DS_VectorMaskEnable_start  94
   25865 
   25866 static inline uint32_t ATTRIBUTE_PURE
   25867 _3DSTATE_DS_VectorMaskEnable_start(const struct gen_device_info *devinfo)
   25868 {
   25869    switch (devinfo->gen) {
   25870    case 10: return 126;
   25871    case 9: return 126;
   25872    case 8: return 126;
   25873    case 7:
   25874       if (devinfo->is_haswell) {
   25875          return 94;
   25876       } else {
   25877          return 94;
   25878       }
   25879    case 6: return 0;
   25880    case 5: return 0;
   25881    case 4:
   25882       if (devinfo->is_g4x) {
   25883          return 0;
   25884       } else {
   25885          return 0;
   25886       }
   25887    default:
   25888       unreachable("Invalid hardware generation");
   25889    }
   25890 }
   25891 
   25892 
   25893 
   25894 /* 3DSTATE_DS::Vertex URB Entry Output Length */
   25895 
   25896 
   25897 #define GEN10_3DSTATE_DS_VertexURBEntryOutputLength_bits  5
   25898 #define GEN9_3DSTATE_DS_VertexURBEntryOutputLength_bits  5
   25899 #define GEN8_3DSTATE_DS_VertexURBEntryOutputLength_bits  5
   25900 
   25901 static inline uint32_t ATTRIBUTE_PURE
   25902 _3DSTATE_DS_VertexURBEntryOutputLength_bits(const struct gen_device_info *devinfo)
   25903 {
   25904    switch (devinfo->gen) {
   25905    case 10: return 5;
   25906    case 9: return 5;
   25907    case 8: return 5;
   25908    case 7:
   25909       if (devinfo->is_haswell) {
   25910          return 0;
   25911       } else {
   25912          return 0;
   25913       }
   25914    case 6: return 0;
   25915    case 5: return 0;
   25916    case 4:
   25917       if (devinfo->is_g4x) {
   25918          return 0;
   25919       } else {
   25920          return 0;
   25921       }
   25922    default:
   25923       unreachable("Invalid hardware generation");
   25924    }
   25925 }
   25926 
   25927 
   25928 
   25929 #define GEN10_3DSTATE_DS_VertexURBEntryOutputLength_start  272
   25930 #define GEN9_3DSTATE_DS_VertexURBEntryOutputLength_start  272
   25931 #define GEN8_3DSTATE_DS_VertexURBEntryOutputLength_start  272
   25932 
   25933 static inline uint32_t ATTRIBUTE_PURE
   25934 _3DSTATE_DS_VertexURBEntryOutputLength_start(const struct gen_device_info *devinfo)
   25935 {
   25936    switch (devinfo->gen) {
   25937    case 10: return 272;
   25938    case 9: return 272;
   25939    case 8: return 272;
   25940    case 7:
   25941       if (devinfo->is_haswell) {
   25942          return 0;
   25943       } else {
   25944          return 0;
   25945       }
   25946    case 6: return 0;
   25947    case 5: return 0;
   25948    case 4:
   25949       if (devinfo->is_g4x) {
   25950          return 0;
   25951       } else {
   25952          return 0;
   25953       }
   25954    default:
   25955       unreachable("Invalid hardware generation");
   25956    }
   25957 }
   25958 
   25959 
   25960 
   25961 /* 3DSTATE_DS::Vertex URB Entry Output Read Offset */
   25962 
   25963 
   25964 #define GEN10_3DSTATE_DS_VertexURBEntryOutputReadOffset_bits  6
   25965 #define GEN9_3DSTATE_DS_VertexURBEntryOutputReadOffset_bits  6
   25966 #define GEN8_3DSTATE_DS_VertexURBEntryOutputReadOffset_bits  6
   25967 
   25968 static inline uint32_t ATTRIBUTE_PURE
   25969 _3DSTATE_DS_VertexURBEntryOutputReadOffset_bits(const struct gen_device_info *devinfo)
   25970 {
   25971    switch (devinfo->gen) {
   25972    case 10: return 6;
   25973    case 9: return 6;
   25974    case 8: return 6;
   25975    case 7:
   25976       if (devinfo->is_haswell) {
   25977          return 0;
   25978       } else {
   25979          return 0;
   25980       }
   25981    case 6: return 0;
   25982    case 5: return 0;
   25983    case 4:
   25984       if (devinfo->is_g4x) {
   25985          return 0;
   25986       } else {
   25987          return 0;
   25988       }
   25989    default:
   25990       unreachable("Invalid hardware generation");
   25991    }
   25992 }
   25993 
   25994 
   25995 
   25996 #define GEN10_3DSTATE_DS_VertexURBEntryOutputReadOffset_start  277
   25997 #define GEN9_3DSTATE_DS_VertexURBEntryOutputReadOffset_start  277
   25998 #define GEN8_3DSTATE_DS_VertexURBEntryOutputReadOffset_start  277
   25999 
   26000 static inline uint32_t ATTRIBUTE_PURE
   26001 _3DSTATE_DS_VertexURBEntryOutputReadOffset_start(const struct gen_device_info *devinfo)
   26002 {
   26003    switch (devinfo->gen) {
   26004    case 10: return 277;
   26005    case 9: return 277;
   26006    case 8: return 277;
   26007    case 7:
   26008       if (devinfo->is_haswell) {
   26009          return 0;
   26010       } else {
   26011          return 0;
   26012       }
   26013    case 6: return 0;
   26014    case 5: return 0;
   26015    case 4:
   26016       if (devinfo->is_g4x) {
   26017          return 0;
   26018       } else {
   26019          return 0;
   26020       }
   26021    default:
   26022       unreachable("Invalid hardware generation");
   26023    }
   26024 }
   26025 
   26026 
   26027 
   26028 /* 3DSTATE_GATHER_CONSTANT_DS */
   26029 
   26030 
   26031 
   26032 
   26033 
   26034 /* 3DSTATE_GATHER_CONSTANT_DS::3D Command Opcode */
   26035 
   26036 
   26037 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_bits  3
   26038 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_bits  3
   26039 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_bits  3
   26040 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_bits  3
   26041 
   26042 static inline uint32_t ATTRIBUTE_PURE
   26043 _3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   26044 {
   26045    switch (devinfo->gen) {
   26046    case 10: return 3;
   26047    case 9: return 3;
   26048    case 8: return 3;
   26049    case 7:
   26050       if (devinfo->is_haswell) {
   26051          return 3;
   26052       } else {
   26053          return 0;
   26054       }
   26055    case 6: return 0;
   26056    case 5: return 0;
   26057    case 4:
   26058       if (devinfo->is_g4x) {
   26059          return 0;
   26060       } else {
   26061          return 0;
   26062       }
   26063    default:
   26064       unreachable("Invalid hardware generation");
   26065    }
   26066 }
   26067 
   26068 
   26069 
   26070 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_start  24
   26071 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_start  24
   26072 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_start  24
   26073 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_start  24
   26074 
   26075 static inline uint32_t ATTRIBUTE_PURE
   26076 _3DSTATE_GATHER_CONSTANT_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   26077 {
   26078    switch (devinfo->gen) {
   26079    case 10: return 24;
   26080    case 9: return 24;
   26081    case 8: return 24;
   26082    case 7:
   26083       if (devinfo->is_haswell) {
   26084          return 24;
   26085       } else {
   26086          return 0;
   26087       }
   26088    case 6: return 0;
   26089    case 5: return 0;
   26090    case 4:
   26091       if (devinfo->is_g4x) {
   26092          return 0;
   26093       } else {
   26094          return 0;
   26095       }
   26096    default:
   26097       unreachable("Invalid hardware generation");
   26098    }
   26099 }
   26100 
   26101 
   26102 
   26103 /* 3DSTATE_GATHER_CONSTANT_DS::3D Command Sub Opcode */
   26104 
   26105 
   26106 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_bits  8
   26107 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_bits  8
   26108 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_bits  8
   26109 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_bits  8
   26110 
   26111 static inline uint32_t ATTRIBUTE_PURE
   26112 _3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   26113 {
   26114    switch (devinfo->gen) {
   26115    case 10: return 8;
   26116    case 9: return 8;
   26117    case 8: return 8;
   26118    case 7:
   26119       if (devinfo->is_haswell) {
   26120          return 8;
   26121       } else {
   26122          return 0;
   26123       }
   26124    case 6: return 0;
   26125    case 5: return 0;
   26126    case 4:
   26127       if (devinfo->is_g4x) {
   26128          return 0;
   26129       } else {
   26130          return 0;
   26131       }
   26132    default:
   26133       unreachable("Invalid hardware generation");
   26134    }
   26135 }
   26136 
   26137 
   26138 
   26139 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_start  16
   26140 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_start  16
   26141 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_start  16
   26142 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_start  16
   26143 
   26144 static inline uint32_t ATTRIBUTE_PURE
   26145 _3DSTATE_GATHER_CONSTANT_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   26146 {
   26147    switch (devinfo->gen) {
   26148    case 10: return 16;
   26149    case 9: return 16;
   26150    case 8: return 16;
   26151    case 7:
   26152       if (devinfo->is_haswell) {
   26153          return 16;
   26154       } else {
   26155          return 0;
   26156       }
   26157    case 6: return 0;
   26158    case 5: return 0;
   26159    case 4:
   26160       if (devinfo->is_g4x) {
   26161          return 0;
   26162       } else {
   26163          return 0;
   26164       }
   26165    default:
   26166       unreachable("Invalid hardware generation");
   26167    }
   26168 }
   26169 
   26170 
   26171 
   26172 /* 3DSTATE_GATHER_CONSTANT_DS::Command SubType */
   26173 
   26174 
   26175 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_bits  2
   26176 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_bits  2
   26177 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_bits  2
   26178 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_bits  2
   26179 
   26180 static inline uint32_t ATTRIBUTE_PURE
   26181 _3DSTATE_GATHER_CONSTANT_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   26182 {
   26183    switch (devinfo->gen) {
   26184    case 10: return 2;
   26185    case 9: return 2;
   26186    case 8: return 2;
   26187    case 7:
   26188       if (devinfo->is_haswell) {
   26189          return 2;
   26190       } else {
   26191          return 0;
   26192       }
   26193    case 6: return 0;
   26194    case 5: return 0;
   26195    case 4:
   26196       if (devinfo->is_g4x) {
   26197          return 0;
   26198       } else {
   26199          return 0;
   26200       }
   26201    default:
   26202       unreachable("Invalid hardware generation");
   26203    }
   26204 }
   26205 
   26206 
   26207 
   26208 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_start  27
   26209 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_start  27
   26210 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_start  27
   26211 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_CommandSubType_start  27
   26212 
   26213 static inline uint32_t ATTRIBUTE_PURE
   26214 _3DSTATE_GATHER_CONSTANT_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   26215 {
   26216    switch (devinfo->gen) {
   26217    case 10: return 27;
   26218    case 9: return 27;
   26219    case 8: return 27;
   26220    case 7:
   26221       if (devinfo->is_haswell) {
   26222          return 27;
   26223       } else {
   26224          return 0;
   26225       }
   26226    case 6: return 0;
   26227    case 5: return 0;
   26228    case 4:
   26229       if (devinfo->is_g4x) {
   26230          return 0;
   26231       } else {
   26232          return 0;
   26233       }
   26234    default:
   26235       unreachable("Invalid hardware generation");
   26236    }
   26237 }
   26238 
   26239 
   26240 
   26241 /* 3DSTATE_GATHER_CONSTANT_DS::Command Type */
   26242 
   26243 
   26244 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_CommandType_bits  3
   26245 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_CommandType_bits  3
   26246 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_CommandType_bits  3
   26247 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_CommandType_bits  3
   26248 
   26249 static inline uint32_t ATTRIBUTE_PURE
   26250 _3DSTATE_GATHER_CONSTANT_DS_CommandType_bits(const struct gen_device_info *devinfo)
   26251 {
   26252    switch (devinfo->gen) {
   26253    case 10: return 3;
   26254    case 9: return 3;
   26255    case 8: return 3;
   26256    case 7:
   26257       if (devinfo->is_haswell) {
   26258          return 3;
   26259       } else {
   26260          return 0;
   26261       }
   26262    case 6: return 0;
   26263    case 5: return 0;
   26264    case 4:
   26265       if (devinfo->is_g4x) {
   26266          return 0;
   26267       } else {
   26268          return 0;
   26269       }
   26270    default:
   26271       unreachable("Invalid hardware generation");
   26272    }
   26273 }
   26274 
   26275 
   26276 
   26277 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_CommandType_start  29
   26278 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_CommandType_start  29
   26279 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_CommandType_start  29
   26280 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_CommandType_start  29
   26281 
   26282 static inline uint32_t ATTRIBUTE_PURE
   26283 _3DSTATE_GATHER_CONSTANT_DS_CommandType_start(const struct gen_device_info *devinfo)
   26284 {
   26285    switch (devinfo->gen) {
   26286    case 10: return 29;
   26287    case 9: return 29;
   26288    case 8: return 29;
   26289    case 7:
   26290       if (devinfo->is_haswell) {
   26291          return 29;
   26292       } else {
   26293          return 0;
   26294       }
   26295    case 6: return 0;
   26296    case 5: return 0;
   26297    case 4:
   26298       if (devinfo->is_g4x) {
   26299          return 0;
   26300       } else {
   26301          return 0;
   26302       }
   26303    default:
   26304       unreachable("Invalid hardware generation");
   26305    }
   26306 }
   26307 
   26308 
   26309 
   26310 /* 3DSTATE_GATHER_CONSTANT_DS::Constant Buffer Binding Table Block */
   26311 
   26312 
   26313 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_bits  4
   26314 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_bits  4
   26315 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_bits  4
   26316 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_bits  4
   26317 
   26318 static inline uint32_t ATTRIBUTE_PURE
   26319 _3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_bits(const struct gen_device_info *devinfo)
   26320 {
   26321    switch (devinfo->gen) {
   26322    case 10: return 4;
   26323    case 9: return 4;
   26324    case 8: return 4;
   26325    case 7:
   26326       if (devinfo->is_haswell) {
   26327          return 4;
   26328       } else {
   26329          return 0;
   26330       }
   26331    case 6: return 0;
   26332    case 5: return 0;
   26333    case 4:
   26334       if (devinfo->is_g4x) {
   26335          return 0;
   26336       } else {
   26337          return 0;
   26338       }
   26339    default:
   26340       unreachable("Invalid hardware generation");
   26341    }
   26342 }
   26343 
   26344 
   26345 
   26346 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_start  44
   26347 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_start  44
   26348 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_start  44
   26349 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_start  44
   26350 
   26351 static inline uint32_t ATTRIBUTE_PURE
   26352 _3DSTATE_GATHER_CONSTANT_DS_ConstantBufferBindingTableBlock_start(const struct gen_device_info *devinfo)
   26353 {
   26354    switch (devinfo->gen) {
   26355    case 10: return 44;
   26356    case 9: return 44;
   26357    case 8: return 44;
   26358    case 7:
   26359       if (devinfo->is_haswell) {
   26360          return 44;
   26361       } else {
   26362          return 0;
   26363       }
   26364    case 6: return 0;
   26365    case 5: return 0;
   26366    case 4:
   26367       if (devinfo->is_g4x) {
   26368          return 0;
   26369       } else {
   26370          return 0;
   26371       }
   26372    default:
   26373       unreachable("Invalid hardware generation");
   26374    }
   26375 }
   26376 
   26377 
   26378 
   26379 /* 3DSTATE_GATHER_CONSTANT_DS::Constant Buffer Dx9 Generate Stall */
   26380 
   26381 
   26382 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_bits  1
   26383 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_bits  1
   26384 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_bits  1
   26385 
   26386 static inline uint32_t ATTRIBUTE_PURE
   26387 _3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_bits(const struct gen_device_info *devinfo)
   26388 {
   26389    switch (devinfo->gen) {
   26390    case 10: return 1;
   26391    case 9: return 1;
   26392    case 8: return 1;
   26393    case 7:
   26394       if (devinfo->is_haswell) {
   26395          return 0;
   26396       } else {
   26397          return 0;
   26398       }
   26399    case 6: return 0;
   26400    case 5: return 0;
   26401    case 4:
   26402       if (devinfo->is_g4x) {
   26403          return 0;
   26404       } else {
   26405          return 0;
   26406       }
   26407    default:
   26408       unreachable("Invalid hardware generation");
   26409    }
   26410 }
   26411 
   26412 
   26413 
   26414 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_start  69
   26415 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_start  69
   26416 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_start  69
   26417 
   26418 static inline uint32_t ATTRIBUTE_PURE
   26419 _3DSTATE_GATHER_CONSTANT_DS_ConstantBufferDx9GenerateStall_start(const struct gen_device_info *devinfo)
   26420 {
   26421    switch (devinfo->gen) {
   26422    case 10: return 69;
   26423    case 9: return 69;
   26424    case 8: return 69;
   26425    case 7:
   26426       if (devinfo->is_haswell) {
   26427          return 0;
   26428       } else {
   26429          return 0;
   26430       }
   26431    case 6: return 0;
   26432    case 5: return 0;
   26433    case 4:
   26434       if (devinfo->is_g4x) {
   26435          return 0;
   26436       } else {
   26437          return 0;
   26438       }
   26439    default:
   26440       unreachable("Invalid hardware generation");
   26441    }
   26442 }
   26443 
   26444 
   26445 
   26446 /* 3DSTATE_GATHER_CONSTANT_DS::Constant Buffer Valid */
   26447 
   26448 
   26449 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_bits  16
   26450 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_bits  16
   26451 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_bits  16
   26452 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_bits  16
   26453 
   26454 static inline uint32_t ATTRIBUTE_PURE
   26455 _3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_bits(const struct gen_device_info *devinfo)
   26456 {
   26457    switch (devinfo->gen) {
   26458    case 10: return 16;
   26459    case 9: return 16;
   26460    case 8: return 16;
   26461    case 7:
   26462       if (devinfo->is_haswell) {
   26463          return 16;
   26464       } else {
   26465          return 0;
   26466       }
   26467    case 6: return 0;
   26468    case 5: return 0;
   26469    case 4:
   26470       if (devinfo->is_g4x) {
   26471          return 0;
   26472       } else {
   26473          return 0;
   26474       }
   26475    default:
   26476       unreachable("Invalid hardware generation");
   26477    }
   26478 }
   26479 
   26480 
   26481 
   26482 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_start  48
   26483 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_start  48
   26484 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_start  48
   26485 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_start  48
   26486 
   26487 static inline uint32_t ATTRIBUTE_PURE
   26488 _3DSTATE_GATHER_CONSTANT_DS_ConstantBufferValid_start(const struct gen_device_info *devinfo)
   26489 {
   26490    switch (devinfo->gen) {
   26491    case 10: return 48;
   26492    case 9: return 48;
   26493    case 8: return 48;
   26494    case 7:
   26495       if (devinfo->is_haswell) {
   26496          return 48;
   26497       } else {
   26498          return 0;
   26499       }
   26500    case 6: return 0;
   26501    case 5: return 0;
   26502    case 4:
   26503       if (devinfo->is_g4x) {
   26504          return 0;
   26505       } else {
   26506          return 0;
   26507       }
   26508    default:
   26509       unreachable("Invalid hardware generation");
   26510    }
   26511 }
   26512 
   26513 
   26514 
   26515 /* 3DSTATE_GATHER_CONSTANT_DS::DWord Length */
   26516 
   26517 
   26518 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_DWordLength_bits  8
   26519 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_DWordLength_bits  8
   26520 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_DWordLength_bits  8
   26521 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_DWordLength_bits  8
   26522 
   26523 static inline uint32_t ATTRIBUTE_PURE
   26524 _3DSTATE_GATHER_CONSTANT_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   26525 {
   26526    switch (devinfo->gen) {
   26527    case 10: return 8;
   26528    case 9: return 8;
   26529    case 8: return 8;
   26530    case 7:
   26531       if (devinfo->is_haswell) {
   26532          return 8;
   26533       } else {
   26534          return 0;
   26535       }
   26536    case 6: return 0;
   26537    case 5: return 0;
   26538    case 4:
   26539       if (devinfo->is_g4x) {
   26540          return 0;
   26541       } else {
   26542          return 0;
   26543       }
   26544    default:
   26545       unreachable("Invalid hardware generation");
   26546    }
   26547 }
   26548 
   26549 
   26550 
   26551 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_DWordLength_start  0
   26552 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_DWordLength_start  0
   26553 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_DWordLength_start  0
   26554 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_DWordLength_start  0
   26555 
   26556 static inline uint32_t ATTRIBUTE_PURE
   26557 _3DSTATE_GATHER_CONSTANT_DS_DWordLength_start(const struct gen_device_info *devinfo)
   26558 {
   26559    switch (devinfo->gen) {
   26560    case 10: return 0;
   26561    case 9: return 0;
   26562    case 8: return 0;
   26563    case 7:
   26564       if (devinfo->is_haswell) {
   26565          return 0;
   26566       } else {
   26567          return 0;
   26568       }
   26569    case 6: return 0;
   26570    case 5: return 0;
   26571    case 4:
   26572       if (devinfo->is_g4x) {
   26573          return 0;
   26574       } else {
   26575          return 0;
   26576       }
   26577    default:
   26578       unreachable("Invalid hardware generation");
   26579    }
   26580 }
   26581 
   26582 
   26583 
   26584 /* 3DSTATE_GATHER_CONSTANT_DS::Entry_0 */
   26585 
   26586 
   26587 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_Entry_0_bits  16
   26588 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_Entry_0_bits  16
   26589 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_Entry_0_bits  16
   26590 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_Entry_0_bits  16
   26591 
   26592 static inline uint32_t ATTRIBUTE_PURE
   26593 _3DSTATE_GATHER_CONSTANT_DS_Entry_0_bits(const struct gen_device_info *devinfo)
   26594 {
   26595    switch (devinfo->gen) {
   26596    case 10: return 16;
   26597    case 9: return 16;
   26598    case 8: return 16;
   26599    case 7:
   26600       if (devinfo->is_haswell) {
   26601          return 16;
   26602       } else {
   26603          return 0;
   26604       }
   26605    case 6: return 0;
   26606    case 5: return 0;
   26607    case 4:
   26608       if (devinfo->is_g4x) {
   26609          return 0;
   26610       } else {
   26611          return 0;
   26612       }
   26613    default:
   26614       unreachable("Invalid hardware generation");
   26615    }
   26616 }
   26617 
   26618 
   26619 
   26620 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_Entry_0_start  0
   26621 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_Entry_0_start  0
   26622 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_Entry_0_start  0
   26623 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_Entry_0_start  0
   26624 
   26625 static inline uint32_t ATTRIBUTE_PURE
   26626 _3DSTATE_GATHER_CONSTANT_DS_Entry_0_start(const struct gen_device_info *devinfo)
   26627 {
   26628    switch (devinfo->gen) {
   26629    case 10: return 0;
   26630    case 9: return 0;
   26631    case 8: return 0;
   26632    case 7:
   26633       if (devinfo->is_haswell) {
   26634          return 0;
   26635       } else {
   26636          return 0;
   26637       }
   26638    case 6: return 0;
   26639    case 5: return 0;
   26640    case 4:
   26641       if (devinfo->is_g4x) {
   26642          return 0;
   26643       } else {
   26644          return 0;
   26645       }
   26646    default:
   26647       unreachable("Invalid hardware generation");
   26648    }
   26649 }
   26650 
   26651 
   26652 
   26653 /* 3DSTATE_GATHER_CONSTANT_DS::Entry_1 */
   26654 
   26655 
   26656 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_Entry_1_bits  16
   26657 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_Entry_1_bits  16
   26658 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_Entry_1_bits  16
   26659 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_Entry_1_bits  16
   26660 
   26661 static inline uint32_t ATTRIBUTE_PURE
   26662 _3DSTATE_GATHER_CONSTANT_DS_Entry_1_bits(const struct gen_device_info *devinfo)
   26663 {
   26664    switch (devinfo->gen) {
   26665    case 10: return 16;
   26666    case 9: return 16;
   26667    case 8: return 16;
   26668    case 7:
   26669       if (devinfo->is_haswell) {
   26670          return 16;
   26671       } else {
   26672          return 0;
   26673       }
   26674    case 6: return 0;
   26675    case 5: return 0;
   26676    case 4:
   26677       if (devinfo->is_g4x) {
   26678          return 0;
   26679       } else {
   26680          return 0;
   26681       }
   26682    default:
   26683       unreachable("Invalid hardware generation");
   26684    }
   26685 }
   26686 
   26687 
   26688 
   26689 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_Entry_1_start  16
   26690 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_Entry_1_start  16
   26691 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_Entry_1_start  16
   26692 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_Entry_1_start  16
   26693 
   26694 static inline uint32_t ATTRIBUTE_PURE
   26695 _3DSTATE_GATHER_CONSTANT_DS_Entry_1_start(const struct gen_device_info *devinfo)
   26696 {
   26697    switch (devinfo->gen) {
   26698    case 10: return 16;
   26699    case 9: return 16;
   26700    case 8: return 16;
   26701    case 7:
   26702       if (devinfo->is_haswell) {
   26703          return 16;
   26704       } else {
   26705          return 0;
   26706       }
   26707    case 6: return 0;
   26708    case 5: return 0;
   26709    case 4:
   26710       if (devinfo->is_g4x) {
   26711          return 0;
   26712       } else {
   26713          return 0;
   26714       }
   26715    default:
   26716       unreachable("Invalid hardware generation");
   26717    }
   26718 }
   26719 
   26720 
   26721 
   26722 /* 3DSTATE_GATHER_CONSTANT_DS::Gather Buffer Offset */
   26723 
   26724 
   26725 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_bits  17
   26726 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_bits  17
   26727 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_bits  17
   26728 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_bits  17
   26729 
   26730 static inline uint32_t ATTRIBUTE_PURE
   26731 _3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_bits(const struct gen_device_info *devinfo)
   26732 {
   26733    switch (devinfo->gen) {
   26734    case 10: return 17;
   26735    case 9: return 17;
   26736    case 8: return 17;
   26737    case 7:
   26738       if (devinfo->is_haswell) {
   26739          return 17;
   26740       } else {
   26741          return 0;
   26742       }
   26743    case 6: return 0;
   26744    case 5: return 0;
   26745    case 4:
   26746       if (devinfo->is_g4x) {
   26747          return 0;
   26748       } else {
   26749          return 0;
   26750       }
   26751    default:
   26752       unreachable("Invalid hardware generation");
   26753    }
   26754 }
   26755 
   26756 
   26757 
   26758 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_start  70
   26759 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_start  70
   26760 #define GEN8_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_start  70
   26761 #define GEN75_3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_start  70
   26762 
   26763 static inline uint32_t ATTRIBUTE_PURE
   26764 _3DSTATE_GATHER_CONSTANT_DS_GatherBufferOffset_start(const struct gen_device_info *devinfo)
   26765 {
   26766    switch (devinfo->gen) {
   26767    case 10: return 70;
   26768    case 9: return 70;
   26769    case 8: return 70;
   26770    case 7:
   26771       if (devinfo->is_haswell) {
   26772          return 70;
   26773       } else {
   26774          return 0;
   26775       }
   26776    case 6: return 0;
   26777    case 5: return 0;
   26778    case 4:
   26779       if (devinfo->is_g4x) {
   26780          return 0;
   26781       } else {
   26782          return 0;
   26783       }
   26784    default:
   26785       unreachable("Invalid hardware generation");
   26786    }
   26787 }
   26788 
   26789 
   26790 
   26791 /* 3DSTATE_GATHER_CONSTANT_DS::On-Die Table */
   26792 
   26793 
   26794 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_OnDieTable_bits  1
   26795 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_OnDieTable_bits  1
   26796 
   26797 static inline uint32_t ATTRIBUTE_PURE
   26798 _3DSTATE_GATHER_CONSTANT_DS_OnDieTable_bits(const struct gen_device_info *devinfo)
   26799 {
   26800    switch (devinfo->gen) {
   26801    case 10: return 1;
   26802    case 9: return 1;
   26803    case 8: return 0;
   26804    case 7:
   26805       if (devinfo->is_haswell) {
   26806          return 0;
   26807       } else {
   26808          return 0;
   26809       }
   26810    case 6: return 0;
   26811    case 5: return 0;
   26812    case 4:
   26813       if (devinfo->is_g4x) {
   26814          return 0;
   26815       } else {
   26816          return 0;
   26817       }
   26818    default:
   26819       unreachable("Invalid hardware generation");
   26820    }
   26821 }
   26822 
   26823 
   26824 
   26825 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_OnDieTable_start  67
   26826 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_OnDieTable_start  67
   26827 
   26828 static inline uint32_t ATTRIBUTE_PURE
   26829 _3DSTATE_GATHER_CONSTANT_DS_OnDieTable_start(const struct gen_device_info *devinfo)
   26830 {
   26831    switch (devinfo->gen) {
   26832    case 10: return 67;
   26833    case 9: return 67;
   26834    case 8: return 0;
   26835    case 7:
   26836       if (devinfo->is_haswell) {
   26837          return 0;
   26838       } else {
   26839          return 0;
   26840       }
   26841    case 6: return 0;
   26842    case 5: return 0;
   26843    case 4:
   26844       if (devinfo->is_g4x) {
   26845          return 0;
   26846       } else {
   26847          return 0;
   26848       }
   26849    default:
   26850       unreachable("Invalid hardware generation");
   26851    }
   26852 }
   26853 
   26854 
   26855 
   26856 /* 3DSTATE_GATHER_CONSTANT_DS::Update Gather Table Only */
   26857 
   26858 
   26859 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_UpdateGatherTableOnly_bits  1
   26860 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_UpdateGatherTableOnly_bits  1
   26861 
   26862 static inline uint32_t ATTRIBUTE_PURE
   26863 _3DSTATE_GATHER_CONSTANT_DS_UpdateGatherTableOnly_bits(const struct gen_device_info *devinfo)
   26864 {
   26865    switch (devinfo->gen) {
   26866    case 10: return 1;
   26867    case 9: return 1;
   26868    case 8: return 0;
   26869    case 7:
   26870       if (devinfo->is_haswell) {
   26871          return 0;
   26872       } else {
   26873          return 0;
   26874       }
   26875    case 6: return 0;
   26876    case 5: return 0;
   26877    case 4:
   26878       if (devinfo->is_g4x) {
   26879          return 0;
   26880       } else {
   26881          return 0;
   26882       }
   26883    default:
   26884       unreachable("Invalid hardware generation");
   26885    }
   26886 }
   26887 
   26888 
   26889 
   26890 #define GEN10_3DSTATE_GATHER_CONSTANT_DS_UpdateGatherTableOnly_start  33
   26891 #define GEN9_3DSTATE_GATHER_CONSTANT_DS_UpdateGatherTableOnly_start  33
   26892 
   26893 static inline uint32_t ATTRIBUTE_PURE
   26894 _3DSTATE_GATHER_CONSTANT_DS_UpdateGatherTableOnly_start(const struct gen_device_info *devinfo)
   26895 {
   26896    switch (devinfo->gen) {
   26897    case 10: return 33;
   26898    case 9: return 33;
   26899    case 8: return 0;
   26900    case 7:
   26901       if (devinfo->is_haswell) {
   26902          return 0;
   26903       } else {
   26904          return 0;
   26905       }
   26906    case 6: return 0;
   26907    case 5: return 0;
   26908    case 4:
   26909       if (devinfo->is_g4x) {
   26910          return 0;
   26911       } else {
   26912          return 0;
   26913       }
   26914    default:
   26915       unreachable("Invalid hardware generation");
   26916    }
   26917 }
   26918 
   26919 
   26920 
   26921 /* 3DSTATE_GATHER_CONSTANT_GS */
   26922 
   26923 
   26924 
   26925 
   26926 
   26927 /* 3DSTATE_GATHER_CONSTANT_GS::3D Command Opcode */
   26928 
   26929 
   26930 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_bits  3
   26931 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_bits  3
   26932 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_bits  3
   26933 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_bits  3
   26934 
   26935 static inline uint32_t ATTRIBUTE_PURE
   26936 _3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   26937 {
   26938    switch (devinfo->gen) {
   26939    case 10: return 3;
   26940    case 9: return 3;
   26941    case 8: return 3;
   26942    case 7:
   26943       if (devinfo->is_haswell) {
   26944          return 3;
   26945       } else {
   26946          return 0;
   26947       }
   26948    case 6: return 0;
   26949    case 5: return 0;
   26950    case 4:
   26951       if (devinfo->is_g4x) {
   26952          return 0;
   26953       } else {
   26954          return 0;
   26955       }
   26956    default:
   26957       unreachable("Invalid hardware generation");
   26958    }
   26959 }
   26960 
   26961 
   26962 
   26963 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_start  24
   26964 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_start  24
   26965 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_start  24
   26966 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_start  24
   26967 
   26968 static inline uint32_t ATTRIBUTE_PURE
   26969 _3DSTATE_GATHER_CONSTANT_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   26970 {
   26971    switch (devinfo->gen) {
   26972    case 10: return 24;
   26973    case 9: return 24;
   26974    case 8: return 24;
   26975    case 7:
   26976       if (devinfo->is_haswell) {
   26977          return 24;
   26978       } else {
   26979          return 0;
   26980       }
   26981    case 6: return 0;
   26982    case 5: return 0;
   26983    case 4:
   26984       if (devinfo->is_g4x) {
   26985          return 0;
   26986       } else {
   26987          return 0;
   26988       }
   26989    default:
   26990       unreachable("Invalid hardware generation");
   26991    }
   26992 }
   26993 
   26994 
   26995 
   26996 /* 3DSTATE_GATHER_CONSTANT_GS::3D Command Sub Opcode */
   26997 
   26998 
   26999 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_bits  8
   27000 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_bits  8
   27001 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_bits  8
   27002 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_bits  8
   27003 
   27004 static inline uint32_t ATTRIBUTE_PURE
   27005 _3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   27006 {
   27007    switch (devinfo->gen) {
   27008    case 10: return 8;
   27009    case 9: return 8;
   27010    case 8: return 8;
   27011    case 7:
   27012       if (devinfo->is_haswell) {
   27013          return 8;
   27014       } else {
   27015          return 0;
   27016       }
   27017    case 6: return 0;
   27018    case 5: return 0;
   27019    case 4:
   27020       if (devinfo->is_g4x) {
   27021          return 0;
   27022       } else {
   27023          return 0;
   27024       }
   27025    default:
   27026       unreachable("Invalid hardware generation");
   27027    }
   27028 }
   27029 
   27030 
   27031 
   27032 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_start  16
   27033 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_start  16
   27034 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_start  16
   27035 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_start  16
   27036 
   27037 static inline uint32_t ATTRIBUTE_PURE
   27038 _3DSTATE_GATHER_CONSTANT_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   27039 {
   27040    switch (devinfo->gen) {
   27041    case 10: return 16;
   27042    case 9: return 16;
   27043    case 8: return 16;
   27044    case 7:
   27045       if (devinfo->is_haswell) {
   27046          return 16;
   27047       } else {
   27048          return 0;
   27049       }
   27050    case 6: return 0;
   27051    case 5: return 0;
   27052    case 4:
   27053       if (devinfo->is_g4x) {
   27054          return 0;
   27055       } else {
   27056          return 0;
   27057       }
   27058    default:
   27059       unreachable("Invalid hardware generation");
   27060    }
   27061 }
   27062 
   27063 
   27064 
   27065 /* 3DSTATE_GATHER_CONSTANT_GS::Command SubType */
   27066 
   27067 
   27068 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_bits  2
   27069 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_bits  2
   27070 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_bits  2
   27071 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_bits  2
   27072 
   27073 static inline uint32_t ATTRIBUTE_PURE
   27074 _3DSTATE_GATHER_CONSTANT_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   27075 {
   27076    switch (devinfo->gen) {
   27077    case 10: return 2;
   27078    case 9: return 2;
   27079    case 8: return 2;
   27080    case 7:
   27081       if (devinfo->is_haswell) {
   27082          return 2;
   27083       } else {
   27084          return 0;
   27085       }
   27086    case 6: return 0;
   27087    case 5: return 0;
   27088    case 4:
   27089       if (devinfo->is_g4x) {
   27090          return 0;
   27091       } else {
   27092          return 0;
   27093       }
   27094    default:
   27095       unreachable("Invalid hardware generation");
   27096    }
   27097 }
   27098 
   27099 
   27100 
   27101 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_start  27
   27102 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_start  27
   27103 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_start  27
   27104 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_CommandSubType_start  27
   27105 
   27106 static inline uint32_t ATTRIBUTE_PURE
   27107 _3DSTATE_GATHER_CONSTANT_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   27108 {
   27109    switch (devinfo->gen) {
   27110    case 10: return 27;
   27111    case 9: return 27;
   27112    case 8: return 27;
   27113    case 7:
   27114       if (devinfo->is_haswell) {
   27115          return 27;
   27116       } else {
   27117          return 0;
   27118       }
   27119    case 6: return 0;
   27120    case 5: return 0;
   27121    case 4:
   27122       if (devinfo->is_g4x) {
   27123          return 0;
   27124       } else {
   27125          return 0;
   27126       }
   27127    default:
   27128       unreachable("Invalid hardware generation");
   27129    }
   27130 }
   27131 
   27132 
   27133 
   27134 /* 3DSTATE_GATHER_CONSTANT_GS::Command Type */
   27135 
   27136 
   27137 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_CommandType_bits  3
   27138 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_CommandType_bits  3
   27139 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_CommandType_bits  3
   27140 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_CommandType_bits  3
   27141 
   27142 static inline uint32_t ATTRIBUTE_PURE
   27143 _3DSTATE_GATHER_CONSTANT_GS_CommandType_bits(const struct gen_device_info *devinfo)
   27144 {
   27145    switch (devinfo->gen) {
   27146    case 10: return 3;
   27147    case 9: return 3;
   27148    case 8: return 3;
   27149    case 7:
   27150       if (devinfo->is_haswell) {
   27151          return 3;
   27152       } else {
   27153          return 0;
   27154       }
   27155    case 6: return 0;
   27156    case 5: return 0;
   27157    case 4:
   27158       if (devinfo->is_g4x) {
   27159          return 0;
   27160       } else {
   27161          return 0;
   27162       }
   27163    default:
   27164       unreachable("Invalid hardware generation");
   27165    }
   27166 }
   27167 
   27168 
   27169 
   27170 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_CommandType_start  29
   27171 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_CommandType_start  29
   27172 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_CommandType_start  29
   27173 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_CommandType_start  29
   27174 
   27175 static inline uint32_t ATTRIBUTE_PURE
   27176 _3DSTATE_GATHER_CONSTANT_GS_CommandType_start(const struct gen_device_info *devinfo)
   27177 {
   27178    switch (devinfo->gen) {
   27179    case 10: return 29;
   27180    case 9: return 29;
   27181    case 8: return 29;
   27182    case 7:
   27183       if (devinfo->is_haswell) {
   27184          return 29;
   27185       } else {
   27186          return 0;
   27187       }
   27188    case 6: return 0;
   27189    case 5: return 0;
   27190    case 4:
   27191       if (devinfo->is_g4x) {
   27192          return 0;
   27193       } else {
   27194          return 0;
   27195       }
   27196    default:
   27197       unreachable("Invalid hardware generation");
   27198    }
   27199 }
   27200 
   27201 
   27202 
   27203 /* 3DSTATE_GATHER_CONSTANT_GS::Constant Buffer Binding Table Block */
   27204 
   27205 
   27206 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_bits  4
   27207 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_bits  4
   27208 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_bits  4
   27209 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_bits  4
   27210 
   27211 static inline uint32_t ATTRIBUTE_PURE
   27212 _3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_bits(const struct gen_device_info *devinfo)
   27213 {
   27214    switch (devinfo->gen) {
   27215    case 10: return 4;
   27216    case 9: return 4;
   27217    case 8: return 4;
   27218    case 7:
   27219       if (devinfo->is_haswell) {
   27220          return 4;
   27221       } else {
   27222          return 0;
   27223       }
   27224    case 6: return 0;
   27225    case 5: return 0;
   27226    case 4:
   27227       if (devinfo->is_g4x) {
   27228          return 0;
   27229       } else {
   27230          return 0;
   27231       }
   27232    default:
   27233       unreachable("Invalid hardware generation");
   27234    }
   27235 }
   27236 
   27237 
   27238 
   27239 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_start  44
   27240 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_start  44
   27241 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_start  44
   27242 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_start  44
   27243 
   27244 static inline uint32_t ATTRIBUTE_PURE
   27245 _3DSTATE_GATHER_CONSTANT_GS_ConstantBufferBindingTableBlock_start(const struct gen_device_info *devinfo)
   27246 {
   27247    switch (devinfo->gen) {
   27248    case 10: return 44;
   27249    case 9: return 44;
   27250    case 8: return 44;
   27251    case 7:
   27252       if (devinfo->is_haswell) {
   27253          return 44;
   27254       } else {
   27255          return 0;
   27256       }
   27257    case 6: return 0;
   27258    case 5: return 0;
   27259    case 4:
   27260       if (devinfo->is_g4x) {
   27261          return 0;
   27262       } else {
   27263          return 0;
   27264       }
   27265    default:
   27266       unreachable("Invalid hardware generation");
   27267    }
   27268 }
   27269 
   27270 
   27271 
   27272 /* 3DSTATE_GATHER_CONSTANT_GS::Constant Buffer Dx9 Generate Stall */
   27273 
   27274 
   27275 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_bits  1
   27276 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_bits  1
   27277 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_bits  1
   27278 
   27279 static inline uint32_t ATTRIBUTE_PURE
   27280 _3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_bits(const struct gen_device_info *devinfo)
   27281 {
   27282    switch (devinfo->gen) {
   27283    case 10: return 1;
   27284    case 9: return 1;
   27285    case 8: return 1;
   27286    case 7:
   27287       if (devinfo->is_haswell) {
   27288          return 0;
   27289       } else {
   27290          return 0;
   27291       }
   27292    case 6: return 0;
   27293    case 5: return 0;
   27294    case 4:
   27295       if (devinfo->is_g4x) {
   27296          return 0;
   27297       } else {
   27298          return 0;
   27299       }
   27300    default:
   27301       unreachable("Invalid hardware generation");
   27302    }
   27303 }
   27304 
   27305 
   27306 
   27307 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_start  69
   27308 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_start  69
   27309 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_start  69
   27310 
   27311 static inline uint32_t ATTRIBUTE_PURE
   27312 _3DSTATE_GATHER_CONSTANT_GS_ConstantBufferDx9GenerateStall_start(const struct gen_device_info *devinfo)
   27313 {
   27314    switch (devinfo->gen) {
   27315    case 10: return 69;
   27316    case 9: return 69;
   27317    case 8: return 69;
   27318    case 7:
   27319       if (devinfo->is_haswell) {
   27320          return 0;
   27321       } else {
   27322          return 0;
   27323       }
   27324    case 6: return 0;
   27325    case 5: return 0;
   27326    case 4:
   27327       if (devinfo->is_g4x) {
   27328          return 0;
   27329       } else {
   27330          return 0;
   27331       }
   27332    default:
   27333       unreachable("Invalid hardware generation");
   27334    }
   27335 }
   27336 
   27337 
   27338 
   27339 /* 3DSTATE_GATHER_CONSTANT_GS::Constant Buffer Valid */
   27340 
   27341 
   27342 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_bits  16
   27343 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_bits  16
   27344 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_bits  16
   27345 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_bits  16
   27346 
   27347 static inline uint32_t ATTRIBUTE_PURE
   27348 _3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_bits(const struct gen_device_info *devinfo)
   27349 {
   27350    switch (devinfo->gen) {
   27351    case 10: return 16;
   27352    case 9: return 16;
   27353    case 8: return 16;
   27354    case 7:
   27355       if (devinfo->is_haswell) {
   27356          return 16;
   27357       } else {
   27358          return 0;
   27359       }
   27360    case 6: return 0;
   27361    case 5: return 0;
   27362    case 4:
   27363       if (devinfo->is_g4x) {
   27364          return 0;
   27365       } else {
   27366          return 0;
   27367       }
   27368    default:
   27369       unreachable("Invalid hardware generation");
   27370    }
   27371 }
   27372 
   27373 
   27374 
   27375 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_start  48
   27376 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_start  48
   27377 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_start  48
   27378 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_start  48
   27379 
   27380 static inline uint32_t ATTRIBUTE_PURE
   27381 _3DSTATE_GATHER_CONSTANT_GS_ConstantBufferValid_start(const struct gen_device_info *devinfo)
   27382 {
   27383    switch (devinfo->gen) {
   27384    case 10: return 48;
   27385    case 9: return 48;
   27386    case 8: return 48;
   27387    case 7:
   27388       if (devinfo->is_haswell) {
   27389          return 48;
   27390       } else {
   27391          return 0;
   27392       }
   27393    case 6: return 0;
   27394    case 5: return 0;
   27395    case 4:
   27396       if (devinfo->is_g4x) {
   27397          return 0;
   27398       } else {
   27399          return 0;
   27400       }
   27401    default:
   27402       unreachable("Invalid hardware generation");
   27403    }
   27404 }
   27405 
   27406 
   27407 
   27408 /* 3DSTATE_GATHER_CONSTANT_GS::DWord Length */
   27409 
   27410 
   27411 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_DWordLength_bits  8
   27412 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_DWordLength_bits  8
   27413 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_DWordLength_bits  8
   27414 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_DWordLength_bits  8
   27415 
   27416 static inline uint32_t ATTRIBUTE_PURE
   27417 _3DSTATE_GATHER_CONSTANT_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   27418 {
   27419    switch (devinfo->gen) {
   27420    case 10: return 8;
   27421    case 9: return 8;
   27422    case 8: return 8;
   27423    case 7:
   27424       if (devinfo->is_haswell) {
   27425          return 8;
   27426       } else {
   27427          return 0;
   27428       }
   27429    case 6: return 0;
   27430    case 5: return 0;
   27431    case 4:
   27432       if (devinfo->is_g4x) {
   27433          return 0;
   27434       } else {
   27435          return 0;
   27436       }
   27437    default:
   27438       unreachable("Invalid hardware generation");
   27439    }
   27440 }
   27441 
   27442 
   27443 
   27444 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_DWordLength_start  0
   27445 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_DWordLength_start  0
   27446 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_DWordLength_start  0
   27447 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_DWordLength_start  0
   27448 
   27449 static inline uint32_t ATTRIBUTE_PURE
   27450 _3DSTATE_GATHER_CONSTANT_GS_DWordLength_start(const struct gen_device_info *devinfo)
   27451 {
   27452    switch (devinfo->gen) {
   27453    case 10: return 0;
   27454    case 9: return 0;
   27455    case 8: return 0;
   27456    case 7:
   27457       if (devinfo->is_haswell) {
   27458          return 0;
   27459       } else {
   27460          return 0;
   27461       }
   27462    case 6: return 0;
   27463    case 5: return 0;
   27464    case 4:
   27465       if (devinfo->is_g4x) {
   27466          return 0;
   27467       } else {
   27468          return 0;
   27469       }
   27470    default:
   27471       unreachable("Invalid hardware generation");
   27472    }
   27473 }
   27474 
   27475 
   27476 
   27477 /* 3DSTATE_GATHER_CONSTANT_GS::Entry_0 */
   27478 
   27479 
   27480 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_Entry_0_bits  16
   27481 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_Entry_0_bits  16
   27482 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_Entry_0_bits  16
   27483 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_Entry_0_bits  16
   27484 
   27485 static inline uint32_t ATTRIBUTE_PURE
   27486 _3DSTATE_GATHER_CONSTANT_GS_Entry_0_bits(const struct gen_device_info *devinfo)
   27487 {
   27488    switch (devinfo->gen) {
   27489    case 10: return 16;
   27490    case 9: return 16;
   27491    case 8: return 16;
   27492    case 7:
   27493       if (devinfo->is_haswell) {
   27494          return 16;
   27495       } else {
   27496          return 0;
   27497       }
   27498    case 6: return 0;
   27499    case 5: return 0;
   27500    case 4:
   27501       if (devinfo->is_g4x) {
   27502          return 0;
   27503       } else {
   27504          return 0;
   27505       }
   27506    default:
   27507       unreachable("Invalid hardware generation");
   27508    }
   27509 }
   27510 
   27511 
   27512 
   27513 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_Entry_0_start  0
   27514 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_Entry_0_start  0
   27515 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_Entry_0_start  0
   27516 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_Entry_0_start  0
   27517 
   27518 static inline uint32_t ATTRIBUTE_PURE
   27519 _3DSTATE_GATHER_CONSTANT_GS_Entry_0_start(const struct gen_device_info *devinfo)
   27520 {
   27521    switch (devinfo->gen) {
   27522    case 10: return 0;
   27523    case 9: return 0;
   27524    case 8: return 0;
   27525    case 7:
   27526       if (devinfo->is_haswell) {
   27527          return 0;
   27528       } else {
   27529          return 0;
   27530       }
   27531    case 6: return 0;
   27532    case 5: return 0;
   27533    case 4:
   27534       if (devinfo->is_g4x) {
   27535          return 0;
   27536       } else {
   27537          return 0;
   27538       }
   27539    default:
   27540       unreachable("Invalid hardware generation");
   27541    }
   27542 }
   27543 
   27544 
   27545 
   27546 /* 3DSTATE_GATHER_CONSTANT_GS::Entry_1 */
   27547 
   27548 
   27549 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_Entry_1_bits  16
   27550 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_Entry_1_bits  16
   27551 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_Entry_1_bits  16
   27552 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_Entry_1_bits  16
   27553 
   27554 static inline uint32_t ATTRIBUTE_PURE
   27555 _3DSTATE_GATHER_CONSTANT_GS_Entry_1_bits(const struct gen_device_info *devinfo)
   27556 {
   27557    switch (devinfo->gen) {
   27558    case 10: return 16;
   27559    case 9: return 16;
   27560    case 8: return 16;
   27561    case 7:
   27562       if (devinfo->is_haswell) {
   27563          return 16;
   27564       } else {
   27565          return 0;
   27566       }
   27567    case 6: return 0;
   27568    case 5: return 0;
   27569    case 4:
   27570       if (devinfo->is_g4x) {
   27571          return 0;
   27572       } else {
   27573          return 0;
   27574       }
   27575    default:
   27576       unreachable("Invalid hardware generation");
   27577    }
   27578 }
   27579 
   27580 
   27581 
   27582 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_Entry_1_start  16
   27583 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_Entry_1_start  16
   27584 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_Entry_1_start  16
   27585 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_Entry_1_start  16
   27586 
   27587 static inline uint32_t ATTRIBUTE_PURE
   27588 _3DSTATE_GATHER_CONSTANT_GS_Entry_1_start(const struct gen_device_info *devinfo)
   27589 {
   27590    switch (devinfo->gen) {
   27591    case 10: return 16;
   27592    case 9: return 16;
   27593    case 8: return 16;
   27594    case 7:
   27595       if (devinfo->is_haswell) {
   27596          return 16;
   27597       } else {
   27598          return 0;
   27599       }
   27600    case 6: return 0;
   27601    case 5: return 0;
   27602    case 4:
   27603       if (devinfo->is_g4x) {
   27604          return 0;
   27605       } else {
   27606          return 0;
   27607       }
   27608    default:
   27609       unreachable("Invalid hardware generation");
   27610    }
   27611 }
   27612 
   27613 
   27614 
   27615 /* 3DSTATE_GATHER_CONSTANT_GS::Gather Buffer Offset */
   27616 
   27617 
   27618 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_bits  17
   27619 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_bits  17
   27620 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_bits  17
   27621 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_bits  17
   27622 
   27623 static inline uint32_t ATTRIBUTE_PURE
   27624 _3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_bits(const struct gen_device_info *devinfo)
   27625 {
   27626    switch (devinfo->gen) {
   27627    case 10: return 17;
   27628    case 9: return 17;
   27629    case 8: return 17;
   27630    case 7:
   27631       if (devinfo->is_haswell) {
   27632          return 17;
   27633       } else {
   27634          return 0;
   27635       }
   27636    case 6: return 0;
   27637    case 5: return 0;
   27638    case 4:
   27639       if (devinfo->is_g4x) {
   27640          return 0;
   27641       } else {
   27642          return 0;
   27643       }
   27644    default:
   27645       unreachable("Invalid hardware generation");
   27646    }
   27647 }
   27648 
   27649 
   27650 
   27651 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_start  70
   27652 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_start  70
   27653 #define GEN8_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_start  70
   27654 #define GEN75_3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_start  70
   27655 
   27656 static inline uint32_t ATTRIBUTE_PURE
   27657 _3DSTATE_GATHER_CONSTANT_GS_GatherBufferOffset_start(const struct gen_device_info *devinfo)
   27658 {
   27659    switch (devinfo->gen) {
   27660    case 10: return 70;
   27661    case 9: return 70;
   27662    case 8: return 70;
   27663    case 7:
   27664       if (devinfo->is_haswell) {
   27665          return 70;
   27666       } else {
   27667          return 0;
   27668       }
   27669    case 6: return 0;
   27670    case 5: return 0;
   27671    case 4:
   27672       if (devinfo->is_g4x) {
   27673          return 0;
   27674       } else {
   27675          return 0;
   27676       }
   27677    default:
   27678       unreachable("Invalid hardware generation");
   27679    }
   27680 }
   27681 
   27682 
   27683 
   27684 /* 3DSTATE_GATHER_CONSTANT_GS::On-Die Table */
   27685 
   27686 
   27687 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_OnDieTable_bits  1
   27688 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_OnDieTable_bits  1
   27689 
   27690 static inline uint32_t ATTRIBUTE_PURE
   27691 _3DSTATE_GATHER_CONSTANT_GS_OnDieTable_bits(const struct gen_device_info *devinfo)
   27692 {
   27693    switch (devinfo->gen) {
   27694    case 10: return 1;
   27695    case 9: return 1;
   27696    case 8: return 0;
   27697    case 7:
   27698       if (devinfo->is_haswell) {
   27699          return 0;
   27700       } else {
   27701          return 0;
   27702       }
   27703    case 6: return 0;
   27704    case 5: return 0;
   27705    case 4:
   27706       if (devinfo->is_g4x) {
   27707          return 0;
   27708       } else {
   27709          return 0;
   27710       }
   27711    default:
   27712       unreachable("Invalid hardware generation");
   27713    }
   27714 }
   27715 
   27716 
   27717 
   27718 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_OnDieTable_start  67
   27719 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_OnDieTable_start  67
   27720 
   27721 static inline uint32_t ATTRIBUTE_PURE
   27722 _3DSTATE_GATHER_CONSTANT_GS_OnDieTable_start(const struct gen_device_info *devinfo)
   27723 {
   27724    switch (devinfo->gen) {
   27725    case 10: return 67;
   27726    case 9: return 67;
   27727    case 8: return 0;
   27728    case 7:
   27729       if (devinfo->is_haswell) {
   27730          return 0;
   27731       } else {
   27732          return 0;
   27733       }
   27734    case 6: return 0;
   27735    case 5: return 0;
   27736    case 4:
   27737       if (devinfo->is_g4x) {
   27738          return 0;
   27739       } else {
   27740          return 0;
   27741       }
   27742    default:
   27743       unreachable("Invalid hardware generation");
   27744    }
   27745 }
   27746 
   27747 
   27748 
   27749 /* 3DSTATE_GATHER_CONSTANT_GS::Update Gather Table Only */
   27750 
   27751 
   27752 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_UpdateGatherTableOnly_bits  1
   27753 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_UpdateGatherTableOnly_bits  1
   27754 
   27755 static inline uint32_t ATTRIBUTE_PURE
   27756 _3DSTATE_GATHER_CONSTANT_GS_UpdateGatherTableOnly_bits(const struct gen_device_info *devinfo)
   27757 {
   27758    switch (devinfo->gen) {
   27759    case 10: return 1;
   27760    case 9: return 1;
   27761    case 8: return 0;
   27762    case 7:
   27763       if (devinfo->is_haswell) {
   27764          return 0;
   27765       } else {
   27766          return 0;
   27767       }
   27768    case 6: return 0;
   27769    case 5: return 0;
   27770    case 4:
   27771       if (devinfo->is_g4x) {
   27772          return 0;
   27773       } else {
   27774          return 0;
   27775       }
   27776    default:
   27777       unreachable("Invalid hardware generation");
   27778    }
   27779 }
   27780 
   27781 
   27782 
   27783 #define GEN10_3DSTATE_GATHER_CONSTANT_GS_UpdateGatherTableOnly_start  33
   27784 #define GEN9_3DSTATE_GATHER_CONSTANT_GS_UpdateGatherTableOnly_start  33
   27785 
   27786 static inline uint32_t ATTRIBUTE_PURE
   27787 _3DSTATE_GATHER_CONSTANT_GS_UpdateGatherTableOnly_start(const struct gen_device_info *devinfo)
   27788 {
   27789    switch (devinfo->gen) {
   27790    case 10: return 33;
   27791    case 9: return 33;
   27792    case 8: return 0;
   27793    case 7:
   27794       if (devinfo->is_haswell) {
   27795          return 0;
   27796       } else {
   27797          return 0;
   27798       }
   27799    case 6: return 0;
   27800    case 5: return 0;
   27801    case 4:
   27802       if (devinfo->is_g4x) {
   27803          return 0;
   27804       } else {
   27805          return 0;
   27806       }
   27807    default:
   27808       unreachable("Invalid hardware generation");
   27809    }
   27810 }
   27811 
   27812 
   27813 
   27814 /* 3DSTATE_GATHER_CONSTANT_HS */
   27815 
   27816 
   27817 
   27818 
   27819 
   27820 /* 3DSTATE_GATHER_CONSTANT_HS::3D Command Opcode */
   27821 
   27822 
   27823 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_bits  3
   27824 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_bits  3
   27825 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_bits  3
   27826 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_bits  3
   27827 
   27828 static inline uint32_t ATTRIBUTE_PURE
   27829 _3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   27830 {
   27831    switch (devinfo->gen) {
   27832    case 10: return 3;
   27833    case 9: return 3;
   27834    case 8: return 3;
   27835    case 7:
   27836       if (devinfo->is_haswell) {
   27837          return 3;
   27838       } else {
   27839          return 0;
   27840       }
   27841    case 6: return 0;
   27842    case 5: return 0;
   27843    case 4:
   27844       if (devinfo->is_g4x) {
   27845          return 0;
   27846       } else {
   27847          return 0;
   27848       }
   27849    default:
   27850       unreachable("Invalid hardware generation");
   27851    }
   27852 }
   27853 
   27854 
   27855 
   27856 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_start  24
   27857 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_start  24
   27858 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_start  24
   27859 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_start  24
   27860 
   27861 static inline uint32_t ATTRIBUTE_PURE
   27862 _3DSTATE_GATHER_CONSTANT_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   27863 {
   27864    switch (devinfo->gen) {
   27865    case 10: return 24;
   27866    case 9: return 24;
   27867    case 8: return 24;
   27868    case 7:
   27869       if (devinfo->is_haswell) {
   27870          return 24;
   27871       } else {
   27872          return 0;
   27873       }
   27874    case 6: return 0;
   27875    case 5: return 0;
   27876    case 4:
   27877       if (devinfo->is_g4x) {
   27878          return 0;
   27879       } else {
   27880          return 0;
   27881       }
   27882    default:
   27883       unreachable("Invalid hardware generation");
   27884    }
   27885 }
   27886 
   27887 
   27888 
   27889 /* 3DSTATE_GATHER_CONSTANT_HS::3D Command Sub Opcode */
   27890 
   27891 
   27892 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_bits  8
   27893 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_bits  8
   27894 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_bits  8
   27895 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_bits  8
   27896 
   27897 static inline uint32_t ATTRIBUTE_PURE
   27898 _3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   27899 {
   27900    switch (devinfo->gen) {
   27901    case 10: return 8;
   27902    case 9: return 8;
   27903    case 8: return 8;
   27904    case 7:
   27905       if (devinfo->is_haswell) {
   27906          return 8;
   27907       } else {
   27908          return 0;
   27909       }
   27910    case 6: return 0;
   27911    case 5: return 0;
   27912    case 4:
   27913       if (devinfo->is_g4x) {
   27914          return 0;
   27915       } else {
   27916          return 0;
   27917       }
   27918    default:
   27919       unreachable("Invalid hardware generation");
   27920    }
   27921 }
   27922 
   27923 
   27924 
   27925 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_start  16
   27926 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_start  16
   27927 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_start  16
   27928 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_start  16
   27929 
   27930 static inline uint32_t ATTRIBUTE_PURE
   27931 _3DSTATE_GATHER_CONSTANT_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   27932 {
   27933    switch (devinfo->gen) {
   27934    case 10: return 16;
   27935    case 9: return 16;
   27936    case 8: return 16;
   27937    case 7:
   27938       if (devinfo->is_haswell) {
   27939          return 16;
   27940       } else {
   27941          return 0;
   27942       }
   27943    case 6: return 0;
   27944    case 5: return 0;
   27945    case 4:
   27946       if (devinfo->is_g4x) {
   27947          return 0;
   27948       } else {
   27949          return 0;
   27950       }
   27951    default:
   27952       unreachable("Invalid hardware generation");
   27953    }
   27954 }
   27955 
   27956 
   27957 
   27958 /* 3DSTATE_GATHER_CONSTANT_HS::Command SubType */
   27959 
   27960 
   27961 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_bits  2
   27962 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_bits  2
   27963 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_bits  2
   27964 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_bits  2
   27965 
   27966 static inline uint32_t ATTRIBUTE_PURE
   27967 _3DSTATE_GATHER_CONSTANT_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   27968 {
   27969    switch (devinfo->gen) {
   27970    case 10: return 2;
   27971    case 9: return 2;
   27972    case 8: return 2;
   27973    case 7:
   27974       if (devinfo->is_haswell) {
   27975          return 2;
   27976       } else {
   27977          return 0;
   27978       }
   27979    case 6: return 0;
   27980    case 5: return 0;
   27981    case 4:
   27982       if (devinfo->is_g4x) {
   27983          return 0;
   27984       } else {
   27985          return 0;
   27986       }
   27987    default:
   27988       unreachable("Invalid hardware generation");
   27989    }
   27990 }
   27991 
   27992 
   27993 
   27994 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_start  27
   27995 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_start  27
   27996 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_start  27
   27997 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_CommandSubType_start  27
   27998 
   27999 static inline uint32_t ATTRIBUTE_PURE
   28000 _3DSTATE_GATHER_CONSTANT_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   28001 {
   28002    switch (devinfo->gen) {
   28003    case 10: return 27;
   28004    case 9: return 27;
   28005    case 8: return 27;
   28006    case 7:
   28007       if (devinfo->is_haswell) {
   28008          return 27;
   28009       } else {
   28010          return 0;
   28011       }
   28012    case 6: return 0;
   28013    case 5: return 0;
   28014    case 4:
   28015       if (devinfo->is_g4x) {
   28016          return 0;
   28017       } else {
   28018          return 0;
   28019       }
   28020    default:
   28021       unreachable("Invalid hardware generation");
   28022    }
   28023 }
   28024 
   28025 
   28026 
   28027 /* 3DSTATE_GATHER_CONSTANT_HS::Command Type */
   28028 
   28029 
   28030 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_CommandType_bits  3
   28031 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_CommandType_bits  3
   28032 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_CommandType_bits  3
   28033 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_CommandType_bits  3
   28034 
   28035 static inline uint32_t ATTRIBUTE_PURE
   28036 _3DSTATE_GATHER_CONSTANT_HS_CommandType_bits(const struct gen_device_info *devinfo)
   28037 {
   28038    switch (devinfo->gen) {
   28039    case 10: return 3;
   28040    case 9: return 3;
   28041    case 8: return 3;
   28042    case 7:
   28043       if (devinfo->is_haswell) {
   28044          return 3;
   28045       } else {
   28046          return 0;
   28047       }
   28048    case 6: return 0;
   28049    case 5: return 0;
   28050    case 4:
   28051       if (devinfo->is_g4x) {
   28052          return 0;
   28053       } else {
   28054          return 0;
   28055       }
   28056    default:
   28057       unreachable("Invalid hardware generation");
   28058    }
   28059 }
   28060 
   28061 
   28062 
   28063 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_CommandType_start  29
   28064 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_CommandType_start  29
   28065 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_CommandType_start  29
   28066 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_CommandType_start  29
   28067 
   28068 static inline uint32_t ATTRIBUTE_PURE
   28069 _3DSTATE_GATHER_CONSTANT_HS_CommandType_start(const struct gen_device_info *devinfo)
   28070 {
   28071    switch (devinfo->gen) {
   28072    case 10: return 29;
   28073    case 9: return 29;
   28074    case 8: return 29;
   28075    case 7:
   28076       if (devinfo->is_haswell) {
   28077          return 29;
   28078       } else {
   28079          return 0;
   28080       }
   28081    case 6: return 0;
   28082    case 5: return 0;
   28083    case 4:
   28084       if (devinfo->is_g4x) {
   28085          return 0;
   28086       } else {
   28087          return 0;
   28088       }
   28089    default:
   28090       unreachable("Invalid hardware generation");
   28091    }
   28092 }
   28093 
   28094 
   28095 
   28096 /* 3DSTATE_GATHER_CONSTANT_HS::Constant Buffer Binding Table Block */
   28097 
   28098 
   28099 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_bits  4
   28100 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_bits  4
   28101 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_bits  4
   28102 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_bits  4
   28103 
   28104 static inline uint32_t ATTRIBUTE_PURE
   28105 _3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_bits(const struct gen_device_info *devinfo)
   28106 {
   28107    switch (devinfo->gen) {
   28108    case 10: return 4;
   28109    case 9: return 4;
   28110    case 8: return 4;
   28111    case 7:
   28112       if (devinfo->is_haswell) {
   28113          return 4;
   28114       } else {
   28115          return 0;
   28116       }
   28117    case 6: return 0;
   28118    case 5: return 0;
   28119    case 4:
   28120       if (devinfo->is_g4x) {
   28121          return 0;
   28122       } else {
   28123          return 0;
   28124       }
   28125    default:
   28126       unreachable("Invalid hardware generation");
   28127    }
   28128 }
   28129 
   28130 
   28131 
   28132 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_start  44
   28133 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_start  44
   28134 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_start  44
   28135 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_start  44
   28136 
   28137 static inline uint32_t ATTRIBUTE_PURE
   28138 _3DSTATE_GATHER_CONSTANT_HS_ConstantBufferBindingTableBlock_start(const struct gen_device_info *devinfo)
   28139 {
   28140    switch (devinfo->gen) {
   28141    case 10: return 44;
   28142    case 9: return 44;
   28143    case 8: return 44;
   28144    case 7:
   28145       if (devinfo->is_haswell) {
   28146          return 44;
   28147       } else {
   28148          return 0;
   28149       }
   28150    case 6: return 0;
   28151    case 5: return 0;
   28152    case 4:
   28153       if (devinfo->is_g4x) {
   28154          return 0;
   28155       } else {
   28156          return 0;
   28157       }
   28158    default:
   28159       unreachable("Invalid hardware generation");
   28160    }
   28161 }
   28162 
   28163 
   28164 
   28165 /* 3DSTATE_GATHER_CONSTANT_HS::Constant Buffer Dx9 Generate Stall */
   28166 
   28167 
   28168 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_bits  1
   28169 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_bits  1
   28170 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_bits  1
   28171 
   28172 static inline uint32_t ATTRIBUTE_PURE
   28173 _3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_bits(const struct gen_device_info *devinfo)
   28174 {
   28175    switch (devinfo->gen) {
   28176    case 10: return 1;
   28177    case 9: return 1;
   28178    case 8: return 1;
   28179    case 7:
   28180       if (devinfo->is_haswell) {
   28181          return 0;
   28182       } else {
   28183          return 0;
   28184       }
   28185    case 6: return 0;
   28186    case 5: return 0;
   28187    case 4:
   28188       if (devinfo->is_g4x) {
   28189          return 0;
   28190       } else {
   28191          return 0;
   28192       }
   28193    default:
   28194       unreachable("Invalid hardware generation");
   28195    }
   28196 }
   28197 
   28198 
   28199 
   28200 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_start  69
   28201 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_start  69
   28202 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_start  69
   28203 
   28204 static inline uint32_t ATTRIBUTE_PURE
   28205 _3DSTATE_GATHER_CONSTANT_HS_ConstantBufferDx9GenerateStall_start(const struct gen_device_info *devinfo)
   28206 {
   28207    switch (devinfo->gen) {
   28208    case 10: return 69;
   28209    case 9: return 69;
   28210    case 8: return 69;
   28211    case 7:
   28212       if (devinfo->is_haswell) {
   28213          return 0;
   28214       } else {
   28215          return 0;
   28216       }
   28217    case 6: return 0;
   28218    case 5: return 0;
   28219    case 4:
   28220       if (devinfo->is_g4x) {
   28221          return 0;
   28222       } else {
   28223          return 0;
   28224       }
   28225    default:
   28226       unreachable("Invalid hardware generation");
   28227    }
   28228 }
   28229 
   28230 
   28231 
   28232 /* 3DSTATE_GATHER_CONSTANT_HS::Constant Buffer Valid */
   28233 
   28234 
   28235 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_bits  16
   28236 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_bits  16
   28237 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_bits  16
   28238 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_bits  16
   28239 
   28240 static inline uint32_t ATTRIBUTE_PURE
   28241 _3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_bits(const struct gen_device_info *devinfo)
   28242 {
   28243    switch (devinfo->gen) {
   28244    case 10: return 16;
   28245    case 9: return 16;
   28246    case 8: return 16;
   28247    case 7:
   28248       if (devinfo->is_haswell) {
   28249          return 16;
   28250       } else {
   28251          return 0;
   28252       }
   28253    case 6: return 0;
   28254    case 5: return 0;
   28255    case 4:
   28256       if (devinfo->is_g4x) {
   28257          return 0;
   28258       } else {
   28259          return 0;
   28260       }
   28261    default:
   28262       unreachable("Invalid hardware generation");
   28263    }
   28264 }
   28265 
   28266 
   28267 
   28268 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_start  48
   28269 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_start  48
   28270 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_start  48
   28271 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_start  48
   28272 
   28273 static inline uint32_t ATTRIBUTE_PURE
   28274 _3DSTATE_GATHER_CONSTANT_HS_ConstantBufferValid_start(const struct gen_device_info *devinfo)
   28275 {
   28276    switch (devinfo->gen) {
   28277    case 10: return 48;
   28278    case 9: return 48;
   28279    case 8: return 48;
   28280    case 7:
   28281       if (devinfo->is_haswell) {
   28282          return 48;
   28283       } else {
   28284          return 0;
   28285       }
   28286    case 6: return 0;
   28287    case 5: return 0;
   28288    case 4:
   28289       if (devinfo->is_g4x) {
   28290          return 0;
   28291       } else {
   28292          return 0;
   28293       }
   28294    default:
   28295       unreachable("Invalid hardware generation");
   28296    }
   28297 }
   28298 
   28299 
   28300 
   28301 /* 3DSTATE_GATHER_CONSTANT_HS::DWord Length */
   28302 
   28303 
   28304 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_DWordLength_bits  8
   28305 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_DWordLength_bits  8
   28306 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_DWordLength_bits  8
   28307 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_DWordLength_bits  8
   28308 
   28309 static inline uint32_t ATTRIBUTE_PURE
   28310 _3DSTATE_GATHER_CONSTANT_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   28311 {
   28312    switch (devinfo->gen) {
   28313    case 10: return 8;
   28314    case 9: return 8;
   28315    case 8: return 8;
   28316    case 7:
   28317       if (devinfo->is_haswell) {
   28318          return 8;
   28319       } else {
   28320          return 0;
   28321       }
   28322    case 6: return 0;
   28323    case 5: return 0;
   28324    case 4:
   28325       if (devinfo->is_g4x) {
   28326          return 0;
   28327       } else {
   28328          return 0;
   28329       }
   28330    default:
   28331       unreachable("Invalid hardware generation");
   28332    }
   28333 }
   28334 
   28335 
   28336 
   28337 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_DWordLength_start  0
   28338 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_DWordLength_start  0
   28339 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_DWordLength_start  0
   28340 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_DWordLength_start  0
   28341 
   28342 static inline uint32_t ATTRIBUTE_PURE
   28343 _3DSTATE_GATHER_CONSTANT_HS_DWordLength_start(const struct gen_device_info *devinfo)
   28344 {
   28345    switch (devinfo->gen) {
   28346    case 10: return 0;
   28347    case 9: return 0;
   28348    case 8: return 0;
   28349    case 7:
   28350       if (devinfo->is_haswell) {
   28351          return 0;
   28352       } else {
   28353          return 0;
   28354       }
   28355    case 6: return 0;
   28356    case 5: return 0;
   28357    case 4:
   28358       if (devinfo->is_g4x) {
   28359          return 0;
   28360       } else {
   28361          return 0;
   28362       }
   28363    default:
   28364       unreachable("Invalid hardware generation");
   28365    }
   28366 }
   28367 
   28368 
   28369 
   28370 /* 3DSTATE_GATHER_CONSTANT_HS::Entry_0 */
   28371 
   28372 
   28373 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_Entry_0_bits  16
   28374 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_Entry_0_bits  16
   28375 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_Entry_0_bits  16
   28376 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_Entry_0_bits  16
   28377 
   28378 static inline uint32_t ATTRIBUTE_PURE
   28379 _3DSTATE_GATHER_CONSTANT_HS_Entry_0_bits(const struct gen_device_info *devinfo)
   28380 {
   28381    switch (devinfo->gen) {
   28382    case 10: return 16;
   28383    case 9: return 16;
   28384    case 8: return 16;
   28385    case 7:
   28386       if (devinfo->is_haswell) {
   28387          return 16;
   28388       } else {
   28389          return 0;
   28390       }
   28391    case 6: return 0;
   28392    case 5: return 0;
   28393    case 4:
   28394       if (devinfo->is_g4x) {
   28395          return 0;
   28396       } else {
   28397          return 0;
   28398       }
   28399    default:
   28400       unreachable("Invalid hardware generation");
   28401    }
   28402 }
   28403 
   28404 
   28405 
   28406 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_Entry_0_start  0
   28407 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_Entry_0_start  0
   28408 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_Entry_0_start  0
   28409 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_Entry_0_start  0
   28410 
   28411 static inline uint32_t ATTRIBUTE_PURE
   28412 _3DSTATE_GATHER_CONSTANT_HS_Entry_0_start(const struct gen_device_info *devinfo)
   28413 {
   28414    switch (devinfo->gen) {
   28415    case 10: return 0;
   28416    case 9: return 0;
   28417    case 8: return 0;
   28418    case 7:
   28419       if (devinfo->is_haswell) {
   28420          return 0;
   28421       } else {
   28422          return 0;
   28423       }
   28424    case 6: return 0;
   28425    case 5: return 0;
   28426    case 4:
   28427       if (devinfo->is_g4x) {
   28428          return 0;
   28429       } else {
   28430          return 0;
   28431       }
   28432    default:
   28433       unreachable("Invalid hardware generation");
   28434    }
   28435 }
   28436 
   28437 
   28438 
   28439 /* 3DSTATE_GATHER_CONSTANT_HS::Entry_1 */
   28440 
   28441 
   28442 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_Entry_1_bits  16
   28443 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_Entry_1_bits  16
   28444 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_Entry_1_bits  16
   28445 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_Entry_1_bits  16
   28446 
   28447 static inline uint32_t ATTRIBUTE_PURE
   28448 _3DSTATE_GATHER_CONSTANT_HS_Entry_1_bits(const struct gen_device_info *devinfo)
   28449 {
   28450    switch (devinfo->gen) {
   28451    case 10: return 16;
   28452    case 9: return 16;
   28453    case 8: return 16;
   28454    case 7:
   28455       if (devinfo->is_haswell) {
   28456          return 16;
   28457       } else {
   28458          return 0;
   28459       }
   28460    case 6: return 0;
   28461    case 5: return 0;
   28462    case 4:
   28463       if (devinfo->is_g4x) {
   28464          return 0;
   28465       } else {
   28466          return 0;
   28467       }
   28468    default:
   28469       unreachable("Invalid hardware generation");
   28470    }
   28471 }
   28472 
   28473 
   28474 
   28475 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_Entry_1_start  16
   28476 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_Entry_1_start  16
   28477 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_Entry_1_start  16
   28478 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_Entry_1_start  16
   28479 
   28480 static inline uint32_t ATTRIBUTE_PURE
   28481 _3DSTATE_GATHER_CONSTANT_HS_Entry_1_start(const struct gen_device_info *devinfo)
   28482 {
   28483    switch (devinfo->gen) {
   28484    case 10: return 16;
   28485    case 9: return 16;
   28486    case 8: return 16;
   28487    case 7:
   28488       if (devinfo->is_haswell) {
   28489          return 16;
   28490       } else {
   28491          return 0;
   28492       }
   28493    case 6: return 0;
   28494    case 5: return 0;
   28495    case 4:
   28496       if (devinfo->is_g4x) {
   28497          return 0;
   28498       } else {
   28499          return 0;
   28500       }
   28501    default:
   28502       unreachable("Invalid hardware generation");
   28503    }
   28504 }
   28505 
   28506 
   28507 
   28508 /* 3DSTATE_GATHER_CONSTANT_HS::Gather Buffer Offset */
   28509 
   28510 
   28511 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_bits  17
   28512 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_bits  17
   28513 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_bits  17
   28514 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_bits  17
   28515 
   28516 static inline uint32_t ATTRIBUTE_PURE
   28517 _3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_bits(const struct gen_device_info *devinfo)
   28518 {
   28519    switch (devinfo->gen) {
   28520    case 10: return 17;
   28521    case 9: return 17;
   28522    case 8: return 17;
   28523    case 7:
   28524       if (devinfo->is_haswell) {
   28525          return 17;
   28526       } else {
   28527          return 0;
   28528       }
   28529    case 6: return 0;
   28530    case 5: return 0;
   28531    case 4:
   28532       if (devinfo->is_g4x) {
   28533          return 0;
   28534       } else {
   28535          return 0;
   28536       }
   28537    default:
   28538       unreachable("Invalid hardware generation");
   28539    }
   28540 }
   28541 
   28542 
   28543 
   28544 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_start  70
   28545 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_start  70
   28546 #define GEN8_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_start  70
   28547 #define GEN75_3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_start  70
   28548 
   28549 static inline uint32_t ATTRIBUTE_PURE
   28550 _3DSTATE_GATHER_CONSTANT_HS_GatherBufferOffset_start(const struct gen_device_info *devinfo)
   28551 {
   28552    switch (devinfo->gen) {
   28553    case 10: return 70;
   28554    case 9: return 70;
   28555    case 8: return 70;
   28556    case 7:
   28557       if (devinfo->is_haswell) {
   28558          return 70;
   28559       } else {
   28560          return 0;
   28561       }
   28562    case 6: return 0;
   28563    case 5: return 0;
   28564    case 4:
   28565       if (devinfo->is_g4x) {
   28566          return 0;
   28567       } else {
   28568          return 0;
   28569       }
   28570    default:
   28571       unreachable("Invalid hardware generation");
   28572    }
   28573 }
   28574 
   28575 
   28576 
   28577 /* 3DSTATE_GATHER_CONSTANT_HS::On-Die Table */
   28578 
   28579 
   28580 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_OnDieTable_bits  1
   28581 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_OnDieTable_bits  1
   28582 
   28583 static inline uint32_t ATTRIBUTE_PURE
   28584 _3DSTATE_GATHER_CONSTANT_HS_OnDieTable_bits(const struct gen_device_info *devinfo)
   28585 {
   28586    switch (devinfo->gen) {
   28587    case 10: return 1;
   28588    case 9: return 1;
   28589    case 8: return 0;
   28590    case 7:
   28591       if (devinfo->is_haswell) {
   28592          return 0;
   28593       } else {
   28594          return 0;
   28595       }
   28596    case 6: return 0;
   28597    case 5: return 0;
   28598    case 4:
   28599       if (devinfo->is_g4x) {
   28600          return 0;
   28601       } else {
   28602          return 0;
   28603       }
   28604    default:
   28605       unreachable("Invalid hardware generation");
   28606    }
   28607 }
   28608 
   28609 
   28610 
   28611 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_OnDieTable_start  67
   28612 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_OnDieTable_start  67
   28613 
   28614 static inline uint32_t ATTRIBUTE_PURE
   28615 _3DSTATE_GATHER_CONSTANT_HS_OnDieTable_start(const struct gen_device_info *devinfo)
   28616 {
   28617    switch (devinfo->gen) {
   28618    case 10: return 67;
   28619    case 9: return 67;
   28620    case 8: return 0;
   28621    case 7:
   28622       if (devinfo->is_haswell) {
   28623          return 0;
   28624       } else {
   28625          return 0;
   28626       }
   28627    case 6: return 0;
   28628    case 5: return 0;
   28629    case 4:
   28630       if (devinfo->is_g4x) {
   28631          return 0;
   28632       } else {
   28633          return 0;
   28634       }
   28635    default:
   28636       unreachable("Invalid hardware generation");
   28637    }
   28638 }
   28639 
   28640 
   28641 
   28642 /* 3DSTATE_GATHER_CONSTANT_HS::Update Gather Table Only */
   28643 
   28644 
   28645 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_UpdateGatherTableOnly_bits  1
   28646 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_UpdateGatherTableOnly_bits  1
   28647 
   28648 static inline uint32_t ATTRIBUTE_PURE
   28649 _3DSTATE_GATHER_CONSTANT_HS_UpdateGatherTableOnly_bits(const struct gen_device_info *devinfo)
   28650 {
   28651    switch (devinfo->gen) {
   28652    case 10: return 1;
   28653    case 9: return 1;
   28654    case 8: return 0;
   28655    case 7:
   28656       if (devinfo->is_haswell) {
   28657          return 0;
   28658       } else {
   28659          return 0;
   28660       }
   28661    case 6: return 0;
   28662    case 5: return 0;
   28663    case 4:
   28664       if (devinfo->is_g4x) {
   28665          return 0;
   28666       } else {
   28667          return 0;
   28668       }
   28669    default:
   28670       unreachable("Invalid hardware generation");
   28671    }
   28672 }
   28673 
   28674 
   28675 
   28676 #define GEN10_3DSTATE_GATHER_CONSTANT_HS_UpdateGatherTableOnly_start  33
   28677 #define GEN9_3DSTATE_GATHER_CONSTANT_HS_UpdateGatherTableOnly_start  33
   28678 
   28679 static inline uint32_t ATTRIBUTE_PURE
   28680 _3DSTATE_GATHER_CONSTANT_HS_UpdateGatherTableOnly_start(const struct gen_device_info *devinfo)
   28681 {
   28682    switch (devinfo->gen) {
   28683    case 10: return 33;
   28684    case 9: return 33;
   28685    case 8: return 0;
   28686    case 7:
   28687       if (devinfo->is_haswell) {
   28688          return 0;
   28689       } else {
   28690          return 0;
   28691       }
   28692    case 6: return 0;
   28693    case 5: return 0;
   28694    case 4:
   28695       if (devinfo->is_g4x) {
   28696          return 0;
   28697       } else {
   28698          return 0;
   28699       }
   28700    default:
   28701       unreachable("Invalid hardware generation");
   28702    }
   28703 }
   28704 
   28705 
   28706 
   28707 /* 3DSTATE_GATHER_CONSTANT_PS */
   28708 
   28709 
   28710 
   28711 
   28712 
   28713 /* 3DSTATE_GATHER_CONSTANT_PS::3D Command Opcode */
   28714 
   28715 
   28716 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_bits  3
   28717 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_bits  3
   28718 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_bits  3
   28719 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_bits  3
   28720 
   28721 static inline uint32_t ATTRIBUTE_PURE
   28722 _3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   28723 {
   28724    switch (devinfo->gen) {
   28725    case 10: return 3;
   28726    case 9: return 3;
   28727    case 8: return 3;
   28728    case 7:
   28729       if (devinfo->is_haswell) {
   28730          return 3;
   28731       } else {
   28732          return 0;
   28733       }
   28734    case 6: return 0;
   28735    case 5: return 0;
   28736    case 4:
   28737       if (devinfo->is_g4x) {
   28738          return 0;
   28739       } else {
   28740          return 0;
   28741       }
   28742    default:
   28743       unreachable("Invalid hardware generation");
   28744    }
   28745 }
   28746 
   28747 
   28748 
   28749 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_start  24
   28750 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_start  24
   28751 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_start  24
   28752 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_start  24
   28753 
   28754 static inline uint32_t ATTRIBUTE_PURE
   28755 _3DSTATE_GATHER_CONSTANT_PS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   28756 {
   28757    switch (devinfo->gen) {
   28758    case 10: return 24;
   28759    case 9: return 24;
   28760    case 8: return 24;
   28761    case 7:
   28762       if (devinfo->is_haswell) {
   28763          return 24;
   28764       } else {
   28765          return 0;
   28766       }
   28767    case 6: return 0;
   28768    case 5: return 0;
   28769    case 4:
   28770       if (devinfo->is_g4x) {
   28771          return 0;
   28772       } else {
   28773          return 0;
   28774       }
   28775    default:
   28776       unreachable("Invalid hardware generation");
   28777    }
   28778 }
   28779 
   28780 
   28781 
   28782 /* 3DSTATE_GATHER_CONSTANT_PS::3D Command Sub Opcode */
   28783 
   28784 
   28785 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_bits  8
   28786 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_bits  8
   28787 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_bits  8
   28788 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_bits  8
   28789 
   28790 static inline uint32_t ATTRIBUTE_PURE
   28791 _3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   28792 {
   28793    switch (devinfo->gen) {
   28794    case 10: return 8;
   28795    case 9: return 8;
   28796    case 8: return 8;
   28797    case 7:
   28798       if (devinfo->is_haswell) {
   28799          return 8;
   28800       } else {
   28801          return 0;
   28802       }
   28803    case 6: return 0;
   28804    case 5: return 0;
   28805    case 4:
   28806       if (devinfo->is_g4x) {
   28807          return 0;
   28808       } else {
   28809          return 0;
   28810       }
   28811    default:
   28812       unreachable("Invalid hardware generation");
   28813    }
   28814 }
   28815 
   28816 
   28817 
   28818 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_start  16
   28819 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_start  16
   28820 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_start  16
   28821 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_start  16
   28822 
   28823 static inline uint32_t ATTRIBUTE_PURE
   28824 _3DSTATE_GATHER_CONSTANT_PS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   28825 {
   28826    switch (devinfo->gen) {
   28827    case 10: return 16;
   28828    case 9: return 16;
   28829    case 8: return 16;
   28830    case 7:
   28831       if (devinfo->is_haswell) {
   28832          return 16;
   28833       } else {
   28834          return 0;
   28835       }
   28836    case 6: return 0;
   28837    case 5: return 0;
   28838    case 4:
   28839       if (devinfo->is_g4x) {
   28840          return 0;
   28841       } else {
   28842          return 0;
   28843       }
   28844    default:
   28845       unreachable("Invalid hardware generation");
   28846    }
   28847 }
   28848 
   28849 
   28850 
   28851 /* 3DSTATE_GATHER_CONSTANT_PS::Command SubType */
   28852 
   28853 
   28854 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_bits  2
   28855 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_bits  2
   28856 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_bits  2
   28857 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_bits  2
   28858 
   28859 static inline uint32_t ATTRIBUTE_PURE
   28860 _3DSTATE_GATHER_CONSTANT_PS_CommandSubType_bits(const struct gen_device_info *devinfo)
   28861 {
   28862    switch (devinfo->gen) {
   28863    case 10: return 2;
   28864    case 9: return 2;
   28865    case 8: return 2;
   28866    case 7:
   28867       if (devinfo->is_haswell) {
   28868          return 2;
   28869       } else {
   28870          return 0;
   28871       }
   28872    case 6: return 0;
   28873    case 5: return 0;
   28874    case 4:
   28875       if (devinfo->is_g4x) {
   28876          return 0;
   28877       } else {
   28878          return 0;
   28879       }
   28880    default:
   28881       unreachable("Invalid hardware generation");
   28882    }
   28883 }
   28884 
   28885 
   28886 
   28887 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_start  27
   28888 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_start  27
   28889 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_start  27
   28890 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_CommandSubType_start  27
   28891 
   28892 static inline uint32_t ATTRIBUTE_PURE
   28893 _3DSTATE_GATHER_CONSTANT_PS_CommandSubType_start(const struct gen_device_info *devinfo)
   28894 {
   28895    switch (devinfo->gen) {
   28896    case 10: return 27;
   28897    case 9: return 27;
   28898    case 8: return 27;
   28899    case 7:
   28900       if (devinfo->is_haswell) {
   28901          return 27;
   28902       } else {
   28903          return 0;
   28904       }
   28905    case 6: return 0;
   28906    case 5: return 0;
   28907    case 4:
   28908       if (devinfo->is_g4x) {
   28909          return 0;
   28910       } else {
   28911          return 0;
   28912       }
   28913    default:
   28914       unreachable("Invalid hardware generation");
   28915    }
   28916 }
   28917 
   28918 
   28919 
   28920 /* 3DSTATE_GATHER_CONSTANT_PS::Command Type */
   28921 
   28922 
   28923 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_CommandType_bits  3
   28924 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_CommandType_bits  3
   28925 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_CommandType_bits  3
   28926 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_CommandType_bits  3
   28927 
   28928 static inline uint32_t ATTRIBUTE_PURE
   28929 _3DSTATE_GATHER_CONSTANT_PS_CommandType_bits(const struct gen_device_info *devinfo)
   28930 {
   28931    switch (devinfo->gen) {
   28932    case 10: return 3;
   28933    case 9: return 3;
   28934    case 8: return 3;
   28935    case 7:
   28936       if (devinfo->is_haswell) {
   28937          return 3;
   28938       } else {
   28939          return 0;
   28940       }
   28941    case 6: return 0;
   28942    case 5: return 0;
   28943    case 4:
   28944       if (devinfo->is_g4x) {
   28945          return 0;
   28946       } else {
   28947          return 0;
   28948       }
   28949    default:
   28950       unreachable("Invalid hardware generation");
   28951    }
   28952 }
   28953 
   28954 
   28955 
   28956 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_CommandType_start  29
   28957 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_CommandType_start  29
   28958 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_CommandType_start  29
   28959 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_CommandType_start  29
   28960 
   28961 static inline uint32_t ATTRIBUTE_PURE
   28962 _3DSTATE_GATHER_CONSTANT_PS_CommandType_start(const struct gen_device_info *devinfo)
   28963 {
   28964    switch (devinfo->gen) {
   28965    case 10: return 29;
   28966    case 9: return 29;
   28967    case 8: return 29;
   28968    case 7:
   28969       if (devinfo->is_haswell) {
   28970          return 29;
   28971       } else {
   28972          return 0;
   28973       }
   28974    case 6: return 0;
   28975    case 5: return 0;
   28976    case 4:
   28977       if (devinfo->is_g4x) {
   28978          return 0;
   28979       } else {
   28980          return 0;
   28981       }
   28982    default:
   28983       unreachable("Invalid hardware generation");
   28984    }
   28985 }
   28986 
   28987 
   28988 
   28989 /* 3DSTATE_GATHER_CONSTANT_PS::Constant Buffer Binding Table Block */
   28990 
   28991 
   28992 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_bits  4
   28993 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_bits  4
   28994 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_bits  4
   28995 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_bits  4
   28996 
   28997 static inline uint32_t ATTRIBUTE_PURE
   28998 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_bits(const struct gen_device_info *devinfo)
   28999 {
   29000    switch (devinfo->gen) {
   29001    case 10: return 4;
   29002    case 9: return 4;
   29003    case 8: return 4;
   29004    case 7:
   29005       if (devinfo->is_haswell) {
   29006          return 4;
   29007       } else {
   29008          return 0;
   29009       }
   29010    case 6: return 0;
   29011    case 5: return 0;
   29012    case 4:
   29013       if (devinfo->is_g4x) {
   29014          return 0;
   29015       } else {
   29016          return 0;
   29017       }
   29018    default:
   29019       unreachable("Invalid hardware generation");
   29020    }
   29021 }
   29022 
   29023 
   29024 
   29025 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_start  44
   29026 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_start  44
   29027 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_start  44
   29028 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_start  44
   29029 
   29030 static inline uint32_t ATTRIBUTE_PURE
   29031 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferBindingTableBlock_start(const struct gen_device_info *devinfo)
   29032 {
   29033    switch (devinfo->gen) {
   29034    case 10: return 44;
   29035    case 9: return 44;
   29036    case 8: return 44;
   29037    case 7:
   29038       if (devinfo->is_haswell) {
   29039          return 44;
   29040       } else {
   29041          return 0;
   29042       }
   29043    case 6: return 0;
   29044    case 5: return 0;
   29045    case 4:
   29046       if (devinfo->is_g4x) {
   29047          return 0;
   29048       } else {
   29049          return 0;
   29050       }
   29051    default:
   29052       unreachable("Invalid hardware generation");
   29053    }
   29054 }
   29055 
   29056 
   29057 
   29058 /* 3DSTATE_GATHER_CONSTANT_PS::Constant Buffer Dx9 Enable */
   29059 
   29060 
   29061 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_bits  1
   29062 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_bits  1
   29063 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_bits  1
   29064 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_bits  1
   29065 
   29066 static inline uint32_t ATTRIBUTE_PURE
   29067 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_bits(const struct gen_device_info *devinfo)
   29068 {
   29069    switch (devinfo->gen) {
   29070    case 10: return 1;
   29071    case 9: return 1;
   29072    case 8: return 1;
   29073    case 7:
   29074       if (devinfo->is_haswell) {
   29075          return 1;
   29076       } else {
   29077          return 0;
   29078       }
   29079    case 6: return 0;
   29080    case 5: return 0;
   29081    case 4:
   29082       if (devinfo->is_g4x) {
   29083          return 0;
   29084       } else {
   29085          return 0;
   29086       }
   29087    default:
   29088       unreachable("Invalid hardware generation");
   29089    }
   29090 }
   29091 
   29092 
   29093 
   29094 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_start  68
   29095 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_start  68
   29096 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_start  68
   29097 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_start  68
   29098 
   29099 static inline uint32_t ATTRIBUTE_PURE
   29100 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9Enable_start(const struct gen_device_info *devinfo)
   29101 {
   29102    switch (devinfo->gen) {
   29103    case 10: return 68;
   29104    case 9: return 68;
   29105    case 8: return 68;
   29106    case 7:
   29107       if (devinfo->is_haswell) {
   29108          return 68;
   29109       } else {
   29110          return 0;
   29111       }
   29112    case 6: return 0;
   29113    case 5: return 0;
   29114    case 4:
   29115       if (devinfo->is_g4x) {
   29116          return 0;
   29117       } else {
   29118          return 0;
   29119       }
   29120    default:
   29121       unreachable("Invalid hardware generation");
   29122    }
   29123 }
   29124 
   29125 
   29126 
   29127 /* 3DSTATE_GATHER_CONSTANT_PS::Constant Buffer Dx9 Generate Stall */
   29128 
   29129 
   29130 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_bits  1
   29131 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_bits  1
   29132 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_bits  1
   29133 
   29134 static inline uint32_t ATTRIBUTE_PURE
   29135 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_bits(const struct gen_device_info *devinfo)
   29136 {
   29137    switch (devinfo->gen) {
   29138    case 10: return 1;
   29139    case 9: return 1;
   29140    case 8: return 1;
   29141    case 7:
   29142       if (devinfo->is_haswell) {
   29143          return 0;
   29144       } else {
   29145          return 0;
   29146       }
   29147    case 6: return 0;
   29148    case 5: return 0;
   29149    case 4:
   29150       if (devinfo->is_g4x) {
   29151          return 0;
   29152       } else {
   29153          return 0;
   29154       }
   29155    default:
   29156       unreachable("Invalid hardware generation");
   29157    }
   29158 }
   29159 
   29160 
   29161 
   29162 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_start  69
   29163 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_start  69
   29164 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_start  69
   29165 
   29166 static inline uint32_t ATTRIBUTE_PURE
   29167 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferDx9GenerateStall_start(const struct gen_device_info *devinfo)
   29168 {
   29169    switch (devinfo->gen) {
   29170    case 10: return 69;
   29171    case 9: return 69;
   29172    case 8: return 69;
   29173    case 7:
   29174       if (devinfo->is_haswell) {
   29175          return 0;
   29176       } else {
   29177          return 0;
   29178       }
   29179    case 6: return 0;
   29180    case 5: return 0;
   29181    case 4:
   29182       if (devinfo->is_g4x) {
   29183          return 0;
   29184       } else {
   29185          return 0;
   29186       }
   29187    default:
   29188       unreachable("Invalid hardware generation");
   29189    }
   29190 }
   29191 
   29192 
   29193 
   29194 /* 3DSTATE_GATHER_CONSTANT_PS::Constant Buffer Valid */
   29195 
   29196 
   29197 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_bits  16
   29198 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_bits  16
   29199 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_bits  16
   29200 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_bits  16
   29201 
   29202 static inline uint32_t ATTRIBUTE_PURE
   29203 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_bits(const struct gen_device_info *devinfo)
   29204 {
   29205    switch (devinfo->gen) {
   29206    case 10: return 16;
   29207    case 9: return 16;
   29208    case 8: return 16;
   29209    case 7:
   29210       if (devinfo->is_haswell) {
   29211          return 16;
   29212       } else {
   29213          return 0;
   29214       }
   29215    case 6: return 0;
   29216    case 5: return 0;
   29217    case 4:
   29218       if (devinfo->is_g4x) {
   29219          return 0;
   29220       } else {
   29221          return 0;
   29222       }
   29223    default:
   29224       unreachable("Invalid hardware generation");
   29225    }
   29226 }
   29227 
   29228 
   29229 
   29230 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_start  48
   29231 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_start  48
   29232 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_start  48
   29233 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_start  48
   29234 
   29235 static inline uint32_t ATTRIBUTE_PURE
   29236 _3DSTATE_GATHER_CONSTANT_PS_ConstantBufferValid_start(const struct gen_device_info *devinfo)
   29237 {
   29238    switch (devinfo->gen) {
   29239    case 10: return 48;
   29240    case 9: return 48;
   29241    case 8: return 48;
   29242    case 7:
   29243       if (devinfo->is_haswell) {
   29244          return 48;
   29245       } else {
   29246          return 0;
   29247       }
   29248    case 6: return 0;
   29249    case 5: return 0;
   29250    case 4:
   29251       if (devinfo->is_g4x) {
   29252          return 0;
   29253       } else {
   29254          return 0;
   29255       }
   29256    default:
   29257       unreachable("Invalid hardware generation");
   29258    }
   29259 }
   29260 
   29261 
   29262 
   29263 /* 3DSTATE_GATHER_CONSTANT_PS::DWord Length */
   29264 
   29265 
   29266 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_DWordLength_bits  8
   29267 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_DWordLength_bits  8
   29268 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_DWordLength_bits  8
   29269 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_DWordLength_bits  8
   29270 
   29271 static inline uint32_t ATTRIBUTE_PURE
   29272 _3DSTATE_GATHER_CONSTANT_PS_DWordLength_bits(const struct gen_device_info *devinfo)
   29273 {
   29274    switch (devinfo->gen) {
   29275    case 10: return 8;
   29276    case 9: return 8;
   29277    case 8: return 8;
   29278    case 7:
   29279       if (devinfo->is_haswell) {
   29280          return 8;
   29281       } else {
   29282          return 0;
   29283       }
   29284    case 6: return 0;
   29285    case 5: return 0;
   29286    case 4:
   29287       if (devinfo->is_g4x) {
   29288          return 0;
   29289       } else {
   29290          return 0;
   29291       }
   29292    default:
   29293       unreachable("Invalid hardware generation");
   29294    }
   29295 }
   29296 
   29297 
   29298 
   29299 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_DWordLength_start  0
   29300 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_DWordLength_start  0
   29301 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_DWordLength_start  0
   29302 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_DWordLength_start  0
   29303 
   29304 static inline uint32_t ATTRIBUTE_PURE
   29305 _3DSTATE_GATHER_CONSTANT_PS_DWordLength_start(const struct gen_device_info *devinfo)
   29306 {
   29307    switch (devinfo->gen) {
   29308    case 10: return 0;
   29309    case 9: return 0;
   29310    case 8: return 0;
   29311    case 7:
   29312       if (devinfo->is_haswell) {
   29313          return 0;
   29314       } else {
   29315          return 0;
   29316       }
   29317    case 6: return 0;
   29318    case 5: return 0;
   29319    case 4:
   29320       if (devinfo->is_g4x) {
   29321          return 0;
   29322       } else {
   29323          return 0;
   29324       }
   29325    default:
   29326       unreachable("Invalid hardware generation");
   29327    }
   29328 }
   29329 
   29330 
   29331 
   29332 /* 3DSTATE_GATHER_CONSTANT_PS::DX9 On-Die Register Read Enable */
   29333 
   29334 
   29335 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_DX9OnDieRegisterReadEnable_bits  1
   29336 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_DX9OnDieRegisterReadEnable_bits  1
   29337 
   29338 static inline uint32_t ATTRIBUTE_PURE
   29339 _3DSTATE_GATHER_CONSTANT_PS_DX9OnDieRegisterReadEnable_bits(const struct gen_device_info *devinfo)
   29340 {
   29341    switch (devinfo->gen) {
   29342    case 10: return 1;
   29343    case 9: return 1;
   29344    case 8: return 0;
   29345    case 7:
   29346       if (devinfo->is_haswell) {
   29347          return 0;
   29348       } else {
   29349          return 0;
   29350       }
   29351    case 6: return 0;
   29352    case 5: return 0;
   29353    case 4:
   29354       if (devinfo->is_g4x) {
   29355          return 0;
   29356       } else {
   29357          return 0;
   29358       }
   29359    default:
   29360       unreachable("Invalid hardware generation");
   29361    }
   29362 }
   29363 
   29364 
   29365 
   29366 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_DX9OnDieRegisterReadEnable_start  32
   29367 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_DX9OnDieRegisterReadEnable_start  32
   29368 
   29369 static inline uint32_t ATTRIBUTE_PURE
   29370 _3DSTATE_GATHER_CONSTANT_PS_DX9OnDieRegisterReadEnable_start(const struct gen_device_info *devinfo)
   29371 {
   29372    switch (devinfo->gen) {
   29373    case 10: return 32;
   29374    case 9: return 32;
   29375    case 8: return 0;
   29376    case 7:
   29377       if (devinfo->is_haswell) {
   29378          return 0;
   29379       } else {
   29380          return 0;
   29381       }
   29382    case 6: return 0;
   29383    case 5: return 0;
   29384    case 4:
   29385       if (devinfo->is_g4x) {
   29386          return 0;
   29387       } else {
   29388          return 0;
   29389       }
   29390    default:
   29391       unreachable("Invalid hardware generation");
   29392    }
   29393 }
   29394 
   29395 
   29396 
   29397 /* 3DSTATE_GATHER_CONSTANT_PS::Entry_0 */
   29398 
   29399 
   29400 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_Entry_0_bits  16
   29401 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_Entry_0_bits  16
   29402 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_Entry_0_bits  16
   29403 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_Entry_0_bits  16
   29404 
   29405 static inline uint32_t ATTRIBUTE_PURE
   29406 _3DSTATE_GATHER_CONSTANT_PS_Entry_0_bits(const struct gen_device_info *devinfo)
   29407 {
   29408    switch (devinfo->gen) {
   29409    case 10: return 16;
   29410    case 9: return 16;
   29411    case 8: return 16;
   29412    case 7:
   29413       if (devinfo->is_haswell) {
   29414          return 16;
   29415       } else {
   29416          return 0;
   29417       }
   29418    case 6: return 0;
   29419    case 5: return 0;
   29420    case 4:
   29421       if (devinfo->is_g4x) {
   29422          return 0;
   29423       } else {
   29424          return 0;
   29425       }
   29426    default:
   29427       unreachable("Invalid hardware generation");
   29428    }
   29429 }
   29430 
   29431 
   29432 
   29433 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_Entry_0_start  0
   29434 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_Entry_0_start  0
   29435 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_Entry_0_start  0
   29436 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_Entry_0_start  0
   29437 
   29438 static inline uint32_t ATTRIBUTE_PURE
   29439 _3DSTATE_GATHER_CONSTANT_PS_Entry_0_start(const struct gen_device_info *devinfo)
   29440 {
   29441    switch (devinfo->gen) {
   29442    case 10: return 0;
   29443    case 9: return 0;
   29444    case 8: return 0;
   29445    case 7:
   29446       if (devinfo->is_haswell) {
   29447          return 0;
   29448       } else {
   29449          return 0;
   29450       }
   29451    case 6: return 0;
   29452    case 5: return 0;
   29453    case 4:
   29454       if (devinfo->is_g4x) {
   29455          return 0;
   29456       } else {
   29457          return 0;
   29458       }
   29459    default:
   29460       unreachable("Invalid hardware generation");
   29461    }
   29462 }
   29463 
   29464 
   29465 
   29466 /* 3DSTATE_GATHER_CONSTANT_PS::Entry_1 */
   29467 
   29468 
   29469 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_Entry_1_bits  16
   29470 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_Entry_1_bits  16
   29471 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_Entry_1_bits  16
   29472 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_Entry_1_bits  16
   29473 
   29474 static inline uint32_t ATTRIBUTE_PURE
   29475 _3DSTATE_GATHER_CONSTANT_PS_Entry_1_bits(const struct gen_device_info *devinfo)
   29476 {
   29477    switch (devinfo->gen) {
   29478    case 10: return 16;
   29479    case 9: return 16;
   29480    case 8: return 16;
   29481    case 7:
   29482       if (devinfo->is_haswell) {
   29483          return 16;
   29484       } else {
   29485          return 0;
   29486       }
   29487    case 6: return 0;
   29488    case 5: return 0;
   29489    case 4:
   29490       if (devinfo->is_g4x) {
   29491          return 0;
   29492       } else {
   29493          return 0;
   29494       }
   29495    default:
   29496       unreachable("Invalid hardware generation");
   29497    }
   29498 }
   29499 
   29500 
   29501 
   29502 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_Entry_1_start  16
   29503 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_Entry_1_start  16
   29504 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_Entry_1_start  16
   29505 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_Entry_1_start  16
   29506 
   29507 static inline uint32_t ATTRIBUTE_PURE
   29508 _3DSTATE_GATHER_CONSTANT_PS_Entry_1_start(const struct gen_device_info *devinfo)
   29509 {
   29510    switch (devinfo->gen) {
   29511    case 10: return 16;
   29512    case 9: return 16;
   29513    case 8: return 16;
   29514    case 7:
   29515       if (devinfo->is_haswell) {
   29516          return 16;
   29517       } else {
   29518          return 0;
   29519       }
   29520    case 6: return 0;
   29521    case 5: return 0;
   29522    case 4:
   29523       if (devinfo->is_g4x) {
   29524          return 0;
   29525       } else {
   29526          return 0;
   29527       }
   29528    default:
   29529       unreachable("Invalid hardware generation");
   29530    }
   29531 }
   29532 
   29533 
   29534 
   29535 /* 3DSTATE_GATHER_CONSTANT_PS::Gather Buffer Offset */
   29536 
   29537 
   29538 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_bits  17
   29539 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_bits  17
   29540 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_bits  17
   29541 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_bits  17
   29542 
   29543 static inline uint32_t ATTRIBUTE_PURE
   29544 _3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_bits(const struct gen_device_info *devinfo)
   29545 {
   29546    switch (devinfo->gen) {
   29547    case 10: return 17;
   29548    case 9: return 17;
   29549    case 8: return 17;
   29550    case 7:
   29551       if (devinfo->is_haswell) {
   29552          return 17;
   29553       } else {
   29554          return 0;
   29555       }
   29556    case 6: return 0;
   29557    case 5: return 0;
   29558    case 4:
   29559       if (devinfo->is_g4x) {
   29560          return 0;
   29561       } else {
   29562          return 0;
   29563       }
   29564    default:
   29565       unreachable("Invalid hardware generation");
   29566    }
   29567 }
   29568 
   29569 
   29570 
   29571 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_start  70
   29572 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_start  70
   29573 #define GEN8_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_start  70
   29574 #define GEN75_3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_start  70
   29575 
   29576 static inline uint32_t ATTRIBUTE_PURE
   29577 _3DSTATE_GATHER_CONSTANT_PS_GatherBufferOffset_start(const struct gen_device_info *devinfo)
   29578 {
   29579    switch (devinfo->gen) {
   29580    case 10: return 70;
   29581    case 9: return 70;
   29582    case 8: return 70;
   29583    case 7:
   29584       if (devinfo->is_haswell) {
   29585          return 70;
   29586       } else {
   29587          return 0;
   29588       }
   29589    case 6: return 0;
   29590    case 5: return 0;
   29591    case 4:
   29592       if (devinfo->is_g4x) {
   29593          return 0;
   29594       } else {
   29595          return 0;
   29596       }
   29597    default:
   29598       unreachable("Invalid hardware generation");
   29599    }
   29600 }
   29601 
   29602 
   29603 
   29604 /* 3DSTATE_GATHER_CONSTANT_PS::On-Die Table */
   29605 
   29606 
   29607 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_OnDieTable_bits  1
   29608 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_OnDieTable_bits  1
   29609 
   29610 static inline uint32_t ATTRIBUTE_PURE
   29611 _3DSTATE_GATHER_CONSTANT_PS_OnDieTable_bits(const struct gen_device_info *devinfo)
   29612 {
   29613    switch (devinfo->gen) {
   29614    case 10: return 1;
   29615    case 9: return 1;
   29616    case 8: return 0;
   29617    case 7:
   29618       if (devinfo->is_haswell) {
   29619          return 0;
   29620       } else {
   29621          return 0;
   29622       }
   29623    case 6: return 0;
   29624    case 5: return 0;
   29625    case 4:
   29626       if (devinfo->is_g4x) {
   29627          return 0;
   29628       } else {
   29629          return 0;
   29630       }
   29631    default:
   29632       unreachable("Invalid hardware generation");
   29633    }
   29634 }
   29635 
   29636 
   29637 
   29638 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_OnDieTable_start  67
   29639 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_OnDieTable_start  67
   29640 
   29641 static inline uint32_t ATTRIBUTE_PURE
   29642 _3DSTATE_GATHER_CONSTANT_PS_OnDieTable_start(const struct gen_device_info *devinfo)
   29643 {
   29644    switch (devinfo->gen) {
   29645    case 10: return 67;
   29646    case 9: return 67;
   29647    case 8: return 0;
   29648    case 7:
   29649       if (devinfo->is_haswell) {
   29650          return 0;
   29651       } else {
   29652          return 0;
   29653       }
   29654    case 6: return 0;
   29655    case 5: return 0;
   29656    case 4:
   29657       if (devinfo->is_g4x) {
   29658          return 0;
   29659       } else {
   29660          return 0;
   29661       }
   29662    default:
   29663       unreachable("Invalid hardware generation");
   29664    }
   29665 }
   29666 
   29667 
   29668 
   29669 /* 3DSTATE_GATHER_CONSTANT_PS::Update Gather Table Only */
   29670 
   29671 
   29672 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_UpdateGatherTableOnly_bits  1
   29673 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_UpdateGatherTableOnly_bits  1
   29674 
   29675 static inline uint32_t ATTRIBUTE_PURE
   29676 _3DSTATE_GATHER_CONSTANT_PS_UpdateGatherTableOnly_bits(const struct gen_device_info *devinfo)
   29677 {
   29678    switch (devinfo->gen) {
   29679    case 10: return 1;
   29680    case 9: return 1;
   29681    case 8: return 0;
   29682    case 7:
   29683       if (devinfo->is_haswell) {
   29684          return 0;
   29685       } else {
   29686          return 0;
   29687       }
   29688    case 6: return 0;
   29689    case 5: return 0;
   29690    case 4:
   29691       if (devinfo->is_g4x) {
   29692          return 0;
   29693       } else {
   29694          return 0;
   29695       }
   29696    default:
   29697       unreachable("Invalid hardware generation");
   29698    }
   29699 }
   29700 
   29701 
   29702 
   29703 #define GEN10_3DSTATE_GATHER_CONSTANT_PS_UpdateGatherTableOnly_start  33
   29704 #define GEN9_3DSTATE_GATHER_CONSTANT_PS_UpdateGatherTableOnly_start  33
   29705 
   29706 static inline uint32_t ATTRIBUTE_PURE
   29707 _3DSTATE_GATHER_CONSTANT_PS_UpdateGatherTableOnly_start(const struct gen_device_info *devinfo)
   29708 {
   29709    switch (devinfo->gen) {
   29710    case 10: return 33;
   29711    case 9: return 33;
   29712    case 8: return 0;
   29713    case 7:
   29714       if (devinfo->is_haswell) {
   29715          return 0;
   29716       } else {
   29717          return 0;
   29718       }
   29719    case 6: return 0;
   29720    case 5: return 0;
   29721    case 4:
   29722       if (devinfo->is_g4x) {
   29723          return 0;
   29724       } else {
   29725          return 0;
   29726       }
   29727    default:
   29728       unreachable("Invalid hardware generation");
   29729    }
   29730 }
   29731 
   29732 
   29733 
   29734 /* 3DSTATE_GATHER_CONSTANT_VS */
   29735 
   29736 
   29737 
   29738 
   29739 
   29740 /* 3DSTATE_GATHER_CONSTANT_VS::3D Command Opcode */
   29741 
   29742 
   29743 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_bits  3
   29744 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_bits  3
   29745 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_bits  3
   29746 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_bits  3
   29747 
   29748 static inline uint32_t ATTRIBUTE_PURE
   29749 _3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   29750 {
   29751    switch (devinfo->gen) {
   29752    case 10: return 3;
   29753    case 9: return 3;
   29754    case 8: return 3;
   29755    case 7:
   29756       if (devinfo->is_haswell) {
   29757          return 3;
   29758       } else {
   29759          return 0;
   29760       }
   29761    case 6: return 0;
   29762    case 5: return 0;
   29763    case 4:
   29764       if (devinfo->is_g4x) {
   29765          return 0;
   29766       } else {
   29767          return 0;
   29768       }
   29769    default:
   29770       unreachable("Invalid hardware generation");
   29771    }
   29772 }
   29773 
   29774 
   29775 
   29776 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_start  24
   29777 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_start  24
   29778 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_start  24
   29779 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_start  24
   29780 
   29781 static inline uint32_t ATTRIBUTE_PURE
   29782 _3DSTATE_GATHER_CONSTANT_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   29783 {
   29784    switch (devinfo->gen) {
   29785    case 10: return 24;
   29786    case 9: return 24;
   29787    case 8: return 24;
   29788    case 7:
   29789       if (devinfo->is_haswell) {
   29790          return 24;
   29791       } else {
   29792          return 0;
   29793       }
   29794    case 6: return 0;
   29795    case 5: return 0;
   29796    case 4:
   29797       if (devinfo->is_g4x) {
   29798          return 0;
   29799       } else {
   29800          return 0;
   29801       }
   29802    default:
   29803       unreachable("Invalid hardware generation");
   29804    }
   29805 }
   29806 
   29807 
   29808 
   29809 /* 3DSTATE_GATHER_CONSTANT_VS::3D Command Sub Opcode */
   29810 
   29811 
   29812 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_bits  8
   29813 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_bits  8
   29814 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_bits  8
   29815 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_bits  8
   29816 
   29817 static inline uint32_t ATTRIBUTE_PURE
   29818 _3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   29819 {
   29820    switch (devinfo->gen) {
   29821    case 10: return 8;
   29822    case 9: return 8;
   29823    case 8: return 8;
   29824    case 7:
   29825       if (devinfo->is_haswell) {
   29826          return 8;
   29827       } else {
   29828          return 0;
   29829       }
   29830    case 6: return 0;
   29831    case 5: return 0;
   29832    case 4:
   29833       if (devinfo->is_g4x) {
   29834          return 0;
   29835       } else {
   29836          return 0;
   29837       }
   29838    default:
   29839       unreachable("Invalid hardware generation");
   29840    }
   29841 }
   29842 
   29843 
   29844 
   29845 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_start  16
   29846 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_start  16
   29847 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_start  16
   29848 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_start  16
   29849 
   29850 static inline uint32_t ATTRIBUTE_PURE
   29851 _3DSTATE_GATHER_CONSTANT_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   29852 {
   29853    switch (devinfo->gen) {
   29854    case 10: return 16;
   29855    case 9: return 16;
   29856    case 8: return 16;
   29857    case 7:
   29858       if (devinfo->is_haswell) {
   29859          return 16;
   29860       } else {
   29861          return 0;
   29862       }
   29863    case 6: return 0;
   29864    case 5: return 0;
   29865    case 4:
   29866       if (devinfo->is_g4x) {
   29867          return 0;
   29868       } else {
   29869          return 0;
   29870       }
   29871    default:
   29872       unreachable("Invalid hardware generation");
   29873    }
   29874 }
   29875 
   29876 
   29877 
   29878 /* 3DSTATE_GATHER_CONSTANT_VS::Command SubType */
   29879 
   29880 
   29881 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_bits  2
   29882 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_bits  2
   29883 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_bits  2
   29884 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_bits  2
   29885 
   29886 static inline uint32_t ATTRIBUTE_PURE
   29887 _3DSTATE_GATHER_CONSTANT_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   29888 {
   29889    switch (devinfo->gen) {
   29890    case 10: return 2;
   29891    case 9: return 2;
   29892    case 8: return 2;
   29893    case 7:
   29894       if (devinfo->is_haswell) {
   29895          return 2;
   29896       } else {
   29897          return 0;
   29898       }
   29899    case 6: return 0;
   29900    case 5: return 0;
   29901    case 4:
   29902       if (devinfo->is_g4x) {
   29903          return 0;
   29904       } else {
   29905          return 0;
   29906       }
   29907    default:
   29908       unreachable("Invalid hardware generation");
   29909    }
   29910 }
   29911 
   29912 
   29913 
   29914 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_start  27
   29915 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_start  27
   29916 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_start  27
   29917 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_CommandSubType_start  27
   29918 
   29919 static inline uint32_t ATTRIBUTE_PURE
   29920 _3DSTATE_GATHER_CONSTANT_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   29921 {
   29922    switch (devinfo->gen) {
   29923    case 10: return 27;
   29924    case 9: return 27;
   29925    case 8: return 27;
   29926    case 7:
   29927       if (devinfo->is_haswell) {
   29928          return 27;
   29929       } else {
   29930          return 0;
   29931       }
   29932    case 6: return 0;
   29933    case 5: return 0;
   29934    case 4:
   29935       if (devinfo->is_g4x) {
   29936          return 0;
   29937       } else {
   29938          return 0;
   29939       }
   29940    default:
   29941       unreachable("Invalid hardware generation");
   29942    }
   29943 }
   29944 
   29945 
   29946 
   29947 /* 3DSTATE_GATHER_CONSTANT_VS::Command Type */
   29948 
   29949 
   29950 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_CommandType_bits  3
   29951 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_CommandType_bits  3
   29952 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_CommandType_bits  3
   29953 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_CommandType_bits  3
   29954 
   29955 static inline uint32_t ATTRIBUTE_PURE
   29956 _3DSTATE_GATHER_CONSTANT_VS_CommandType_bits(const struct gen_device_info *devinfo)
   29957 {
   29958    switch (devinfo->gen) {
   29959    case 10: return 3;
   29960    case 9: return 3;
   29961    case 8: return 3;
   29962    case 7:
   29963       if (devinfo->is_haswell) {
   29964          return 3;
   29965       } else {
   29966          return 0;
   29967       }
   29968    case 6: return 0;
   29969    case 5: return 0;
   29970    case 4:
   29971       if (devinfo->is_g4x) {
   29972          return 0;
   29973       } else {
   29974          return 0;
   29975       }
   29976    default:
   29977       unreachable("Invalid hardware generation");
   29978    }
   29979 }
   29980 
   29981 
   29982 
   29983 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_CommandType_start  29
   29984 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_CommandType_start  29
   29985 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_CommandType_start  29
   29986 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_CommandType_start  29
   29987 
   29988 static inline uint32_t ATTRIBUTE_PURE
   29989 _3DSTATE_GATHER_CONSTANT_VS_CommandType_start(const struct gen_device_info *devinfo)
   29990 {
   29991    switch (devinfo->gen) {
   29992    case 10: return 29;
   29993    case 9: return 29;
   29994    case 8: return 29;
   29995    case 7:
   29996       if (devinfo->is_haswell) {
   29997          return 29;
   29998       } else {
   29999          return 0;
   30000       }
   30001    case 6: return 0;
   30002    case 5: return 0;
   30003    case 4:
   30004       if (devinfo->is_g4x) {
   30005          return 0;
   30006       } else {
   30007          return 0;
   30008       }
   30009    default:
   30010       unreachable("Invalid hardware generation");
   30011    }
   30012 }
   30013 
   30014 
   30015 
   30016 /* 3DSTATE_GATHER_CONSTANT_VS::Constant Buffer Binding Table Block */
   30017 
   30018 
   30019 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_bits  4
   30020 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_bits  4
   30021 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_bits  4
   30022 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_bits  4
   30023 
   30024 static inline uint32_t ATTRIBUTE_PURE
   30025 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_bits(const struct gen_device_info *devinfo)
   30026 {
   30027    switch (devinfo->gen) {
   30028    case 10: return 4;
   30029    case 9: return 4;
   30030    case 8: return 4;
   30031    case 7:
   30032       if (devinfo->is_haswell) {
   30033          return 4;
   30034       } else {
   30035          return 0;
   30036       }
   30037    case 6: return 0;
   30038    case 5: return 0;
   30039    case 4:
   30040       if (devinfo->is_g4x) {
   30041          return 0;
   30042       } else {
   30043          return 0;
   30044       }
   30045    default:
   30046       unreachable("Invalid hardware generation");
   30047    }
   30048 }
   30049 
   30050 
   30051 
   30052 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_start  44
   30053 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_start  44
   30054 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_start  44
   30055 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_start  44
   30056 
   30057 static inline uint32_t ATTRIBUTE_PURE
   30058 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferBindingTableBlock_start(const struct gen_device_info *devinfo)
   30059 {
   30060    switch (devinfo->gen) {
   30061    case 10: return 44;
   30062    case 9: return 44;
   30063    case 8: return 44;
   30064    case 7:
   30065       if (devinfo->is_haswell) {
   30066          return 44;
   30067       } else {
   30068          return 0;
   30069       }
   30070    case 6: return 0;
   30071    case 5: return 0;
   30072    case 4:
   30073       if (devinfo->is_g4x) {
   30074          return 0;
   30075       } else {
   30076          return 0;
   30077       }
   30078    default:
   30079       unreachable("Invalid hardware generation");
   30080    }
   30081 }
   30082 
   30083 
   30084 
   30085 /* 3DSTATE_GATHER_CONSTANT_VS::Constant Buffer Dx9 Enable */
   30086 
   30087 
   30088 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_bits  1
   30089 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_bits  1
   30090 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_bits  1
   30091 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_bits  1
   30092 
   30093 static inline uint32_t ATTRIBUTE_PURE
   30094 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_bits(const struct gen_device_info *devinfo)
   30095 {
   30096    switch (devinfo->gen) {
   30097    case 10: return 1;
   30098    case 9: return 1;
   30099    case 8: return 1;
   30100    case 7:
   30101       if (devinfo->is_haswell) {
   30102          return 1;
   30103       } else {
   30104          return 0;
   30105       }
   30106    case 6: return 0;
   30107    case 5: return 0;
   30108    case 4:
   30109       if (devinfo->is_g4x) {
   30110          return 0;
   30111       } else {
   30112          return 0;
   30113       }
   30114    default:
   30115       unreachable("Invalid hardware generation");
   30116    }
   30117 }
   30118 
   30119 
   30120 
   30121 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_start  68
   30122 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_start  68
   30123 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_start  68
   30124 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_start  68
   30125 
   30126 static inline uint32_t ATTRIBUTE_PURE
   30127 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9Enable_start(const struct gen_device_info *devinfo)
   30128 {
   30129    switch (devinfo->gen) {
   30130    case 10: return 68;
   30131    case 9: return 68;
   30132    case 8: return 68;
   30133    case 7:
   30134       if (devinfo->is_haswell) {
   30135          return 68;
   30136       } else {
   30137          return 0;
   30138       }
   30139    case 6: return 0;
   30140    case 5: return 0;
   30141    case 4:
   30142       if (devinfo->is_g4x) {
   30143          return 0;
   30144       } else {
   30145          return 0;
   30146       }
   30147    default:
   30148       unreachable("Invalid hardware generation");
   30149    }
   30150 }
   30151 
   30152 
   30153 
   30154 /* 3DSTATE_GATHER_CONSTANT_VS::Constant Buffer Dx9 Generate Stall */
   30155 
   30156 
   30157 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_bits  1
   30158 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_bits  1
   30159 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_bits  1
   30160 
   30161 static inline uint32_t ATTRIBUTE_PURE
   30162 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_bits(const struct gen_device_info *devinfo)
   30163 {
   30164    switch (devinfo->gen) {
   30165    case 10: return 1;
   30166    case 9: return 1;
   30167    case 8: return 1;
   30168    case 7:
   30169       if (devinfo->is_haswell) {
   30170          return 0;
   30171       } else {
   30172          return 0;
   30173       }
   30174    case 6: return 0;
   30175    case 5: return 0;
   30176    case 4:
   30177       if (devinfo->is_g4x) {
   30178          return 0;
   30179       } else {
   30180          return 0;
   30181       }
   30182    default:
   30183       unreachable("Invalid hardware generation");
   30184    }
   30185 }
   30186 
   30187 
   30188 
   30189 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_start  69
   30190 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_start  69
   30191 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_start  69
   30192 
   30193 static inline uint32_t ATTRIBUTE_PURE
   30194 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferDx9GenerateStall_start(const struct gen_device_info *devinfo)
   30195 {
   30196    switch (devinfo->gen) {
   30197    case 10: return 69;
   30198    case 9: return 69;
   30199    case 8: return 69;
   30200    case 7:
   30201       if (devinfo->is_haswell) {
   30202          return 0;
   30203       } else {
   30204          return 0;
   30205       }
   30206    case 6: return 0;
   30207    case 5: return 0;
   30208    case 4:
   30209       if (devinfo->is_g4x) {
   30210          return 0;
   30211       } else {
   30212          return 0;
   30213       }
   30214    default:
   30215       unreachable("Invalid hardware generation");
   30216    }
   30217 }
   30218 
   30219 
   30220 
   30221 /* 3DSTATE_GATHER_CONSTANT_VS::Constant Buffer Valid */
   30222 
   30223 
   30224 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_bits  16
   30225 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_bits  16
   30226 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_bits  16
   30227 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_bits  16
   30228 
   30229 static inline uint32_t ATTRIBUTE_PURE
   30230 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_bits(const struct gen_device_info *devinfo)
   30231 {
   30232    switch (devinfo->gen) {
   30233    case 10: return 16;
   30234    case 9: return 16;
   30235    case 8: return 16;
   30236    case 7:
   30237       if (devinfo->is_haswell) {
   30238          return 16;
   30239       } else {
   30240          return 0;
   30241       }
   30242    case 6: return 0;
   30243    case 5: return 0;
   30244    case 4:
   30245       if (devinfo->is_g4x) {
   30246          return 0;
   30247       } else {
   30248          return 0;
   30249       }
   30250    default:
   30251       unreachable("Invalid hardware generation");
   30252    }
   30253 }
   30254 
   30255 
   30256 
   30257 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_start  48
   30258 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_start  48
   30259 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_start  48
   30260 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_start  48
   30261 
   30262 static inline uint32_t ATTRIBUTE_PURE
   30263 _3DSTATE_GATHER_CONSTANT_VS_ConstantBufferValid_start(const struct gen_device_info *devinfo)
   30264 {
   30265    switch (devinfo->gen) {
   30266    case 10: return 48;
   30267    case 9: return 48;
   30268    case 8: return 48;
   30269    case 7:
   30270       if (devinfo->is_haswell) {
   30271          return 48;
   30272       } else {
   30273          return 0;
   30274       }
   30275    case 6: return 0;
   30276    case 5: return 0;
   30277    case 4:
   30278       if (devinfo->is_g4x) {
   30279          return 0;
   30280       } else {
   30281          return 0;
   30282       }
   30283    default:
   30284       unreachable("Invalid hardware generation");
   30285    }
   30286 }
   30287 
   30288 
   30289 
   30290 /* 3DSTATE_GATHER_CONSTANT_VS::DWord Length */
   30291 
   30292 
   30293 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_DWordLength_bits  8
   30294 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_DWordLength_bits  8
   30295 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_DWordLength_bits  8
   30296 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_DWordLength_bits  8
   30297 
   30298 static inline uint32_t ATTRIBUTE_PURE
   30299 _3DSTATE_GATHER_CONSTANT_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   30300 {
   30301    switch (devinfo->gen) {
   30302    case 10: return 8;
   30303    case 9: return 8;
   30304    case 8: return 8;
   30305    case 7:
   30306       if (devinfo->is_haswell) {
   30307          return 8;
   30308       } else {
   30309          return 0;
   30310       }
   30311    case 6: return 0;
   30312    case 5: return 0;
   30313    case 4:
   30314       if (devinfo->is_g4x) {
   30315          return 0;
   30316       } else {
   30317          return 0;
   30318       }
   30319    default:
   30320       unreachable("Invalid hardware generation");
   30321    }
   30322 }
   30323 
   30324 
   30325 
   30326 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_DWordLength_start  0
   30327 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_DWordLength_start  0
   30328 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_DWordLength_start  0
   30329 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_DWordLength_start  0
   30330 
   30331 static inline uint32_t ATTRIBUTE_PURE
   30332 _3DSTATE_GATHER_CONSTANT_VS_DWordLength_start(const struct gen_device_info *devinfo)
   30333 {
   30334    switch (devinfo->gen) {
   30335    case 10: return 0;
   30336    case 9: return 0;
   30337    case 8: return 0;
   30338    case 7:
   30339       if (devinfo->is_haswell) {
   30340          return 0;
   30341       } else {
   30342          return 0;
   30343       }
   30344    case 6: return 0;
   30345    case 5: return 0;
   30346    case 4:
   30347       if (devinfo->is_g4x) {
   30348          return 0;
   30349       } else {
   30350          return 0;
   30351       }
   30352    default:
   30353       unreachable("Invalid hardware generation");
   30354    }
   30355 }
   30356 
   30357 
   30358 
   30359 /* 3DSTATE_GATHER_CONSTANT_VS::DX9 On-Die Register Read Enable */
   30360 
   30361 
   30362 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_DX9OnDieRegisterReadEnable_bits  1
   30363 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_DX9OnDieRegisterReadEnable_bits  1
   30364 
   30365 static inline uint32_t ATTRIBUTE_PURE
   30366 _3DSTATE_GATHER_CONSTANT_VS_DX9OnDieRegisterReadEnable_bits(const struct gen_device_info *devinfo)
   30367 {
   30368    switch (devinfo->gen) {
   30369    case 10: return 1;
   30370    case 9: return 1;
   30371    case 8: return 0;
   30372    case 7:
   30373       if (devinfo->is_haswell) {
   30374          return 0;
   30375       } else {
   30376          return 0;
   30377       }
   30378    case 6: return 0;
   30379    case 5: return 0;
   30380    case 4:
   30381       if (devinfo->is_g4x) {
   30382          return 0;
   30383       } else {
   30384          return 0;
   30385       }
   30386    default:
   30387       unreachable("Invalid hardware generation");
   30388    }
   30389 }
   30390 
   30391 
   30392 
   30393 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_DX9OnDieRegisterReadEnable_start  32
   30394 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_DX9OnDieRegisterReadEnable_start  32
   30395 
   30396 static inline uint32_t ATTRIBUTE_PURE
   30397 _3DSTATE_GATHER_CONSTANT_VS_DX9OnDieRegisterReadEnable_start(const struct gen_device_info *devinfo)
   30398 {
   30399    switch (devinfo->gen) {
   30400    case 10: return 32;
   30401    case 9: return 32;
   30402    case 8: return 0;
   30403    case 7:
   30404       if (devinfo->is_haswell) {
   30405          return 0;
   30406       } else {
   30407          return 0;
   30408       }
   30409    case 6: return 0;
   30410    case 5: return 0;
   30411    case 4:
   30412       if (devinfo->is_g4x) {
   30413          return 0;
   30414       } else {
   30415          return 0;
   30416       }
   30417    default:
   30418       unreachable("Invalid hardware generation");
   30419    }
   30420 }
   30421 
   30422 
   30423 
   30424 /* 3DSTATE_GATHER_CONSTANT_VS::Entry_0 */
   30425 
   30426 
   30427 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_Entry_0_bits  16
   30428 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_Entry_0_bits  16
   30429 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_Entry_0_bits  16
   30430 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_Entry_0_bits  16
   30431 
   30432 static inline uint32_t ATTRIBUTE_PURE
   30433 _3DSTATE_GATHER_CONSTANT_VS_Entry_0_bits(const struct gen_device_info *devinfo)
   30434 {
   30435    switch (devinfo->gen) {
   30436    case 10: return 16;
   30437    case 9: return 16;
   30438    case 8: return 16;
   30439    case 7:
   30440       if (devinfo->is_haswell) {
   30441          return 16;
   30442       } else {
   30443          return 0;
   30444       }
   30445    case 6: return 0;
   30446    case 5: return 0;
   30447    case 4:
   30448       if (devinfo->is_g4x) {
   30449          return 0;
   30450       } else {
   30451          return 0;
   30452       }
   30453    default:
   30454       unreachable("Invalid hardware generation");
   30455    }
   30456 }
   30457 
   30458 
   30459 
   30460 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_Entry_0_start  0
   30461 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_Entry_0_start  0
   30462 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_Entry_0_start  0
   30463 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_Entry_0_start  0
   30464 
   30465 static inline uint32_t ATTRIBUTE_PURE
   30466 _3DSTATE_GATHER_CONSTANT_VS_Entry_0_start(const struct gen_device_info *devinfo)
   30467 {
   30468    switch (devinfo->gen) {
   30469    case 10: return 0;
   30470    case 9: return 0;
   30471    case 8: return 0;
   30472    case 7:
   30473       if (devinfo->is_haswell) {
   30474          return 0;
   30475       } else {
   30476          return 0;
   30477       }
   30478    case 6: return 0;
   30479    case 5: return 0;
   30480    case 4:
   30481       if (devinfo->is_g4x) {
   30482          return 0;
   30483       } else {
   30484          return 0;
   30485       }
   30486    default:
   30487       unreachable("Invalid hardware generation");
   30488    }
   30489 }
   30490 
   30491 
   30492 
   30493 /* 3DSTATE_GATHER_CONSTANT_VS::Entry_1 */
   30494 
   30495 
   30496 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_Entry_1_bits  16
   30497 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_Entry_1_bits  16
   30498 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_Entry_1_bits  16
   30499 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_Entry_1_bits  16
   30500 
   30501 static inline uint32_t ATTRIBUTE_PURE
   30502 _3DSTATE_GATHER_CONSTANT_VS_Entry_1_bits(const struct gen_device_info *devinfo)
   30503 {
   30504    switch (devinfo->gen) {
   30505    case 10: return 16;
   30506    case 9: return 16;
   30507    case 8: return 16;
   30508    case 7:
   30509       if (devinfo->is_haswell) {
   30510          return 16;
   30511       } else {
   30512          return 0;
   30513       }
   30514    case 6: return 0;
   30515    case 5: return 0;
   30516    case 4:
   30517       if (devinfo->is_g4x) {
   30518          return 0;
   30519       } else {
   30520          return 0;
   30521       }
   30522    default:
   30523       unreachable("Invalid hardware generation");
   30524    }
   30525 }
   30526 
   30527 
   30528 
   30529 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_Entry_1_start  16
   30530 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_Entry_1_start  16
   30531 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_Entry_1_start  16
   30532 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_Entry_1_start  16
   30533 
   30534 static inline uint32_t ATTRIBUTE_PURE
   30535 _3DSTATE_GATHER_CONSTANT_VS_Entry_1_start(const struct gen_device_info *devinfo)
   30536 {
   30537    switch (devinfo->gen) {
   30538    case 10: return 16;
   30539    case 9: return 16;
   30540    case 8: return 16;
   30541    case 7:
   30542       if (devinfo->is_haswell) {
   30543          return 16;
   30544       } else {
   30545          return 0;
   30546       }
   30547    case 6: return 0;
   30548    case 5: return 0;
   30549    case 4:
   30550       if (devinfo->is_g4x) {
   30551          return 0;
   30552       } else {
   30553          return 0;
   30554       }
   30555    default:
   30556       unreachable("Invalid hardware generation");
   30557    }
   30558 }
   30559 
   30560 
   30561 
   30562 /* 3DSTATE_GATHER_CONSTANT_VS::Gather Buffer Offset */
   30563 
   30564 
   30565 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_bits  17
   30566 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_bits  17
   30567 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_bits  17
   30568 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_bits  17
   30569 
   30570 static inline uint32_t ATTRIBUTE_PURE
   30571 _3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_bits(const struct gen_device_info *devinfo)
   30572 {
   30573    switch (devinfo->gen) {
   30574    case 10: return 17;
   30575    case 9: return 17;
   30576    case 8: return 17;
   30577    case 7:
   30578       if (devinfo->is_haswell) {
   30579          return 17;
   30580       } else {
   30581          return 0;
   30582       }
   30583    case 6: return 0;
   30584    case 5: return 0;
   30585    case 4:
   30586       if (devinfo->is_g4x) {
   30587          return 0;
   30588       } else {
   30589          return 0;
   30590       }
   30591    default:
   30592       unreachable("Invalid hardware generation");
   30593    }
   30594 }
   30595 
   30596 
   30597 
   30598 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_start  70
   30599 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_start  70
   30600 #define GEN8_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_start  70
   30601 #define GEN75_3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_start  70
   30602 
   30603 static inline uint32_t ATTRIBUTE_PURE
   30604 _3DSTATE_GATHER_CONSTANT_VS_GatherBufferOffset_start(const struct gen_device_info *devinfo)
   30605 {
   30606    switch (devinfo->gen) {
   30607    case 10: return 70;
   30608    case 9: return 70;
   30609    case 8: return 70;
   30610    case 7:
   30611       if (devinfo->is_haswell) {
   30612          return 70;
   30613       } else {
   30614          return 0;
   30615       }
   30616    case 6: return 0;
   30617    case 5: return 0;
   30618    case 4:
   30619       if (devinfo->is_g4x) {
   30620          return 0;
   30621       } else {
   30622          return 0;
   30623       }
   30624    default:
   30625       unreachable("Invalid hardware generation");
   30626    }
   30627 }
   30628 
   30629 
   30630 
   30631 /* 3DSTATE_GATHER_CONSTANT_VS::On-Die Table */
   30632 
   30633 
   30634 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_OnDieTable_bits  1
   30635 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_OnDieTable_bits  1
   30636 
   30637 static inline uint32_t ATTRIBUTE_PURE
   30638 _3DSTATE_GATHER_CONSTANT_VS_OnDieTable_bits(const struct gen_device_info *devinfo)
   30639 {
   30640    switch (devinfo->gen) {
   30641    case 10: return 1;
   30642    case 9: return 1;
   30643    case 8: return 0;
   30644    case 7:
   30645       if (devinfo->is_haswell) {
   30646          return 0;
   30647       } else {
   30648          return 0;
   30649       }
   30650    case 6: return 0;
   30651    case 5: return 0;
   30652    case 4:
   30653       if (devinfo->is_g4x) {
   30654          return 0;
   30655       } else {
   30656          return 0;
   30657       }
   30658    default:
   30659       unreachable("Invalid hardware generation");
   30660    }
   30661 }
   30662 
   30663 
   30664 
   30665 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_OnDieTable_start  67
   30666 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_OnDieTable_start  67
   30667 
   30668 static inline uint32_t ATTRIBUTE_PURE
   30669 _3DSTATE_GATHER_CONSTANT_VS_OnDieTable_start(const struct gen_device_info *devinfo)
   30670 {
   30671    switch (devinfo->gen) {
   30672    case 10: return 67;
   30673    case 9: return 67;
   30674    case 8: return 0;
   30675    case 7:
   30676       if (devinfo->is_haswell) {
   30677          return 0;
   30678       } else {
   30679          return 0;
   30680       }
   30681    case 6: return 0;
   30682    case 5: return 0;
   30683    case 4:
   30684       if (devinfo->is_g4x) {
   30685          return 0;
   30686       } else {
   30687          return 0;
   30688       }
   30689    default:
   30690       unreachable("Invalid hardware generation");
   30691    }
   30692 }
   30693 
   30694 
   30695 
   30696 /* 3DSTATE_GATHER_CONSTANT_VS::Update Gather Table Only */
   30697 
   30698 
   30699 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_UpdateGatherTableOnly_bits  1
   30700 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_UpdateGatherTableOnly_bits  1
   30701 
   30702 static inline uint32_t ATTRIBUTE_PURE
   30703 _3DSTATE_GATHER_CONSTANT_VS_UpdateGatherTableOnly_bits(const struct gen_device_info *devinfo)
   30704 {
   30705    switch (devinfo->gen) {
   30706    case 10: return 1;
   30707    case 9: return 1;
   30708    case 8: return 0;
   30709    case 7:
   30710       if (devinfo->is_haswell) {
   30711          return 0;
   30712       } else {
   30713          return 0;
   30714       }
   30715    case 6: return 0;
   30716    case 5: return 0;
   30717    case 4:
   30718       if (devinfo->is_g4x) {
   30719          return 0;
   30720       } else {
   30721          return 0;
   30722       }
   30723    default:
   30724       unreachable("Invalid hardware generation");
   30725    }
   30726 }
   30727 
   30728 
   30729 
   30730 #define GEN10_3DSTATE_GATHER_CONSTANT_VS_UpdateGatherTableOnly_start  33
   30731 #define GEN9_3DSTATE_GATHER_CONSTANT_VS_UpdateGatherTableOnly_start  33
   30732 
   30733 static inline uint32_t ATTRIBUTE_PURE
   30734 _3DSTATE_GATHER_CONSTANT_VS_UpdateGatherTableOnly_start(const struct gen_device_info *devinfo)
   30735 {
   30736    switch (devinfo->gen) {
   30737    case 10: return 33;
   30738    case 9: return 33;
   30739    case 8: return 0;
   30740    case 7:
   30741       if (devinfo->is_haswell) {
   30742          return 0;
   30743       } else {
   30744          return 0;
   30745       }
   30746    case 6: return 0;
   30747    case 5: return 0;
   30748    case 4:
   30749       if (devinfo->is_g4x) {
   30750          return 0;
   30751       } else {
   30752          return 0;
   30753       }
   30754    default:
   30755       unreachable("Invalid hardware generation");
   30756    }
   30757 }
   30758 
   30759 
   30760 
   30761 /* 3DSTATE_GATHER_POOL_ALLOC */
   30762 
   30763 
   30764 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_length  4
   30765 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_length  4
   30766 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_length  4
   30767 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_length  3
   30768 
   30769 static inline uint32_t ATTRIBUTE_PURE
   30770 _3DSTATE_GATHER_POOL_ALLOC_length(const struct gen_device_info *devinfo)
   30771 {
   30772    switch (devinfo->gen) {
   30773    case 10: return 4;
   30774    case 9: return 4;
   30775    case 8: return 4;
   30776    case 7:
   30777       if (devinfo->is_haswell) {
   30778          return 3;
   30779       } else {
   30780          return 0;
   30781       }
   30782    case 6: return 0;
   30783    case 5: return 0;
   30784    case 4:
   30785       if (devinfo->is_g4x) {
   30786          return 0;
   30787       } else {
   30788          return 0;
   30789       }
   30790    default:
   30791       unreachable("Invalid hardware generation");
   30792    }
   30793 }
   30794 
   30795 
   30796 
   30797 /* 3DSTATE_GATHER_POOL_ALLOC::3D Command Opcode */
   30798 
   30799 
   30800 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_bits  3
   30801 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_bits  3
   30802 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_bits  3
   30803 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_bits  3
   30804 
   30805 static inline uint32_t ATTRIBUTE_PURE
   30806 _3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   30807 {
   30808    switch (devinfo->gen) {
   30809    case 10: return 3;
   30810    case 9: return 3;
   30811    case 8: return 3;
   30812    case 7:
   30813       if (devinfo->is_haswell) {
   30814          return 3;
   30815       } else {
   30816          return 0;
   30817       }
   30818    case 6: return 0;
   30819    case 5: return 0;
   30820    case 4:
   30821       if (devinfo->is_g4x) {
   30822          return 0;
   30823       } else {
   30824          return 0;
   30825       }
   30826    default:
   30827       unreachable("Invalid hardware generation");
   30828    }
   30829 }
   30830 
   30831 
   30832 
   30833 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_start  24
   30834 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_start  24
   30835 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_start  24
   30836 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_start  24
   30837 
   30838 static inline uint32_t ATTRIBUTE_PURE
   30839 _3DSTATE_GATHER_POOL_ALLOC_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   30840 {
   30841    switch (devinfo->gen) {
   30842    case 10: return 24;
   30843    case 9: return 24;
   30844    case 8: return 24;
   30845    case 7:
   30846       if (devinfo->is_haswell) {
   30847          return 24;
   30848       } else {
   30849          return 0;
   30850       }
   30851    case 6: return 0;
   30852    case 5: return 0;
   30853    case 4:
   30854       if (devinfo->is_g4x) {
   30855          return 0;
   30856       } else {
   30857          return 0;
   30858       }
   30859    default:
   30860       unreachable("Invalid hardware generation");
   30861    }
   30862 }
   30863 
   30864 
   30865 
   30866 /* 3DSTATE_GATHER_POOL_ALLOC::3D Command Sub Opcode */
   30867 
   30868 
   30869 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_bits  8
   30870 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_bits  8
   30871 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_bits  8
   30872 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_bits  8
   30873 
   30874 static inline uint32_t ATTRIBUTE_PURE
   30875 _3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   30876 {
   30877    switch (devinfo->gen) {
   30878    case 10: return 8;
   30879    case 9: return 8;
   30880    case 8: return 8;
   30881    case 7:
   30882       if (devinfo->is_haswell) {
   30883          return 8;
   30884       } else {
   30885          return 0;
   30886       }
   30887    case 6: return 0;
   30888    case 5: return 0;
   30889    case 4:
   30890       if (devinfo->is_g4x) {
   30891          return 0;
   30892       } else {
   30893          return 0;
   30894       }
   30895    default:
   30896       unreachable("Invalid hardware generation");
   30897    }
   30898 }
   30899 
   30900 
   30901 
   30902 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_start  16
   30903 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_start  16
   30904 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_start  16
   30905 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_start  16
   30906 
   30907 static inline uint32_t ATTRIBUTE_PURE
   30908 _3DSTATE_GATHER_POOL_ALLOC_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   30909 {
   30910    switch (devinfo->gen) {
   30911    case 10: return 16;
   30912    case 9: return 16;
   30913    case 8: return 16;
   30914    case 7:
   30915       if (devinfo->is_haswell) {
   30916          return 16;
   30917       } else {
   30918          return 0;
   30919       }
   30920    case 6: return 0;
   30921    case 5: return 0;
   30922    case 4:
   30923       if (devinfo->is_g4x) {
   30924          return 0;
   30925       } else {
   30926          return 0;
   30927       }
   30928    default:
   30929       unreachable("Invalid hardware generation");
   30930    }
   30931 }
   30932 
   30933 
   30934 
   30935 /* 3DSTATE_GATHER_POOL_ALLOC::Command SubType */
   30936 
   30937 
   30938 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_bits  2
   30939 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_bits  2
   30940 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_bits  2
   30941 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_bits  2
   30942 
   30943 static inline uint32_t ATTRIBUTE_PURE
   30944 _3DSTATE_GATHER_POOL_ALLOC_CommandSubType_bits(const struct gen_device_info *devinfo)
   30945 {
   30946    switch (devinfo->gen) {
   30947    case 10: return 2;
   30948    case 9: return 2;
   30949    case 8: return 2;
   30950    case 7:
   30951       if (devinfo->is_haswell) {
   30952          return 2;
   30953       } else {
   30954          return 0;
   30955       }
   30956    case 6: return 0;
   30957    case 5: return 0;
   30958    case 4:
   30959       if (devinfo->is_g4x) {
   30960          return 0;
   30961       } else {
   30962          return 0;
   30963       }
   30964    default:
   30965       unreachable("Invalid hardware generation");
   30966    }
   30967 }
   30968 
   30969 
   30970 
   30971 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_start  27
   30972 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_start  27
   30973 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_start  27
   30974 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_CommandSubType_start  27
   30975 
   30976 static inline uint32_t ATTRIBUTE_PURE
   30977 _3DSTATE_GATHER_POOL_ALLOC_CommandSubType_start(const struct gen_device_info *devinfo)
   30978 {
   30979    switch (devinfo->gen) {
   30980    case 10: return 27;
   30981    case 9: return 27;
   30982    case 8: return 27;
   30983    case 7:
   30984       if (devinfo->is_haswell) {
   30985          return 27;
   30986       } else {
   30987          return 0;
   30988       }
   30989    case 6: return 0;
   30990    case 5: return 0;
   30991    case 4:
   30992       if (devinfo->is_g4x) {
   30993          return 0;
   30994       } else {
   30995          return 0;
   30996       }
   30997    default:
   30998       unreachable("Invalid hardware generation");
   30999    }
   31000 }
   31001 
   31002 
   31003 
   31004 /* 3DSTATE_GATHER_POOL_ALLOC::Command Type */
   31005 
   31006 
   31007 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_CommandType_bits  3
   31008 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_CommandType_bits  3
   31009 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_CommandType_bits  3
   31010 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_CommandType_bits  3
   31011 
   31012 static inline uint32_t ATTRIBUTE_PURE
   31013 _3DSTATE_GATHER_POOL_ALLOC_CommandType_bits(const struct gen_device_info *devinfo)
   31014 {
   31015    switch (devinfo->gen) {
   31016    case 10: return 3;
   31017    case 9: return 3;
   31018    case 8: return 3;
   31019    case 7:
   31020       if (devinfo->is_haswell) {
   31021          return 3;
   31022       } else {
   31023          return 0;
   31024       }
   31025    case 6: return 0;
   31026    case 5: return 0;
   31027    case 4:
   31028       if (devinfo->is_g4x) {
   31029          return 0;
   31030       } else {
   31031          return 0;
   31032       }
   31033    default:
   31034       unreachable("Invalid hardware generation");
   31035    }
   31036 }
   31037 
   31038 
   31039 
   31040 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_CommandType_start  29
   31041 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_CommandType_start  29
   31042 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_CommandType_start  29
   31043 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_CommandType_start  29
   31044 
   31045 static inline uint32_t ATTRIBUTE_PURE
   31046 _3DSTATE_GATHER_POOL_ALLOC_CommandType_start(const struct gen_device_info *devinfo)
   31047 {
   31048    switch (devinfo->gen) {
   31049    case 10: return 29;
   31050    case 9: return 29;
   31051    case 8: return 29;
   31052    case 7:
   31053       if (devinfo->is_haswell) {
   31054          return 29;
   31055       } else {
   31056          return 0;
   31057       }
   31058    case 6: return 0;
   31059    case 5: return 0;
   31060    case 4:
   31061       if (devinfo->is_g4x) {
   31062          return 0;
   31063       } else {
   31064          return 0;
   31065       }
   31066    default:
   31067       unreachable("Invalid hardware generation");
   31068    }
   31069 }
   31070 
   31071 
   31072 
   31073 /* 3DSTATE_GATHER_POOL_ALLOC::DWord Length */
   31074 
   31075 
   31076 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_DWordLength_bits  8
   31077 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_DWordLength_bits  8
   31078 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_DWordLength_bits  8
   31079 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_DWordLength_bits  8
   31080 
   31081 static inline uint32_t ATTRIBUTE_PURE
   31082 _3DSTATE_GATHER_POOL_ALLOC_DWordLength_bits(const struct gen_device_info *devinfo)
   31083 {
   31084    switch (devinfo->gen) {
   31085    case 10: return 8;
   31086    case 9: return 8;
   31087    case 8: return 8;
   31088    case 7:
   31089       if (devinfo->is_haswell) {
   31090          return 8;
   31091       } else {
   31092          return 0;
   31093       }
   31094    case 6: return 0;
   31095    case 5: return 0;
   31096    case 4:
   31097       if (devinfo->is_g4x) {
   31098          return 0;
   31099       } else {
   31100          return 0;
   31101       }
   31102    default:
   31103       unreachable("Invalid hardware generation");
   31104    }
   31105 }
   31106 
   31107 
   31108 
   31109 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_DWordLength_start  0
   31110 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_DWordLength_start  0
   31111 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_DWordLength_start  0
   31112 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_DWordLength_start  0
   31113 
   31114 static inline uint32_t ATTRIBUTE_PURE
   31115 _3DSTATE_GATHER_POOL_ALLOC_DWordLength_start(const struct gen_device_info *devinfo)
   31116 {
   31117    switch (devinfo->gen) {
   31118    case 10: return 0;
   31119    case 9: return 0;
   31120    case 8: return 0;
   31121    case 7:
   31122       if (devinfo->is_haswell) {
   31123          return 0;
   31124       } else {
   31125          return 0;
   31126       }
   31127    case 6: return 0;
   31128    case 5: return 0;
   31129    case 4:
   31130       if (devinfo->is_g4x) {
   31131          return 0;
   31132       } else {
   31133          return 0;
   31134       }
   31135    default:
   31136       unreachable("Invalid hardware generation");
   31137    }
   31138 }
   31139 
   31140 
   31141 
   31142 /* 3DSTATE_GATHER_POOL_ALLOC::Gather Pool Base Address */
   31143 
   31144 
   31145 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_bits  52
   31146 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_bits  52
   31147 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_bits  52
   31148 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_bits  20
   31149 
   31150 static inline uint32_t ATTRIBUTE_PURE
   31151 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_bits(const struct gen_device_info *devinfo)
   31152 {
   31153    switch (devinfo->gen) {
   31154    case 10: return 52;
   31155    case 9: return 52;
   31156    case 8: return 52;
   31157    case 7:
   31158       if (devinfo->is_haswell) {
   31159          return 20;
   31160       } else {
   31161          return 0;
   31162       }
   31163    case 6: return 0;
   31164    case 5: return 0;
   31165    case 4:
   31166       if (devinfo->is_g4x) {
   31167          return 0;
   31168       } else {
   31169          return 0;
   31170       }
   31171    default:
   31172       unreachable("Invalid hardware generation");
   31173    }
   31174 }
   31175 
   31176 
   31177 
   31178 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_start  44
   31179 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_start  44
   31180 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_start  44
   31181 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_start  44
   31182 
   31183 static inline uint32_t ATTRIBUTE_PURE
   31184 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolBaseAddress_start(const struct gen_device_info *devinfo)
   31185 {
   31186    switch (devinfo->gen) {
   31187    case 10: return 44;
   31188    case 9: return 44;
   31189    case 8: return 44;
   31190    case 7:
   31191       if (devinfo->is_haswell) {
   31192          return 44;
   31193       } else {
   31194          return 0;
   31195       }
   31196    case 6: return 0;
   31197    case 5: return 0;
   31198    case 4:
   31199       if (devinfo->is_g4x) {
   31200          return 0;
   31201       } else {
   31202          return 0;
   31203       }
   31204    default:
   31205       unreachable("Invalid hardware generation");
   31206    }
   31207 }
   31208 
   31209 
   31210 
   31211 /* 3DSTATE_GATHER_POOL_ALLOC::Gather Pool Buffer Size */
   31212 
   31213 
   31214 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_bits  20
   31215 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_bits  20
   31216 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_bits  20
   31217 
   31218 static inline uint32_t ATTRIBUTE_PURE
   31219 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_bits(const struct gen_device_info *devinfo)
   31220 {
   31221    switch (devinfo->gen) {
   31222    case 10: return 20;
   31223    case 9: return 20;
   31224    case 8: return 20;
   31225    case 7:
   31226       if (devinfo->is_haswell) {
   31227          return 0;
   31228       } else {
   31229          return 0;
   31230       }
   31231    case 6: return 0;
   31232    case 5: return 0;
   31233    case 4:
   31234       if (devinfo->is_g4x) {
   31235          return 0;
   31236       } else {
   31237          return 0;
   31238       }
   31239    default:
   31240       unreachable("Invalid hardware generation");
   31241    }
   31242 }
   31243 
   31244 
   31245 
   31246 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_start  108
   31247 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_start  108
   31248 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_start  108
   31249 
   31250 static inline uint32_t ATTRIBUTE_PURE
   31251 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolBufferSize_start(const struct gen_device_info *devinfo)
   31252 {
   31253    switch (devinfo->gen) {
   31254    case 10: return 108;
   31255    case 9: return 108;
   31256    case 8: return 108;
   31257    case 7:
   31258       if (devinfo->is_haswell) {
   31259          return 0;
   31260       } else {
   31261          return 0;
   31262       }
   31263    case 6: return 0;
   31264    case 5: return 0;
   31265    case 4:
   31266       if (devinfo->is_g4x) {
   31267          return 0;
   31268       } else {
   31269          return 0;
   31270       }
   31271    default:
   31272       unreachable("Invalid hardware generation");
   31273    }
   31274 }
   31275 
   31276 
   31277 
   31278 /* 3DSTATE_GATHER_POOL_ALLOC::Gather Pool Enable */
   31279 
   31280 
   31281 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_bits  1
   31282 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_bits  1
   31283 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_bits  1
   31284 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_bits  1
   31285 
   31286 static inline uint32_t ATTRIBUTE_PURE
   31287 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_bits(const struct gen_device_info *devinfo)
   31288 {
   31289    switch (devinfo->gen) {
   31290    case 10: return 1;
   31291    case 9: return 1;
   31292    case 8: return 1;
   31293    case 7:
   31294       if (devinfo->is_haswell) {
   31295          return 1;
   31296       } else {
   31297          return 0;
   31298       }
   31299    case 6: return 0;
   31300    case 5: return 0;
   31301    case 4:
   31302       if (devinfo->is_g4x) {
   31303          return 0;
   31304       } else {
   31305          return 0;
   31306       }
   31307    default:
   31308       unreachable("Invalid hardware generation");
   31309    }
   31310 }
   31311 
   31312 
   31313 
   31314 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_start  43
   31315 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_start  43
   31316 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_start  43
   31317 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_start  43
   31318 
   31319 static inline uint32_t ATTRIBUTE_PURE
   31320 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolEnable_start(const struct gen_device_info *devinfo)
   31321 {
   31322    switch (devinfo->gen) {
   31323    case 10: return 43;
   31324    case 9: return 43;
   31325    case 8: return 43;
   31326    case 7:
   31327       if (devinfo->is_haswell) {
   31328          return 43;
   31329       } else {
   31330          return 0;
   31331       }
   31332    case 6: return 0;
   31333    case 5: return 0;
   31334    case 4:
   31335       if (devinfo->is_g4x) {
   31336          return 0;
   31337       } else {
   31338          return 0;
   31339       }
   31340    default:
   31341       unreachable("Invalid hardware generation");
   31342    }
   31343 }
   31344 
   31345 
   31346 
   31347 /* 3DSTATE_GATHER_POOL_ALLOC::Gather Pool Upper Bound */
   31348 
   31349 
   31350 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_GatherPoolUpperBound_bits  20
   31351 
   31352 static inline uint32_t ATTRIBUTE_PURE
   31353 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolUpperBound_bits(const struct gen_device_info *devinfo)
   31354 {
   31355    switch (devinfo->gen) {
   31356    case 10: return 0;
   31357    case 9: return 0;
   31358    case 8: return 0;
   31359    case 7:
   31360       if (devinfo->is_haswell) {
   31361          return 20;
   31362       } else {
   31363          return 0;
   31364       }
   31365    case 6: return 0;
   31366    case 5: return 0;
   31367    case 4:
   31368       if (devinfo->is_g4x) {
   31369          return 0;
   31370       } else {
   31371          return 0;
   31372       }
   31373    default:
   31374       unreachable("Invalid hardware generation");
   31375    }
   31376 }
   31377 
   31378 
   31379 
   31380 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_GatherPoolUpperBound_start  76
   31381 
   31382 static inline uint32_t ATTRIBUTE_PURE
   31383 _3DSTATE_GATHER_POOL_ALLOC_GatherPoolUpperBound_start(const struct gen_device_info *devinfo)
   31384 {
   31385    switch (devinfo->gen) {
   31386    case 10: return 0;
   31387    case 9: return 0;
   31388    case 8: return 0;
   31389    case 7:
   31390       if (devinfo->is_haswell) {
   31391          return 76;
   31392       } else {
   31393          return 0;
   31394       }
   31395    case 6: return 0;
   31396    case 5: return 0;
   31397    case 4:
   31398       if (devinfo->is_g4x) {
   31399          return 0;
   31400       } else {
   31401          return 0;
   31402       }
   31403    default:
   31404       unreachable("Invalid hardware generation");
   31405    }
   31406 }
   31407 
   31408 
   31409 
   31410 /* 3DSTATE_GATHER_POOL_ALLOC::Memory Object Control State */
   31411 
   31412 
   31413 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_bits  7
   31414 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_bits  7
   31415 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_bits  7
   31416 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_bits  4
   31417 
   31418 static inline uint32_t ATTRIBUTE_PURE
   31419 _3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   31420 {
   31421    switch (devinfo->gen) {
   31422    case 10: return 7;
   31423    case 9: return 7;
   31424    case 8: return 7;
   31425    case 7:
   31426       if (devinfo->is_haswell) {
   31427          return 4;
   31428       } else {
   31429          return 0;
   31430       }
   31431    case 6: return 0;
   31432    case 5: return 0;
   31433    case 4:
   31434       if (devinfo->is_g4x) {
   31435          return 0;
   31436       } else {
   31437          return 0;
   31438       }
   31439    default:
   31440       unreachable("Invalid hardware generation");
   31441    }
   31442 }
   31443 
   31444 
   31445 
   31446 #define GEN10_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_start  32
   31447 #define GEN9_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_start  32
   31448 #define GEN8_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_start  32
   31449 #define GEN75_3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_start  32
   31450 
   31451 static inline uint32_t ATTRIBUTE_PURE
   31452 _3DSTATE_GATHER_POOL_ALLOC_MemoryObjectControlState_start(const struct gen_device_info *devinfo)
   31453 {
   31454    switch (devinfo->gen) {
   31455    case 10: return 32;
   31456    case 9: return 32;
   31457    case 8: return 32;
   31458    case 7:
   31459       if (devinfo->is_haswell) {
   31460          return 32;
   31461       } else {
   31462          return 0;
   31463       }
   31464    case 6: return 0;
   31465    case 5: return 0;
   31466    case 4:
   31467       if (devinfo->is_g4x) {
   31468          return 0;
   31469       } else {
   31470          return 0;
   31471       }
   31472    default:
   31473       unreachable("Invalid hardware generation");
   31474    }
   31475 }
   31476 
   31477 
   31478 
   31479 /* 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP */
   31480 
   31481 
   31482 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_length  2
   31483 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_length  2
   31484 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_length  2
   31485 
   31486 static inline uint32_t ATTRIBUTE_PURE
   31487 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_length(const struct gen_device_info *devinfo)
   31488 {
   31489    switch (devinfo->gen) {
   31490    case 10: return 0;
   31491    case 9: return 0;
   31492    case 8: return 0;
   31493    case 7:
   31494       if (devinfo->is_haswell) {
   31495          return 0;
   31496       } else {
   31497          return 0;
   31498       }
   31499    case 6: return 0;
   31500    case 5: return 2;
   31501    case 4:
   31502       if (devinfo->is_g4x) {
   31503          return 2;
   31504       } else {
   31505          return 2;
   31506       }
   31507    default:
   31508       unreachable("Invalid hardware generation");
   31509    }
   31510 }
   31511 
   31512 
   31513 
   31514 /* 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP::3D Command Opcode */
   31515 
   31516 
   31517 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_bits  3
   31518 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_bits  3
   31519 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_bits  3
   31520 
   31521 static inline uint32_t ATTRIBUTE_PURE
   31522 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   31523 {
   31524    switch (devinfo->gen) {
   31525    case 10: return 0;
   31526    case 9: return 0;
   31527    case 8: return 0;
   31528    case 7:
   31529       if (devinfo->is_haswell) {
   31530          return 0;
   31531       } else {
   31532          return 0;
   31533       }
   31534    case 6: return 0;
   31535    case 5: return 3;
   31536    case 4:
   31537       if (devinfo->is_g4x) {
   31538          return 3;
   31539       } else {
   31540          return 3;
   31541       }
   31542    default:
   31543       unreachable("Invalid hardware generation");
   31544    }
   31545 }
   31546 
   31547 
   31548 
   31549 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_start  24
   31550 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_start  24
   31551 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_start  24
   31552 
   31553 static inline uint32_t ATTRIBUTE_PURE
   31554 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   31555 {
   31556    switch (devinfo->gen) {
   31557    case 10: return 0;
   31558    case 9: return 0;
   31559    case 8: return 0;
   31560    case 7:
   31561       if (devinfo->is_haswell) {
   31562          return 0;
   31563       } else {
   31564          return 0;
   31565       }
   31566    case 6: return 0;
   31567    case 5: return 24;
   31568    case 4:
   31569       if (devinfo->is_g4x) {
   31570          return 24;
   31571       } else {
   31572          return 24;
   31573       }
   31574    default:
   31575       unreachable("Invalid hardware generation");
   31576    }
   31577 }
   31578 
   31579 
   31580 
   31581 /* 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP::3D Command Sub Opcode */
   31582 
   31583 
   31584 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_bits  8
   31585 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_bits  8
   31586 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_bits  8
   31587 
   31588 static inline uint32_t ATTRIBUTE_PURE
   31589 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   31590 {
   31591    switch (devinfo->gen) {
   31592    case 10: return 0;
   31593    case 9: return 0;
   31594    case 8: return 0;
   31595    case 7:
   31596       if (devinfo->is_haswell) {
   31597          return 0;
   31598       } else {
   31599          return 0;
   31600       }
   31601    case 6: return 0;
   31602    case 5: return 8;
   31603    case 4:
   31604       if (devinfo->is_g4x) {
   31605          return 8;
   31606       } else {
   31607          return 8;
   31608       }
   31609    default:
   31610       unreachable("Invalid hardware generation");
   31611    }
   31612 }
   31613 
   31614 
   31615 
   31616 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_start  16
   31617 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_start  16
   31618 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_start  16
   31619 
   31620 static inline uint32_t ATTRIBUTE_PURE
   31621 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   31622 {
   31623    switch (devinfo->gen) {
   31624    case 10: return 0;
   31625    case 9: return 0;
   31626    case 8: return 0;
   31627    case 7:
   31628       if (devinfo->is_haswell) {
   31629          return 0;
   31630       } else {
   31631          return 0;
   31632       }
   31633    case 6: return 0;
   31634    case 5: return 16;
   31635    case 4:
   31636       if (devinfo->is_g4x) {
   31637          return 16;
   31638       } else {
   31639          return 16;
   31640       }
   31641    default:
   31642       unreachable("Invalid hardware generation");
   31643    }
   31644 }
   31645 
   31646 
   31647 
   31648 /* 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP::Command SubType */
   31649 
   31650 
   31651 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_bits  2
   31652 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_bits  2
   31653 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_bits  2
   31654 
   31655 static inline uint32_t ATTRIBUTE_PURE
   31656 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_bits(const struct gen_device_info *devinfo)
   31657 {
   31658    switch (devinfo->gen) {
   31659    case 10: return 0;
   31660    case 9: return 0;
   31661    case 8: return 0;
   31662    case 7:
   31663       if (devinfo->is_haswell) {
   31664          return 0;
   31665       } else {
   31666          return 0;
   31667       }
   31668    case 6: return 0;
   31669    case 5: return 2;
   31670    case 4:
   31671       if (devinfo->is_g4x) {
   31672          return 2;
   31673       } else {
   31674          return 2;
   31675       }
   31676    default:
   31677       unreachable("Invalid hardware generation");
   31678    }
   31679 }
   31680 
   31681 
   31682 
   31683 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_start  27
   31684 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_start  27
   31685 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_start  27
   31686 
   31687 static inline uint32_t ATTRIBUTE_PURE
   31688 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandSubType_start(const struct gen_device_info *devinfo)
   31689 {
   31690    switch (devinfo->gen) {
   31691    case 10: return 0;
   31692    case 9: return 0;
   31693    case 8: return 0;
   31694    case 7:
   31695       if (devinfo->is_haswell) {
   31696          return 0;
   31697       } else {
   31698          return 0;
   31699       }
   31700    case 6: return 0;
   31701    case 5: return 27;
   31702    case 4:
   31703       if (devinfo->is_g4x) {
   31704          return 27;
   31705       } else {
   31706          return 27;
   31707       }
   31708    default:
   31709       unreachable("Invalid hardware generation");
   31710    }
   31711 }
   31712 
   31713 
   31714 
   31715 /* 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP::Command Type */
   31716 
   31717 
   31718 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_bits  3
   31719 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_bits  3
   31720 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_bits  3
   31721 
   31722 static inline uint32_t ATTRIBUTE_PURE
   31723 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_bits(const struct gen_device_info *devinfo)
   31724 {
   31725    switch (devinfo->gen) {
   31726    case 10: return 0;
   31727    case 9: return 0;
   31728    case 8: return 0;
   31729    case 7:
   31730       if (devinfo->is_haswell) {
   31731          return 0;
   31732       } else {
   31733          return 0;
   31734       }
   31735    case 6: return 0;
   31736    case 5: return 3;
   31737    case 4:
   31738       if (devinfo->is_g4x) {
   31739          return 3;
   31740       } else {
   31741          return 3;
   31742       }
   31743    default:
   31744       unreachable("Invalid hardware generation");
   31745    }
   31746 }
   31747 
   31748 
   31749 
   31750 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_start  29
   31751 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_start  29
   31752 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_start  29
   31753 
   31754 static inline uint32_t ATTRIBUTE_PURE
   31755 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_CommandType_start(const struct gen_device_info *devinfo)
   31756 {
   31757    switch (devinfo->gen) {
   31758    case 10: return 0;
   31759    case 9: return 0;
   31760    case 8: return 0;
   31761    case 7:
   31762       if (devinfo->is_haswell) {
   31763          return 0;
   31764       } else {
   31765          return 0;
   31766       }
   31767    case 6: return 0;
   31768    case 5: return 29;
   31769    case 4:
   31770       if (devinfo->is_g4x) {
   31771          return 29;
   31772       } else {
   31773          return 29;
   31774       }
   31775    default:
   31776       unreachable("Invalid hardware generation");
   31777    }
   31778 }
   31779 
   31780 
   31781 
   31782 /* 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP::DWord Length */
   31783 
   31784 
   31785 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_bits  8
   31786 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_bits  8
   31787 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_bits  8
   31788 
   31789 static inline uint32_t ATTRIBUTE_PURE
   31790 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_bits(const struct gen_device_info *devinfo)
   31791 {
   31792    switch (devinfo->gen) {
   31793    case 10: return 0;
   31794    case 9: return 0;
   31795    case 8: return 0;
   31796    case 7:
   31797       if (devinfo->is_haswell) {
   31798          return 0;
   31799       } else {
   31800          return 0;
   31801       }
   31802    case 6: return 0;
   31803    case 5: return 8;
   31804    case 4:
   31805       if (devinfo->is_g4x) {
   31806          return 8;
   31807       } else {
   31808          return 8;
   31809       }
   31810    default:
   31811       unreachable("Invalid hardware generation");
   31812    }
   31813 }
   31814 
   31815 
   31816 
   31817 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_start  0
   31818 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_start  0
   31819 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_start  0
   31820 
   31821 static inline uint32_t ATTRIBUTE_PURE
   31822 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_DWordLength_start(const struct gen_device_info *devinfo)
   31823 {
   31824    switch (devinfo->gen) {
   31825    case 10: return 0;
   31826    case 9: return 0;
   31827    case 8: return 0;
   31828    case 7:
   31829       if (devinfo->is_haswell) {
   31830          return 0;
   31831       } else {
   31832          return 0;
   31833       }
   31834    case 6: return 0;
   31835    case 5: return 0;
   31836    case 4:
   31837       if (devinfo->is_g4x) {
   31838          return 0;
   31839       } else {
   31840          return 0;
   31841       }
   31842    default:
   31843       unreachable("Invalid hardware generation");
   31844    }
   31845 }
   31846 
   31847 
   31848 
   31849 /* 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP::Global Depth Offset Clamp */
   31850 
   31851 
   31852 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_bits  32
   31853 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_bits  32
   31854 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_bits  32
   31855 
   31856 static inline uint32_t ATTRIBUTE_PURE
   31857 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_bits(const struct gen_device_info *devinfo)
   31858 {
   31859    switch (devinfo->gen) {
   31860    case 10: return 0;
   31861    case 9: return 0;
   31862    case 8: return 0;
   31863    case 7:
   31864       if (devinfo->is_haswell) {
   31865          return 0;
   31866       } else {
   31867          return 0;
   31868       }
   31869    case 6: return 0;
   31870    case 5: return 32;
   31871    case 4:
   31872       if (devinfo->is_g4x) {
   31873          return 32;
   31874       } else {
   31875          return 32;
   31876       }
   31877    default:
   31878       unreachable("Invalid hardware generation");
   31879    }
   31880 }
   31881 
   31882 
   31883 
   31884 #define GEN5_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_start  32
   31885 #define GEN45_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_start  32
   31886 #define GEN4_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_start  32
   31887 
   31888 static inline uint32_t ATTRIBUTE_PURE
   31889 _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP_GlobalDepthOffsetClamp_start(const struct gen_device_info *devinfo)
   31890 {
   31891    switch (devinfo->gen) {
   31892    case 10: return 0;
   31893    case 9: return 0;
   31894    case 8: return 0;
   31895    case 7:
   31896       if (devinfo->is_haswell) {
   31897          return 0;
   31898       } else {
   31899          return 0;
   31900       }
   31901    case 6: return 0;
   31902    case 5: return 32;
   31903    case 4:
   31904       if (devinfo->is_g4x) {
   31905          return 32;
   31906       } else {
   31907          return 32;
   31908       }
   31909    default:
   31910       unreachable("Invalid hardware generation");
   31911    }
   31912 }
   31913 
   31914 
   31915 
   31916 /* 3DSTATE_GS */
   31917 
   31918 
   31919 #define GEN10_3DSTATE_GS_length  10
   31920 #define GEN9_3DSTATE_GS_length  10
   31921 #define GEN8_3DSTATE_GS_length  10
   31922 #define GEN75_3DSTATE_GS_length  7
   31923 #define GEN7_3DSTATE_GS_length  7
   31924 #define GEN6_3DSTATE_GS_length  7
   31925 
   31926 static inline uint32_t ATTRIBUTE_PURE
   31927 _3DSTATE_GS_length(const struct gen_device_info *devinfo)
   31928 {
   31929    switch (devinfo->gen) {
   31930    case 10: return 10;
   31931    case 9: return 10;
   31932    case 8: return 10;
   31933    case 7:
   31934       if (devinfo->is_haswell) {
   31935          return 7;
   31936       } else {
   31937          return 7;
   31938       }
   31939    case 6: return 7;
   31940    case 5: return 0;
   31941    case 4:
   31942       if (devinfo->is_g4x) {
   31943          return 0;
   31944       } else {
   31945          return 0;
   31946       }
   31947    default:
   31948       unreachable("Invalid hardware generation");
   31949    }
   31950 }
   31951 
   31952 
   31953 
   31954 /* 3DSTATE_GS::3D Command Opcode */
   31955 
   31956 
   31957 #define GEN10_3DSTATE_GS_3DCommandOpcode_bits  3
   31958 #define GEN9_3DSTATE_GS_3DCommandOpcode_bits  3
   31959 #define GEN8_3DSTATE_GS_3DCommandOpcode_bits  3
   31960 #define GEN75_3DSTATE_GS_3DCommandOpcode_bits  3
   31961 #define GEN7_3DSTATE_GS_3DCommandOpcode_bits  3
   31962 #define GEN6_3DSTATE_GS_3DCommandOpcode_bits  3
   31963 
   31964 static inline uint32_t ATTRIBUTE_PURE
   31965 _3DSTATE_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   31966 {
   31967    switch (devinfo->gen) {
   31968    case 10: return 3;
   31969    case 9: return 3;
   31970    case 8: return 3;
   31971    case 7:
   31972       if (devinfo->is_haswell) {
   31973          return 3;
   31974       } else {
   31975          return 3;
   31976       }
   31977    case 6: return 3;
   31978    case 5: return 0;
   31979    case 4:
   31980       if (devinfo->is_g4x) {
   31981          return 0;
   31982       } else {
   31983          return 0;
   31984       }
   31985    default:
   31986       unreachable("Invalid hardware generation");
   31987    }
   31988 }
   31989 
   31990 
   31991 
   31992 #define GEN10_3DSTATE_GS_3DCommandOpcode_start  24
   31993 #define GEN9_3DSTATE_GS_3DCommandOpcode_start  24
   31994 #define GEN8_3DSTATE_GS_3DCommandOpcode_start  24
   31995 #define GEN75_3DSTATE_GS_3DCommandOpcode_start  24
   31996 #define GEN7_3DSTATE_GS_3DCommandOpcode_start  24
   31997 #define GEN6_3DSTATE_GS_3DCommandOpcode_start  24
   31998 
   31999 static inline uint32_t ATTRIBUTE_PURE
   32000 _3DSTATE_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   32001 {
   32002    switch (devinfo->gen) {
   32003    case 10: return 24;
   32004    case 9: return 24;
   32005    case 8: return 24;
   32006    case 7:
   32007       if (devinfo->is_haswell) {
   32008          return 24;
   32009       } else {
   32010          return 24;
   32011       }
   32012    case 6: return 24;
   32013    case 5: return 0;
   32014    case 4:
   32015       if (devinfo->is_g4x) {
   32016          return 0;
   32017       } else {
   32018          return 0;
   32019       }
   32020    default:
   32021       unreachable("Invalid hardware generation");
   32022    }
   32023 }
   32024 
   32025 
   32026 
   32027 /* 3DSTATE_GS::3D Command Sub Opcode */
   32028 
   32029 
   32030 #define GEN10_3DSTATE_GS_3DCommandSubOpcode_bits  8
   32031 #define GEN9_3DSTATE_GS_3DCommandSubOpcode_bits  8
   32032 #define GEN8_3DSTATE_GS_3DCommandSubOpcode_bits  8
   32033 #define GEN75_3DSTATE_GS_3DCommandSubOpcode_bits  8
   32034 #define GEN7_3DSTATE_GS_3DCommandSubOpcode_bits  8
   32035 #define GEN6_3DSTATE_GS_3DCommandSubOpcode_bits  8
   32036 
   32037 static inline uint32_t ATTRIBUTE_PURE
   32038 _3DSTATE_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   32039 {
   32040    switch (devinfo->gen) {
   32041    case 10: return 8;
   32042    case 9: return 8;
   32043    case 8: return 8;
   32044    case 7:
   32045       if (devinfo->is_haswell) {
   32046          return 8;
   32047       } else {
   32048          return 8;
   32049       }
   32050    case 6: return 8;
   32051    case 5: return 0;
   32052    case 4:
   32053       if (devinfo->is_g4x) {
   32054          return 0;
   32055       } else {
   32056          return 0;
   32057       }
   32058    default:
   32059       unreachable("Invalid hardware generation");
   32060    }
   32061 }
   32062 
   32063 
   32064 
   32065 #define GEN10_3DSTATE_GS_3DCommandSubOpcode_start  16
   32066 #define GEN9_3DSTATE_GS_3DCommandSubOpcode_start  16
   32067 #define GEN8_3DSTATE_GS_3DCommandSubOpcode_start  16
   32068 #define GEN75_3DSTATE_GS_3DCommandSubOpcode_start  16
   32069 #define GEN7_3DSTATE_GS_3DCommandSubOpcode_start  16
   32070 #define GEN6_3DSTATE_GS_3DCommandSubOpcode_start  16
   32071 
   32072 static inline uint32_t ATTRIBUTE_PURE
   32073 _3DSTATE_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   32074 {
   32075    switch (devinfo->gen) {
   32076    case 10: return 16;
   32077    case 9: return 16;
   32078    case 8: return 16;
   32079    case 7:
   32080       if (devinfo->is_haswell) {
   32081          return 16;
   32082       } else {
   32083          return 16;
   32084       }
   32085    case 6: return 16;
   32086    case 5: return 0;
   32087    case 4:
   32088       if (devinfo->is_g4x) {
   32089          return 0;
   32090       } else {
   32091          return 0;
   32092       }
   32093    default:
   32094       unreachable("Invalid hardware generation");
   32095    }
   32096 }
   32097 
   32098 
   32099 
   32100 /* 3DSTATE_GS::Accesses UAV */
   32101 
   32102 
   32103 #define GEN10_3DSTATE_GS_AccessesUAV_bits  1
   32104 #define GEN9_3DSTATE_GS_AccessesUAV_bits  1
   32105 #define GEN8_3DSTATE_GS_AccessesUAV_bits  1
   32106 
   32107 static inline uint32_t ATTRIBUTE_PURE
   32108 _3DSTATE_GS_AccessesUAV_bits(const struct gen_device_info *devinfo)
   32109 {
   32110    switch (devinfo->gen) {
   32111    case 10: return 1;
   32112    case 9: return 1;
   32113    case 8: return 1;
   32114    case 7:
   32115       if (devinfo->is_haswell) {
   32116          return 0;
   32117       } else {
   32118          return 0;
   32119       }
   32120    case 6: return 0;
   32121    case 5: return 0;
   32122    case 4:
   32123       if (devinfo->is_g4x) {
   32124          return 0;
   32125       } else {
   32126          return 0;
   32127       }
   32128    default:
   32129       unreachable("Invalid hardware generation");
   32130    }
   32131 }
   32132 
   32133 
   32134 
   32135 #define GEN10_3DSTATE_GS_AccessesUAV_start  108
   32136 #define GEN9_3DSTATE_GS_AccessesUAV_start  108
   32137 #define GEN8_3DSTATE_GS_AccessesUAV_start  108
   32138 
   32139 static inline uint32_t ATTRIBUTE_PURE
   32140 _3DSTATE_GS_AccessesUAV_start(const struct gen_device_info *devinfo)
   32141 {
   32142    switch (devinfo->gen) {
   32143    case 10: return 108;
   32144    case 9: return 108;
   32145    case 8: return 108;
   32146    case 7:
   32147       if (devinfo->is_haswell) {
   32148          return 0;
   32149       } else {
   32150          return 0;
   32151       }
   32152    case 6: return 0;
   32153    case 5: return 0;
   32154    case 4:
   32155       if (devinfo->is_g4x) {
   32156          return 0;
   32157       } else {
   32158          return 0;
   32159       }
   32160    default:
   32161       unreachable("Invalid hardware generation");
   32162    }
   32163 }
   32164 
   32165 
   32166 
   32167 /* 3DSTATE_GS::Binding Table Entry Count */
   32168 
   32169 
   32170 #define GEN10_3DSTATE_GS_BindingTableEntryCount_bits  8
   32171 #define GEN9_3DSTATE_GS_BindingTableEntryCount_bits  8
   32172 #define GEN8_3DSTATE_GS_BindingTableEntryCount_bits  8
   32173 #define GEN75_3DSTATE_GS_BindingTableEntryCount_bits  8
   32174 #define GEN7_3DSTATE_GS_BindingTableEntryCount_bits  8
   32175 #define GEN6_3DSTATE_GS_BindingTableEntryCount_bits  8
   32176 
   32177 static inline uint32_t ATTRIBUTE_PURE
   32178 _3DSTATE_GS_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   32179 {
   32180    switch (devinfo->gen) {
   32181    case 10: return 8;
   32182    case 9: return 8;
   32183    case 8: return 8;
   32184    case 7:
   32185       if (devinfo->is_haswell) {
   32186          return 8;
   32187       } else {
   32188          return 8;
   32189       }
   32190    case 6: return 8;
   32191    case 5: return 0;
   32192    case 4:
   32193       if (devinfo->is_g4x) {
   32194          return 0;
   32195       } else {
   32196          return 0;
   32197       }
   32198    default:
   32199       unreachable("Invalid hardware generation");
   32200    }
   32201 }
   32202 
   32203 
   32204 
   32205 #define GEN10_3DSTATE_GS_BindingTableEntryCount_start  114
   32206 #define GEN9_3DSTATE_GS_BindingTableEntryCount_start  114
   32207 #define GEN8_3DSTATE_GS_BindingTableEntryCount_start  114
   32208 #define GEN75_3DSTATE_GS_BindingTableEntryCount_start  82
   32209 #define GEN7_3DSTATE_GS_BindingTableEntryCount_start  82
   32210 #define GEN6_3DSTATE_GS_BindingTableEntryCount_start  82
   32211 
   32212 static inline uint32_t ATTRIBUTE_PURE
   32213 _3DSTATE_GS_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   32214 {
   32215    switch (devinfo->gen) {
   32216    case 10: return 114;
   32217    case 9: return 114;
   32218    case 8: return 114;
   32219    case 7:
   32220       if (devinfo->is_haswell) {
   32221          return 82;
   32222       } else {
   32223          return 82;
   32224       }
   32225    case 6: return 82;
   32226    case 5: return 0;
   32227    case 4:
   32228       if (devinfo->is_g4x) {
   32229          return 0;
   32230       } else {
   32231          return 0;
   32232       }
   32233    default:
   32234       unreachable("Invalid hardware generation");
   32235    }
   32236 }
   32237 
   32238 
   32239 
   32240 /* 3DSTATE_GS::Command SubType */
   32241 
   32242 
   32243 #define GEN10_3DSTATE_GS_CommandSubType_bits  2
   32244 #define GEN9_3DSTATE_GS_CommandSubType_bits  2
   32245 #define GEN8_3DSTATE_GS_CommandSubType_bits  2
   32246 #define GEN75_3DSTATE_GS_CommandSubType_bits  2
   32247 #define GEN7_3DSTATE_GS_CommandSubType_bits  2
   32248 #define GEN6_3DSTATE_GS_CommandSubType_bits  2
   32249 
   32250 static inline uint32_t ATTRIBUTE_PURE
   32251 _3DSTATE_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   32252 {
   32253    switch (devinfo->gen) {
   32254    case 10: return 2;
   32255    case 9: return 2;
   32256    case 8: return 2;
   32257    case 7:
   32258       if (devinfo->is_haswell) {
   32259          return 2;
   32260       } else {
   32261          return 2;
   32262       }
   32263    case 6: return 2;
   32264    case 5: return 0;
   32265    case 4:
   32266       if (devinfo->is_g4x) {
   32267          return 0;
   32268       } else {
   32269          return 0;
   32270       }
   32271    default:
   32272       unreachable("Invalid hardware generation");
   32273    }
   32274 }
   32275 
   32276 
   32277 
   32278 #define GEN10_3DSTATE_GS_CommandSubType_start  27
   32279 #define GEN9_3DSTATE_GS_CommandSubType_start  27
   32280 #define GEN8_3DSTATE_GS_CommandSubType_start  27
   32281 #define GEN75_3DSTATE_GS_CommandSubType_start  27
   32282 #define GEN7_3DSTATE_GS_CommandSubType_start  27
   32283 #define GEN6_3DSTATE_GS_CommandSubType_start  27
   32284 
   32285 static inline uint32_t ATTRIBUTE_PURE
   32286 _3DSTATE_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   32287 {
   32288    switch (devinfo->gen) {
   32289    case 10: return 27;
   32290    case 9: return 27;
   32291    case 8: return 27;
   32292    case 7:
   32293       if (devinfo->is_haswell) {
   32294          return 27;
   32295       } else {
   32296          return 27;
   32297       }
   32298    case 6: return 27;
   32299    case 5: return 0;
   32300    case 4:
   32301       if (devinfo->is_g4x) {
   32302          return 0;
   32303       } else {
   32304          return 0;
   32305       }
   32306    default:
   32307       unreachable("Invalid hardware generation");
   32308    }
   32309 }
   32310 
   32311 
   32312 
   32313 /* 3DSTATE_GS::Command Type */
   32314 
   32315 
   32316 #define GEN10_3DSTATE_GS_CommandType_bits  3
   32317 #define GEN9_3DSTATE_GS_CommandType_bits  3
   32318 #define GEN8_3DSTATE_GS_CommandType_bits  3
   32319 #define GEN75_3DSTATE_GS_CommandType_bits  3
   32320 #define GEN7_3DSTATE_GS_CommandType_bits  3
   32321 #define GEN6_3DSTATE_GS_CommandType_bits  3
   32322 
   32323 static inline uint32_t ATTRIBUTE_PURE
   32324 _3DSTATE_GS_CommandType_bits(const struct gen_device_info *devinfo)
   32325 {
   32326    switch (devinfo->gen) {
   32327    case 10: return 3;
   32328    case 9: return 3;
   32329    case 8: return 3;
   32330    case 7:
   32331       if (devinfo->is_haswell) {
   32332          return 3;
   32333       } else {
   32334          return 3;
   32335       }
   32336    case 6: return 3;
   32337    case 5: return 0;
   32338    case 4:
   32339       if (devinfo->is_g4x) {
   32340          return 0;
   32341       } else {
   32342          return 0;
   32343       }
   32344    default:
   32345       unreachable("Invalid hardware generation");
   32346    }
   32347 }
   32348 
   32349 
   32350 
   32351 #define GEN10_3DSTATE_GS_CommandType_start  29
   32352 #define GEN9_3DSTATE_GS_CommandType_start  29
   32353 #define GEN8_3DSTATE_GS_CommandType_start  29
   32354 #define GEN75_3DSTATE_GS_CommandType_start  29
   32355 #define GEN7_3DSTATE_GS_CommandType_start  29
   32356 #define GEN6_3DSTATE_GS_CommandType_start  29
   32357 
   32358 static inline uint32_t ATTRIBUTE_PURE
   32359 _3DSTATE_GS_CommandType_start(const struct gen_device_info *devinfo)
   32360 {
   32361    switch (devinfo->gen) {
   32362    case 10: return 29;
   32363    case 9: return 29;
   32364    case 8: return 29;
   32365    case 7:
   32366       if (devinfo->is_haswell) {
   32367          return 29;
   32368       } else {
   32369          return 29;
   32370       }
   32371    case 6: return 29;
   32372    case 5: return 0;
   32373    case 4:
   32374       if (devinfo->is_g4x) {
   32375          return 0;
   32376       } else {
   32377          return 0;
   32378       }
   32379    default:
   32380       unreachable("Invalid hardware generation");
   32381    }
   32382 }
   32383 
   32384 
   32385 
   32386 /* 3DSTATE_GS::Control Data Format */
   32387 
   32388 
   32389 #define GEN10_3DSTATE_GS_ControlDataFormat_bits  1
   32390 #define GEN9_3DSTATE_GS_ControlDataFormat_bits  1
   32391 #define GEN8_3DSTATE_GS_ControlDataFormat_bits  1
   32392 #define GEN75_3DSTATE_GS_ControlDataFormat_bits  1
   32393 #define GEN7_3DSTATE_GS_ControlDataFormat_bits  1
   32394 
   32395 static inline uint32_t ATTRIBUTE_PURE
   32396 _3DSTATE_GS_ControlDataFormat_bits(const struct gen_device_info *devinfo)
   32397 {
   32398    switch (devinfo->gen) {
   32399    case 10: return 1;
   32400    case 9: return 1;
   32401    case 8: return 1;
   32402    case 7:
   32403       if (devinfo->is_haswell) {
   32404          return 1;
   32405       } else {
   32406          return 1;
   32407       }
   32408    case 6: return 0;
   32409    case 5: return 0;
   32410    case 4:
   32411       if (devinfo->is_g4x) {
   32412          return 0;
   32413       } else {
   32414          return 0;
   32415       }
   32416    default:
   32417       unreachable("Invalid hardware generation");
   32418    }
   32419 }
   32420 
   32421 
   32422 
   32423 #define GEN10_3DSTATE_GS_ControlDataFormat_start  287
   32424 #define GEN9_3DSTATE_GS_ControlDataFormat_start  287
   32425 #define GEN8_3DSTATE_GS_ControlDataFormat_start  287
   32426 #define GEN75_3DSTATE_GS_ControlDataFormat_start  223
   32427 #define GEN7_3DSTATE_GS_ControlDataFormat_start  184
   32428 
   32429 static inline uint32_t ATTRIBUTE_PURE
   32430 _3DSTATE_GS_ControlDataFormat_start(const struct gen_device_info *devinfo)
   32431 {
   32432    switch (devinfo->gen) {
   32433    case 10: return 287;
   32434    case 9: return 287;
   32435    case 8: return 287;
   32436    case 7:
   32437       if (devinfo->is_haswell) {
   32438          return 223;
   32439       } else {
   32440          return 184;
   32441       }
   32442    case 6: return 0;
   32443    case 5: return 0;
   32444    case 4:
   32445       if (devinfo->is_g4x) {
   32446          return 0;
   32447       } else {
   32448          return 0;
   32449       }
   32450    default:
   32451       unreachable("Invalid hardware generation");
   32452    }
   32453 }
   32454 
   32455 
   32456 
   32457 /* 3DSTATE_GS::Control Data Header Size */
   32458 
   32459 
   32460 #define GEN10_3DSTATE_GS_ControlDataHeaderSize_bits  4
   32461 #define GEN9_3DSTATE_GS_ControlDataHeaderSize_bits  4
   32462 #define GEN8_3DSTATE_GS_ControlDataHeaderSize_bits  4
   32463 #define GEN75_3DSTATE_GS_ControlDataHeaderSize_bits  4
   32464 #define GEN7_3DSTATE_GS_ControlDataHeaderSize_bits  4
   32465 
   32466 static inline uint32_t ATTRIBUTE_PURE
   32467 _3DSTATE_GS_ControlDataHeaderSize_bits(const struct gen_device_info *devinfo)
   32468 {
   32469    switch (devinfo->gen) {
   32470    case 10: return 4;
   32471    case 9: return 4;
   32472    case 8: return 4;
   32473    case 7:
   32474       if (devinfo->is_haswell) {
   32475          return 4;
   32476       } else {
   32477          return 4;
   32478       }
   32479    case 6: return 0;
   32480    case 5: return 0;
   32481    case 4:
   32482       if (devinfo->is_g4x) {
   32483          return 0;
   32484       } else {
   32485          return 0;
   32486       }
   32487    default:
   32488       unreachable("Invalid hardware generation");
   32489    }
   32490 }
   32491 
   32492 
   32493 
   32494 #define GEN10_3DSTATE_GS_ControlDataHeaderSize_start  244
   32495 #define GEN9_3DSTATE_GS_ControlDataHeaderSize_start  244
   32496 #define GEN8_3DSTATE_GS_ControlDataHeaderSize_start  244
   32497 #define GEN75_3DSTATE_GS_ControlDataHeaderSize_start  180
   32498 #define GEN7_3DSTATE_GS_ControlDataHeaderSize_start  180
   32499 
   32500 static inline uint32_t ATTRIBUTE_PURE
   32501 _3DSTATE_GS_ControlDataHeaderSize_start(const struct gen_device_info *devinfo)
   32502 {
   32503    switch (devinfo->gen) {
   32504    case 10: return 244;
   32505    case 9: return 244;
   32506    case 8: return 244;
   32507    case 7:
   32508       if (devinfo->is_haswell) {
   32509          return 180;
   32510       } else {
   32511          return 180;
   32512       }
   32513    case 6: return 0;
   32514    case 5: return 0;
   32515    case 4:
   32516       if (devinfo->is_g4x) {
   32517          return 0;
   32518       } else {
   32519          return 0;
   32520       }
   32521    default:
   32522       unreachable("Invalid hardware generation");
   32523    }
   32524 }
   32525 
   32526 
   32527 
   32528 /* 3DSTATE_GS::DWord Length */
   32529 
   32530 
   32531 #define GEN10_3DSTATE_GS_DWordLength_bits  8
   32532 #define GEN9_3DSTATE_GS_DWordLength_bits  8
   32533 #define GEN8_3DSTATE_GS_DWordLength_bits  8
   32534 #define GEN75_3DSTATE_GS_DWordLength_bits  8
   32535 #define GEN7_3DSTATE_GS_DWordLength_bits  8
   32536 #define GEN6_3DSTATE_GS_DWordLength_bits  8
   32537 
   32538 static inline uint32_t ATTRIBUTE_PURE
   32539 _3DSTATE_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   32540 {
   32541    switch (devinfo->gen) {
   32542    case 10: return 8;
   32543    case 9: return 8;
   32544    case 8: return 8;
   32545    case 7:
   32546       if (devinfo->is_haswell) {
   32547          return 8;
   32548       } else {
   32549          return 8;
   32550       }
   32551    case 6: return 8;
   32552    case 5: return 0;
   32553    case 4:
   32554       if (devinfo->is_g4x) {
   32555          return 0;
   32556       } else {
   32557          return 0;
   32558       }
   32559    default:
   32560       unreachable("Invalid hardware generation");
   32561    }
   32562 }
   32563 
   32564 
   32565 
   32566 #define GEN10_3DSTATE_GS_DWordLength_start  0
   32567 #define GEN9_3DSTATE_GS_DWordLength_start  0
   32568 #define GEN8_3DSTATE_GS_DWordLength_start  0
   32569 #define GEN75_3DSTATE_GS_DWordLength_start  0
   32570 #define GEN7_3DSTATE_GS_DWordLength_start  0
   32571 #define GEN6_3DSTATE_GS_DWordLength_start  0
   32572 
   32573 static inline uint32_t ATTRIBUTE_PURE
   32574 _3DSTATE_GS_DWordLength_start(const struct gen_device_info *devinfo)
   32575 {
   32576    switch (devinfo->gen) {
   32577    case 10: return 0;
   32578    case 9: return 0;
   32579    case 8: return 0;
   32580    case 7:
   32581       if (devinfo->is_haswell) {
   32582          return 0;
   32583       } else {
   32584          return 0;
   32585       }
   32586    case 6: return 0;
   32587    case 5: return 0;
   32588    case 4:
   32589       if (devinfo->is_g4x) {
   32590          return 0;
   32591       } else {
   32592          return 0;
   32593       }
   32594    default:
   32595       unreachable("Invalid hardware generation");
   32596    }
   32597 }
   32598 
   32599 
   32600 
   32601 /* 3DSTATE_GS::Default Stream Id */
   32602 
   32603 
   32604 #define GEN10_3DSTATE_GS_DefaultStreamId_bits  2
   32605 #define GEN9_3DSTATE_GS_DefaultStreamId_bits  2
   32606 #define GEN8_3DSTATE_GS_DefaultStreamId_bits  2
   32607 
   32608 static inline uint32_t ATTRIBUTE_PURE
   32609 _3DSTATE_GS_DefaultStreamId_bits(const struct gen_device_info *devinfo)
   32610 {
   32611    switch (devinfo->gen) {
   32612    case 10: return 2;
   32613    case 9: return 2;
   32614    case 8: return 2;
   32615    case 7:
   32616       if (devinfo->is_haswell) {
   32617          return 0;
   32618       } else {
   32619          return 0;
   32620       }
   32621    case 6: return 0;
   32622    case 5: return 0;
   32623    case 4:
   32624       if (devinfo->is_g4x) {
   32625          return 0;
   32626       } else {
   32627          return 0;
   32628       }
   32629    default:
   32630       unreachable("Invalid hardware generation");
   32631    }
   32632 }
   32633 
   32634 
   32635 
   32636 #define GEN10_3DSTATE_GS_DefaultStreamId_start  237
   32637 #define GEN9_3DSTATE_GS_DefaultStreamId_start  237
   32638 #define GEN8_3DSTATE_GS_DefaultStreamId_start  237
   32639 
   32640 static inline uint32_t ATTRIBUTE_PURE
   32641 _3DSTATE_GS_DefaultStreamId_start(const struct gen_device_info *devinfo)
   32642 {
   32643    switch (devinfo->gen) {
   32644    case 10: return 237;
   32645    case 9: return 237;
   32646    case 8: return 237;
   32647    case 7:
   32648       if (devinfo->is_haswell) {
   32649          return 0;
   32650       } else {
   32651          return 0;
   32652       }
   32653    case 6: return 0;
   32654    case 5: return 0;
   32655    case 4:
   32656       if (devinfo->is_g4x) {
   32657          return 0;
   32658       } else {
   32659          return 0;
   32660       }
   32661    default:
   32662       unreachable("Invalid hardware generation");
   32663    }
   32664 }
   32665 
   32666 
   32667 
   32668 /* 3DSTATE_GS::Default StreamID */
   32669 
   32670 
   32671 #define GEN75_3DSTATE_GS_DefaultStreamID_bits  2
   32672 #define GEN7_3DSTATE_GS_DefaultStreamID_bits  2
   32673 
   32674 static inline uint32_t ATTRIBUTE_PURE
   32675 _3DSTATE_GS_DefaultStreamID_bits(const struct gen_device_info *devinfo)
   32676 {
   32677    switch (devinfo->gen) {
   32678    case 10: return 0;
   32679    case 9: return 0;
   32680    case 8: return 0;
   32681    case 7:
   32682       if (devinfo->is_haswell) {
   32683          return 2;
   32684       } else {
   32685          return 2;
   32686       }
   32687    case 6: return 0;
   32688    case 5: return 0;
   32689    case 4:
   32690       if (devinfo->is_g4x) {
   32691          return 0;
   32692       } else {
   32693          return 0;
   32694       }
   32695    default:
   32696       unreachable("Invalid hardware generation");
   32697    }
   32698 }
   32699 
   32700 
   32701 
   32702 #define GEN75_3DSTATE_GS_DefaultStreamID_start  173
   32703 #define GEN7_3DSTATE_GS_DefaultStreamID_start  173
   32704 
   32705 static inline uint32_t ATTRIBUTE_PURE
   32706 _3DSTATE_GS_DefaultStreamID_start(const struct gen_device_info *devinfo)
   32707 {
   32708    switch (devinfo->gen) {
   32709    case 10: return 0;
   32710    case 9: return 0;
   32711    case 8: return 0;
   32712    case 7:
   32713       if (devinfo->is_haswell) {
   32714          return 173;
   32715       } else {
   32716          return 173;
   32717       }
   32718    case 6: return 0;
   32719    case 5: return 0;
   32720    case 4:
   32721       if (devinfo->is_g4x) {
   32722          return 0;
   32723       } else {
   32724          return 0;
   32725       }
   32726    default:
   32727       unreachable("Invalid hardware generation");
   32728    }
   32729 }
   32730 
   32731 
   32732 
   32733 /* 3DSTATE_GS::Discard Adjacency */
   32734 
   32735 
   32736 #define GEN10_3DSTATE_GS_DiscardAdjacency_bits  1
   32737 #define GEN9_3DSTATE_GS_DiscardAdjacency_bits  1
   32738 #define GEN8_3DSTATE_GS_DiscardAdjacency_bits  1
   32739 #define GEN75_3DSTATE_GS_DiscardAdjacency_bits  1
   32740 #define GEN7_3DSTATE_GS_DiscardAdjacency_bits  1
   32741 #define GEN6_3DSTATE_GS_DiscardAdjacency_bits  1
   32742 
   32743 static inline uint32_t ATTRIBUTE_PURE
   32744 _3DSTATE_GS_DiscardAdjacency_bits(const struct gen_device_info *devinfo)
   32745 {
   32746    switch (devinfo->gen) {
   32747    case 10: return 1;
   32748    case 9: return 1;
   32749    case 8: return 1;
   32750    case 7:
   32751       if (devinfo->is_haswell) {
   32752          return 1;
   32753       } else {
   32754          return 1;
   32755       }
   32756    case 6: return 1;
   32757    case 5: return 0;
   32758    case 4:
   32759       if (devinfo->is_g4x) {
   32760          return 0;
   32761       } else {
   32762          return 0;
   32763       }
   32764    default:
   32765       unreachable("Invalid hardware generation");
   32766    }
   32767 }
   32768 
   32769 
   32770 
   32771 #define GEN10_3DSTATE_GS_DiscardAdjacency_start  225
   32772 #define GEN9_3DSTATE_GS_DiscardAdjacency_start  225
   32773 #define GEN8_3DSTATE_GS_DiscardAdjacency_start  225
   32774 #define GEN75_3DSTATE_GS_DiscardAdjacency_start  161
   32775 #define GEN7_3DSTATE_GS_DiscardAdjacency_start  161
   32776 #define GEN6_3DSTATE_GS_DiscardAdjacency_start  221
   32777 
   32778 static inline uint32_t ATTRIBUTE_PURE
   32779 _3DSTATE_GS_DiscardAdjacency_start(const struct gen_device_info *devinfo)
   32780 {
   32781    switch (devinfo->gen) {
   32782    case 10: return 225;
   32783    case 9: return 225;
   32784    case 8: return 225;
   32785    case 7:
   32786       if (devinfo->is_haswell) {
   32787          return 161;
   32788       } else {
   32789          return 161;
   32790       }
   32791    case 6: return 221;
   32792    case 5: return 0;
   32793    case 4:
   32794       if (devinfo->is_g4x) {
   32795          return 0;
   32796       } else {
   32797          return 0;
   32798       }
   32799    default:
   32800       unreachable("Invalid hardware generation");
   32801    }
   32802 }
   32803 
   32804 
   32805 
   32806 /* 3DSTATE_GS::Dispatch GRF Start Register For URB Data */
   32807 
   32808 
   32809 #define GEN10_3DSTATE_GS_DispatchGRFStartRegisterForURBData_bits  4
   32810 #define GEN9_3DSTATE_GS_DispatchGRFStartRegisterForURBData_bits  4
   32811 #define GEN8_3DSTATE_GS_DispatchGRFStartRegisterForURBData_bits  4
   32812 #define GEN75_3DSTATE_GS_DispatchGRFStartRegisterForURBData_bits  4
   32813 #define GEN7_3DSTATE_GS_DispatchGRFStartRegisterForURBData_bits  4
   32814 #define GEN6_3DSTATE_GS_DispatchGRFStartRegisterForURBData_bits  4
   32815 
   32816 static inline uint32_t ATTRIBUTE_PURE
   32817 _3DSTATE_GS_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   32818 {
   32819    switch (devinfo->gen) {
   32820    case 10: return 4;
   32821    case 9: return 4;
   32822    case 8: return 4;
   32823    case 7:
   32824       if (devinfo->is_haswell) {
   32825          return 4;
   32826       } else {
   32827          return 4;
   32828       }
   32829    case 6: return 4;
   32830    case 5: return 0;
   32831    case 4:
   32832       if (devinfo->is_g4x) {
   32833          return 0;
   32834       } else {
   32835          return 0;
   32836       }
   32837    default:
   32838       unreachable("Invalid hardware generation");
   32839    }
   32840 }
   32841 
   32842 
   32843 
   32844 #define GEN10_3DSTATE_GS_DispatchGRFStartRegisterForURBData_start  192
   32845 #define GEN9_3DSTATE_GS_DispatchGRFStartRegisterForURBData_start  192
   32846 #define GEN8_3DSTATE_GS_DispatchGRFStartRegisterForURBData_start  192
   32847 #define GEN75_3DSTATE_GS_DispatchGRFStartRegisterForURBData_start  128
   32848 #define GEN7_3DSTATE_GS_DispatchGRFStartRegisterForURBData_start  128
   32849 #define GEN6_3DSTATE_GS_DispatchGRFStartRegisterForURBData_start  128
   32850 
   32851 static inline uint32_t ATTRIBUTE_PURE
   32852 _3DSTATE_GS_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   32853 {
   32854    switch (devinfo->gen) {
   32855    case 10: return 192;
   32856    case 9: return 192;
   32857    case 8: return 192;
   32858    case 7:
   32859       if (devinfo->is_haswell) {
   32860          return 128;
   32861       } else {
   32862          return 128;
   32863       }
   32864    case 6: return 128;
   32865    case 5: return 0;
   32866    case 4:
   32867       if (devinfo->is_g4x) {
   32868          return 0;
   32869       } else {
   32870          return 0;
   32871       }
   32872    default:
   32873       unreachable("Invalid hardware generation");
   32874    }
   32875 }
   32876 
   32877 
   32878 
   32879 /* 3DSTATE_GS::Dispatch GRF Start Register For URB Data [5:4] */
   32880 
   32881 
   32882 #define GEN10_3DSTATE_GS_DispatchGRFStartRegisterForURBData54_bits  2
   32883 #define GEN9_3DSTATE_GS_DispatchGRFStartRegisterForURBData54_bits  2
   32884 
   32885 static inline uint32_t ATTRIBUTE_PURE
   32886 _3DSTATE_GS_DispatchGRFStartRegisterForURBData54_bits(const struct gen_device_info *devinfo)
   32887 {
   32888    switch (devinfo->gen) {
   32889    case 10: return 2;
   32890    case 9: return 2;
   32891    case 8: return 0;
   32892    case 7:
   32893       if (devinfo->is_haswell) {
   32894          return 0;
   32895       } else {
   32896          return 0;
   32897       }
   32898    case 6: return 0;
   32899    case 5: return 0;
   32900    case 4:
   32901       if (devinfo->is_g4x) {
   32902          return 0;
   32903       } else {
   32904          return 0;
   32905       }
   32906    default:
   32907       unreachable("Invalid hardware generation");
   32908    }
   32909 }
   32910 
   32911 
   32912 
   32913 #define GEN10_3DSTATE_GS_DispatchGRFStartRegisterForURBData54_start  221
   32914 #define GEN9_3DSTATE_GS_DispatchGRFStartRegisterForURBData54_start  221
   32915 
   32916 static inline uint32_t ATTRIBUTE_PURE
   32917 _3DSTATE_GS_DispatchGRFStartRegisterForURBData54_start(const struct gen_device_info *devinfo)
   32918 {
   32919    switch (devinfo->gen) {
   32920    case 10: return 221;
   32921    case 9: return 221;
   32922    case 8: return 0;
   32923    case 7:
   32924       if (devinfo->is_haswell) {
   32925          return 0;
   32926       } else {
   32927          return 0;
   32928       }
   32929    case 6: return 0;
   32930    case 5: return 0;
   32931    case 4:
   32932       if (devinfo->is_g4x) {
   32933          return 0;
   32934       } else {
   32935          return 0;
   32936       }
   32937    default:
   32938       unreachable("Invalid hardware generation");
   32939    }
   32940 }
   32941 
   32942 
   32943 
   32944 /* 3DSTATE_GS::Dispatch Mode */
   32945 
   32946 
   32947 #define GEN10_3DSTATE_GS_DispatchMode_bits  2
   32948 #define GEN9_3DSTATE_GS_DispatchMode_bits  2
   32949 #define GEN8_3DSTATE_GS_DispatchMode_bits  2
   32950 #define GEN75_3DSTATE_GS_DispatchMode_bits  2
   32951 #define GEN7_3DSTATE_GS_DispatchMode_bits  2
   32952 
   32953 static inline uint32_t ATTRIBUTE_PURE
   32954 _3DSTATE_GS_DispatchMode_bits(const struct gen_device_info *devinfo)
   32955 {
   32956    switch (devinfo->gen) {
   32957    case 10: return 2;
   32958    case 9: return 2;
   32959    case 8: return 2;
   32960    case 7:
   32961       if (devinfo->is_haswell) {
   32962          return 2;
   32963       } else {
   32964          return 2;
   32965       }
   32966    case 6: return 0;
   32967    case 5: return 0;
   32968    case 4:
   32969       if (devinfo->is_g4x) {
   32970          return 0;
   32971       } else {
   32972          return 0;
   32973       }
   32974    default:
   32975       unreachable("Invalid hardware generation");
   32976    }
   32977 }
   32978 
   32979 
   32980 
   32981 #define GEN10_3DSTATE_GS_DispatchMode_start  235
   32982 #define GEN9_3DSTATE_GS_DispatchMode_start  235
   32983 #define GEN8_3DSTATE_GS_DispatchMode_start  235
   32984 #define GEN75_3DSTATE_GS_DispatchMode_start  171
   32985 #define GEN7_3DSTATE_GS_DispatchMode_start  171
   32986 
   32987 static inline uint32_t ATTRIBUTE_PURE
   32988 _3DSTATE_GS_DispatchMode_start(const struct gen_device_info *devinfo)
   32989 {
   32990    switch (devinfo->gen) {
   32991    case 10: return 235;
   32992    case 9: return 235;
   32993    case 8: return 235;
   32994    case 7:
   32995       if (devinfo->is_haswell) {
   32996          return 171;
   32997       } else {
   32998          return 171;
   32999       }
   33000    case 6: return 0;
   33001    case 5: return 0;
   33002    case 4:
   33003       if (devinfo->is_g4x) {
   33004          return 0;
   33005       } else {
   33006          return 0;
   33007       }
   33008    default:
   33009       unreachable("Invalid hardware generation");
   33010    }
   33011 }
   33012 
   33013 
   33014 
   33015 /* 3DSTATE_GS::Enable */
   33016 
   33017 
   33018 #define GEN10_3DSTATE_GS_Enable_bits  1
   33019 #define GEN9_3DSTATE_GS_Enable_bits  1
   33020 #define GEN8_3DSTATE_GS_Enable_bits  1
   33021 #define GEN75_3DSTATE_GS_Enable_bits  1
   33022 #define GEN7_3DSTATE_GS_Enable_bits  1
   33023 #define GEN6_3DSTATE_GS_Enable_bits  1
   33024 
   33025 static inline uint32_t ATTRIBUTE_PURE
   33026 _3DSTATE_GS_Enable_bits(const struct gen_device_info *devinfo)
   33027 {
   33028    switch (devinfo->gen) {
   33029    case 10: return 1;
   33030    case 9: return 1;
   33031    case 8: return 1;
   33032    case 7:
   33033       if (devinfo->is_haswell) {
   33034          return 1;
   33035       } else {
   33036          return 1;
   33037       }
   33038    case 6: return 1;
   33039    case 5: return 0;
   33040    case 4:
   33041       if (devinfo->is_g4x) {
   33042          return 0;
   33043       } else {
   33044          return 0;
   33045       }
   33046    default:
   33047       unreachable("Invalid hardware generation");
   33048    }
   33049 }
   33050 
   33051 
   33052 
   33053 #define GEN10_3DSTATE_GS_Enable_start  224
   33054 #define GEN9_3DSTATE_GS_Enable_start  224
   33055 #define GEN8_3DSTATE_GS_Enable_start  224
   33056 #define GEN75_3DSTATE_GS_Enable_start  160
   33057 #define GEN7_3DSTATE_GS_Enable_start  160
   33058 #define GEN6_3DSTATE_GS_Enable_start  207
   33059 
   33060 static inline uint32_t ATTRIBUTE_PURE
   33061 _3DSTATE_GS_Enable_start(const struct gen_device_info *devinfo)
   33062 {
   33063    switch (devinfo->gen) {
   33064    case 10: return 224;
   33065    case 9: return 224;
   33066    case 8: return 224;
   33067    case 7:
   33068       if (devinfo->is_haswell) {
   33069          return 160;
   33070       } else {
   33071          return 160;
   33072       }
   33073    case 6: return 207;
   33074    case 5: return 0;
   33075    case 4:
   33076       if (devinfo->is_g4x) {
   33077          return 0;
   33078       } else {
   33079          return 0;
   33080       }
   33081    default:
   33082       unreachable("Invalid hardware generation");
   33083    }
   33084 }
   33085 
   33086 
   33087 
   33088 /* 3DSTATE_GS::Expected Vertex Count */
   33089 
   33090 
   33091 #define GEN10_3DSTATE_GS_ExpectedVertexCount_bits  6
   33092 #define GEN9_3DSTATE_GS_ExpectedVertexCount_bits  6
   33093 #define GEN8_3DSTATE_GS_ExpectedVertexCount_bits  6
   33094 
   33095 static inline uint32_t ATTRIBUTE_PURE
   33096 _3DSTATE_GS_ExpectedVertexCount_bits(const struct gen_device_info *devinfo)
   33097 {
   33098    switch (devinfo->gen) {
   33099    case 10: return 6;
   33100    case 9: return 6;
   33101    case 8: return 6;
   33102    case 7:
   33103       if (devinfo->is_haswell) {
   33104          return 0;
   33105       } else {
   33106          return 0;
   33107       }
   33108    case 6: return 0;
   33109    case 5: return 0;
   33110    case 4:
   33111       if (devinfo->is_g4x) {
   33112          return 0;
   33113       } else {
   33114          return 0;
   33115       }
   33116    default:
   33117       unreachable("Invalid hardware generation");
   33118    }
   33119 }
   33120 
   33121 
   33122 
   33123 #define GEN10_3DSTATE_GS_ExpectedVertexCount_start  96
   33124 #define GEN9_3DSTATE_GS_ExpectedVertexCount_start  96
   33125 #define GEN8_3DSTATE_GS_ExpectedVertexCount_start  96
   33126 
   33127 static inline uint32_t ATTRIBUTE_PURE
   33128 _3DSTATE_GS_ExpectedVertexCount_start(const struct gen_device_info *devinfo)
   33129 {
   33130    switch (devinfo->gen) {
   33131    case 10: return 96;
   33132    case 9: return 96;
   33133    case 8: return 96;
   33134    case 7:
   33135       if (devinfo->is_haswell) {
   33136          return 0;
   33137       } else {
   33138          return 0;
   33139       }
   33140    case 6: return 0;
   33141    case 5: return 0;
   33142    case 4:
   33143       if (devinfo->is_g4x) {
   33144          return 0;
   33145       } else {
   33146          return 0;
   33147       }
   33148    default:
   33149       unreachable("Invalid hardware generation");
   33150    }
   33151 }
   33152 
   33153 
   33154 
   33155 /* 3DSTATE_GS::Floating Point Mode */
   33156 
   33157 
   33158 #define GEN10_3DSTATE_GS_FloatingPointMode_bits  1
   33159 #define GEN9_3DSTATE_GS_FloatingPointMode_bits  1
   33160 #define GEN8_3DSTATE_GS_FloatingPointMode_bits  1
   33161 #define GEN75_3DSTATE_GS_FloatingPointMode_bits  1
   33162 #define GEN7_3DSTATE_GS_FloatingPointMode_bits  1
   33163 #define GEN6_3DSTATE_GS_FloatingPointMode_bits  1
   33164 
   33165 static inline uint32_t ATTRIBUTE_PURE
   33166 _3DSTATE_GS_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   33167 {
   33168    switch (devinfo->gen) {
   33169    case 10: return 1;
   33170    case 9: return 1;
   33171    case 8: return 1;
   33172    case 7:
   33173       if (devinfo->is_haswell) {
   33174          return 1;
   33175       } else {
   33176          return 1;
   33177       }
   33178    case 6: return 1;
   33179    case 5: return 0;
   33180    case 4:
   33181       if (devinfo->is_g4x) {
   33182          return 0;
   33183       } else {
   33184          return 0;
   33185       }
   33186    default:
   33187       unreachable("Invalid hardware generation");
   33188    }
   33189 }
   33190 
   33191 
   33192 
   33193 #define GEN10_3DSTATE_GS_FloatingPointMode_start  112
   33194 #define GEN9_3DSTATE_GS_FloatingPointMode_start  112
   33195 #define GEN8_3DSTATE_GS_FloatingPointMode_start  112
   33196 #define GEN75_3DSTATE_GS_FloatingPointMode_start  80
   33197 #define GEN7_3DSTATE_GS_FloatingPointMode_start  80
   33198 #define GEN6_3DSTATE_GS_FloatingPointMode_start  80
   33199 
   33200 static inline uint32_t ATTRIBUTE_PURE
   33201 _3DSTATE_GS_FloatingPointMode_start(const struct gen_device_info *devinfo)
   33202 {
   33203    switch (devinfo->gen) {
   33204    case 10: return 112;
   33205    case 9: return 112;
   33206    case 8: return 112;
   33207    case 7:
   33208       if (devinfo->is_haswell) {
   33209          return 80;
   33210       } else {
   33211          return 80;
   33212       }
   33213    case 6: return 80;
   33214    case 5: return 0;
   33215    case 4:
   33216       if (devinfo->is_g4x) {
   33217          return 0;
   33218       } else {
   33219          return 0;
   33220       }
   33221    default:
   33222       unreachable("Invalid hardware generation");
   33223    }
   33224 }
   33225 
   33226 
   33227 
   33228 /* 3DSTATE_GS::GS Invocations Increment Value */
   33229 
   33230 
   33231 #define GEN75_3DSTATE_GS_GSInvocationsIncrementValue_bits  5
   33232 #define GEN7_3DSTATE_GS_GSInvocationsIncrementValue_bits  5
   33233 
   33234 static inline uint32_t ATTRIBUTE_PURE
   33235 _3DSTATE_GS_GSInvocationsIncrementValue_bits(const struct gen_device_info *devinfo)
   33236 {
   33237    switch (devinfo->gen) {
   33238    case 10: return 0;
   33239    case 9: return 0;
   33240    case 8: return 0;
   33241    case 7:
   33242       if (devinfo->is_haswell) {
   33243          return 5;
   33244       } else {
   33245          return 5;
   33246       }
   33247    case 6: return 0;
   33248    case 5: return 0;
   33249    case 4:
   33250       if (devinfo->is_g4x) {
   33251          return 0;
   33252       } else {
   33253          return 0;
   33254       }
   33255    default:
   33256       unreachable("Invalid hardware generation");
   33257    }
   33258 }
   33259 
   33260 
   33261 
   33262 #define GEN75_3DSTATE_GS_GSInvocationsIncrementValue_start  165
   33263 #define GEN7_3DSTATE_GS_GSInvocationsIncrementValue_start  165
   33264 
   33265 static inline uint32_t ATTRIBUTE_PURE
   33266 _3DSTATE_GS_GSInvocationsIncrementValue_start(const struct gen_device_info *devinfo)
   33267 {
   33268    switch (devinfo->gen) {
   33269    case 10: return 0;
   33270    case 9: return 0;
   33271    case 8: return 0;
   33272    case 7:
   33273       if (devinfo->is_haswell) {
   33274          return 165;
   33275       } else {
   33276          return 165;
   33277       }
   33278    case 6: return 0;
   33279    case 5: return 0;
   33280    case 4:
   33281       if (devinfo->is_g4x) {
   33282          return 0;
   33283       } else {
   33284          return 0;
   33285       }
   33286    default:
   33287       unreachable("Invalid hardware generation");
   33288    }
   33289 }
   33290 
   33291 
   33292 
   33293 /* 3DSTATE_GS::GS accesses UAV */
   33294 
   33295 
   33296 #define GEN75_3DSTATE_GS_GSaccessesUAV_bits  1
   33297 
   33298 static inline uint32_t ATTRIBUTE_PURE
   33299 _3DSTATE_GS_GSaccessesUAV_bits(const struct gen_device_info *devinfo)
   33300 {
   33301    switch (devinfo->gen) {
   33302    case 10: return 0;
   33303    case 9: return 0;
   33304    case 8: return 0;
   33305    case 7:
   33306       if (devinfo->is_haswell) {
   33307          return 1;
   33308       } else {
   33309          return 0;
   33310       }
   33311    case 6: return 0;
   33312    case 5: return 0;
   33313    case 4:
   33314       if (devinfo->is_g4x) {
   33315          return 0;
   33316       } else {
   33317          return 0;
   33318       }
   33319    default:
   33320       unreachable("Invalid hardware generation");
   33321    }
   33322 }
   33323 
   33324 
   33325 
   33326 #define GEN75_3DSTATE_GS_GSaccessesUAV_start  76
   33327 
   33328 static inline uint32_t ATTRIBUTE_PURE
   33329 _3DSTATE_GS_GSaccessesUAV_start(const struct gen_device_info *devinfo)
   33330 {
   33331    switch (devinfo->gen) {
   33332    case 10: return 0;
   33333    case 9: return 0;
   33334    case 8: return 0;
   33335    case 7:
   33336       if (devinfo->is_haswell) {
   33337          return 76;
   33338       } else {
   33339          return 0;
   33340       }
   33341    case 6: return 0;
   33342    case 5: return 0;
   33343    case 4:
   33344       if (devinfo->is_g4x) {
   33345          return 0;
   33346       } else {
   33347          return 0;
   33348       }
   33349    default:
   33350       unreachable("Invalid hardware generation");
   33351    }
   33352 }
   33353 
   33354 
   33355 
   33356 /* 3DSTATE_GS::Hint */
   33357 
   33358 
   33359 #define GEN10_3DSTATE_GS_Hint_bits  1
   33360 #define GEN9_3DSTATE_GS_Hint_bits  1
   33361 #define GEN8_3DSTATE_GS_Hint_bits  1
   33362 #define GEN75_3DSTATE_GS_Hint_bits  1
   33363 #define GEN7_3DSTATE_GS_Hint_bits  1
   33364 
   33365 static inline uint32_t ATTRIBUTE_PURE
   33366 _3DSTATE_GS_Hint_bits(const struct gen_device_info *devinfo)
   33367 {
   33368    switch (devinfo->gen) {
   33369    case 10: return 1;
   33370    case 9: return 1;
   33371    case 8: return 1;
   33372    case 7:
   33373       if (devinfo->is_haswell) {
   33374          return 1;
   33375       } else {
   33376          return 1;
   33377       }
   33378    case 6: return 0;
   33379    case 5: return 0;
   33380    case 4:
   33381       if (devinfo->is_g4x) {
   33382          return 0;
   33383       } else {
   33384          return 0;
   33385       }
   33386    default:
   33387       unreachable("Invalid hardware generation");
   33388    }
   33389 }
   33390 
   33391 
   33392 
   33393 #define GEN10_3DSTATE_GS_Hint_start  227
   33394 #define GEN9_3DSTATE_GS_Hint_start  227
   33395 #define GEN8_3DSTATE_GS_Hint_start  227
   33396 #define GEN75_3DSTATE_GS_Hint_start  163
   33397 #define GEN7_3DSTATE_GS_Hint_start  163
   33398 
   33399 static inline uint32_t ATTRIBUTE_PURE
   33400 _3DSTATE_GS_Hint_start(const struct gen_device_info *devinfo)
   33401 {
   33402    switch (devinfo->gen) {
   33403    case 10: return 227;
   33404    case 9: return 227;
   33405    case 8: return 227;
   33406    case 7:
   33407       if (devinfo->is_haswell) {
   33408          return 163;
   33409       } else {
   33410          return 163;
   33411       }
   33412    case 6: return 0;
   33413    case 5: return 0;
   33414    case 4:
   33415       if (devinfo->is_g4x) {
   33416          return 0;
   33417       } else {
   33418          return 0;
   33419       }
   33420    default:
   33421       unreachable("Invalid hardware generation");
   33422    }
   33423 }
   33424 
   33425 
   33426 
   33427 /* 3DSTATE_GS::Illegal Opcode Exception Enable */
   33428 
   33429 
   33430 #define GEN10_3DSTATE_GS_IllegalOpcodeExceptionEnable_bits  1
   33431 #define GEN9_3DSTATE_GS_IllegalOpcodeExceptionEnable_bits  1
   33432 #define GEN8_3DSTATE_GS_IllegalOpcodeExceptionEnable_bits  1
   33433 #define GEN75_3DSTATE_GS_IllegalOpcodeExceptionEnable_bits  1
   33434 #define GEN7_3DSTATE_GS_IllegalOpcodeExceptionEnable_bits  1
   33435 #define GEN6_3DSTATE_GS_IllegalOpcodeExceptionEnable_bits  1
   33436 
   33437 static inline uint32_t ATTRIBUTE_PURE
   33438 _3DSTATE_GS_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   33439 {
   33440    switch (devinfo->gen) {
   33441    case 10: return 1;
   33442    case 9: return 1;
   33443    case 8: return 1;
   33444    case 7:
   33445       if (devinfo->is_haswell) {
   33446          return 1;
   33447       } else {
   33448          return 1;
   33449       }
   33450    case 6: return 1;
   33451    case 5: return 0;
   33452    case 4:
   33453       if (devinfo->is_g4x) {
   33454          return 0;
   33455       } else {
   33456          return 0;
   33457       }
   33458    default:
   33459       unreachable("Invalid hardware generation");
   33460    }
   33461 }
   33462 
   33463 
   33464 
   33465 #define GEN10_3DSTATE_GS_IllegalOpcodeExceptionEnable_start  109
   33466 #define GEN9_3DSTATE_GS_IllegalOpcodeExceptionEnable_start  109
   33467 #define GEN8_3DSTATE_GS_IllegalOpcodeExceptionEnable_start  109
   33468 #define GEN75_3DSTATE_GS_IllegalOpcodeExceptionEnable_start  77
   33469 #define GEN7_3DSTATE_GS_IllegalOpcodeExceptionEnable_start  77
   33470 #define GEN6_3DSTATE_GS_IllegalOpcodeExceptionEnable_start  77
   33471 
   33472 static inline uint32_t ATTRIBUTE_PURE
   33473 _3DSTATE_GS_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   33474 {
   33475    switch (devinfo->gen) {
   33476    case 10: return 109;
   33477    case 9: return 109;
   33478    case 8: return 109;
   33479    case 7:
   33480       if (devinfo->is_haswell) {
   33481          return 77;
   33482       } else {
   33483          return 77;
   33484       }
   33485    case 6: return 77;
   33486    case 5: return 0;
   33487    case 4:
   33488       if (devinfo->is_g4x) {
   33489          return 0;
   33490       } else {
   33491          return 0;
   33492       }
   33493    default:
   33494       unreachable("Invalid hardware generation");
   33495    }
   33496 }
   33497 
   33498 
   33499 
   33500 /* 3DSTATE_GS::Include Primitive ID */
   33501 
   33502 
   33503 #define GEN10_3DSTATE_GS_IncludePrimitiveID_bits  1
   33504 #define GEN9_3DSTATE_GS_IncludePrimitiveID_bits  1
   33505 #define GEN8_3DSTATE_GS_IncludePrimitiveID_bits  1
   33506 #define GEN75_3DSTATE_GS_IncludePrimitiveID_bits  1
   33507 #define GEN7_3DSTATE_GS_IncludePrimitiveID_bits  1
   33508 
   33509 static inline uint32_t ATTRIBUTE_PURE
   33510 _3DSTATE_GS_IncludePrimitiveID_bits(const struct gen_device_info *devinfo)
   33511 {
   33512    switch (devinfo->gen) {
   33513    case 10: return 1;
   33514    case 9: return 1;
   33515    case 8: return 1;
   33516    case 7:
   33517       if (devinfo->is_haswell) {
   33518          return 1;
   33519       } else {
   33520          return 1;
   33521       }
   33522    case 6: return 0;
   33523    case 5: return 0;
   33524    case 4:
   33525       if (devinfo->is_g4x) {
   33526          return 0;
   33527       } else {
   33528          return 0;
   33529       }
   33530    default:
   33531       unreachable("Invalid hardware generation");
   33532    }
   33533 }
   33534 
   33535 
   33536 
   33537 #define GEN10_3DSTATE_GS_IncludePrimitiveID_start  228
   33538 #define GEN9_3DSTATE_GS_IncludePrimitiveID_start  228
   33539 #define GEN8_3DSTATE_GS_IncludePrimitiveID_start  228
   33540 #define GEN75_3DSTATE_GS_IncludePrimitiveID_start  164
   33541 #define GEN7_3DSTATE_GS_IncludePrimitiveID_start  164
   33542 
   33543 static inline uint32_t ATTRIBUTE_PURE
   33544 _3DSTATE_GS_IncludePrimitiveID_start(const struct gen_device_info *devinfo)
   33545 {
   33546    switch (devinfo->gen) {
   33547    case 10: return 228;
   33548    case 9: return 228;
   33549    case 8: return 228;
   33550    case 7:
   33551       if (devinfo->is_haswell) {
   33552          return 164;
   33553       } else {
   33554          return 164;
   33555       }
   33556    case 6: return 0;
   33557    case 5: return 0;
   33558    case 4:
   33559       if (devinfo->is_g4x) {
   33560          return 0;
   33561       } else {
   33562          return 0;
   33563       }
   33564    default:
   33565       unreachable("Invalid hardware generation");
   33566    }
   33567 }
   33568 
   33569 
   33570 
   33571 /* 3DSTATE_GS::Include Vertex Handles */
   33572 
   33573 
   33574 #define GEN10_3DSTATE_GS_IncludeVertexHandles_bits  1
   33575 #define GEN9_3DSTATE_GS_IncludeVertexHandles_bits  1
   33576 #define GEN8_3DSTATE_GS_IncludeVertexHandles_bits  1
   33577 #define GEN75_3DSTATE_GS_IncludeVertexHandles_bits  1
   33578 #define GEN7_3DSTATE_GS_IncludeVertexHandles_bits  1
   33579 
   33580 static inline uint32_t ATTRIBUTE_PURE
   33581 _3DSTATE_GS_IncludeVertexHandles_bits(const struct gen_device_info *devinfo)
   33582 {
   33583    switch (devinfo->gen) {
   33584    case 10: return 1;
   33585    case 9: return 1;
   33586    case 8: return 1;
   33587    case 7:
   33588       if (devinfo->is_haswell) {
   33589          return 1;
   33590       } else {
   33591          return 1;
   33592       }
   33593    case 6: return 0;
   33594    case 5: return 0;
   33595    case 4:
   33596       if (devinfo->is_g4x) {
   33597          return 0;
   33598       } else {
   33599          return 0;
   33600       }
   33601    default:
   33602       unreachable("Invalid hardware generation");
   33603    }
   33604 }
   33605 
   33606 
   33607 
   33608 #define GEN10_3DSTATE_GS_IncludeVertexHandles_start  202
   33609 #define GEN9_3DSTATE_GS_IncludeVertexHandles_start  202
   33610 #define GEN8_3DSTATE_GS_IncludeVertexHandles_start  202
   33611 #define GEN75_3DSTATE_GS_IncludeVertexHandles_start  138
   33612 #define GEN7_3DSTATE_GS_IncludeVertexHandles_start  138
   33613 
   33614 static inline uint32_t ATTRIBUTE_PURE
   33615 _3DSTATE_GS_IncludeVertexHandles_start(const struct gen_device_info *devinfo)
   33616 {
   33617    switch (devinfo->gen) {
   33618    case 10: return 202;
   33619    case 9: return 202;
   33620    case 8: return 202;
   33621    case 7:
   33622       if (devinfo->is_haswell) {
   33623          return 138;
   33624       } else {
   33625          return 138;
   33626       }
   33627    case 6: return 0;
   33628    case 5: return 0;
   33629    case 4:
   33630       if (devinfo->is_g4x) {
   33631          return 0;
   33632       } else {
   33633          return 0;
   33634       }
   33635    default:
   33636       unreachable("Invalid hardware generation");
   33637    }
   33638 }
   33639 
   33640 
   33641 
   33642 /* 3DSTATE_GS::Instance Control */
   33643 
   33644 
   33645 #define GEN10_3DSTATE_GS_InstanceControl_bits  5
   33646 #define GEN9_3DSTATE_GS_InstanceControl_bits  5
   33647 #define GEN8_3DSTATE_GS_InstanceControl_bits  5
   33648 #define GEN75_3DSTATE_GS_InstanceControl_bits  5
   33649 #define GEN7_3DSTATE_GS_InstanceControl_bits  5
   33650 
   33651 static inline uint32_t ATTRIBUTE_PURE
   33652 _3DSTATE_GS_InstanceControl_bits(const struct gen_device_info *devinfo)
   33653 {
   33654    switch (devinfo->gen) {
   33655    case 10: return 5;
   33656    case 9: return 5;
   33657    case 8: return 5;
   33658    case 7:
   33659       if (devinfo->is_haswell) {
   33660          return 5;
   33661       } else {
   33662          return 5;
   33663       }
   33664    case 6: return 0;
   33665    case 5: return 0;
   33666    case 4:
   33667       if (devinfo->is_g4x) {
   33668          return 0;
   33669       } else {
   33670          return 0;
   33671       }
   33672    default:
   33673       unreachable("Invalid hardware generation");
   33674    }
   33675 }
   33676 
   33677 
   33678 
   33679 #define GEN10_3DSTATE_GS_InstanceControl_start  239
   33680 #define GEN9_3DSTATE_GS_InstanceControl_start  239
   33681 #define GEN8_3DSTATE_GS_InstanceControl_start  239
   33682 #define GEN75_3DSTATE_GS_InstanceControl_start  175
   33683 #define GEN7_3DSTATE_GS_InstanceControl_start  175
   33684 
   33685 static inline uint32_t ATTRIBUTE_PURE
   33686 _3DSTATE_GS_InstanceControl_start(const struct gen_device_info *devinfo)
   33687 {
   33688    switch (devinfo->gen) {
   33689    case 10: return 239;
   33690    case 9: return 239;
   33691    case 8: return 239;
   33692    case 7:
   33693       if (devinfo->is_haswell) {
   33694          return 175;
   33695       } else {
   33696          return 175;
   33697       }
   33698    case 6: return 0;
   33699    case 5: return 0;
   33700    case 4:
   33701       if (devinfo->is_g4x) {
   33702          return 0;
   33703       } else {
   33704          return 0;
   33705       }
   33706    default:
   33707       unreachable("Invalid hardware generation");
   33708    }
   33709 }
   33710 
   33711 
   33712 
   33713 /* 3DSTATE_GS::Invocations Increment Value */
   33714 
   33715 
   33716 #define GEN10_3DSTATE_GS_InvocationsIncrementValue_bits  5
   33717 #define GEN9_3DSTATE_GS_InvocationsIncrementValue_bits  5
   33718 #define GEN8_3DSTATE_GS_InvocationsIncrementValue_bits  5
   33719 
   33720 static inline uint32_t ATTRIBUTE_PURE
   33721 _3DSTATE_GS_InvocationsIncrementValue_bits(const struct gen_device_info *devinfo)
   33722 {
   33723    switch (devinfo->gen) {
   33724    case 10: return 5;
   33725    case 9: return 5;
   33726    case 8: return 5;
   33727    case 7:
   33728       if (devinfo->is_haswell) {
   33729          return 0;
   33730       } else {
   33731          return 0;
   33732       }
   33733    case 6: return 0;
   33734    case 5: return 0;
   33735    case 4:
   33736       if (devinfo->is_g4x) {
   33737          return 0;
   33738       } else {
   33739          return 0;
   33740       }
   33741    default:
   33742       unreachable("Invalid hardware generation");
   33743    }
   33744 }
   33745 
   33746 
   33747 
   33748 #define GEN10_3DSTATE_GS_InvocationsIncrementValue_start  229
   33749 #define GEN9_3DSTATE_GS_InvocationsIncrementValue_start  229
   33750 #define GEN8_3DSTATE_GS_InvocationsIncrementValue_start  229
   33751 
   33752 static inline uint32_t ATTRIBUTE_PURE
   33753 _3DSTATE_GS_InvocationsIncrementValue_start(const struct gen_device_info *devinfo)
   33754 {
   33755    switch (devinfo->gen) {
   33756    case 10: return 229;
   33757    case 9: return 229;
   33758    case 8: return 229;
   33759    case 7:
   33760       if (devinfo->is_haswell) {
   33761          return 0;
   33762       } else {
   33763          return 0;
   33764       }
   33765    case 6: return 0;
   33766    case 5: return 0;
   33767    case 4:
   33768       if (devinfo->is_g4x) {
   33769          return 0;
   33770       } else {
   33771          return 0;
   33772       }
   33773    default:
   33774       unreachable("Invalid hardware generation");
   33775    }
   33776 }
   33777 
   33778 
   33779 
   33780 /* 3DSTATE_GS::Kernel Start Pointer */
   33781 
   33782 
   33783 #define GEN10_3DSTATE_GS_KernelStartPointer_bits  58
   33784 #define GEN9_3DSTATE_GS_KernelStartPointer_bits  58
   33785 #define GEN8_3DSTATE_GS_KernelStartPointer_bits  58
   33786 #define GEN75_3DSTATE_GS_KernelStartPointer_bits  26
   33787 #define GEN7_3DSTATE_GS_KernelStartPointer_bits  26
   33788 #define GEN6_3DSTATE_GS_KernelStartPointer_bits  26
   33789 
   33790 static inline uint32_t ATTRIBUTE_PURE
   33791 _3DSTATE_GS_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   33792 {
   33793    switch (devinfo->gen) {
   33794    case 10: return 58;
   33795    case 9: return 58;
   33796    case 8: return 58;
   33797    case 7:
   33798       if (devinfo->is_haswell) {
   33799          return 26;
   33800       } else {
   33801          return 26;
   33802       }
   33803    case 6: return 26;
   33804    case 5: return 0;
   33805    case 4:
   33806       if (devinfo->is_g4x) {
   33807          return 0;
   33808       } else {
   33809          return 0;
   33810       }
   33811    default:
   33812       unreachable("Invalid hardware generation");
   33813    }
   33814 }
   33815 
   33816 
   33817 
   33818 #define GEN10_3DSTATE_GS_KernelStartPointer_start  38
   33819 #define GEN9_3DSTATE_GS_KernelStartPointer_start  38
   33820 #define GEN8_3DSTATE_GS_KernelStartPointer_start  38
   33821 #define GEN75_3DSTATE_GS_KernelStartPointer_start  38
   33822 #define GEN7_3DSTATE_GS_KernelStartPointer_start  38
   33823 #define GEN6_3DSTATE_GS_KernelStartPointer_start  38
   33824 
   33825 static inline uint32_t ATTRIBUTE_PURE
   33826 _3DSTATE_GS_KernelStartPointer_start(const struct gen_device_info *devinfo)
   33827 {
   33828    switch (devinfo->gen) {
   33829    case 10: return 38;
   33830    case 9: return 38;
   33831    case 8: return 38;
   33832    case 7:
   33833       if (devinfo->is_haswell) {
   33834          return 38;
   33835       } else {
   33836          return 38;
   33837       }
   33838    case 6: return 38;
   33839    case 5: return 0;
   33840    case 4:
   33841       if (devinfo->is_g4x) {
   33842          return 0;
   33843       } else {
   33844          return 0;
   33845       }
   33846    default:
   33847       unreachable("Invalid hardware generation");
   33848    }
   33849 }
   33850 
   33851 
   33852 
   33853 /* 3DSTATE_GS::Mask Stack Exception Enable */
   33854 
   33855 
   33856 #define GEN10_3DSTATE_GS_MaskStackExceptionEnable_bits  1
   33857 #define GEN9_3DSTATE_GS_MaskStackExceptionEnable_bits  1
   33858 #define GEN8_3DSTATE_GS_MaskStackExceptionEnable_bits  1
   33859 #define GEN75_3DSTATE_GS_MaskStackExceptionEnable_bits  1
   33860 #define GEN7_3DSTATE_GS_MaskStackExceptionEnable_bits  1
   33861 #define GEN6_3DSTATE_GS_MaskStackExceptionEnable_bits  1
   33862 
   33863 static inline uint32_t ATTRIBUTE_PURE
   33864 _3DSTATE_GS_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   33865 {
   33866    switch (devinfo->gen) {
   33867    case 10: return 1;
   33868    case 9: return 1;
   33869    case 8: return 1;
   33870    case 7:
   33871       if (devinfo->is_haswell) {
   33872          return 1;
   33873       } else {
   33874          return 1;
   33875       }
   33876    case 6: return 1;
   33877    case 5: return 0;
   33878    case 4:
   33879       if (devinfo->is_g4x) {
   33880          return 0;
   33881       } else {
   33882          return 0;
   33883       }
   33884    default:
   33885       unreachable("Invalid hardware generation");
   33886    }
   33887 }
   33888 
   33889 
   33890 
   33891 #define GEN10_3DSTATE_GS_MaskStackExceptionEnable_start  107
   33892 #define GEN9_3DSTATE_GS_MaskStackExceptionEnable_start  107
   33893 #define GEN8_3DSTATE_GS_MaskStackExceptionEnable_start  107
   33894 #define GEN75_3DSTATE_GS_MaskStackExceptionEnable_start  75
   33895 #define GEN7_3DSTATE_GS_MaskStackExceptionEnable_start  75
   33896 #define GEN6_3DSTATE_GS_MaskStackExceptionEnable_start  75
   33897 
   33898 static inline uint32_t ATTRIBUTE_PURE
   33899 _3DSTATE_GS_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   33900 {
   33901    switch (devinfo->gen) {
   33902    case 10: return 107;
   33903    case 9: return 107;
   33904    case 8: return 107;
   33905    case 7:
   33906       if (devinfo->is_haswell) {
   33907          return 75;
   33908       } else {
   33909          return 75;
   33910       }
   33911    case 6: return 75;
   33912    case 5: return 0;
   33913    case 4:
   33914       if (devinfo->is_g4x) {
   33915          return 0;
   33916       } else {
   33917          return 0;
   33918       }
   33919    default:
   33920       unreachable("Invalid hardware generation");
   33921    }
   33922 }
   33923 
   33924 
   33925 
   33926 /* 3DSTATE_GS::Maximum Number of Threads */
   33927 
   33928 
   33929 #define GEN10_3DSTATE_GS_MaximumNumberofThreads_bits  9
   33930 #define GEN9_3DSTATE_GS_MaximumNumberofThreads_bits  9
   33931 #define GEN8_3DSTATE_GS_MaximumNumberofThreads_bits  8
   33932 #define GEN75_3DSTATE_GS_MaximumNumberofThreads_bits  8
   33933 #define GEN7_3DSTATE_GS_MaximumNumberofThreads_bits  7
   33934 #define GEN6_3DSTATE_GS_MaximumNumberofThreads_bits  7
   33935 
   33936 static inline uint32_t ATTRIBUTE_PURE
   33937 _3DSTATE_GS_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   33938 {
   33939    switch (devinfo->gen) {
   33940    case 10: return 9;
   33941    case 9: return 9;
   33942    case 8: return 8;
   33943    case 7:
   33944       if (devinfo->is_haswell) {
   33945          return 8;
   33946       } else {
   33947          return 7;
   33948       }
   33949    case 6: return 7;
   33950    case 5: return 0;
   33951    case 4:
   33952       if (devinfo->is_g4x) {
   33953          return 0;
   33954       } else {
   33955          return 0;
   33956       }
   33957    default:
   33958       unreachable("Invalid hardware generation");
   33959    }
   33960 }
   33961 
   33962 
   33963 
   33964 #define GEN10_3DSTATE_GS_MaximumNumberofThreads_start  256
   33965 #define GEN9_3DSTATE_GS_MaximumNumberofThreads_start  256
   33966 #define GEN8_3DSTATE_GS_MaximumNumberofThreads_start  248
   33967 #define GEN75_3DSTATE_GS_MaximumNumberofThreads_start  184
   33968 #define GEN7_3DSTATE_GS_MaximumNumberofThreads_start  185
   33969 #define GEN6_3DSTATE_GS_MaximumNumberofThreads_start  185
   33970 
   33971 static inline uint32_t ATTRIBUTE_PURE
   33972 _3DSTATE_GS_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   33973 {
   33974    switch (devinfo->gen) {
   33975    case 10: return 256;
   33976    case 9: return 256;
   33977    case 8: return 248;
   33978    case 7:
   33979       if (devinfo->is_haswell) {
   33980          return 184;
   33981       } else {
   33982          return 185;
   33983       }
   33984    case 6: return 185;
   33985    case 5: return 0;
   33986    case 4:
   33987       if (devinfo->is_g4x) {
   33988          return 0;
   33989       } else {
   33990          return 0;
   33991       }
   33992    default:
   33993       unreachable("Invalid hardware generation");
   33994    }
   33995 }
   33996 
   33997 
   33998 
   33999 /* 3DSTATE_GS::Output Topology */
   34000 
   34001 
   34002 #define GEN10_3DSTATE_GS_OutputTopology_bits  6
   34003 #define GEN9_3DSTATE_GS_OutputTopology_bits  6
   34004 #define GEN8_3DSTATE_GS_OutputTopology_bits  6
   34005 #define GEN75_3DSTATE_GS_OutputTopology_bits  6
   34006 #define GEN7_3DSTATE_GS_OutputTopology_bits  6
   34007 
   34008 static inline uint32_t ATTRIBUTE_PURE
   34009 _3DSTATE_GS_OutputTopology_bits(const struct gen_device_info *devinfo)
   34010 {
   34011    switch (devinfo->gen) {
   34012    case 10: return 6;
   34013    case 9: return 6;
   34014    case 8: return 6;
   34015    case 7:
   34016       if (devinfo->is_haswell) {
   34017          return 6;
   34018       } else {
   34019          return 6;
   34020       }
   34021    case 6: return 0;
   34022    case 5: return 0;
   34023    case 4:
   34024       if (devinfo->is_g4x) {
   34025          return 0;
   34026       } else {
   34027          return 0;
   34028       }
   34029    default:
   34030       unreachable("Invalid hardware generation");
   34031    }
   34032 }
   34033 
   34034 
   34035 
   34036 #define GEN10_3DSTATE_GS_OutputTopology_start  209
   34037 #define GEN9_3DSTATE_GS_OutputTopology_start  209
   34038 #define GEN8_3DSTATE_GS_OutputTopology_start  209
   34039 #define GEN75_3DSTATE_GS_OutputTopology_start  145
   34040 #define GEN7_3DSTATE_GS_OutputTopology_start  145
   34041 
   34042 static inline uint32_t ATTRIBUTE_PURE
   34043 _3DSTATE_GS_OutputTopology_start(const struct gen_device_info *devinfo)
   34044 {
   34045    switch (devinfo->gen) {
   34046    case 10: return 209;
   34047    case 9: return 209;
   34048    case 8: return 209;
   34049    case 7:
   34050       if (devinfo->is_haswell) {
   34051          return 145;
   34052       } else {
   34053          return 145;
   34054       }
   34055    case 6: return 0;
   34056    case 5: return 0;
   34057    case 4:
   34058       if (devinfo->is_g4x) {
   34059          return 0;
   34060       } else {
   34061          return 0;
   34062       }
   34063    default:
   34064       unreachable("Invalid hardware generation");
   34065    }
   34066 }
   34067 
   34068 
   34069 
   34070 /* 3DSTATE_GS::Output Vertex Size */
   34071 
   34072 
   34073 #define GEN10_3DSTATE_GS_OutputVertexSize_bits  6
   34074 #define GEN9_3DSTATE_GS_OutputVertexSize_bits  6
   34075 #define GEN8_3DSTATE_GS_OutputVertexSize_bits  6
   34076 #define GEN75_3DSTATE_GS_OutputVertexSize_bits  6
   34077 #define GEN7_3DSTATE_GS_OutputVertexSize_bits  6
   34078 
   34079 static inline uint32_t ATTRIBUTE_PURE
   34080 _3DSTATE_GS_OutputVertexSize_bits(const struct gen_device_info *devinfo)
   34081 {
   34082    switch (devinfo->gen) {
   34083    case 10: return 6;
   34084    case 9: return 6;
   34085    case 8: return 6;
   34086    case 7:
   34087       if (devinfo->is_haswell) {
   34088          return 6;
   34089       } else {
   34090          return 6;
   34091       }
   34092    case 6: return 0;
   34093    case 5: return 0;
   34094    case 4:
   34095       if (devinfo->is_g4x) {
   34096          return 0;
   34097       } else {
   34098          return 0;
   34099       }
   34100    default:
   34101       unreachable("Invalid hardware generation");
   34102    }
   34103 }
   34104 
   34105 
   34106 
   34107 #define GEN10_3DSTATE_GS_OutputVertexSize_start  215
   34108 #define GEN9_3DSTATE_GS_OutputVertexSize_start  215
   34109 #define GEN8_3DSTATE_GS_OutputVertexSize_start  215
   34110 #define GEN75_3DSTATE_GS_OutputVertexSize_start  151
   34111 #define GEN7_3DSTATE_GS_OutputVertexSize_start  151
   34112 
   34113 static inline uint32_t ATTRIBUTE_PURE
   34114 _3DSTATE_GS_OutputVertexSize_start(const struct gen_device_info *devinfo)
   34115 {
   34116    switch (devinfo->gen) {
   34117    case 10: return 215;
   34118    case 9: return 215;
   34119    case 8: return 215;
   34120    case 7:
   34121       if (devinfo->is_haswell) {
   34122          return 151;
   34123       } else {
   34124          return 151;
   34125       }
   34126    case 6: return 0;
   34127    case 5: return 0;
   34128    case 4:
   34129       if (devinfo->is_g4x) {
   34130          return 0;
   34131       } else {
   34132          return 0;
   34133       }
   34134    default:
   34135       unreachable("Invalid hardware generation");
   34136    }
   34137 }
   34138 
   34139 
   34140 
   34141 /* 3DSTATE_GS::Per-Thread Scratch Space */
   34142 
   34143 
   34144 #define GEN10_3DSTATE_GS_PerThreadScratchSpace_bits  4
   34145 #define GEN9_3DSTATE_GS_PerThreadScratchSpace_bits  4
   34146 #define GEN8_3DSTATE_GS_PerThreadScratchSpace_bits  4
   34147 #define GEN75_3DSTATE_GS_PerThreadScratchSpace_bits  4
   34148 #define GEN7_3DSTATE_GS_PerThreadScratchSpace_bits  4
   34149 #define GEN6_3DSTATE_GS_PerThreadScratchSpace_bits  4
   34150 
   34151 static inline uint32_t ATTRIBUTE_PURE
   34152 _3DSTATE_GS_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   34153 {
   34154    switch (devinfo->gen) {
   34155    case 10: return 4;
   34156    case 9: return 4;
   34157    case 8: return 4;
   34158    case 7:
   34159       if (devinfo->is_haswell) {
   34160          return 4;
   34161       } else {
   34162          return 4;
   34163       }
   34164    case 6: return 4;
   34165    case 5: return 0;
   34166    case 4:
   34167       if (devinfo->is_g4x) {
   34168          return 0;
   34169       } else {
   34170          return 0;
   34171       }
   34172    default:
   34173       unreachable("Invalid hardware generation");
   34174    }
   34175 }
   34176 
   34177 
   34178 
   34179 #define GEN10_3DSTATE_GS_PerThreadScratchSpace_start  128
   34180 #define GEN9_3DSTATE_GS_PerThreadScratchSpace_start  128
   34181 #define GEN8_3DSTATE_GS_PerThreadScratchSpace_start  128
   34182 #define GEN75_3DSTATE_GS_PerThreadScratchSpace_start  96
   34183 #define GEN7_3DSTATE_GS_PerThreadScratchSpace_start  96
   34184 #define GEN6_3DSTATE_GS_PerThreadScratchSpace_start  96
   34185 
   34186 static inline uint32_t ATTRIBUTE_PURE
   34187 _3DSTATE_GS_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   34188 {
   34189    switch (devinfo->gen) {
   34190    case 10: return 128;
   34191    case 9: return 128;
   34192    case 8: return 128;
   34193    case 7:
   34194       if (devinfo->is_haswell) {
   34195          return 96;
   34196       } else {
   34197          return 96;
   34198       }
   34199    case 6: return 96;
   34200    case 5: return 0;
   34201    case 4:
   34202       if (devinfo->is_g4x) {
   34203          return 0;
   34204       } else {
   34205          return 0;
   34206       }
   34207    default:
   34208       unreachable("Invalid hardware generation");
   34209    }
   34210 }
   34211 
   34212 
   34213 
   34214 /* 3DSTATE_GS::Rendering Enabled */
   34215 
   34216 
   34217 #define GEN6_3DSTATE_GS_RenderingEnabled_bits  1
   34218 
   34219 static inline uint32_t ATTRIBUTE_PURE
   34220 _3DSTATE_GS_RenderingEnabled_bits(const struct gen_device_info *devinfo)
   34221 {
   34222    switch (devinfo->gen) {
   34223    case 10: return 0;
   34224    case 9: return 0;
   34225    case 8: return 0;
   34226    case 7:
   34227       if (devinfo->is_haswell) {
   34228          return 0;
   34229       } else {
   34230          return 0;
   34231       }
   34232    case 6: return 1;
   34233    case 5: return 0;
   34234    case 4:
   34235       if (devinfo->is_g4x) {
   34236          return 0;
   34237       } else {
   34238          return 0;
   34239       }
   34240    default:
   34241       unreachable("Invalid hardware generation");
   34242    }
   34243 }
   34244 
   34245 
   34246 
   34247 #define GEN6_3DSTATE_GS_RenderingEnabled_start  168
   34248 
   34249 static inline uint32_t ATTRIBUTE_PURE
   34250 _3DSTATE_GS_RenderingEnabled_start(const struct gen_device_info *devinfo)
   34251 {
   34252    switch (devinfo->gen) {
   34253    case 10: return 0;
   34254    case 9: return 0;
   34255    case 8: return 0;
   34256    case 7:
   34257       if (devinfo->is_haswell) {
   34258          return 0;
   34259       } else {
   34260          return 0;
   34261       }
   34262    case 6: return 168;
   34263    case 5: return 0;
   34264    case 4:
   34265       if (devinfo->is_g4x) {
   34266          return 0;
   34267       } else {
   34268          return 0;
   34269       }
   34270    default:
   34271       unreachable("Invalid hardware generation");
   34272    }
   34273 }
   34274 
   34275 
   34276 
   34277 /* 3DSTATE_GS::Reorder Mode */
   34278 
   34279 
   34280 #define GEN10_3DSTATE_GS_ReorderMode_bits  1
   34281 #define GEN9_3DSTATE_GS_ReorderMode_bits  1
   34282 #define GEN8_3DSTATE_GS_ReorderMode_bits  1
   34283 #define GEN75_3DSTATE_GS_ReorderMode_bits  1
   34284 #define GEN7_3DSTATE_GS_ReorderMode_bits  1
   34285 #define GEN6_3DSTATE_GS_ReorderMode_bits  1
   34286 
   34287 static inline uint32_t ATTRIBUTE_PURE
   34288 _3DSTATE_GS_ReorderMode_bits(const struct gen_device_info *devinfo)
   34289 {
   34290    switch (devinfo->gen) {
   34291    case 10: return 1;
   34292    case 9: return 1;
   34293    case 8: return 1;
   34294    case 7:
   34295       if (devinfo->is_haswell) {
   34296          return 1;
   34297       } else {
   34298          return 1;
   34299       }
   34300    case 6: return 1;
   34301    case 5: return 0;
   34302    case 4:
   34303       if (devinfo->is_g4x) {
   34304          return 0;
   34305       } else {
   34306          return 0;
   34307       }
   34308    default:
   34309       unreachable("Invalid hardware generation");
   34310    }
   34311 }
   34312 
   34313 
   34314 
   34315 #define GEN10_3DSTATE_GS_ReorderMode_start  226
   34316 #define GEN9_3DSTATE_GS_ReorderMode_start  226
   34317 #define GEN8_3DSTATE_GS_ReorderMode_start  226
   34318 #define GEN75_3DSTATE_GS_ReorderMode_start  162
   34319 #define GEN7_3DSTATE_GS_ReorderMode_start  162
   34320 #define GEN6_3DSTATE_GS_ReorderMode_start  222
   34321 
   34322 static inline uint32_t ATTRIBUTE_PURE
   34323 _3DSTATE_GS_ReorderMode_start(const struct gen_device_info *devinfo)
   34324 {
   34325    switch (devinfo->gen) {
   34326    case 10: return 226;
   34327    case 9: return 226;
   34328    case 8: return 226;
   34329    case 7:
   34330       if (devinfo->is_haswell) {
   34331          return 162;
   34332       } else {
   34333          return 162;
   34334       }
   34335    case 6: return 222;
   34336    case 5: return 0;
   34337    case 4:
   34338       if (devinfo->is_g4x) {
   34339          return 0;
   34340       } else {
   34341          return 0;
   34342       }
   34343    default:
   34344       unreachable("Invalid hardware generation");
   34345    }
   34346 }
   34347 
   34348 
   34349 
   34350 /* 3DSTATE_GS::SO Statistics Enable */
   34351 
   34352 
   34353 #define GEN6_3DSTATE_GS_SOStatisticsEnable_bits  1
   34354 
   34355 static inline uint32_t ATTRIBUTE_PURE
   34356 _3DSTATE_GS_SOStatisticsEnable_bits(const struct gen_device_info *devinfo)
   34357 {
   34358    switch (devinfo->gen) {
   34359    case 10: return 0;
   34360    case 9: return 0;
   34361    case 8: return 0;
   34362    case 7:
   34363       if (devinfo->is_haswell) {
   34364          return 0;
   34365       } else {
   34366          return 0;
   34367       }
   34368    case 6: return 1;
   34369    case 5: return 0;
   34370    case 4:
   34371       if (devinfo->is_g4x) {
   34372          return 0;
   34373       } else {
   34374          return 0;
   34375       }
   34376    default:
   34377       unreachable("Invalid hardware generation");
   34378    }
   34379 }
   34380 
   34381 
   34382 
   34383 #define GEN6_3DSTATE_GS_SOStatisticsEnable_start  169
   34384 
   34385 static inline uint32_t ATTRIBUTE_PURE
   34386 _3DSTATE_GS_SOStatisticsEnable_start(const struct gen_device_info *devinfo)
   34387 {
   34388    switch (devinfo->gen) {
   34389    case 10: return 0;
   34390    case 9: return 0;
   34391    case 8: return 0;
   34392    case 7:
   34393       if (devinfo->is_haswell) {
   34394          return 0;
   34395       } else {
   34396          return 0;
   34397       }
   34398    case 6: return 169;
   34399    case 5: return 0;
   34400    case 4:
   34401       if (devinfo->is_g4x) {
   34402          return 0;
   34403       } else {
   34404          return 0;
   34405       }
   34406    default:
   34407       unreachable("Invalid hardware generation");
   34408    }
   34409 }
   34410 
   34411 
   34412 
   34413 /* 3DSTATE_GS::SVBI Payload Enable */
   34414 
   34415 
   34416 #define GEN6_3DSTATE_GS_SVBIPayloadEnable_bits  1
   34417 
   34418 static inline uint32_t ATTRIBUTE_PURE
   34419 _3DSTATE_GS_SVBIPayloadEnable_bits(const struct gen_device_info *devinfo)
   34420 {
   34421    switch (devinfo->gen) {
   34422    case 10: return 0;
   34423    case 9: return 0;
   34424    case 8: return 0;
   34425    case 7:
   34426       if (devinfo->is_haswell) {
   34427          return 0;
   34428       } else {
   34429          return 0;
   34430       }
   34431    case 6: return 1;
   34432    case 5: return 0;
   34433    case 4:
   34434       if (devinfo->is_g4x) {
   34435          return 0;
   34436       } else {
   34437          return 0;
   34438       }
   34439    default:
   34440       unreachable("Invalid hardware generation");
   34441    }
   34442 }
   34443 
   34444 
   34445 
   34446 #define GEN6_3DSTATE_GS_SVBIPayloadEnable_start  220
   34447 
   34448 static inline uint32_t ATTRIBUTE_PURE
   34449 _3DSTATE_GS_SVBIPayloadEnable_start(const struct gen_device_info *devinfo)
   34450 {
   34451    switch (devinfo->gen) {
   34452    case 10: return 0;
   34453    case 9: return 0;
   34454    case 8: return 0;
   34455    case 7:
   34456       if (devinfo->is_haswell) {
   34457          return 0;
   34458       } else {
   34459          return 0;
   34460       }
   34461    case 6: return 220;
   34462    case 5: return 0;
   34463    case 4:
   34464       if (devinfo->is_g4x) {
   34465          return 0;
   34466       } else {
   34467          return 0;
   34468       }
   34469    default:
   34470       unreachable("Invalid hardware generation");
   34471    }
   34472 }
   34473 
   34474 
   34475 
   34476 /* 3DSTATE_GS::SVBI Post-Increment Enable */
   34477 
   34478 
   34479 #define GEN6_3DSTATE_GS_SVBIPostIncrementEnable_bits  1
   34480 
   34481 static inline uint32_t ATTRIBUTE_PURE
   34482 _3DSTATE_GS_SVBIPostIncrementEnable_bits(const struct gen_device_info *devinfo)
   34483 {
   34484    switch (devinfo->gen) {
   34485    case 10: return 0;
   34486    case 9: return 0;
   34487    case 8: return 0;
   34488    case 7:
   34489       if (devinfo->is_haswell) {
   34490          return 0;
   34491       } else {
   34492          return 0;
   34493       }
   34494    case 6: return 1;
   34495    case 5: return 0;
   34496    case 4:
   34497       if (devinfo->is_g4x) {
   34498          return 0;
   34499       } else {
   34500          return 0;
   34501       }
   34502    default:
   34503       unreachable("Invalid hardware generation");
   34504    }
   34505 }
   34506 
   34507 
   34508 
   34509 #define GEN6_3DSTATE_GS_SVBIPostIncrementEnable_start  219
   34510 
   34511 static inline uint32_t ATTRIBUTE_PURE
   34512 _3DSTATE_GS_SVBIPostIncrementEnable_start(const struct gen_device_info *devinfo)
   34513 {
   34514    switch (devinfo->gen) {
   34515    case 10: return 0;
   34516    case 9: return 0;
   34517    case 8: return 0;
   34518    case 7:
   34519       if (devinfo->is_haswell) {
   34520          return 0;
   34521       } else {
   34522          return 0;
   34523       }
   34524    case 6: return 219;
   34525    case 5: return 0;
   34526    case 4:
   34527       if (devinfo->is_g4x) {
   34528          return 0;
   34529       } else {
   34530          return 0;
   34531       }
   34532    default:
   34533       unreachable("Invalid hardware generation");
   34534    }
   34535 }
   34536 
   34537 
   34538 
   34539 /* 3DSTATE_GS::SVBI Post-Increment Value */
   34540 
   34541 
   34542 #define GEN6_3DSTATE_GS_SVBIPostIncrementValue_bits  10
   34543 
   34544 static inline uint32_t ATTRIBUTE_PURE
   34545 _3DSTATE_GS_SVBIPostIncrementValue_bits(const struct gen_device_info *devinfo)
   34546 {
   34547    switch (devinfo->gen) {
   34548    case 10: return 0;
   34549    case 9: return 0;
   34550    case 8: return 0;
   34551    case 7:
   34552       if (devinfo->is_haswell) {
   34553          return 0;
   34554       } else {
   34555          return 0;
   34556       }
   34557    case 6: return 10;
   34558    case 5: return 0;
   34559    case 4:
   34560       if (devinfo->is_g4x) {
   34561          return 0;
   34562       } else {
   34563          return 0;
   34564       }
   34565    default:
   34566       unreachable("Invalid hardware generation");
   34567    }
   34568 }
   34569 
   34570 
   34571 
   34572 #define GEN6_3DSTATE_GS_SVBIPostIncrementValue_start  208
   34573 
   34574 static inline uint32_t ATTRIBUTE_PURE
   34575 _3DSTATE_GS_SVBIPostIncrementValue_start(const struct gen_device_info *devinfo)
   34576 {
   34577    switch (devinfo->gen) {
   34578    case 10: return 0;
   34579    case 9: return 0;
   34580    case 8: return 0;
   34581    case 7:
   34582       if (devinfo->is_haswell) {
   34583          return 0;
   34584       } else {
   34585          return 0;
   34586       }
   34587    case 6: return 208;
   34588    case 5: return 0;
   34589    case 4:
   34590       if (devinfo->is_g4x) {
   34591          return 0;
   34592       } else {
   34593          return 0;
   34594       }
   34595    default:
   34596       unreachable("Invalid hardware generation");
   34597    }
   34598 }
   34599 
   34600 
   34601 
   34602 /* 3DSTATE_GS::Sampler Count */
   34603 
   34604 
   34605 #define GEN10_3DSTATE_GS_SamplerCount_bits  3
   34606 #define GEN9_3DSTATE_GS_SamplerCount_bits  3
   34607 #define GEN8_3DSTATE_GS_SamplerCount_bits  3
   34608 #define GEN75_3DSTATE_GS_SamplerCount_bits  3
   34609 #define GEN7_3DSTATE_GS_SamplerCount_bits  3
   34610 #define GEN6_3DSTATE_GS_SamplerCount_bits  3
   34611 
   34612 static inline uint32_t ATTRIBUTE_PURE
   34613 _3DSTATE_GS_SamplerCount_bits(const struct gen_device_info *devinfo)
   34614 {
   34615    switch (devinfo->gen) {
   34616    case 10: return 3;
   34617    case 9: return 3;
   34618    case 8: return 3;
   34619    case 7:
   34620       if (devinfo->is_haswell) {
   34621          return 3;
   34622       } else {
   34623          return 3;
   34624       }
   34625    case 6: return 3;
   34626    case 5: return 0;
   34627    case 4:
   34628       if (devinfo->is_g4x) {
   34629          return 0;
   34630       } else {
   34631          return 0;
   34632       }
   34633    default:
   34634       unreachable("Invalid hardware generation");
   34635    }
   34636 }
   34637 
   34638 
   34639 
   34640 #define GEN10_3DSTATE_GS_SamplerCount_start  123
   34641 #define GEN9_3DSTATE_GS_SamplerCount_start  123
   34642 #define GEN8_3DSTATE_GS_SamplerCount_start  123
   34643 #define GEN75_3DSTATE_GS_SamplerCount_start  91
   34644 #define GEN7_3DSTATE_GS_SamplerCount_start  91
   34645 #define GEN6_3DSTATE_GS_SamplerCount_start  91
   34646 
   34647 static inline uint32_t ATTRIBUTE_PURE
   34648 _3DSTATE_GS_SamplerCount_start(const struct gen_device_info *devinfo)
   34649 {
   34650    switch (devinfo->gen) {
   34651    case 10: return 123;
   34652    case 9: return 123;
   34653    case 8: return 123;
   34654    case 7:
   34655       if (devinfo->is_haswell) {
   34656          return 91;
   34657       } else {
   34658          return 91;
   34659       }
   34660    case 6: return 91;
   34661    case 5: return 0;
   34662    case 4:
   34663       if (devinfo->is_g4x) {
   34664          return 0;
   34665       } else {
   34666          return 0;
   34667       }
   34668    default:
   34669       unreachable("Invalid hardware generation");
   34670    }
   34671 }
   34672 
   34673 
   34674 
   34675 /* 3DSTATE_GS::Scratch Space Base Pointer */
   34676 
   34677 
   34678 #define GEN10_3DSTATE_GS_ScratchSpaceBasePointer_bits  54
   34679 #define GEN9_3DSTATE_GS_ScratchSpaceBasePointer_bits  54
   34680 #define GEN8_3DSTATE_GS_ScratchSpaceBasePointer_bits  54
   34681 #define GEN75_3DSTATE_GS_ScratchSpaceBasePointer_bits  22
   34682 #define GEN7_3DSTATE_GS_ScratchSpaceBasePointer_bits  22
   34683 #define GEN6_3DSTATE_GS_ScratchSpaceBasePointer_bits  22
   34684 
   34685 static inline uint32_t ATTRIBUTE_PURE
   34686 _3DSTATE_GS_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   34687 {
   34688    switch (devinfo->gen) {
   34689    case 10: return 54;
   34690    case 9: return 54;
   34691    case 8: return 54;
   34692    case 7:
   34693       if (devinfo->is_haswell) {
   34694          return 22;
   34695       } else {
   34696          return 22;
   34697       }
   34698    case 6: return 22;
   34699    case 5: return 0;
   34700    case 4:
   34701       if (devinfo->is_g4x) {
   34702          return 0;
   34703       } else {
   34704          return 0;
   34705       }
   34706    default:
   34707       unreachable("Invalid hardware generation");
   34708    }
   34709 }
   34710 
   34711 
   34712 
   34713 #define GEN10_3DSTATE_GS_ScratchSpaceBasePointer_start  138
   34714 #define GEN9_3DSTATE_GS_ScratchSpaceBasePointer_start  138
   34715 #define GEN8_3DSTATE_GS_ScratchSpaceBasePointer_start  138
   34716 #define GEN75_3DSTATE_GS_ScratchSpaceBasePointer_start  106
   34717 #define GEN7_3DSTATE_GS_ScratchSpaceBasePointer_start  106
   34718 #define GEN6_3DSTATE_GS_ScratchSpaceBasePointer_start  106
   34719 
   34720 static inline uint32_t ATTRIBUTE_PURE
   34721 _3DSTATE_GS_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   34722 {
   34723    switch (devinfo->gen) {
   34724    case 10: return 138;
   34725    case 9: return 138;
   34726    case 8: return 138;
   34727    case 7:
   34728       if (devinfo->is_haswell) {
   34729          return 106;
   34730       } else {
   34731          return 106;
   34732       }
   34733    case 6: return 106;
   34734    case 5: return 0;
   34735    case 4:
   34736       if (devinfo->is_g4x) {
   34737          return 0;
   34738       } else {
   34739          return 0;
   34740       }
   34741    default:
   34742       unreachable("Invalid hardware generation");
   34743    }
   34744 }
   34745 
   34746 
   34747 
   34748 /* 3DSTATE_GS::Semaphore Handle */
   34749 
   34750 
   34751 #define GEN75_3DSTATE_GS_SemaphoreHandle_bits  13
   34752 #define GEN7_3DSTATE_GS_SemaphoreHandle_bits  12
   34753 
   34754 static inline uint32_t ATTRIBUTE_PURE
   34755 _3DSTATE_GS_SemaphoreHandle_bits(const struct gen_device_info *devinfo)
   34756 {
   34757    switch (devinfo->gen) {
   34758    case 10: return 0;
   34759    case 9: return 0;
   34760    case 8: return 0;
   34761    case 7:
   34762       if (devinfo->is_haswell) {
   34763          return 13;
   34764       } else {
   34765          return 12;
   34766       }
   34767    case 6: return 0;
   34768    case 5: return 0;
   34769    case 4:
   34770       if (devinfo->is_g4x) {
   34771          return 0;
   34772       } else {
   34773          return 0;
   34774       }
   34775    default:
   34776       unreachable("Invalid hardware generation");
   34777    }
   34778 }
   34779 
   34780 
   34781 
   34782 #define GEN75_3DSTATE_GS_SemaphoreHandle_start  192
   34783 #define GEN7_3DSTATE_GS_SemaphoreHandle_start  192
   34784 
   34785 static inline uint32_t ATTRIBUTE_PURE
   34786 _3DSTATE_GS_SemaphoreHandle_start(const struct gen_device_info *devinfo)
   34787 {
   34788    switch (devinfo->gen) {
   34789    case 10: return 0;
   34790    case 9: return 0;
   34791    case 8: return 0;
   34792    case 7:
   34793       if (devinfo->is_haswell) {
   34794          return 192;
   34795       } else {
   34796          return 192;
   34797       }
   34798    case 6: return 0;
   34799    case 5: return 0;
   34800    case 4:
   34801       if (devinfo->is_g4x) {
   34802          return 0;
   34803       } else {
   34804          return 0;
   34805       }
   34806    default:
   34807       unreachable("Invalid hardware generation");
   34808    }
   34809 }
   34810 
   34811 
   34812 
   34813 /* 3DSTATE_GS::Single Program Flow */
   34814 
   34815 
   34816 #define GEN10_3DSTATE_GS_SingleProgramFlow_bits  1
   34817 #define GEN9_3DSTATE_GS_SingleProgramFlow_bits  1
   34818 #define GEN8_3DSTATE_GS_SingleProgramFlow_bits  1
   34819 #define GEN75_3DSTATE_GS_SingleProgramFlow_bits  1
   34820 #define GEN7_3DSTATE_GS_SingleProgramFlow_bits  1
   34821 #define GEN6_3DSTATE_GS_SingleProgramFlow_bits  1
   34822 
   34823 static inline uint32_t ATTRIBUTE_PURE
   34824 _3DSTATE_GS_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   34825 {
   34826    switch (devinfo->gen) {
   34827    case 10: return 1;
   34828    case 9: return 1;
   34829    case 8: return 1;
   34830    case 7:
   34831       if (devinfo->is_haswell) {
   34832          return 1;
   34833       } else {
   34834          return 1;
   34835       }
   34836    case 6: return 1;
   34837    case 5: return 0;
   34838    case 4:
   34839       if (devinfo->is_g4x) {
   34840          return 0;
   34841       } else {
   34842          return 0;
   34843       }
   34844    default:
   34845       unreachable("Invalid hardware generation");
   34846    }
   34847 }
   34848 
   34849 
   34850 
   34851 #define GEN10_3DSTATE_GS_SingleProgramFlow_start  127
   34852 #define GEN9_3DSTATE_GS_SingleProgramFlow_start  127
   34853 #define GEN8_3DSTATE_GS_SingleProgramFlow_start  127
   34854 #define GEN75_3DSTATE_GS_SingleProgramFlow_start  95
   34855 #define GEN7_3DSTATE_GS_SingleProgramFlow_start  95
   34856 #define GEN6_3DSTATE_GS_SingleProgramFlow_start  95
   34857 
   34858 static inline uint32_t ATTRIBUTE_PURE
   34859 _3DSTATE_GS_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   34860 {
   34861    switch (devinfo->gen) {
   34862    case 10: return 127;
   34863    case 9: return 127;
   34864    case 8: return 127;
   34865    case 7:
   34866       if (devinfo->is_haswell) {
   34867          return 95;
   34868       } else {
   34869          return 95;
   34870       }
   34871    case 6: return 95;
   34872    case 5: return 0;
   34873    case 4:
   34874       if (devinfo->is_g4x) {
   34875          return 0;
   34876       } else {
   34877          return 0;
   34878       }
   34879    default:
   34880       unreachable("Invalid hardware generation");
   34881    }
   34882 }
   34883 
   34884 
   34885 
   34886 /* 3DSTATE_GS::Software Exception Enable */
   34887 
   34888 
   34889 #define GEN10_3DSTATE_GS_SoftwareExceptionEnable_bits  1
   34890 #define GEN9_3DSTATE_GS_SoftwareExceptionEnable_bits  1
   34891 #define GEN8_3DSTATE_GS_SoftwareExceptionEnable_bits  1
   34892 #define GEN75_3DSTATE_GS_SoftwareExceptionEnable_bits  1
   34893 #define GEN7_3DSTATE_GS_SoftwareExceptionEnable_bits  1
   34894 #define GEN6_3DSTATE_GS_SoftwareExceptionEnable_bits  1
   34895 
   34896 static inline uint32_t ATTRIBUTE_PURE
   34897 _3DSTATE_GS_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   34898 {
   34899    switch (devinfo->gen) {
   34900    case 10: return 1;
   34901    case 9: return 1;
   34902    case 8: return 1;
   34903    case 7:
   34904       if (devinfo->is_haswell) {
   34905          return 1;
   34906       } else {
   34907          return 1;
   34908       }
   34909    case 6: return 1;
   34910    case 5: return 0;
   34911    case 4:
   34912       if (devinfo->is_g4x) {
   34913          return 0;
   34914       } else {
   34915          return 0;
   34916       }
   34917    default:
   34918       unreachable("Invalid hardware generation");
   34919    }
   34920 }
   34921 
   34922 
   34923 
   34924 #define GEN10_3DSTATE_GS_SoftwareExceptionEnable_start  103
   34925 #define GEN9_3DSTATE_GS_SoftwareExceptionEnable_start  103
   34926 #define GEN8_3DSTATE_GS_SoftwareExceptionEnable_start  103
   34927 #define GEN75_3DSTATE_GS_SoftwareExceptionEnable_start  71
   34928 #define GEN7_3DSTATE_GS_SoftwareExceptionEnable_start  71
   34929 #define GEN6_3DSTATE_GS_SoftwareExceptionEnable_start  71
   34930 
   34931 static inline uint32_t ATTRIBUTE_PURE
   34932 _3DSTATE_GS_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   34933 {
   34934    switch (devinfo->gen) {
   34935    case 10: return 103;
   34936    case 9: return 103;
   34937    case 8: return 103;
   34938    case 7:
   34939       if (devinfo->is_haswell) {
   34940          return 71;
   34941       } else {
   34942          return 71;
   34943       }
   34944    case 6: return 71;
   34945    case 5: return 0;
   34946    case 4:
   34947       if (devinfo->is_g4x) {
   34948          return 0;
   34949       } else {
   34950          return 0;
   34951       }
   34952    default:
   34953       unreachable("Invalid hardware generation");
   34954    }
   34955 }
   34956 
   34957 
   34958 
   34959 /* 3DSTATE_GS::Static Output */
   34960 
   34961 
   34962 #define GEN10_3DSTATE_GS_StaticOutput_bits  1
   34963 #define GEN9_3DSTATE_GS_StaticOutput_bits  1
   34964 #define GEN8_3DSTATE_GS_StaticOutput_bits  1
   34965 
   34966 static inline uint32_t ATTRIBUTE_PURE
   34967 _3DSTATE_GS_StaticOutput_bits(const struct gen_device_info *devinfo)
   34968 {
   34969    switch (devinfo->gen) {
   34970    case 10: return 1;
   34971    case 9: return 1;
   34972    case 8: return 1;
   34973    case 7:
   34974       if (devinfo->is_haswell) {
   34975          return 0;
   34976       } else {
   34977          return 0;
   34978       }
   34979    case 6: return 0;
   34980    case 5: return 0;
   34981    case 4:
   34982       if (devinfo->is_g4x) {
   34983          return 0;
   34984       } else {
   34985          return 0;
   34986       }
   34987    default:
   34988       unreachable("Invalid hardware generation");
   34989    }
   34990 }
   34991 
   34992 
   34993 
   34994 #define GEN10_3DSTATE_GS_StaticOutput_start  286
   34995 #define GEN9_3DSTATE_GS_StaticOutput_start  286
   34996 #define GEN8_3DSTATE_GS_StaticOutput_start  286
   34997 
   34998 static inline uint32_t ATTRIBUTE_PURE
   34999 _3DSTATE_GS_StaticOutput_start(const struct gen_device_info *devinfo)
   35000 {
   35001    switch (devinfo->gen) {
   35002    case 10: return 286;
   35003    case 9: return 286;
   35004    case 8: return 286;
   35005    case 7:
   35006       if (devinfo->is_haswell) {
   35007          return 0;
   35008       } else {
   35009          return 0;
   35010       }
   35011    case 6: return 0;
   35012    case 5: return 0;
   35013    case 4:
   35014       if (devinfo->is_g4x) {
   35015          return 0;
   35016       } else {
   35017          return 0;
   35018       }
   35019    default:
   35020       unreachable("Invalid hardware generation");
   35021    }
   35022 }
   35023 
   35024 
   35025 
   35026 /* 3DSTATE_GS::Static Output Vertex Count */
   35027 
   35028 
   35029 #define GEN10_3DSTATE_GS_StaticOutputVertexCount_bits  11
   35030 #define GEN9_3DSTATE_GS_StaticOutputVertexCount_bits  11
   35031 #define GEN8_3DSTATE_GS_StaticOutputVertexCount_bits  11
   35032 
   35033 static inline uint32_t ATTRIBUTE_PURE
   35034 _3DSTATE_GS_StaticOutputVertexCount_bits(const struct gen_device_info *devinfo)
   35035 {
   35036    switch (devinfo->gen) {
   35037    case 10: return 11;
   35038    case 9: return 11;
   35039    case 8: return 11;
   35040    case 7:
   35041       if (devinfo->is_haswell) {
   35042          return 0;
   35043       } else {
   35044          return 0;
   35045       }
   35046    case 6: return 0;
   35047    case 5: return 0;
   35048    case 4:
   35049       if (devinfo->is_g4x) {
   35050          return 0;
   35051       } else {
   35052          return 0;
   35053       }
   35054    default:
   35055       unreachable("Invalid hardware generation");
   35056    }
   35057 }
   35058 
   35059 
   35060 
   35061 #define GEN10_3DSTATE_GS_StaticOutputVertexCount_start  272
   35062 #define GEN9_3DSTATE_GS_StaticOutputVertexCount_start  272
   35063 #define GEN8_3DSTATE_GS_StaticOutputVertexCount_start  272
   35064 
   35065 static inline uint32_t ATTRIBUTE_PURE
   35066 _3DSTATE_GS_StaticOutputVertexCount_start(const struct gen_device_info *devinfo)
   35067 {
   35068    switch (devinfo->gen) {
   35069    case 10: return 272;
   35070    case 9: return 272;
   35071    case 8: return 272;
   35072    case 7:
   35073       if (devinfo->is_haswell) {
   35074          return 0;
   35075       } else {
   35076          return 0;
   35077       }
   35078    case 6: return 0;
   35079    case 5: return 0;
   35080    case 4:
   35081       if (devinfo->is_g4x) {
   35082          return 0;
   35083       } else {
   35084          return 0;
   35085       }
   35086    default:
   35087       unreachable("Invalid hardware generation");
   35088    }
   35089 }
   35090 
   35091 
   35092 
   35093 /* 3DSTATE_GS::Statistics Enable */
   35094 
   35095 
   35096 #define GEN10_3DSTATE_GS_StatisticsEnable_bits  1
   35097 #define GEN9_3DSTATE_GS_StatisticsEnable_bits  1
   35098 #define GEN8_3DSTATE_GS_StatisticsEnable_bits  1
   35099 #define GEN75_3DSTATE_GS_StatisticsEnable_bits  1
   35100 #define GEN7_3DSTATE_GS_StatisticsEnable_bits  1
   35101 #define GEN6_3DSTATE_GS_StatisticsEnable_bits  1
   35102 
   35103 static inline uint32_t ATTRIBUTE_PURE
   35104 _3DSTATE_GS_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   35105 {
   35106    switch (devinfo->gen) {
   35107    case 10: return 1;
   35108    case 9: return 1;
   35109    case 8: return 1;
   35110    case 7:
   35111       if (devinfo->is_haswell) {
   35112          return 1;
   35113       } else {
   35114          return 1;
   35115       }
   35116    case 6: return 1;
   35117    case 5: return 0;
   35118    case 4:
   35119       if (devinfo->is_g4x) {
   35120          return 0;
   35121       } else {
   35122          return 0;
   35123       }
   35124    default:
   35125       unreachable("Invalid hardware generation");
   35126    }
   35127 }
   35128 
   35129 
   35130 
   35131 #define GEN10_3DSTATE_GS_StatisticsEnable_start  234
   35132 #define GEN9_3DSTATE_GS_StatisticsEnable_start  234
   35133 #define GEN8_3DSTATE_GS_StatisticsEnable_start  234
   35134 #define GEN75_3DSTATE_GS_StatisticsEnable_start  170
   35135 #define GEN7_3DSTATE_GS_StatisticsEnable_start  170
   35136 #define GEN6_3DSTATE_GS_StatisticsEnable_start  170
   35137 
   35138 static inline uint32_t ATTRIBUTE_PURE
   35139 _3DSTATE_GS_StatisticsEnable_start(const struct gen_device_info *devinfo)
   35140 {
   35141    switch (devinfo->gen) {
   35142    case 10: return 234;
   35143    case 9: return 234;
   35144    case 8: return 234;
   35145    case 7:
   35146       if (devinfo->is_haswell) {
   35147          return 170;
   35148       } else {
   35149          return 170;
   35150       }
   35151    case 6: return 170;
   35152    case 5: return 0;
   35153    case 4:
   35154       if (devinfo->is_g4x) {
   35155          return 0;
   35156       } else {
   35157          return 0;
   35158       }
   35159    default:
   35160       unreachable("Invalid hardware generation");
   35161    }
   35162 }
   35163 
   35164 
   35165 
   35166 /* 3DSTATE_GS::Thread Dispatch Priority */
   35167 
   35168 
   35169 #define GEN10_3DSTATE_GS_ThreadDispatchPriority_bits  1
   35170 #define GEN9_3DSTATE_GS_ThreadDispatchPriority_bits  1
   35171 #define GEN8_3DSTATE_GS_ThreadDispatchPriority_bits  1
   35172 
   35173 static inline uint32_t ATTRIBUTE_PURE
   35174 _3DSTATE_GS_ThreadDispatchPriority_bits(const struct gen_device_info *devinfo)
   35175 {
   35176    switch (devinfo->gen) {
   35177    case 10: return 1;
   35178    case 9: return 1;
   35179    case 8: return 1;
   35180    case 7:
   35181       if (devinfo->is_haswell) {
   35182          return 0;
   35183       } else {
   35184          return 0;
   35185       }
   35186    case 6: return 0;
   35187    case 5: return 0;
   35188    case 4:
   35189       if (devinfo->is_g4x) {
   35190          return 0;
   35191       } else {
   35192          return 0;
   35193       }
   35194    default:
   35195       unreachable("Invalid hardware generation");
   35196    }
   35197 }
   35198 
   35199 
   35200 
   35201 #define GEN10_3DSTATE_GS_ThreadDispatchPriority_start  113
   35202 #define GEN9_3DSTATE_GS_ThreadDispatchPriority_start  113
   35203 #define GEN8_3DSTATE_GS_ThreadDispatchPriority_start  113
   35204 
   35205 static inline uint32_t ATTRIBUTE_PURE
   35206 _3DSTATE_GS_ThreadDispatchPriority_start(const struct gen_device_info *devinfo)
   35207 {
   35208    switch (devinfo->gen) {
   35209    case 10: return 113;
   35210    case 9: return 113;
   35211    case 8: return 113;
   35212    case 7:
   35213       if (devinfo->is_haswell) {
   35214          return 0;
   35215       } else {
   35216          return 0;
   35217       }
   35218    case 6: return 0;
   35219    case 5: return 0;
   35220    case 4:
   35221       if (devinfo->is_g4x) {
   35222          return 0;
   35223       } else {
   35224          return 0;
   35225       }
   35226    default:
   35227       unreachable("Invalid hardware generation");
   35228    }
   35229 }
   35230 
   35231 
   35232 
   35233 /* 3DSTATE_GS::Thread Priority */
   35234 
   35235 
   35236 #define GEN75_3DSTATE_GS_ThreadPriority_bits  1
   35237 #define GEN7_3DSTATE_GS_ThreadPriority_bits  1
   35238 #define GEN6_3DSTATE_GS_ThreadPriority_bits  1
   35239 
   35240 static inline uint32_t ATTRIBUTE_PURE
   35241 _3DSTATE_GS_ThreadPriority_bits(const struct gen_device_info *devinfo)
   35242 {
   35243    switch (devinfo->gen) {
   35244    case 10: return 0;
   35245    case 9: return 0;
   35246    case 8: return 0;
   35247    case 7:
   35248       if (devinfo->is_haswell) {
   35249          return 1;
   35250       } else {
   35251          return 1;
   35252       }
   35253    case 6: return 1;
   35254    case 5: return 0;
   35255    case 4:
   35256       if (devinfo->is_g4x) {
   35257          return 0;
   35258       } else {
   35259          return 0;
   35260       }
   35261    default:
   35262       unreachable("Invalid hardware generation");
   35263    }
   35264 }
   35265 
   35266 
   35267 
   35268 #define GEN75_3DSTATE_GS_ThreadPriority_start  81
   35269 #define GEN7_3DSTATE_GS_ThreadPriority_start  81
   35270 #define GEN6_3DSTATE_GS_ThreadPriority_start  81
   35271 
   35272 static inline uint32_t ATTRIBUTE_PURE
   35273 _3DSTATE_GS_ThreadPriority_start(const struct gen_device_info *devinfo)
   35274 {
   35275    switch (devinfo->gen) {
   35276    case 10: return 0;
   35277    case 9: return 0;
   35278    case 8: return 0;
   35279    case 7:
   35280       if (devinfo->is_haswell) {
   35281          return 81;
   35282       } else {
   35283          return 81;
   35284       }
   35285    case 6: return 81;
   35286    case 5: return 0;
   35287    case 4:
   35288       if (devinfo->is_g4x) {
   35289          return 0;
   35290       } else {
   35291          return 0;
   35292       }
   35293    default:
   35294       unreachable("Invalid hardware generation");
   35295    }
   35296 }
   35297 
   35298 
   35299 
   35300 /* 3DSTATE_GS::User Clip Distance Clip Test Enable Bitmask */
   35301 
   35302 
   35303 #define GEN10_3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_bits  8
   35304 #define GEN9_3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_bits  8
   35305 #define GEN8_3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_bits  8
   35306 
   35307 static inline uint32_t ATTRIBUTE_PURE
   35308 _3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   35309 {
   35310    switch (devinfo->gen) {
   35311    case 10: return 8;
   35312    case 9: return 8;
   35313    case 8: return 8;
   35314    case 7:
   35315       if (devinfo->is_haswell) {
   35316          return 0;
   35317       } else {
   35318          return 0;
   35319       }
   35320    case 6: return 0;
   35321    case 5: return 0;
   35322    case 4:
   35323       if (devinfo->is_g4x) {
   35324          return 0;
   35325       } else {
   35326          return 0;
   35327       }
   35328    default:
   35329       unreachable("Invalid hardware generation");
   35330    }
   35331 }
   35332 
   35333 
   35334 
   35335 #define GEN10_3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_start  296
   35336 #define GEN9_3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_start  296
   35337 #define GEN8_3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_start  296
   35338 
   35339 static inline uint32_t ATTRIBUTE_PURE
   35340 _3DSTATE_GS_UserClipDistanceClipTestEnableBitmask_start(const struct gen_device_info *devinfo)
   35341 {
   35342    switch (devinfo->gen) {
   35343    case 10: return 296;
   35344    case 9: return 296;
   35345    case 8: return 296;
   35346    case 7:
   35347       if (devinfo->is_haswell) {
   35348          return 0;
   35349       } else {
   35350          return 0;
   35351       }
   35352    case 6: return 0;
   35353    case 5: return 0;
   35354    case 4:
   35355       if (devinfo->is_g4x) {
   35356          return 0;
   35357       } else {
   35358          return 0;
   35359       }
   35360    default:
   35361       unreachable("Invalid hardware generation");
   35362    }
   35363 }
   35364 
   35365 
   35366 
   35367 /* 3DSTATE_GS::User Clip Distance Cull Test Enable Bitmask */
   35368 
   35369 
   35370 #define GEN10_3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_bits  8
   35371 #define GEN9_3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_bits  8
   35372 #define GEN8_3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_bits  8
   35373 
   35374 static inline uint32_t ATTRIBUTE_PURE
   35375 _3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   35376 {
   35377    switch (devinfo->gen) {
   35378    case 10: return 8;
   35379    case 9: return 8;
   35380    case 8: return 8;
   35381    case 7:
   35382       if (devinfo->is_haswell) {
   35383          return 0;
   35384       } else {
   35385          return 0;
   35386       }
   35387    case 6: return 0;
   35388    case 5: return 0;
   35389    case 4:
   35390       if (devinfo->is_g4x) {
   35391          return 0;
   35392       } else {
   35393          return 0;
   35394       }
   35395    default:
   35396       unreachable("Invalid hardware generation");
   35397    }
   35398 }
   35399 
   35400 
   35401 
   35402 #define GEN10_3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_start  288
   35403 #define GEN9_3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_start  288
   35404 #define GEN8_3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_start  288
   35405 
   35406 static inline uint32_t ATTRIBUTE_PURE
   35407 _3DSTATE_GS_UserClipDistanceCullTestEnableBitmask_start(const struct gen_device_info *devinfo)
   35408 {
   35409    switch (devinfo->gen) {
   35410    case 10: return 288;
   35411    case 9: return 288;
   35412    case 8: return 288;
   35413    case 7:
   35414       if (devinfo->is_haswell) {
   35415          return 0;
   35416       } else {
   35417          return 0;
   35418       }
   35419    case 6: return 0;
   35420    case 5: return 0;
   35421    case 4:
   35422       if (devinfo->is_g4x) {
   35423          return 0;
   35424       } else {
   35425          return 0;
   35426       }
   35427    default:
   35428       unreachable("Invalid hardware generation");
   35429    }
   35430 }
   35431 
   35432 
   35433 
   35434 /* 3DSTATE_GS::Vector Mask Enable */
   35435 
   35436 
   35437 #define GEN10_3DSTATE_GS_VectorMaskEnable_bits  1
   35438 #define GEN9_3DSTATE_GS_VectorMaskEnable_bits  1
   35439 #define GEN8_3DSTATE_GS_VectorMaskEnable_bits  1
   35440 #define GEN75_3DSTATE_GS_VectorMaskEnable_bits  1
   35441 #define GEN7_3DSTATE_GS_VectorMaskEnable_bits  1
   35442 #define GEN6_3DSTATE_GS_VectorMaskEnable_bits  1
   35443 
   35444 static inline uint32_t ATTRIBUTE_PURE
   35445 _3DSTATE_GS_VectorMaskEnable_bits(const struct gen_device_info *devinfo)
   35446 {
   35447    switch (devinfo->gen) {
   35448    case 10: return 1;
   35449    case 9: return 1;
   35450    case 8: return 1;
   35451    case 7:
   35452       if (devinfo->is_haswell) {
   35453          return 1;
   35454       } else {
   35455          return 1;
   35456       }
   35457    case 6: return 1;
   35458    case 5: return 0;
   35459    case 4:
   35460       if (devinfo->is_g4x) {
   35461          return 0;
   35462       } else {
   35463          return 0;
   35464       }
   35465    default:
   35466       unreachable("Invalid hardware generation");
   35467    }
   35468 }
   35469 
   35470 
   35471 
   35472 #define GEN10_3DSTATE_GS_VectorMaskEnable_start  126
   35473 #define GEN9_3DSTATE_GS_VectorMaskEnable_start  126
   35474 #define GEN8_3DSTATE_GS_VectorMaskEnable_start  126
   35475 #define GEN75_3DSTATE_GS_VectorMaskEnable_start  94
   35476 #define GEN7_3DSTATE_GS_VectorMaskEnable_start  94
   35477 #define GEN6_3DSTATE_GS_VectorMaskEnable_start  94
   35478 
   35479 static inline uint32_t ATTRIBUTE_PURE
   35480 _3DSTATE_GS_VectorMaskEnable_start(const struct gen_device_info *devinfo)
   35481 {
   35482    switch (devinfo->gen) {
   35483    case 10: return 126;
   35484    case 9: return 126;
   35485    case 8: return 126;
   35486    case 7:
   35487       if (devinfo->is_haswell) {
   35488          return 94;
   35489       } else {
   35490          return 94;
   35491       }
   35492    case 6: return 94;
   35493    case 5: return 0;
   35494    case 4:
   35495       if (devinfo->is_g4x) {
   35496          return 0;
   35497       } else {
   35498          return 0;
   35499       }
   35500    default:
   35501       unreachable("Invalid hardware generation");
   35502    }
   35503 }
   35504 
   35505 
   35506 
   35507 /* 3DSTATE_GS::Vertex URB Entry Output Length */
   35508 
   35509 
   35510 #define GEN10_3DSTATE_GS_VertexURBEntryOutputLength_bits  5
   35511 #define GEN9_3DSTATE_GS_VertexURBEntryOutputLength_bits  5
   35512 #define GEN8_3DSTATE_GS_VertexURBEntryOutputLength_bits  5
   35513 
   35514 static inline uint32_t ATTRIBUTE_PURE
   35515 _3DSTATE_GS_VertexURBEntryOutputLength_bits(const struct gen_device_info *devinfo)
   35516 {
   35517    switch (devinfo->gen) {
   35518    case 10: return 5;
   35519    case 9: return 5;
   35520    case 8: return 5;
   35521    case 7:
   35522       if (devinfo->is_haswell) {
   35523          return 0;
   35524       } else {
   35525          return 0;
   35526       }
   35527    case 6: return 0;
   35528    case 5: return 0;
   35529    case 4:
   35530       if (devinfo->is_g4x) {
   35531          return 0;
   35532       } else {
   35533          return 0;
   35534       }
   35535    default:
   35536       unreachable("Invalid hardware generation");
   35537    }
   35538 }
   35539 
   35540 
   35541 
   35542 #define GEN10_3DSTATE_GS_VertexURBEntryOutputLength_start  304
   35543 #define GEN9_3DSTATE_GS_VertexURBEntryOutputLength_start  304
   35544 #define GEN8_3DSTATE_GS_VertexURBEntryOutputLength_start  304
   35545 
   35546 static inline uint32_t ATTRIBUTE_PURE
   35547 _3DSTATE_GS_VertexURBEntryOutputLength_start(const struct gen_device_info *devinfo)
   35548 {
   35549    switch (devinfo->gen) {
   35550    case 10: return 304;
   35551    case 9: return 304;
   35552    case 8: return 304;
   35553    case 7:
   35554       if (devinfo->is_haswell) {
   35555          return 0;
   35556       } else {
   35557          return 0;
   35558       }
   35559    case 6: return 0;
   35560    case 5: return 0;
   35561    case 4:
   35562       if (devinfo->is_g4x) {
   35563          return 0;
   35564       } else {
   35565          return 0;
   35566       }
   35567    default:
   35568       unreachable("Invalid hardware generation");
   35569    }
   35570 }
   35571 
   35572 
   35573 
   35574 /* 3DSTATE_GS::Vertex URB Entry Output Read Offset */
   35575 
   35576 
   35577 #define GEN10_3DSTATE_GS_VertexURBEntryOutputReadOffset_bits  6
   35578 #define GEN9_3DSTATE_GS_VertexURBEntryOutputReadOffset_bits  6
   35579 #define GEN8_3DSTATE_GS_VertexURBEntryOutputReadOffset_bits  6
   35580 
   35581 static inline uint32_t ATTRIBUTE_PURE
   35582 _3DSTATE_GS_VertexURBEntryOutputReadOffset_bits(const struct gen_device_info *devinfo)
   35583 {
   35584    switch (devinfo->gen) {
   35585    case 10: return 6;
   35586    case 9: return 6;
   35587    case 8: return 6;
   35588    case 7:
   35589       if (devinfo->is_haswell) {
   35590          return 0;
   35591       } else {
   35592          return 0;
   35593       }
   35594    case 6: return 0;
   35595    case 5: return 0;
   35596    case 4:
   35597       if (devinfo->is_g4x) {
   35598          return 0;
   35599       } else {
   35600          return 0;
   35601       }
   35602    default:
   35603       unreachable("Invalid hardware generation");
   35604    }
   35605 }
   35606 
   35607 
   35608 
   35609 #define GEN10_3DSTATE_GS_VertexURBEntryOutputReadOffset_start  309
   35610 #define GEN9_3DSTATE_GS_VertexURBEntryOutputReadOffset_start  309
   35611 #define GEN8_3DSTATE_GS_VertexURBEntryOutputReadOffset_start  309
   35612 
   35613 static inline uint32_t ATTRIBUTE_PURE
   35614 _3DSTATE_GS_VertexURBEntryOutputReadOffset_start(const struct gen_device_info *devinfo)
   35615 {
   35616    switch (devinfo->gen) {
   35617    case 10: return 309;
   35618    case 9: return 309;
   35619    case 8: return 309;
   35620    case 7:
   35621       if (devinfo->is_haswell) {
   35622          return 0;
   35623       } else {
   35624          return 0;
   35625       }
   35626    case 6: return 0;
   35627    case 5: return 0;
   35628    case 4:
   35629       if (devinfo->is_g4x) {
   35630          return 0;
   35631       } else {
   35632          return 0;
   35633       }
   35634    default:
   35635       unreachable("Invalid hardware generation");
   35636    }
   35637 }
   35638 
   35639 
   35640 
   35641 /* 3DSTATE_GS::Vertex URB Entry Read Length */
   35642 
   35643 
   35644 #define GEN10_3DSTATE_GS_VertexURBEntryReadLength_bits  6
   35645 #define GEN9_3DSTATE_GS_VertexURBEntryReadLength_bits  6
   35646 #define GEN8_3DSTATE_GS_VertexURBEntryReadLength_bits  6
   35647 #define GEN75_3DSTATE_GS_VertexURBEntryReadLength_bits  6
   35648 #define GEN7_3DSTATE_GS_VertexURBEntryReadLength_bits  6
   35649 #define GEN6_3DSTATE_GS_VertexURBEntryReadLength_bits  6
   35650 
   35651 static inline uint32_t ATTRIBUTE_PURE
   35652 _3DSTATE_GS_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   35653 {
   35654    switch (devinfo->gen) {
   35655    case 10: return 6;
   35656    case 9: return 6;
   35657    case 8: return 6;
   35658    case 7:
   35659       if (devinfo->is_haswell) {
   35660          return 6;
   35661       } else {
   35662          return 6;
   35663       }
   35664    case 6: return 6;
   35665    case 5: return 0;
   35666    case 4:
   35667       if (devinfo->is_g4x) {
   35668          return 0;
   35669       } else {
   35670          return 0;
   35671       }
   35672    default:
   35673       unreachable("Invalid hardware generation");
   35674    }
   35675 }
   35676 
   35677 
   35678 
   35679 #define GEN10_3DSTATE_GS_VertexURBEntryReadLength_start  203
   35680 #define GEN9_3DSTATE_GS_VertexURBEntryReadLength_start  203
   35681 #define GEN8_3DSTATE_GS_VertexURBEntryReadLength_start  203
   35682 #define GEN75_3DSTATE_GS_VertexURBEntryReadLength_start  139
   35683 #define GEN7_3DSTATE_GS_VertexURBEntryReadLength_start  139
   35684 #define GEN6_3DSTATE_GS_VertexURBEntryReadLength_start  139
   35685 
   35686 static inline uint32_t ATTRIBUTE_PURE
   35687 _3DSTATE_GS_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   35688 {
   35689    switch (devinfo->gen) {
   35690    case 10: return 203;
   35691    case 9: return 203;
   35692    case 8: return 203;
   35693    case 7:
   35694       if (devinfo->is_haswell) {
   35695          return 139;
   35696       } else {
   35697          return 139;
   35698       }
   35699    case 6: return 139;
   35700    case 5: return 0;
   35701    case 4:
   35702       if (devinfo->is_g4x) {
   35703          return 0;
   35704       } else {
   35705          return 0;
   35706       }
   35707    default:
   35708       unreachable("Invalid hardware generation");
   35709    }
   35710 }
   35711 
   35712 
   35713 
   35714 /* 3DSTATE_GS::Vertex URB Entry Read Offset */
   35715 
   35716 
   35717 #define GEN10_3DSTATE_GS_VertexURBEntryReadOffset_bits  6
   35718 #define GEN9_3DSTATE_GS_VertexURBEntryReadOffset_bits  6
   35719 #define GEN8_3DSTATE_GS_VertexURBEntryReadOffset_bits  6
   35720 #define GEN75_3DSTATE_GS_VertexURBEntryReadOffset_bits  6
   35721 #define GEN7_3DSTATE_GS_VertexURBEntryReadOffset_bits  6
   35722 #define GEN6_3DSTATE_GS_VertexURBEntryReadOffset_bits  6
   35723 
   35724 static inline uint32_t ATTRIBUTE_PURE
   35725 _3DSTATE_GS_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   35726 {
   35727    switch (devinfo->gen) {
   35728    case 10: return 6;
   35729    case 9: return 6;
   35730    case 8: return 6;
   35731    case 7:
   35732       if (devinfo->is_haswell) {
   35733          return 6;
   35734       } else {
   35735          return 6;
   35736       }
   35737    case 6: return 6;
   35738    case 5: return 0;
   35739    case 4:
   35740       if (devinfo->is_g4x) {
   35741          return 0;
   35742       } else {
   35743          return 0;
   35744       }
   35745    default:
   35746       unreachable("Invalid hardware generation");
   35747    }
   35748 }
   35749 
   35750 
   35751 
   35752 #define GEN10_3DSTATE_GS_VertexURBEntryReadOffset_start  196
   35753 #define GEN9_3DSTATE_GS_VertexURBEntryReadOffset_start  196
   35754 #define GEN8_3DSTATE_GS_VertexURBEntryReadOffset_start  196
   35755 #define GEN75_3DSTATE_GS_VertexURBEntryReadOffset_start  132
   35756 #define GEN7_3DSTATE_GS_VertexURBEntryReadOffset_start  132
   35757 #define GEN6_3DSTATE_GS_VertexURBEntryReadOffset_start  132
   35758 
   35759 static inline uint32_t ATTRIBUTE_PURE
   35760 _3DSTATE_GS_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   35761 {
   35762    switch (devinfo->gen) {
   35763    case 10: return 196;
   35764    case 9: return 196;
   35765    case 8: return 196;
   35766    case 7:
   35767       if (devinfo->is_haswell) {
   35768          return 132;
   35769       } else {
   35770          return 132;
   35771       }
   35772    case 6: return 132;
   35773    case 5: return 0;
   35774    case 4:
   35775       if (devinfo->is_g4x) {
   35776          return 0;
   35777       } else {
   35778          return 0;
   35779       }
   35780    default:
   35781       unreachable("Invalid hardware generation");
   35782    }
   35783 }
   35784 
   35785 
   35786 
   35787 /* 3DSTATE_GS_SVB_INDEX */
   35788 
   35789 
   35790 #define GEN6_3DSTATE_GS_SVB_INDEX_length  7
   35791 
   35792 static inline uint32_t ATTRIBUTE_PURE
   35793 _3DSTATE_GS_SVB_INDEX_length(const struct gen_device_info *devinfo)
   35794 {
   35795    switch (devinfo->gen) {
   35796    case 10: return 0;
   35797    case 9: return 0;
   35798    case 8: return 0;
   35799    case 7:
   35800       if (devinfo->is_haswell) {
   35801          return 0;
   35802       } else {
   35803          return 0;
   35804       }
   35805    case 6: return 7;
   35806    case 5: return 0;
   35807    case 4:
   35808       if (devinfo->is_g4x) {
   35809          return 0;
   35810       } else {
   35811          return 0;
   35812       }
   35813    default:
   35814       unreachable("Invalid hardware generation");
   35815    }
   35816 }
   35817 
   35818 
   35819 
   35820 /* 3DSTATE_GS_SVB_INDEX::3D Command Opcode */
   35821 
   35822 
   35823 #define GEN6_3DSTATE_GS_SVB_INDEX_3DCommandOpcode_bits  3
   35824 
   35825 static inline uint32_t ATTRIBUTE_PURE
   35826 _3DSTATE_GS_SVB_INDEX_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   35827 {
   35828    switch (devinfo->gen) {
   35829    case 10: return 0;
   35830    case 9: return 0;
   35831    case 8: return 0;
   35832    case 7:
   35833       if (devinfo->is_haswell) {
   35834          return 0;
   35835       } else {
   35836          return 0;
   35837       }
   35838    case 6: return 3;
   35839    case 5: return 0;
   35840    case 4:
   35841       if (devinfo->is_g4x) {
   35842          return 0;
   35843       } else {
   35844          return 0;
   35845       }
   35846    default:
   35847       unreachable("Invalid hardware generation");
   35848    }
   35849 }
   35850 
   35851 
   35852 
   35853 #define GEN6_3DSTATE_GS_SVB_INDEX_3DCommandOpcode_start  24
   35854 
   35855 static inline uint32_t ATTRIBUTE_PURE
   35856 _3DSTATE_GS_SVB_INDEX_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   35857 {
   35858    switch (devinfo->gen) {
   35859    case 10: return 0;
   35860    case 9: return 0;
   35861    case 8: return 0;
   35862    case 7:
   35863       if (devinfo->is_haswell) {
   35864          return 0;
   35865       } else {
   35866          return 0;
   35867       }
   35868    case 6: return 24;
   35869    case 5: return 0;
   35870    case 4:
   35871       if (devinfo->is_g4x) {
   35872          return 0;
   35873       } else {
   35874          return 0;
   35875       }
   35876    default:
   35877       unreachable("Invalid hardware generation");
   35878    }
   35879 }
   35880 
   35881 
   35882 
   35883 /* 3DSTATE_GS_SVB_INDEX::3D Command Sub Opcode */
   35884 
   35885 
   35886 #define GEN6_3DSTATE_GS_SVB_INDEX_3DCommandSubOpcode_bits  8
   35887 
   35888 static inline uint32_t ATTRIBUTE_PURE
   35889 _3DSTATE_GS_SVB_INDEX_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   35890 {
   35891    switch (devinfo->gen) {
   35892    case 10: return 0;
   35893    case 9: return 0;
   35894    case 8: return 0;
   35895    case 7:
   35896       if (devinfo->is_haswell) {
   35897          return 0;
   35898       } else {
   35899          return 0;
   35900       }
   35901    case 6: return 8;
   35902    case 5: return 0;
   35903    case 4:
   35904       if (devinfo->is_g4x) {
   35905          return 0;
   35906       } else {
   35907          return 0;
   35908       }
   35909    default:
   35910       unreachable("Invalid hardware generation");
   35911    }
   35912 }
   35913 
   35914 
   35915 
   35916 #define GEN6_3DSTATE_GS_SVB_INDEX_3DCommandSubOpcode_start  16
   35917 
   35918 static inline uint32_t ATTRIBUTE_PURE
   35919 _3DSTATE_GS_SVB_INDEX_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   35920 {
   35921    switch (devinfo->gen) {
   35922    case 10: return 0;
   35923    case 9: return 0;
   35924    case 8: return 0;
   35925    case 7:
   35926       if (devinfo->is_haswell) {
   35927          return 0;
   35928       } else {
   35929          return 0;
   35930       }
   35931    case 6: return 16;
   35932    case 5: return 0;
   35933    case 4:
   35934       if (devinfo->is_g4x) {
   35935          return 0;
   35936       } else {
   35937          return 0;
   35938       }
   35939    default:
   35940       unreachable("Invalid hardware generation");
   35941    }
   35942 }
   35943 
   35944 
   35945 
   35946 /* 3DSTATE_GS_SVB_INDEX::Command SubType */
   35947 
   35948 
   35949 #define GEN6_3DSTATE_GS_SVB_INDEX_CommandSubType_bits  2
   35950 
   35951 static inline uint32_t ATTRIBUTE_PURE
   35952 _3DSTATE_GS_SVB_INDEX_CommandSubType_bits(const struct gen_device_info *devinfo)
   35953 {
   35954    switch (devinfo->gen) {
   35955    case 10: return 0;
   35956    case 9: return 0;
   35957    case 8: return 0;
   35958    case 7:
   35959       if (devinfo->is_haswell) {
   35960          return 0;
   35961       } else {
   35962          return 0;
   35963       }
   35964    case 6: return 2;
   35965    case 5: return 0;
   35966    case 4:
   35967       if (devinfo->is_g4x) {
   35968          return 0;
   35969       } else {
   35970          return 0;
   35971       }
   35972    default:
   35973       unreachable("Invalid hardware generation");
   35974    }
   35975 }
   35976 
   35977 
   35978 
   35979 #define GEN6_3DSTATE_GS_SVB_INDEX_CommandSubType_start  27
   35980 
   35981 static inline uint32_t ATTRIBUTE_PURE
   35982 _3DSTATE_GS_SVB_INDEX_CommandSubType_start(const struct gen_device_info *devinfo)
   35983 {
   35984    switch (devinfo->gen) {
   35985    case 10: return 0;
   35986    case 9: return 0;
   35987    case 8: return 0;
   35988    case 7:
   35989       if (devinfo->is_haswell) {
   35990          return 0;
   35991       } else {
   35992          return 0;
   35993       }
   35994    case 6: return 27;
   35995    case 5: return 0;
   35996    case 4:
   35997       if (devinfo->is_g4x) {
   35998          return 0;
   35999       } else {
   36000          return 0;
   36001       }
   36002    default:
   36003       unreachable("Invalid hardware generation");
   36004    }
   36005 }
   36006 
   36007 
   36008 
   36009 /* 3DSTATE_GS_SVB_INDEX::Command Type */
   36010 
   36011 
   36012 #define GEN6_3DSTATE_GS_SVB_INDEX_CommandType_bits  3
   36013 
   36014 static inline uint32_t ATTRIBUTE_PURE
   36015 _3DSTATE_GS_SVB_INDEX_CommandType_bits(const struct gen_device_info *devinfo)
   36016 {
   36017    switch (devinfo->gen) {
   36018    case 10: return 0;
   36019    case 9: return 0;
   36020    case 8: return 0;
   36021    case 7:
   36022       if (devinfo->is_haswell) {
   36023          return 0;
   36024       } else {
   36025          return 0;
   36026       }
   36027    case 6: return 3;
   36028    case 5: return 0;
   36029    case 4:
   36030       if (devinfo->is_g4x) {
   36031          return 0;
   36032       } else {
   36033          return 0;
   36034       }
   36035    default:
   36036       unreachable("Invalid hardware generation");
   36037    }
   36038 }
   36039 
   36040 
   36041 
   36042 #define GEN6_3DSTATE_GS_SVB_INDEX_CommandType_start  29
   36043 
   36044 static inline uint32_t ATTRIBUTE_PURE
   36045 _3DSTATE_GS_SVB_INDEX_CommandType_start(const struct gen_device_info *devinfo)
   36046 {
   36047    switch (devinfo->gen) {
   36048    case 10: return 0;
   36049    case 9: return 0;
   36050    case 8: return 0;
   36051    case 7:
   36052       if (devinfo->is_haswell) {
   36053          return 0;
   36054       } else {
   36055          return 0;
   36056       }
   36057    case 6: return 29;
   36058    case 5: return 0;
   36059    case 4:
   36060       if (devinfo->is_g4x) {
   36061          return 0;
   36062       } else {
   36063          return 0;
   36064       }
   36065    default:
   36066       unreachable("Invalid hardware generation");
   36067    }
   36068 }
   36069 
   36070 
   36071 
   36072 /* 3DSTATE_GS_SVB_INDEX::DWord Length */
   36073 
   36074 
   36075 #define GEN6_3DSTATE_GS_SVB_INDEX_DWordLength_bits  8
   36076 
   36077 static inline uint32_t ATTRIBUTE_PURE
   36078 _3DSTATE_GS_SVB_INDEX_DWordLength_bits(const struct gen_device_info *devinfo)
   36079 {
   36080    switch (devinfo->gen) {
   36081    case 10: return 0;
   36082    case 9: return 0;
   36083    case 8: return 0;
   36084    case 7:
   36085       if (devinfo->is_haswell) {
   36086          return 0;
   36087       } else {
   36088          return 0;
   36089       }
   36090    case 6: return 8;
   36091    case 5: return 0;
   36092    case 4:
   36093       if (devinfo->is_g4x) {
   36094          return 0;
   36095       } else {
   36096          return 0;
   36097       }
   36098    default:
   36099       unreachable("Invalid hardware generation");
   36100    }
   36101 }
   36102 
   36103 
   36104 
   36105 #define GEN6_3DSTATE_GS_SVB_INDEX_DWordLength_start  0
   36106 
   36107 static inline uint32_t ATTRIBUTE_PURE
   36108 _3DSTATE_GS_SVB_INDEX_DWordLength_start(const struct gen_device_info *devinfo)
   36109 {
   36110    switch (devinfo->gen) {
   36111    case 10: return 0;
   36112    case 9: return 0;
   36113    case 8: return 0;
   36114    case 7:
   36115       if (devinfo->is_haswell) {
   36116          return 0;
   36117       } else {
   36118          return 0;
   36119       }
   36120    case 6: return 0;
   36121    case 5: return 0;
   36122    case 4:
   36123       if (devinfo->is_g4x) {
   36124          return 0;
   36125       } else {
   36126          return 0;
   36127       }
   36128    default:
   36129       unreachable("Invalid hardware generation");
   36130    }
   36131 }
   36132 
   36133 
   36134 
   36135 /* 3DSTATE_GS_SVB_INDEX::Index Number */
   36136 
   36137 
   36138 #define GEN6_3DSTATE_GS_SVB_INDEX_IndexNumber_bits  2
   36139 
   36140 static inline uint32_t ATTRIBUTE_PURE
   36141 _3DSTATE_GS_SVB_INDEX_IndexNumber_bits(const struct gen_device_info *devinfo)
   36142 {
   36143    switch (devinfo->gen) {
   36144    case 10: return 0;
   36145    case 9: return 0;
   36146    case 8: return 0;
   36147    case 7:
   36148       if (devinfo->is_haswell) {
   36149          return 0;
   36150       } else {
   36151          return 0;
   36152       }
   36153    case 6: return 2;
   36154    case 5: return 0;
   36155    case 4:
   36156       if (devinfo->is_g4x) {
   36157          return 0;
   36158       } else {
   36159          return 0;
   36160       }
   36161    default:
   36162       unreachable("Invalid hardware generation");
   36163    }
   36164 }
   36165 
   36166 
   36167 
   36168 #define GEN6_3DSTATE_GS_SVB_INDEX_IndexNumber_start  61
   36169 
   36170 static inline uint32_t ATTRIBUTE_PURE
   36171 _3DSTATE_GS_SVB_INDEX_IndexNumber_start(const struct gen_device_info *devinfo)
   36172 {
   36173    switch (devinfo->gen) {
   36174    case 10: return 0;
   36175    case 9: return 0;
   36176    case 8: return 0;
   36177    case 7:
   36178       if (devinfo->is_haswell) {
   36179          return 0;
   36180       } else {
   36181          return 0;
   36182       }
   36183    case 6: return 61;
   36184    case 5: return 0;
   36185    case 4:
   36186       if (devinfo->is_g4x) {
   36187          return 0;
   36188       } else {
   36189          return 0;
   36190       }
   36191    default:
   36192       unreachable("Invalid hardware generation");
   36193    }
   36194 }
   36195 
   36196 
   36197 
   36198 /* 3DSTATE_GS_SVB_INDEX::Load Internal Vertex Count */
   36199 
   36200 
   36201 #define GEN6_3DSTATE_GS_SVB_INDEX_LoadInternalVertexCount_bits  1
   36202 
   36203 static inline uint32_t ATTRIBUTE_PURE
   36204 _3DSTATE_GS_SVB_INDEX_LoadInternalVertexCount_bits(const struct gen_device_info *devinfo)
   36205 {
   36206    switch (devinfo->gen) {
   36207    case 10: return 0;
   36208    case 9: return 0;
   36209    case 8: return 0;
   36210    case 7:
   36211       if (devinfo->is_haswell) {
   36212          return 0;
   36213       } else {
   36214          return 0;
   36215       }
   36216    case 6: return 1;
   36217    case 5: return 0;
   36218    case 4:
   36219       if (devinfo->is_g4x) {
   36220          return 0;
   36221       } else {
   36222          return 0;
   36223       }
   36224    default:
   36225       unreachable("Invalid hardware generation");
   36226    }
   36227 }
   36228 
   36229 
   36230 
   36231 #define GEN6_3DSTATE_GS_SVB_INDEX_LoadInternalVertexCount_start  32
   36232 
   36233 static inline uint32_t ATTRIBUTE_PURE
   36234 _3DSTATE_GS_SVB_INDEX_LoadInternalVertexCount_start(const struct gen_device_info *devinfo)
   36235 {
   36236    switch (devinfo->gen) {
   36237    case 10: return 0;
   36238    case 9: return 0;
   36239    case 8: return 0;
   36240    case 7:
   36241       if (devinfo->is_haswell) {
   36242          return 0;
   36243       } else {
   36244          return 0;
   36245       }
   36246    case 6: return 32;
   36247    case 5: return 0;
   36248    case 4:
   36249       if (devinfo->is_g4x) {
   36250          return 0;
   36251       } else {
   36252          return 0;
   36253       }
   36254    default:
   36255       unreachable("Invalid hardware generation");
   36256    }
   36257 }
   36258 
   36259 
   36260 
   36261 /* 3DSTATE_GS_SVB_INDEX::Maximum Index */
   36262 
   36263 
   36264 #define GEN6_3DSTATE_GS_SVB_INDEX_MaximumIndex_bits  32
   36265 
   36266 static inline uint32_t ATTRIBUTE_PURE
   36267 _3DSTATE_GS_SVB_INDEX_MaximumIndex_bits(const struct gen_device_info *devinfo)
   36268 {
   36269    switch (devinfo->gen) {
   36270    case 10: return 0;
   36271    case 9: return 0;
   36272    case 8: return 0;
   36273    case 7:
   36274       if (devinfo->is_haswell) {
   36275          return 0;
   36276       } else {
   36277          return 0;
   36278       }
   36279    case 6: return 32;
   36280    case 5: return 0;
   36281    case 4:
   36282       if (devinfo->is_g4x) {
   36283          return 0;
   36284       } else {
   36285          return 0;
   36286       }
   36287    default:
   36288       unreachable("Invalid hardware generation");
   36289    }
   36290 }
   36291 
   36292 
   36293 
   36294 #define GEN6_3DSTATE_GS_SVB_INDEX_MaximumIndex_start  96
   36295 
   36296 static inline uint32_t ATTRIBUTE_PURE
   36297 _3DSTATE_GS_SVB_INDEX_MaximumIndex_start(const struct gen_device_info *devinfo)
   36298 {
   36299    switch (devinfo->gen) {
   36300    case 10: return 0;
   36301    case 9: return 0;
   36302    case 8: return 0;
   36303    case 7:
   36304       if (devinfo->is_haswell) {
   36305          return 0;
   36306       } else {
   36307          return 0;
   36308       }
   36309    case 6: return 96;
   36310    case 5: return 0;
   36311    case 4:
   36312       if (devinfo->is_g4x) {
   36313          return 0;
   36314       } else {
   36315          return 0;
   36316       }
   36317    default:
   36318       unreachable("Invalid hardware generation");
   36319    }
   36320 }
   36321 
   36322 
   36323 
   36324 /* 3DSTATE_GS_SVB_INDEX::Streamed Vertex Buffer Index */
   36325 
   36326 
   36327 #define GEN6_3DSTATE_GS_SVB_INDEX_StreamedVertexBufferIndex_bits  32
   36328 
   36329 static inline uint32_t ATTRIBUTE_PURE
   36330 _3DSTATE_GS_SVB_INDEX_StreamedVertexBufferIndex_bits(const struct gen_device_info *devinfo)
   36331 {
   36332    switch (devinfo->gen) {
   36333    case 10: return 0;
   36334    case 9: return 0;
   36335    case 8: return 0;
   36336    case 7:
   36337       if (devinfo->is_haswell) {
   36338          return 0;
   36339       } else {
   36340          return 0;
   36341       }
   36342    case 6: return 32;
   36343    case 5: return 0;
   36344    case 4:
   36345       if (devinfo->is_g4x) {
   36346          return 0;
   36347       } else {
   36348          return 0;
   36349       }
   36350    default:
   36351       unreachable("Invalid hardware generation");
   36352    }
   36353 }
   36354 
   36355 
   36356 
   36357 #define GEN6_3DSTATE_GS_SVB_INDEX_StreamedVertexBufferIndex_start  64
   36358 
   36359 static inline uint32_t ATTRIBUTE_PURE
   36360 _3DSTATE_GS_SVB_INDEX_StreamedVertexBufferIndex_start(const struct gen_device_info *devinfo)
   36361 {
   36362    switch (devinfo->gen) {
   36363    case 10: return 0;
   36364    case 9: return 0;
   36365    case 8: return 0;
   36366    case 7:
   36367       if (devinfo->is_haswell) {
   36368          return 0;
   36369       } else {
   36370          return 0;
   36371       }
   36372    case 6: return 64;
   36373    case 5: return 0;
   36374    case 4:
   36375       if (devinfo->is_g4x) {
   36376          return 0;
   36377       } else {
   36378          return 0;
   36379       }
   36380    default:
   36381       unreachable("Invalid hardware generation");
   36382    }
   36383 }
   36384 
   36385 
   36386 
   36387 /* 3DSTATE_HIER_DEPTH_BUFFER */
   36388 
   36389 
   36390 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_length  5
   36391 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_length  5
   36392 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_length  5
   36393 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_length  3
   36394 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_length  3
   36395 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_length  3
   36396 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_length  3
   36397 
   36398 static inline uint32_t ATTRIBUTE_PURE
   36399 _3DSTATE_HIER_DEPTH_BUFFER_length(const struct gen_device_info *devinfo)
   36400 {
   36401    switch (devinfo->gen) {
   36402    case 10: return 5;
   36403    case 9: return 5;
   36404    case 8: return 5;
   36405    case 7:
   36406       if (devinfo->is_haswell) {
   36407          return 3;
   36408       } else {
   36409          return 3;
   36410       }
   36411    case 6: return 3;
   36412    case 5: return 3;
   36413    case 4:
   36414       if (devinfo->is_g4x) {
   36415          return 0;
   36416       } else {
   36417          return 0;
   36418       }
   36419    default:
   36420       unreachable("Invalid hardware generation");
   36421    }
   36422 }
   36423 
   36424 
   36425 
   36426 /* 3DSTATE_HIER_DEPTH_BUFFER::3D Command Opcode */
   36427 
   36428 
   36429 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits  3
   36430 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits  3
   36431 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits  3
   36432 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits  3
   36433 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits  3
   36434 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits  3
   36435 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits  3
   36436 
   36437 static inline uint32_t ATTRIBUTE_PURE
   36438 _3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   36439 {
   36440    switch (devinfo->gen) {
   36441    case 10: return 3;
   36442    case 9: return 3;
   36443    case 8: return 3;
   36444    case 7:
   36445       if (devinfo->is_haswell) {
   36446          return 3;
   36447       } else {
   36448          return 3;
   36449       }
   36450    case 6: return 3;
   36451    case 5: return 3;
   36452    case 4:
   36453       if (devinfo->is_g4x) {
   36454          return 0;
   36455       } else {
   36456          return 0;
   36457       }
   36458    default:
   36459       unreachable("Invalid hardware generation");
   36460    }
   36461 }
   36462 
   36463 
   36464 
   36465 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start  24
   36466 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start  24
   36467 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start  24
   36468 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start  24
   36469 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start  24
   36470 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start  24
   36471 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start  24
   36472 
   36473 static inline uint32_t ATTRIBUTE_PURE
   36474 _3DSTATE_HIER_DEPTH_BUFFER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   36475 {
   36476    switch (devinfo->gen) {
   36477    case 10: return 24;
   36478    case 9: return 24;
   36479    case 8: return 24;
   36480    case 7:
   36481       if (devinfo->is_haswell) {
   36482          return 24;
   36483       } else {
   36484          return 24;
   36485       }
   36486    case 6: return 24;
   36487    case 5: return 24;
   36488    case 4:
   36489       if (devinfo->is_g4x) {
   36490          return 0;
   36491       } else {
   36492          return 0;
   36493       }
   36494    default:
   36495       unreachable("Invalid hardware generation");
   36496    }
   36497 }
   36498 
   36499 
   36500 
   36501 /* 3DSTATE_HIER_DEPTH_BUFFER::3D Command Sub Opcode */
   36502 
   36503 
   36504 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   36505 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   36506 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   36507 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   36508 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   36509 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   36510 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits  8
   36511 
   36512 static inline uint32_t ATTRIBUTE_PURE
   36513 _3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   36514 {
   36515    switch (devinfo->gen) {
   36516    case 10: return 8;
   36517    case 9: return 8;
   36518    case 8: return 8;
   36519    case 7:
   36520       if (devinfo->is_haswell) {
   36521          return 8;
   36522       } else {
   36523          return 8;
   36524       }
   36525    case 6: return 8;
   36526    case 5: return 8;
   36527    case 4:
   36528       if (devinfo->is_g4x) {
   36529          return 0;
   36530       } else {
   36531          return 0;
   36532       }
   36533    default:
   36534       unreachable("Invalid hardware generation");
   36535    }
   36536 }
   36537 
   36538 
   36539 
   36540 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   36541 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   36542 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   36543 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   36544 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   36545 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   36546 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start  16
   36547 
   36548 static inline uint32_t ATTRIBUTE_PURE
   36549 _3DSTATE_HIER_DEPTH_BUFFER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   36550 {
   36551    switch (devinfo->gen) {
   36552    case 10: return 16;
   36553    case 9: return 16;
   36554    case 8: return 16;
   36555    case 7:
   36556       if (devinfo->is_haswell) {
   36557          return 16;
   36558       } else {
   36559          return 16;
   36560       }
   36561    case 6: return 16;
   36562    case 5: return 16;
   36563    case 4:
   36564       if (devinfo->is_g4x) {
   36565          return 0;
   36566       } else {
   36567          return 0;
   36568       }
   36569    default:
   36570       unreachable("Invalid hardware generation");
   36571    }
   36572 }
   36573 
   36574 
   36575 
   36576 /* 3DSTATE_HIER_DEPTH_BUFFER::Command SubType */
   36577 
   36578 
   36579 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits  2
   36580 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits  2
   36581 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits  2
   36582 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits  2
   36583 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits  2
   36584 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits  2
   36585 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits  2
   36586 
   36587 static inline uint32_t ATTRIBUTE_PURE
   36588 _3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_bits(const struct gen_device_info *devinfo)
   36589 {
   36590    switch (devinfo->gen) {
   36591    case 10: return 2;
   36592    case 9: return 2;
   36593    case 8: return 2;
   36594    case 7:
   36595       if (devinfo->is_haswell) {
   36596          return 2;
   36597       } else {
   36598          return 2;
   36599       }
   36600    case 6: return 2;
   36601    case 5: return 2;
   36602    case 4:
   36603       if (devinfo->is_g4x) {
   36604          return 0;
   36605       } else {
   36606          return 0;
   36607       }
   36608    default:
   36609       unreachable("Invalid hardware generation");
   36610    }
   36611 }
   36612 
   36613 
   36614 
   36615 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start  27
   36616 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start  27
   36617 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start  27
   36618 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start  27
   36619 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start  27
   36620 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start  27
   36621 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start  27
   36622 
   36623 static inline uint32_t ATTRIBUTE_PURE
   36624 _3DSTATE_HIER_DEPTH_BUFFER_CommandSubType_start(const struct gen_device_info *devinfo)
   36625 {
   36626    switch (devinfo->gen) {
   36627    case 10: return 27;
   36628    case 9: return 27;
   36629    case 8: return 27;
   36630    case 7:
   36631       if (devinfo->is_haswell) {
   36632          return 27;
   36633       } else {
   36634          return 27;
   36635       }
   36636    case 6: return 27;
   36637    case 5: return 27;
   36638    case 4:
   36639       if (devinfo->is_g4x) {
   36640          return 0;
   36641       } else {
   36642          return 0;
   36643       }
   36644    default:
   36645       unreachable("Invalid hardware generation");
   36646    }
   36647 }
   36648 
   36649 
   36650 
   36651 /* 3DSTATE_HIER_DEPTH_BUFFER::Command Type */
   36652 
   36653 
   36654 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits  3
   36655 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits  3
   36656 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits  3
   36657 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits  3
   36658 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits  3
   36659 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits  3
   36660 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits  3
   36661 
   36662 static inline uint32_t ATTRIBUTE_PURE
   36663 _3DSTATE_HIER_DEPTH_BUFFER_CommandType_bits(const struct gen_device_info *devinfo)
   36664 {
   36665    switch (devinfo->gen) {
   36666    case 10: return 3;
   36667    case 9: return 3;
   36668    case 8: return 3;
   36669    case 7:
   36670       if (devinfo->is_haswell) {
   36671          return 3;
   36672       } else {
   36673          return 3;
   36674       }
   36675    case 6: return 3;
   36676    case 5: return 3;
   36677    case 4:
   36678       if (devinfo->is_g4x) {
   36679          return 0;
   36680       } else {
   36681          return 0;
   36682       }
   36683    default:
   36684       unreachable("Invalid hardware generation");
   36685    }
   36686 }
   36687 
   36688 
   36689 
   36690 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_CommandType_start  29
   36691 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_CommandType_start  29
   36692 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_CommandType_start  29
   36693 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_CommandType_start  29
   36694 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_CommandType_start  29
   36695 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_CommandType_start  29
   36696 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_CommandType_start  29
   36697 
   36698 static inline uint32_t ATTRIBUTE_PURE
   36699 _3DSTATE_HIER_DEPTH_BUFFER_CommandType_start(const struct gen_device_info *devinfo)
   36700 {
   36701    switch (devinfo->gen) {
   36702    case 10: return 29;
   36703    case 9: return 29;
   36704    case 8: return 29;
   36705    case 7:
   36706       if (devinfo->is_haswell) {
   36707          return 29;
   36708       } else {
   36709          return 29;
   36710       }
   36711    case 6: return 29;
   36712    case 5: return 29;
   36713    case 4:
   36714       if (devinfo->is_g4x) {
   36715          return 0;
   36716       } else {
   36717          return 0;
   36718       }
   36719    default:
   36720       unreachable("Invalid hardware generation");
   36721    }
   36722 }
   36723 
   36724 
   36725 
   36726 /* 3DSTATE_HIER_DEPTH_BUFFER::DWord Length */
   36727 
   36728 
   36729 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits  8
   36730 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits  8
   36731 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits  8
   36732 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits  8
   36733 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits  8
   36734 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits  8
   36735 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits  8
   36736 
   36737 static inline uint32_t ATTRIBUTE_PURE
   36738 _3DSTATE_HIER_DEPTH_BUFFER_DWordLength_bits(const struct gen_device_info *devinfo)
   36739 {
   36740    switch (devinfo->gen) {
   36741    case 10: return 8;
   36742    case 9: return 8;
   36743    case 8: return 8;
   36744    case 7:
   36745       if (devinfo->is_haswell) {
   36746          return 8;
   36747       } else {
   36748          return 8;
   36749       }
   36750    case 6: return 8;
   36751    case 5: return 8;
   36752    case 4:
   36753       if (devinfo->is_g4x) {
   36754          return 0;
   36755       } else {
   36756          return 0;
   36757       }
   36758    default:
   36759       unreachable("Invalid hardware generation");
   36760    }
   36761 }
   36762 
   36763 
   36764 
   36765 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start  0
   36766 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start  0
   36767 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start  0
   36768 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start  0
   36769 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start  0
   36770 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start  0
   36771 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start  0
   36772 
   36773 static inline uint32_t ATTRIBUTE_PURE
   36774 _3DSTATE_HIER_DEPTH_BUFFER_DWordLength_start(const struct gen_device_info *devinfo)
   36775 {
   36776    switch (devinfo->gen) {
   36777    case 10: return 0;
   36778    case 9: return 0;
   36779    case 8: return 0;
   36780    case 7:
   36781       if (devinfo->is_haswell) {
   36782          return 0;
   36783       } else {
   36784          return 0;
   36785       }
   36786    case 6: return 0;
   36787    case 5: return 0;
   36788    case 4:
   36789       if (devinfo->is_g4x) {
   36790          return 0;
   36791       } else {
   36792          return 0;
   36793       }
   36794    default:
   36795       unreachable("Invalid hardware generation");
   36796    }
   36797 }
   36798 
   36799 
   36800 
   36801 /* 3DSTATE_HIER_DEPTH_BUFFER::Hierarchical Depth Buffer MOCS */
   36802 
   36803 
   36804 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_bits  7
   36805 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_bits  7
   36806 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_bits  7
   36807 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_bits  4
   36808 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_bits  4
   36809 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_bits  4
   36810 
   36811 static inline uint32_t ATTRIBUTE_PURE
   36812 _3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_bits(const struct gen_device_info *devinfo)
   36813 {
   36814    switch (devinfo->gen) {
   36815    case 10: return 7;
   36816    case 9: return 7;
   36817    case 8: return 7;
   36818    case 7:
   36819       if (devinfo->is_haswell) {
   36820          return 4;
   36821       } else {
   36822          return 4;
   36823       }
   36824    case 6: return 4;
   36825    case 5: return 0;
   36826    case 4:
   36827       if (devinfo->is_g4x) {
   36828          return 0;
   36829       } else {
   36830          return 0;
   36831       }
   36832    default:
   36833       unreachable("Invalid hardware generation");
   36834    }
   36835 }
   36836 
   36837 
   36838 
   36839 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_start  57
   36840 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_start  57
   36841 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_start  57
   36842 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_start  57
   36843 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_start  57
   36844 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_start  57
   36845 
   36846 static inline uint32_t ATTRIBUTE_PURE
   36847 _3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferMOCS_start(const struct gen_device_info *devinfo)
   36848 {
   36849    switch (devinfo->gen) {
   36850    case 10: return 57;
   36851    case 9: return 57;
   36852    case 8: return 57;
   36853    case 7:
   36854       if (devinfo->is_haswell) {
   36855          return 57;
   36856       } else {
   36857          return 57;
   36858       }
   36859    case 6: return 57;
   36860    case 5: return 0;
   36861    case 4:
   36862       if (devinfo->is_g4x) {
   36863          return 0;
   36864       } else {
   36865          return 0;
   36866       }
   36867    default:
   36868       unreachable("Invalid hardware generation");
   36869    }
   36870 }
   36871 
   36872 
   36873 
   36874 /* 3DSTATE_HIER_DEPTH_BUFFER::Hierarchical Depth Buffer Object Control State */
   36875 
   36876 
   36877 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_bits  7
   36878 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_bits  7
   36879 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_bits  7
   36880 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_bits  4
   36881 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_bits  4
   36882 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_bits  4
   36883 
   36884 static inline uint32_t ATTRIBUTE_PURE
   36885 _3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   36886 {
   36887    switch (devinfo->gen) {
   36888    case 10: return 7;
   36889    case 9: return 7;
   36890    case 8: return 7;
   36891    case 7:
   36892       if (devinfo->is_haswell) {
   36893          return 4;
   36894       } else {
   36895          return 4;
   36896       }
   36897    case 6: return 4;
   36898    case 5: return 0;
   36899    case 4:
   36900       if (devinfo->is_g4x) {
   36901          return 0;
   36902       } else {
   36903          return 0;
   36904       }
   36905    default:
   36906       unreachable("Invalid hardware generation");
   36907    }
   36908 }
   36909 
   36910 
   36911 
   36912 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_start  57
   36913 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_start  57
   36914 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_start  57
   36915 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_start  57
   36916 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_start  57
   36917 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_start  57
   36918 
   36919 static inline uint32_t ATTRIBUTE_PURE
   36920 _3DSTATE_HIER_DEPTH_BUFFER_HierarchicalDepthBufferObjectControlState_start(const struct gen_device_info *devinfo)
   36921 {
   36922    switch (devinfo->gen) {
   36923    case 10: return 57;
   36924    case 9: return 57;
   36925    case 8: return 57;
   36926    case 7:
   36927       if (devinfo->is_haswell) {
   36928          return 57;
   36929       } else {
   36930          return 57;
   36931       }
   36932    case 6: return 57;
   36933    case 5: return 0;
   36934    case 4:
   36935       if (devinfo->is_g4x) {
   36936          return 0;
   36937       } else {
   36938          return 0;
   36939       }
   36940    default:
   36941       unreachable("Invalid hardware generation");
   36942    }
   36943 }
   36944 
   36945 
   36946 
   36947 /* 3DSTATE_HIER_DEPTH_BUFFER::Surface Base Address */
   36948 
   36949 
   36950 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits  64
   36951 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits  64
   36952 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits  64
   36953 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   36954 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   36955 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   36956 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits  32
   36957 
   36958 static inline uint32_t ATTRIBUTE_PURE
   36959 _3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_bits(const struct gen_device_info *devinfo)
   36960 {
   36961    switch (devinfo->gen) {
   36962    case 10: return 64;
   36963    case 9: return 64;
   36964    case 8: return 64;
   36965    case 7:
   36966       if (devinfo->is_haswell) {
   36967          return 32;
   36968       } else {
   36969          return 32;
   36970       }
   36971    case 6: return 32;
   36972    case 5: return 32;
   36973    case 4:
   36974       if (devinfo->is_g4x) {
   36975          return 0;
   36976       } else {
   36977          return 0;
   36978       }
   36979    default:
   36980       unreachable("Invalid hardware generation");
   36981    }
   36982 }
   36983 
   36984 
   36985 
   36986 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   36987 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   36988 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   36989 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   36990 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   36991 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   36992 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start  64
   36993 
   36994 static inline uint32_t ATTRIBUTE_PURE
   36995 _3DSTATE_HIER_DEPTH_BUFFER_SurfaceBaseAddress_start(const struct gen_device_info *devinfo)
   36996 {
   36997    switch (devinfo->gen) {
   36998    case 10: return 64;
   36999    case 9: return 64;
   37000    case 8: return 64;
   37001    case 7:
   37002       if (devinfo->is_haswell) {
   37003          return 64;
   37004       } else {
   37005          return 64;
   37006       }
   37007    case 6: return 64;
   37008    case 5: return 64;
   37009    case 4:
   37010       if (devinfo->is_g4x) {
   37011          return 0;
   37012       } else {
   37013          return 0;
   37014       }
   37015    default:
   37016       unreachable("Invalid hardware generation");
   37017    }
   37018 }
   37019 
   37020 
   37021 
   37022 /* 3DSTATE_HIER_DEPTH_BUFFER::Surface Pitch */
   37023 
   37024 
   37025 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits  17
   37026 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits  17
   37027 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits  17
   37028 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits  17
   37029 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits  17
   37030 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits  17
   37031 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits  17
   37032 
   37033 static inline uint32_t ATTRIBUTE_PURE
   37034 _3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_bits(const struct gen_device_info *devinfo)
   37035 {
   37036    switch (devinfo->gen) {
   37037    case 10: return 17;
   37038    case 9: return 17;
   37039    case 8: return 17;
   37040    case 7:
   37041       if (devinfo->is_haswell) {
   37042          return 17;
   37043       } else {
   37044          return 17;
   37045       }
   37046    case 6: return 17;
   37047    case 5: return 17;
   37048    case 4:
   37049       if (devinfo->is_g4x) {
   37050          return 0;
   37051       } else {
   37052          return 0;
   37053       }
   37054    default:
   37055       unreachable("Invalid hardware generation");
   37056    }
   37057 }
   37058 
   37059 
   37060 
   37061 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start  32
   37062 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start  32
   37063 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start  32
   37064 #define GEN75_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start  32
   37065 #define GEN7_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start  32
   37066 #define GEN6_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start  32
   37067 #define GEN5_3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start  32
   37068 
   37069 static inline uint32_t ATTRIBUTE_PURE
   37070 _3DSTATE_HIER_DEPTH_BUFFER_SurfacePitch_start(const struct gen_device_info *devinfo)
   37071 {
   37072    switch (devinfo->gen) {
   37073    case 10: return 32;
   37074    case 9: return 32;
   37075    case 8: return 32;
   37076    case 7:
   37077       if (devinfo->is_haswell) {
   37078          return 32;
   37079       } else {
   37080          return 32;
   37081       }
   37082    case 6: return 32;
   37083    case 5: return 32;
   37084    case 4:
   37085       if (devinfo->is_g4x) {
   37086          return 0;
   37087       } else {
   37088          return 0;
   37089       }
   37090    default:
   37091       unreachable("Invalid hardware generation");
   37092    }
   37093 }
   37094 
   37095 
   37096 
   37097 /* 3DSTATE_HIER_DEPTH_BUFFER::Surface QPitch */
   37098 
   37099 
   37100 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_bits  15
   37101 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_bits  15
   37102 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_bits  15
   37103 
   37104 static inline uint32_t ATTRIBUTE_PURE
   37105 _3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_bits(const struct gen_device_info *devinfo)
   37106 {
   37107    switch (devinfo->gen) {
   37108    case 10: return 15;
   37109    case 9: return 15;
   37110    case 8: return 15;
   37111    case 7:
   37112       if (devinfo->is_haswell) {
   37113          return 0;
   37114       } else {
   37115          return 0;
   37116       }
   37117    case 6: return 0;
   37118    case 5: return 0;
   37119    case 4:
   37120       if (devinfo->is_g4x) {
   37121          return 0;
   37122       } else {
   37123          return 0;
   37124       }
   37125    default:
   37126       unreachable("Invalid hardware generation");
   37127    }
   37128 }
   37129 
   37130 
   37131 
   37132 #define GEN10_3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_start  128
   37133 #define GEN9_3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_start  128
   37134 #define GEN8_3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_start  128
   37135 
   37136 static inline uint32_t ATTRIBUTE_PURE
   37137 _3DSTATE_HIER_DEPTH_BUFFER_SurfaceQPitch_start(const struct gen_device_info *devinfo)
   37138 {
   37139    switch (devinfo->gen) {
   37140    case 10: return 128;
   37141    case 9: return 128;
   37142    case 8: return 128;
   37143    case 7:
   37144       if (devinfo->is_haswell) {
   37145          return 0;
   37146       } else {
   37147          return 0;
   37148       }
   37149    case 6: return 0;
   37150    case 5: return 0;
   37151    case 4:
   37152       if (devinfo->is_g4x) {
   37153          return 0;
   37154       } else {
   37155          return 0;
   37156       }
   37157    default:
   37158       unreachable("Invalid hardware generation");
   37159    }
   37160 }
   37161 
   37162 
   37163 
   37164 /* 3DSTATE_HS */
   37165 
   37166 
   37167 #define GEN10_3DSTATE_HS_length  9
   37168 #define GEN9_3DSTATE_HS_length  9
   37169 #define GEN8_3DSTATE_HS_length  9
   37170 #define GEN75_3DSTATE_HS_length  7
   37171 #define GEN7_3DSTATE_HS_length  7
   37172 
   37173 static inline uint32_t ATTRIBUTE_PURE
   37174 _3DSTATE_HS_length(const struct gen_device_info *devinfo)
   37175 {
   37176    switch (devinfo->gen) {
   37177    case 10: return 9;
   37178    case 9: return 9;
   37179    case 8: return 9;
   37180    case 7:
   37181       if (devinfo->is_haswell) {
   37182          return 7;
   37183       } else {
   37184          return 7;
   37185       }
   37186    case 6: return 0;
   37187    case 5: return 0;
   37188    case 4:
   37189       if (devinfo->is_g4x) {
   37190          return 0;
   37191       } else {
   37192          return 0;
   37193       }
   37194    default:
   37195       unreachable("Invalid hardware generation");
   37196    }
   37197 }
   37198 
   37199 
   37200 
   37201 /* 3DSTATE_HS::3D Command Opcode */
   37202 
   37203 
   37204 #define GEN10_3DSTATE_HS_3DCommandOpcode_bits  3
   37205 #define GEN9_3DSTATE_HS_3DCommandOpcode_bits  3
   37206 #define GEN8_3DSTATE_HS_3DCommandOpcode_bits  3
   37207 #define GEN75_3DSTATE_HS_3DCommandOpcode_bits  3
   37208 #define GEN7_3DSTATE_HS_3DCommandOpcode_bits  3
   37209 
   37210 static inline uint32_t ATTRIBUTE_PURE
   37211 _3DSTATE_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   37212 {
   37213    switch (devinfo->gen) {
   37214    case 10: return 3;
   37215    case 9: return 3;
   37216    case 8: return 3;
   37217    case 7:
   37218       if (devinfo->is_haswell) {
   37219          return 3;
   37220       } else {
   37221          return 3;
   37222       }
   37223    case 6: return 0;
   37224    case 5: return 0;
   37225    case 4:
   37226       if (devinfo->is_g4x) {
   37227          return 0;
   37228       } else {
   37229          return 0;
   37230       }
   37231    default:
   37232       unreachable("Invalid hardware generation");
   37233    }
   37234 }
   37235 
   37236 
   37237 
   37238 #define GEN10_3DSTATE_HS_3DCommandOpcode_start  24
   37239 #define GEN9_3DSTATE_HS_3DCommandOpcode_start  24
   37240 #define GEN8_3DSTATE_HS_3DCommandOpcode_start  24
   37241 #define GEN75_3DSTATE_HS_3DCommandOpcode_start  24
   37242 #define GEN7_3DSTATE_HS_3DCommandOpcode_start  24
   37243 
   37244 static inline uint32_t ATTRIBUTE_PURE
   37245 _3DSTATE_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   37246 {
   37247    switch (devinfo->gen) {
   37248    case 10: return 24;
   37249    case 9: return 24;
   37250    case 8: return 24;
   37251    case 7:
   37252       if (devinfo->is_haswell) {
   37253          return 24;
   37254       } else {
   37255          return 24;
   37256       }
   37257    case 6: return 0;
   37258    case 5: return 0;
   37259    case 4:
   37260       if (devinfo->is_g4x) {
   37261          return 0;
   37262       } else {
   37263          return 0;
   37264       }
   37265    default:
   37266       unreachable("Invalid hardware generation");
   37267    }
   37268 }
   37269 
   37270 
   37271 
   37272 /* 3DSTATE_HS::3D Command Sub Opcode */
   37273 
   37274 
   37275 #define GEN10_3DSTATE_HS_3DCommandSubOpcode_bits  8
   37276 #define GEN9_3DSTATE_HS_3DCommandSubOpcode_bits  8
   37277 #define GEN8_3DSTATE_HS_3DCommandSubOpcode_bits  8
   37278 #define GEN75_3DSTATE_HS_3DCommandSubOpcode_bits  8
   37279 #define GEN7_3DSTATE_HS_3DCommandSubOpcode_bits  8
   37280 
   37281 static inline uint32_t ATTRIBUTE_PURE
   37282 _3DSTATE_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   37283 {
   37284    switch (devinfo->gen) {
   37285    case 10: return 8;
   37286    case 9: return 8;
   37287    case 8: return 8;
   37288    case 7:
   37289       if (devinfo->is_haswell) {
   37290          return 8;
   37291       } else {
   37292          return 8;
   37293       }
   37294    case 6: return 0;
   37295    case 5: return 0;
   37296    case 4:
   37297       if (devinfo->is_g4x) {
   37298          return 0;
   37299       } else {
   37300          return 0;
   37301       }
   37302    default:
   37303       unreachable("Invalid hardware generation");
   37304    }
   37305 }
   37306 
   37307 
   37308 
   37309 #define GEN10_3DSTATE_HS_3DCommandSubOpcode_start  16
   37310 #define GEN9_3DSTATE_HS_3DCommandSubOpcode_start  16
   37311 #define GEN8_3DSTATE_HS_3DCommandSubOpcode_start  16
   37312 #define GEN75_3DSTATE_HS_3DCommandSubOpcode_start  16
   37313 #define GEN7_3DSTATE_HS_3DCommandSubOpcode_start  16
   37314 
   37315 static inline uint32_t ATTRIBUTE_PURE
   37316 _3DSTATE_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   37317 {
   37318    switch (devinfo->gen) {
   37319    case 10: return 16;
   37320    case 9: return 16;
   37321    case 8: return 16;
   37322    case 7:
   37323       if (devinfo->is_haswell) {
   37324          return 16;
   37325       } else {
   37326          return 16;
   37327       }
   37328    case 6: return 0;
   37329    case 5: return 0;
   37330    case 4:
   37331       if (devinfo->is_g4x) {
   37332          return 0;
   37333       } else {
   37334          return 0;
   37335       }
   37336    default:
   37337       unreachable("Invalid hardware generation");
   37338    }
   37339 }
   37340 
   37341 
   37342 
   37343 /* 3DSTATE_HS::Accesses UAV */
   37344 
   37345 
   37346 #define GEN10_3DSTATE_HS_AccessesUAV_bits  1
   37347 #define GEN9_3DSTATE_HS_AccessesUAV_bits  1
   37348 #define GEN8_3DSTATE_HS_AccessesUAV_bits  1
   37349 
   37350 static inline uint32_t ATTRIBUTE_PURE
   37351 _3DSTATE_HS_AccessesUAV_bits(const struct gen_device_info *devinfo)
   37352 {
   37353    switch (devinfo->gen) {
   37354    case 10: return 1;
   37355    case 9: return 1;
   37356    case 8: return 1;
   37357    case 7:
   37358       if (devinfo->is_haswell) {
   37359          return 0;
   37360       } else {
   37361          return 0;
   37362       }
   37363    case 6: return 0;
   37364    case 5: return 0;
   37365    case 4:
   37366       if (devinfo->is_g4x) {
   37367          return 0;
   37368       } else {
   37369          return 0;
   37370       }
   37371    default:
   37372       unreachable("Invalid hardware generation");
   37373    }
   37374 }
   37375 
   37376 
   37377 
   37378 #define GEN10_3DSTATE_HS_AccessesUAV_start  249
   37379 #define GEN9_3DSTATE_HS_AccessesUAV_start  249
   37380 #define GEN8_3DSTATE_HS_AccessesUAV_start  249
   37381 
   37382 static inline uint32_t ATTRIBUTE_PURE
   37383 _3DSTATE_HS_AccessesUAV_start(const struct gen_device_info *devinfo)
   37384 {
   37385    switch (devinfo->gen) {
   37386    case 10: return 249;
   37387    case 9: return 249;
   37388    case 8: return 249;
   37389    case 7:
   37390       if (devinfo->is_haswell) {
   37391          return 0;
   37392       } else {
   37393          return 0;
   37394       }
   37395    case 6: return 0;
   37396    case 5: return 0;
   37397    case 4:
   37398       if (devinfo->is_g4x) {
   37399          return 0;
   37400       } else {
   37401          return 0;
   37402       }
   37403    default:
   37404       unreachable("Invalid hardware generation");
   37405    }
   37406 }
   37407 
   37408 
   37409 
   37410 /* 3DSTATE_HS::Binding Table Entry Count */
   37411 
   37412 
   37413 #define GEN10_3DSTATE_HS_BindingTableEntryCount_bits  8
   37414 #define GEN9_3DSTATE_HS_BindingTableEntryCount_bits  8
   37415 #define GEN8_3DSTATE_HS_BindingTableEntryCount_bits  8
   37416 #define GEN75_3DSTATE_HS_BindingTableEntryCount_bits  8
   37417 #define GEN7_3DSTATE_HS_BindingTableEntryCount_bits  8
   37418 
   37419 static inline uint32_t ATTRIBUTE_PURE
   37420 _3DSTATE_HS_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   37421 {
   37422    switch (devinfo->gen) {
   37423    case 10: return 8;
   37424    case 9: return 8;
   37425    case 8: return 8;
   37426    case 7:
   37427       if (devinfo->is_haswell) {
   37428          return 8;
   37429       } else {
   37430          return 8;
   37431       }
   37432    case 6: return 0;
   37433    case 5: return 0;
   37434    case 4:
   37435       if (devinfo->is_g4x) {
   37436          return 0;
   37437       } else {
   37438          return 0;
   37439       }
   37440    default:
   37441       unreachable("Invalid hardware generation");
   37442    }
   37443 }
   37444 
   37445 
   37446 
   37447 #define GEN10_3DSTATE_HS_BindingTableEntryCount_start  50
   37448 #define GEN9_3DSTATE_HS_BindingTableEntryCount_start  50
   37449 #define GEN8_3DSTATE_HS_BindingTableEntryCount_start  50
   37450 #define GEN75_3DSTATE_HS_BindingTableEntryCount_start  50
   37451 #define GEN7_3DSTATE_HS_BindingTableEntryCount_start  50
   37452 
   37453 static inline uint32_t ATTRIBUTE_PURE
   37454 _3DSTATE_HS_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   37455 {
   37456    switch (devinfo->gen) {
   37457    case 10: return 50;
   37458    case 9: return 50;
   37459    case 8: return 50;
   37460    case 7:
   37461       if (devinfo->is_haswell) {
   37462          return 50;
   37463       } else {
   37464          return 50;
   37465       }
   37466    case 6: return 0;
   37467    case 5: return 0;
   37468    case 4:
   37469       if (devinfo->is_g4x) {
   37470          return 0;
   37471       } else {
   37472          return 0;
   37473       }
   37474    default:
   37475       unreachable("Invalid hardware generation");
   37476    }
   37477 }
   37478 
   37479 
   37480 
   37481 /* 3DSTATE_HS::Command SubType */
   37482 
   37483 
   37484 #define GEN10_3DSTATE_HS_CommandSubType_bits  2
   37485 #define GEN9_3DSTATE_HS_CommandSubType_bits  2
   37486 #define GEN8_3DSTATE_HS_CommandSubType_bits  2
   37487 #define GEN75_3DSTATE_HS_CommandSubType_bits  2
   37488 #define GEN7_3DSTATE_HS_CommandSubType_bits  2
   37489 
   37490 static inline uint32_t ATTRIBUTE_PURE
   37491 _3DSTATE_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   37492 {
   37493    switch (devinfo->gen) {
   37494    case 10: return 2;
   37495    case 9: return 2;
   37496    case 8: return 2;
   37497    case 7:
   37498       if (devinfo->is_haswell) {
   37499          return 2;
   37500       } else {
   37501          return 2;
   37502       }
   37503    case 6: return 0;
   37504    case 5: return 0;
   37505    case 4:
   37506       if (devinfo->is_g4x) {
   37507          return 0;
   37508       } else {
   37509          return 0;
   37510       }
   37511    default:
   37512       unreachable("Invalid hardware generation");
   37513    }
   37514 }
   37515 
   37516 
   37517 
   37518 #define GEN10_3DSTATE_HS_CommandSubType_start  27
   37519 #define GEN9_3DSTATE_HS_CommandSubType_start  27
   37520 #define GEN8_3DSTATE_HS_CommandSubType_start  27
   37521 #define GEN75_3DSTATE_HS_CommandSubType_start  27
   37522 #define GEN7_3DSTATE_HS_CommandSubType_start  27
   37523 
   37524 static inline uint32_t ATTRIBUTE_PURE
   37525 _3DSTATE_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   37526 {
   37527    switch (devinfo->gen) {
   37528    case 10: return 27;
   37529    case 9: return 27;
   37530    case 8: return 27;
   37531    case 7:
   37532       if (devinfo->is_haswell) {
   37533          return 27;
   37534       } else {
   37535          return 27;
   37536       }
   37537    case 6: return 0;
   37538    case 5: return 0;
   37539    case 4:
   37540       if (devinfo->is_g4x) {
   37541          return 0;
   37542       } else {
   37543          return 0;
   37544       }
   37545    default:
   37546       unreachable("Invalid hardware generation");
   37547    }
   37548 }
   37549 
   37550 
   37551 
   37552 /* 3DSTATE_HS::Command Type */
   37553 
   37554 
   37555 #define GEN10_3DSTATE_HS_CommandType_bits  3
   37556 #define GEN9_3DSTATE_HS_CommandType_bits  3
   37557 #define GEN8_3DSTATE_HS_CommandType_bits  3
   37558 #define GEN75_3DSTATE_HS_CommandType_bits  3
   37559 #define GEN7_3DSTATE_HS_CommandType_bits  3
   37560 
   37561 static inline uint32_t ATTRIBUTE_PURE
   37562 _3DSTATE_HS_CommandType_bits(const struct gen_device_info *devinfo)
   37563 {
   37564    switch (devinfo->gen) {
   37565    case 10: return 3;
   37566    case 9: return 3;
   37567    case 8: return 3;
   37568    case 7:
   37569       if (devinfo->is_haswell) {
   37570          return 3;
   37571       } else {
   37572          return 3;
   37573       }
   37574    case 6: return 0;
   37575    case 5: return 0;
   37576    case 4:
   37577       if (devinfo->is_g4x) {
   37578          return 0;
   37579       } else {
   37580          return 0;
   37581       }
   37582    default:
   37583       unreachable("Invalid hardware generation");
   37584    }
   37585 }
   37586 
   37587 
   37588 
   37589 #define GEN10_3DSTATE_HS_CommandType_start  29
   37590 #define GEN9_3DSTATE_HS_CommandType_start  29
   37591 #define GEN8_3DSTATE_HS_CommandType_start  29
   37592 #define GEN75_3DSTATE_HS_CommandType_start  29
   37593 #define GEN7_3DSTATE_HS_CommandType_start  29
   37594 
   37595 static inline uint32_t ATTRIBUTE_PURE
   37596 _3DSTATE_HS_CommandType_start(const struct gen_device_info *devinfo)
   37597 {
   37598    switch (devinfo->gen) {
   37599    case 10: return 29;
   37600    case 9: return 29;
   37601    case 8: return 29;
   37602    case 7:
   37603       if (devinfo->is_haswell) {
   37604          return 29;
   37605       } else {
   37606          return 29;
   37607       }
   37608    case 6: return 0;
   37609    case 5: return 0;
   37610    case 4:
   37611       if (devinfo->is_g4x) {
   37612          return 0;
   37613       } else {
   37614          return 0;
   37615       }
   37616    default:
   37617       unreachable("Invalid hardware generation");
   37618    }
   37619 }
   37620 
   37621 
   37622 
   37623 /* 3DSTATE_HS::DWord Length */
   37624 
   37625 
   37626 #define GEN10_3DSTATE_HS_DWordLength_bits  8
   37627 #define GEN9_3DSTATE_HS_DWordLength_bits  8
   37628 #define GEN8_3DSTATE_HS_DWordLength_bits  8
   37629 #define GEN75_3DSTATE_HS_DWordLength_bits  8
   37630 #define GEN7_3DSTATE_HS_DWordLength_bits  8
   37631 
   37632 static inline uint32_t ATTRIBUTE_PURE
   37633 _3DSTATE_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   37634 {
   37635    switch (devinfo->gen) {
   37636    case 10: return 8;
   37637    case 9: return 8;
   37638    case 8: return 8;
   37639    case 7:
   37640       if (devinfo->is_haswell) {
   37641          return 8;
   37642       } else {
   37643          return 8;
   37644       }
   37645    case 6: return 0;
   37646    case 5: return 0;
   37647    case 4:
   37648       if (devinfo->is_g4x) {
   37649          return 0;
   37650       } else {
   37651          return 0;
   37652       }
   37653    default:
   37654       unreachable("Invalid hardware generation");
   37655    }
   37656 }
   37657 
   37658 
   37659 
   37660 #define GEN10_3DSTATE_HS_DWordLength_start  0
   37661 #define GEN9_3DSTATE_HS_DWordLength_start  0
   37662 #define GEN8_3DSTATE_HS_DWordLength_start  0
   37663 #define GEN75_3DSTATE_HS_DWordLength_start  0
   37664 #define GEN7_3DSTATE_HS_DWordLength_start  0
   37665 
   37666 static inline uint32_t ATTRIBUTE_PURE
   37667 _3DSTATE_HS_DWordLength_start(const struct gen_device_info *devinfo)
   37668 {
   37669    switch (devinfo->gen) {
   37670    case 10: return 0;
   37671    case 9: return 0;
   37672    case 8: return 0;
   37673    case 7:
   37674       if (devinfo->is_haswell) {
   37675          return 0;
   37676       } else {
   37677          return 0;
   37678       }
   37679    case 6: return 0;
   37680    case 5: return 0;
   37681    case 4:
   37682       if (devinfo->is_g4x) {
   37683          return 0;
   37684       } else {
   37685          return 0;
   37686       }
   37687    default:
   37688       unreachable("Invalid hardware generation");
   37689    }
   37690 }
   37691 
   37692 
   37693 
   37694 /* 3DSTATE_HS::Dispatch GRF Start Register For URB Data */
   37695 
   37696 
   37697 #define GEN10_3DSTATE_HS_DispatchGRFStartRegisterForURBData_bits  5
   37698 #define GEN9_3DSTATE_HS_DispatchGRFStartRegisterForURBData_bits  5
   37699 #define GEN8_3DSTATE_HS_DispatchGRFStartRegisterForURBData_bits  5
   37700 #define GEN75_3DSTATE_HS_DispatchGRFStartRegisterForURBData_bits  5
   37701 #define GEN7_3DSTATE_HS_DispatchGRFStartRegisterForURBData_bits  5
   37702 
   37703 static inline uint32_t ATTRIBUTE_PURE
   37704 _3DSTATE_HS_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   37705 {
   37706    switch (devinfo->gen) {
   37707    case 10: return 5;
   37708    case 9: return 5;
   37709    case 8: return 5;
   37710    case 7:
   37711       if (devinfo->is_haswell) {
   37712          return 5;
   37713       } else {
   37714          return 5;
   37715       }
   37716    case 6: return 0;
   37717    case 5: return 0;
   37718    case 4:
   37719       if (devinfo->is_g4x) {
   37720          return 0;
   37721       } else {
   37722          return 0;
   37723       }
   37724    default:
   37725       unreachable("Invalid hardware generation");
   37726    }
   37727 }
   37728 
   37729 
   37730 
   37731 #define GEN10_3DSTATE_HS_DispatchGRFStartRegisterForURBData_start  243
   37732 #define GEN9_3DSTATE_HS_DispatchGRFStartRegisterForURBData_start  243
   37733 #define GEN8_3DSTATE_HS_DispatchGRFStartRegisterForURBData_start  243
   37734 #define GEN75_3DSTATE_HS_DispatchGRFStartRegisterForURBData_start  179
   37735 #define GEN7_3DSTATE_HS_DispatchGRFStartRegisterForURBData_start  179
   37736 
   37737 static inline uint32_t ATTRIBUTE_PURE
   37738 _3DSTATE_HS_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   37739 {
   37740    switch (devinfo->gen) {
   37741    case 10: return 243;
   37742    case 9: return 243;
   37743    case 8: return 243;
   37744    case 7:
   37745       if (devinfo->is_haswell) {
   37746          return 179;
   37747       } else {
   37748          return 179;
   37749       }
   37750    case 6: return 0;
   37751    case 5: return 0;
   37752    case 4:
   37753       if (devinfo->is_g4x) {
   37754          return 0;
   37755       } else {
   37756          return 0;
   37757       }
   37758    default:
   37759       unreachable("Invalid hardware generation");
   37760    }
   37761 }
   37762 
   37763 
   37764 
   37765 /* 3DSTATE_HS::Dispatch GRF Start Register For URB Data [5] */
   37766 
   37767 
   37768 #define GEN10_3DSTATE_HS_DispatchGRFStartRegisterForURBData5_bits  1
   37769 #define GEN9_3DSTATE_HS_DispatchGRFStartRegisterForURBData5_bits  1
   37770 
   37771 static inline uint32_t ATTRIBUTE_PURE
   37772 _3DSTATE_HS_DispatchGRFStartRegisterForURBData5_bits(const struct gen_device_info *devinfo)
   37773 {
   37774    switch (devinfo->gen) {
   37775    case 10: return 1;
   37776    case 9: return 1;
   37777    case 8: return 0;
   37778    case 7:
   37779       if (devinfo->is_haswell) {
   37780          return 0;
   37781       } else {
   37782          return 0;
   37783       }
   37784    case 6: return 0;
   37785    case 5: return 0;
   37786    case 4:
   37787       if (devinfo->is_g4x) {
   37788          return 0;
   37789       } else {
   37790          return 0;
   37791       }
   37792    default:
   37793       unreachable("Invalid hardware generation");
   37794    }
   37795 }
   37796 
   37797 
   37798 
   37799 #define GEN10_3DSTATE_HS_DispatchGRFStartRegisterForURBData5_start  252
   37800 #define GEN9_3DSTATE_HS_DispatchGRFStartRegisterForURBData5_start  252
   37801 
   37802 static inline uint32_t ATTRIBUTE_PURE
   37803 _3DSTATE_HS_DispatchGRFStartRegisterForURBData5_start(const struct gen_device_info *devinfo)
   37804 {
   37805    switch (devinfo->gen) {
   37806    case 10: return 252;
   37807    case 9: return 252;
   37808    case 8: return 0;
   37809    case 7:
   37810       if (devinfo->is_haswell) {
   37811          return 0;
   37812       } else {
   37813          return 0;
   37814       }
   37815    case 6: return 0;
   37816    case 5: return 0;
   37817    case 4:
   37818       if (devinfo->is_g4x) {
   37819          return 0;
   37820       } else {
   37821          return 0;
   37822       }
   37823    default:
   37824       unreachable("Invalid hardware generation");
   37825    }
   37826 }
   37827 
   37828 
   37829 
   37830 /* 3DSTATE_HS::Dispatch Mode */
   37831 
   37832 
   37833 #define GEN10_3DSTATE_HS_DispatchMode_bits  2
   37834 #define GEN9_3DSTATE_HS_DispatchMode_bits  2
   37835 
   37836 static inline uint32_t ATTRIBUTE_PURE
   37837 _3DSTATE_HS_DispatchMode_bits(const struct gen_device_info *devinfo)
   37838 {
   37839    switch (devinfo->gen) {
   37840    case 10: return 2;
   37841    case 9: return 2;
   37842    case 8: return 0;
   37843    case 7:
   37844       if (devinfo->is_haswell) {
   37845          return 0;
   37846       } else {
   37847          return 0;
   37848       }
   37849    case 6: return 0;
   37850    case 5: return 0;
   37851    case 4:
   37852       if (devinfo->is_g4x) {
   37853          return 0;
   37854       } else {
   37855          return 0;
   37856       }
   37857    default:
   37858       unreachable("Invalid hardware generation");
   37859    }
   37860 }
   37861 
   37862 
   37863 
   37864 #define GEN10_3DSTATE_HS_DispatchMode_start  241
   37865 #define GEN9_3DSTATE_HS_DispatchMode_start  241
   37866 
   37867 static inline uint32_t ATTRIBUTE_PURE
   37868 _3DSTATE_HS_DispatchMode_start(const struct gen_device_info *devinfo)
   37869 {
   37870    switch (devinfo->gen) {
   37871    case 10: return 241;
   37872    case 9: return 241;
   37873    case 8: return 0;
   37874    case 7:
   37875       if (devinfo->is_haswell) {
   37876          return 0;
   37877       } else {
   37878          return 0;
   37879       }
   37880    case 6: return 0;
   37881    case 5: return 0;
   37882    case 4:
   37883       if (devinfo->is_g4x) {
   37884          return 0;
   37885       } else {
   37886          return 0;
   37887       }
   37888    default:
   37889       unreachable("Invalid hardware generation");
   37890    }
   37891 }
   37892 
   37893 
   37894 
   37895 /* 3DSTATE_HS::Enable */
   37896 
   37897 
   37898 #define GEN10_3DSTATE_HS_Enable_bits  1
   37899 #define GEN9_3DSTATE_HS_Enable_bits  1
   37900 #define GEN8_3DSTATE_HS_Enable_bits  1
   37901 #define GEN75_3DSTATE_HS_Enable_bits  1
   37902 #define GEN7_3DSTATE_HS_Enable_bits  1
   37903 
   37904 static inline uint32_t ATTRIBUTE_PURE
   37905 _3DSTATE_HS_Enable_bits(const struct gen_device_info *devinfo)
   37906 {
   37907    switch (devinfo->gen) {
   37908    case 10: return 1;
   37909    case 9: return 1;
   37910    case 8: return 1;
   37911    case 7:
   37912       if (devinfo->is_haswell) {
   37913          return 1;
   37914       } else {
   37915          return 1;
   37916       }
   37917    case 6: return 0;
   37918    case 5: return 0;
   37919    case 4:
   37920       if (devinfo->is_g4x) {
   37921          return 0;
   37922       } else {
   37923          return 0;
   37924       }
   37925    default:
   37926       unreachable("Invalid hardware generation");
   37927    }
   37928 }
   37929 
   37930 
   37931 
   37932 #define GEN10_3DSTATE_HS_Enable_start  95
   37933 #define GEN9_3DSTATE_HS_Enable_start  95
   37934 #define GEN8_3DSTATE_HS_Enable_start  95
   37935 #define GEN75_3DSTATE_HS_Enable_start  95
   37936 #define GEN7_3DSTATE_HS_Enable_start  95
   37937 
   37938 static inline uint32_t ATTRIBUTE_PURE
   37939 _3DSTATE_HS_Enable_start(const struct gen_device_info *devinfo)
   37940 {
   37941    switch (devinfo->gen) {
   37942    case 10: return 95;
   37943    case 9: return 95;
   37944    case 8: return 95;
   37945    case 7:
   37946       if (devinfo->is_haswell) {
   37947          return 95;
   37948       } else {
   37949          return 95;
   37950       }
   37951    case 6: return 0;
   37952    case 5: return 0;
   37953    case 4:
   37954       if (devinfo->is_g4x) {
   37955          return 0;
   37956       } else {
   37957          return 0;
   37958       }
   37959    default:
   37960       unreachable("Invalid hardware generation");
   37961    }
   37962 }
   37963 
   37964 
   37965 
   37966 /* 3DSTATE_HS::Floating Point Mode */
   37967 
   37968 
   37969 #define GEN10_3DSTATE_HS_FloatingPointMode_bits  1
   37970 #define GEN9_3DSTATE_HS_FloatingPointMode_bits  1
   37971 #define GEN8_3DSTATE_HS_FloatingPointMode_bits  1
   37972 #define GEN75_3DSTATE_HS_FloatingPointMode_bits  1
   37973 #define GEN7_3DSTATE_HS_FloatingPointMode_bits  1
   37974 
   37975 static inline uint32_t ATTRIBUTE_PURE
   37976 _3DSTATE_HS_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   37977 {
   37978    switch (devinfo->gen) {
   37979    case 10: return 1;
   37980    case 9: return 1;
   37981    case 8: return 1;
   37982    case 7:
   37983       if (devinfo->is_haswell) {
   37984          return 1;
   37985       } else {
   37986          return 1;
   37987       }
   37988    case 6: return 0;
   37989    case 5: return 0;
   37990    case 4:
   37991       if (devinfo->is_g4x) {
   37992          return 0;
   37993       } else {
   37994          return 0;
   37995       }
   37996    default:
   37997       unreachable("Invalid hardware generation");
   37998    }
   37999 }
   38000 
   38001 
   38002 
   38003 #define GEN10_3DSTATE_HS_FloatingPointMode_start  48
   38004 #define GEN9_3DSTATE_HS_FloatingPointMode_start  48
   38005 #define GEN8_3DSTATE_HS_FloatingPointMode_start  48
   38006 #define GEN75_3DSTATE_HS_FloatingPointMode_start  48
   38007 #define GEN7_3DSTATE_HS_FloatingPointMode_start  48
   38008 
   38009 static inline uint32_t ATTRIBUTE_PURE
   38010 _3DSTATE_HS_FloatingPointMode_start(const struct gen_device_info *devinfo)
   38011 {
   38012    switch (devinfo->gen) {
   38013    case 10: return 48;
   38014    case 9: return 48;
   38015    case 8: return 48;
   38016    case 7:
   38017       if (devinfo->is_haswell) {
   38018          return 48;
   38019       } else {
   38020          return 48;
   38021       }
   38022    case 6: return 0;
   38023    case 5: return 0;
   38024    case 4:
   38025       if (devinfo->is_g4x) {
   38026          return 0;
   38027       } else {
   38028          return 0;
   38029       }
   38030    default:
   38031       unreachable("Invalid hardware generation");
   38032    }
   38033 }
   38034 
   38035 
   38036 
   38037 /* 3DSTATE_HS::HS accesses UAV */
   38038 
   38039 
   38040 #define GEN75_3DSTATE_HS_HSaccessesUAV_bits  1
   38041 
   38042 static inline uint32_t ATTRIBUTE_PURE
   38043 _3DSTATE_HS_HSaccessesUAV_bits(const struct gen_device_info *devinfo)
   38044 {
   38045    switch (devinfo->gen) {
   38046    case 10: return 0;
   38047    case 9: return 0;
   38048    case 8: return 0;
   38049    case 7:
   38050       if (devinfo->is_haswell) {
   38051          return 1;
   38052       } else {
   38053          return 0;
   38054       }
   38055    case 6: return 0;
   38056    case 5: return 0;
   38057    case 4:
   38058       if (devinfo->is_g4x) {
   38059          return 0;
   38060       } else {
   38061          return 0;
   38062       }
   38063    default:
   38064       unreachable("Invalid hardware generation");
   38065    }
   38066 }
   38067 
   38068 
   38069 
   38070 #define GEN75_3DSTATE_HS_HSaccessesUAV_start  185
   38071 
   38072 static inline uint32_t ATTRIBUTE_PURE
   38073 _3DSTATE_HS_HSaccessesUAV_start(const struct gen_device_info *devinfo)
   38074 {
   38075    switch (devinfo->gen) {
   38076    case 10: return 0;
   38077    case 9: return 0;
   38078    case 8: return 0;
   38079    case 7:
   38080       if (devinfo->is_haswell) {
   38081          return 185;
   38082       } else {
   38083          return 0;
   38084       }
   38085    case 6: return 0;
   38086    case 5: return 0;
   38087    case 4:
   38088       if (devinfo->is_g4x) {
   38089          return 0;
   38090       } else {
   38091          return 0;
   38092       }
   38093    default:
   38094       unreachable("Invalid hardware generation");
   38095    }
   38096 }
   38097 
   38098 
   38099 
   38100 /* 3DSTATE_HS::Illegal Opcode Exception Enable */
   38101 
   38102 
   38103 #define GEN10_3DSTATE_HS_IllegalOpcodeExceptionEnable_bits  1
   38104 #define GEN9_3DSTATE_HS_IllegalOpcodeExceptionEnable_bits  1
   38105 #define GEN8_3DSTATE_HS_IllegalOpcodeExceptionEnable_bits  1
   38106 #define GEN75_3DSTATE_HS_IllegalOpcodeExceptionEnable_bits  1
   38107 #define GEN7_3DSTATE_HS_IllegalOpcodeExceptionEnable_bits  1
   38108 
   38109 static inline uint32_t ATTRIBUTE_PURE
   38110 _3DSTATE_HS_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   38111 {
   38112    switch (devinfo->gen) {
   38113    case 10: return 1;
   38114    case 9: return 1;
   38115    case 8: return 1;
   38116    case 7:
   38117       if (devinfo->is_haswell) {
   38118          return 1;
   38119       } else {
   38120          return 1;
   38121       }
   38122    case 6: return 0;
   38123    case 5: return 0;
   38124    case 4:
   38125       if (devinfo->is_g4x) {
   38126          return 0;
   38127       } else {
   38128          return 0;
   38129       }
   38130    default:
   38131       unreachable("Invalid hardware generation");
   38132    }
   38133 }
   38134 
   38135 
   38136 
   38137 #define GEN10_3DSTATE_HS_IllegalOpcodeExceptionEnable_start  45
   38138 #define GEN9_3DSTATE_HS_IllegalOpcodeExceptionEnable_start  45
   38139 #define GEN8_3DSTATE_HS_IllegalOpcodeExceptionEnable_start  45
   38140 #define GEN75_3DSTATE_HS_IllegalOpcodeExceptionEnable_start  45
   38141 #define GEN7_3DSTATE_HS_IllegalOpcodeExceptionEnable_start  45
   38142 
   38143 static inline uint32_t ATTRIBUTE_PURE
   38144 _3DSTATE_HS_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   38145 {
   38146    switch (devinfo->gen) {
   38147    case 10: return 45;
   38148    case 9: return 45;
   38149    case 8: return 45;
   38150    case 7:
   38151       if (devinfo->is_haswell) {
   38152          return 45;
   38153       } else {
   38154          return 45;
   38155       }
   38156    case 6: return 0;
   38157    case 5: return 0;
   38158    case 4:
   38159       if (devinfo->is_g4x) {
   38160          return 0;
   38161       } else {
   38162          return 0;
   38163       }
   38164    default:
   38165       unreachable("Invalid hardware generation");
   38166    }
   38167 }
   38168 
   38169 
   38170 
   38171 /* 3DSTATE_HS::Include Primitive ID */
   38172 
   38173 
   38174 #define GEN10_3DSTATE_HS_IncludePrimitiveID_bits  1
   38175 #define GEN9_3DSTATE_HS_IncludePrimitiveID_bits  1
   38176 
   38177 static inline uint32_t ATTRIBUTE_PURE
   38178 _3DSTATE_HS_IncludePrimitiveID_bits(const struct gen_device_info *devinfo)
   38179 {
   38180    switch (devinfo->gen) {
   38181    case 10: return 1;
   38182    case 9: return 1;
   38183    case 8: return 0;
   38184    case 7:
   38185       if (devinfo->is_haswell) {
   38186          return 0;
   38187       } else {
   38188          return 0;
   38189       }
   38190    case 6: return 0;
   38191    case 5: return 0;
   38192    case 4:
   38193       if (devinfo->is_g4x) {
   38194          return 0;
   38195       } else {
   38196          return 0;
   38197       }
   38198    default:
   38199       unreachable("Invalid hardware generation");
   38200    }
   38201 }
   38202 
   38203 
   38204 
   38205 #define GEN10_3DSTATE_HS_IncludePrimitiveID_start  224
   38206 #define GEN9_3DSTATE_HS_IncludePrimitiveID_start  224
   38207 
   38208 static inline uint32_t ATTRIBUTE_PURE
   38209 _3DSTATE_HS_IncludePrimitiveID_start(const struct gen_device_info *devinfo)
   38210 {
   38211    switch (devinfo->gen) {
   38212    case 10: return 224;
   38213    case 9: return 224;
   38214    case 8: return 0;
   38215    case 7:
   38216       if (devinfo->is_haswell) {
   38217          return 0;
   38218       } else {
   38219          return 0;
   38220       }
   38221    case 6: return 0;
   38222    case 5: return 0;
   38223    case 4:
   38224       if (devinfo->is_g4x) {
   38225          return 0;
   38226       } else {
   38227          return 0;
   38228       }
   38229    default:
   38230       unreachable("Invalid hardware generation");
   38231    }
   38232 }
   38233 
   38234 
   38235 
   38236 /* 3DSTATE_HS::Include Vertex Handles */
   38237 
   38238 
   38239 #define GEN10_3DSTATE_HS_IncludeVertexHandles_bits  1
   38240 #define GEN9_3DSTATE_HS_IncludeVertexHandles_bits  1
   38241 #define GEN8_3DSTATE_HS_IncludeVertexHandles_bits  1
   38242 #define GEN75_3DSTATE_HS_IncludeVertexHandles_bits  1
   38243 #define GEN7_3DSTATE_HS_IncludeVertexHandles_bits  1
   38244 
   38245 static inline uint32_t ATTRIBUTE_PURE
   38246 _3DSTATE_HS_IncludeVertexHandles_bits(const struct gen_device_info *devinfo)
   38247 {
   38248    switch (devinfo->gen) {
   38249    case 10: return 1;
   38250    case 9: return 1;
   38251    case 8: return 1;
   38252    case 7:
   38253       if (devinfo->is_haswell) {
   38254          return 1;
   38255       } else {
   38256          return 1;
   38257       }
   38258    case 6: return 0;
   38259    case 5: return 0;
   38260    case 4:
   38261       if (devinfo->is_g4x) {
   38262          return 0;
   38263       } else {
   38264          return 0;
   38265       }
   38266    default:
   38267       unreachable("Invalid hardware generation");
   38268    }
   38269 }
   38270 
   38271 
   38272 
   38273 #define GEN10_3DSTATE_HS_IncludeVertexHandles_start  248
   38274 #define GEN9_3DSTATE_HS_IncludeVertexHandles_start  248
   38275 #define GEN8_3DSTATE_HS_IncludeVertexHandles_start  248
   38276 #define GEN75_3DSTATE_HS_IncludeVertexHandles_start  184
   38277 #define GEN7_3DSTATE_HS_IncludeVertexHandles_start  184
   38278 
   38279 static inline uint32_t ATTRIBUTE_PURE
   38280 _3DSTATE_HS_IncludeVertexHandles_start(const struct gen_device_info *devinfo)
   38281 {
   38282    switch (devinfo->gen) {
   38283    case 10: return 248;
   38284    case 9: return 248;
   38285    case 8: return 248;
   38286    case 7:
   38287       if (devinfo->is_haswell) {
   38288          return 184;
   38289       } else {
   38290          return 184;
   38291       }
   38292    case 6: return 0;
   38293    case 5: return 0;
   38294    case 4:
   38295       if (devinfo->is_g4x) {
   38296          return 0;
   38297       } else {
   38298          return 0;
   38299       }
   38300    default:
   38301       unreachable("Invalid hardware generation");
   38302    }
   38303 }
   38304 
   38305 
   38306 
   38307 /* 3DSTATE_HS::Instance Count */
   38308 
   38309 
   38310 #define GEN10_3DSTATE_HS_InstanceCount_bits  4
   38311 #define GEN9_3DSTATE_HS_InstanceCount_bits  4
   38312 #define GEN8_3DSTATE_HS_InstanceCount_bits  4
   38313 #define GEN75_3DSTATE_HS_InstanceCount_bits  4
   38314 #define GEN7_3DSTATE_HS_InstanceCount_bits  4
   38315 
   38316 static inline uint32_t ATTRIBUTE_PURE
   38317 _3DSTATE_HS_InstanceCount_bits(const struct gen_device_info *devinfo)
   38318 {
   38319    switch (devinfo->gen) {
   38320    case 10: return 4;
   38321    case 9: return 4;
   38322    case 8: return 4;
   38323    case 7:
   38324       if (devinfo->is_haswell) {
   38325          return 4;
   38326       } else {
   38327          return 4;
   38328       }
   38329    case 6: return 0;
   38330    case 5: return 0;
   38331    case 4:
   38332       if (devinfo->is_g4x) {
   38333          return 0;
   38334       } else {
   38335          return 0;
   38336       }
   38337    default:
   38338       unreachable("Invalid hardware generation");
   38339    }
   38340 }
   38341 
   38342 
   38343 
   38344 #define GEN10_3DSTATE_HS_InstanceCount_start  64
   38345 #define GEN9_3DSTATE_HS_InstanceCount_start  64
   38346 #define GEN8_3DSTATE_HS_InstanceCount_start  64
   38347 #define GEN75_3DSTATE_HS_InstanceCount_start  64
   38348 #define GEN7_3DSTATE_HS_InstanceCount_start  64
   38349 
   38350 static inline uint32_t ATTRIBUTE_PURE
   38351 _3DSTATE_HS_InstanceCount_start(const struct gen_device_info *devinfo)
   38352 {
   38353    switch (devinfo->gen) {
   38354    case 10: return 64;
   38355    case 9: return 64;
   38356    case 8: return 64;
   38357    case 7:
   38358       if (devinfo->is_haswell) {
   38359          return 64;
   38360       } else {
   38361          return 64;
   38362       }
   38363    case 6: return 0;
   38364    case 5: return 0;
   38365    case 4:
   38366       if (devinfo->is_g4x) {
   38367          return 0;
   38368       } else {
   38369          return 0;
   38370       }
   38371    default:
   38372       unreachable("Invalid hardware generation");
   38373    }
   38374 }
   38375 
   38376 
   38377 
   38378 /* 3DSTATE_HS::Kernel Start Pointer */
   38379 
   38380 
   38381 #define GEN10_3DSTATE_HS_KernelStartPointer_bits  58
   38382 #define GEN9_3DSTATE_HS_KernelStartPointer_bits  58
   38383 #define GEN8_3DSTATE_HS_KernelStartPointer_bits  58
   38384 #define GEN75_3DSTATE_HS_KernelStartPointer_bits  26
   38385 #define GEN7_3DSTATE_HS_KernelStartPointer_bits  26
   38386 
   38387 static inline uint32_t ATTRIBUTE_PURE
   38388 _3DSTATE_HS_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   38389 {
   38390    switch (devinfo->gen) {
   38391    case 10: return 58;
   38392    case 9: return 58;
   38393    case 8: return 58;
   38394    case 7:
   38395       if (devinfo->is_haswell) {
   38396          return 26;
   38397       } else {
   38398          return 26;
   38399       }
   38400    case 6: return 0;
   38401    case 5: return 0;
   38402    case 4:
   38403       if (devinfo->is_g4x) {
   38404          return 0;
   38405       } else {
   38406          return 0;
   38407       }
   38408    default:
   38409       unreachable("Invalid hardware generation");
   38410    }
   38411 }
   38412 
   38413 
   38414 
   38415 #define GEN10_3DSTATE_HS_KernelStartPointer_start  102
   38416 #define GEN9_3DSTATE_HS_KernelStartPointer_start  102
   38417 #define GEN8_3DSTATE_HS_KernelStartPointer_start  102
   38418 #define GEN75_3DSTATE_HS_KernelStartPointer_start  102
   38419 #define GEN7_3DSTATE_HS_KernelStartPointer_start  102
   38420 
   38421 static inline uint32_t ATTRIBUTE_PURE
   38422 _3DSTATE_HS_KernelStartPointer_start(const struct gen_device_info *devinfo)
   38423 {
   38424    switch (devinfo->gen) {
   38425    case 10: return 102;
   38426    case 9: return 102;
   38427    case 8: return 102;
   38428    case 7:
   38429       if (devinfo->is_haswell) {
   38430          return 102;
   38431       } else {
   38432          return 102;
   38433       }
   38434    case 6: return 0;
   38435    case 5: return 0;
   38436    case 4:
   38437       if (devinfo->is_g4x) {
   38438          return 0;
   38439       } else {
   38440          return 0;
   38441       }
   38442    default:
   38443       unreachable("Invalid hardware generation");
   38444    }
   38445 }
   38446 
   38447 
   38448 
   38449 /* 3DSTATE_HS::Maximum Number of Threads */
   38450 
   38451 
   38452 #define GEN10_3DSTATE_HS_MaximumNumberofThreads_bits  9
   38453 #define GEN9_3DSTATE_HS_MaximumNumberofThreads_bits  9
   38454 #define GEN8_3DSTATE_HS_MaximumNumberofThreads_bits  9
   38455 #define GEN75_3DSTATE_HS_MaximumNumberofThreads_bits  8
   38456 #define GEN7_3DSTATE_HS_MaximumNumberofThreads_bits  7
   38457 
   38458 static inline uint32_t ATTRIBUTE_PURE
   38459 _3DSTATE_HS_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   38460 {
   38461    switch (devinfo->gen) {
   38462    case 10: return 9;
   38463    case 9: return 9;
   38464    case 8: return 9;
   38465    case 7:
   38466       if (devinfo->is_haswell) {
   38467          return 8;
   38468       } else {
   38469          return 7;
   38470       }
   38471    case 6: return 0;
   38472    case 5: return 0;
   38473    case 4:
   38474       if (devinfo->is_g4x) {
   38475          return 0;
   38476       } else {
   38477          return 0;
   38478       }
   38479    default:
   38480       unreachable("Invalid hardware generation");
   38481    }
   38482 }
   38483 
   38484 
   38485 
   38486 #define GEN10_3DSTATE_HS_MaximumNumberofThreads_start  72
   38487 #define GEN9_3DSTATE_HS_MaximumNumberofThreads_start  72
   38488 #define GEN8_3DSTATE_HS_MaximumNumberofThreads_start  72
   38489 #define GEN75_3DSTATE_HS_MaximumNumberofThreads_start  32
   38490 #define GEN7_3DSTATE_HS_MaximumNumberofThreads_start  32
   38491 
   38492 static inline uint32_t ATTRIBUTE_PURE
   38493 _3DSTATE_HS_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   38494 {
   38495    switch (devinfo->gen) {
   38496    case 10: return 72;
   38497    case 9: return 72;
   38498    case 8: return 72;
   38499    case 7:
   38500       if (devinfo->is_haswell) {
   38501          return 32;
   38502       } else {
   38503          return 32;
   38504       }
   38505    case 6: return 0;
   38506    case 5: return 0;
   38507    case 4:
   38508       if (devinfo->is_g4x) {
   38509          return 0;
   38510       } else {
   38511          return 0;
   38512       }
   38513    default:
   38514       unreachable("Invalid hardware generation");
   38515    }
   38516 }
   38517 
   38518 
   38519 
   38520 /* 3DSTATE_HS::Per-Thread Scratch Space */
   38521 
   38522 
   38523 #define GEN10_3DSTATE_HS_PerThreadScratchSpace_bits  4
   38524 #define GEN9_3DSTATE_HS_PerThreadScratchSpace_bits  4
   38525 #define GEN8_3DSTATE_HS_PerThreadScratchSpace_bits  4
   38526 #define GEN75_3DSTATE_HS_PerThreadScratchSpace_bits  4
   38527 #define GEN7_3DSTATE_HS_PerThreadScratchSpace_bits  4
   38528 
   38529 static inline uint32_t ATTRIBUTE_PURE
   38530 _3DSTATE_HS_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   38531 {
   38532    switch (devinfo->gen) {
   38533    case 10: return 4;
   38534    case 9: return 4;
   38535    case 8: return 4;
   38536    case 7:
   38537       if (devinfo->is_haswell) {
   38538          return 4;
   38539       } else {
   38540          return 4;
   38541       }
   38542    case 6: return 0;
   38543    case 5: return 0;
   38544    case 4:
   38545       if (devinfo->is_g4x) {
   38546          return 0;
   38547       } else {
   38548          return 0;
   38549       }
   38550    default:
   38551       unreachable("Invalid hardware generation");
   38552    }
   38553 }
   38554 
   38555 
   38556 
   38557 #define GEN10_3DSTATE_HS_PerThreadScratchSpace_start  160
   38558 #define GEN9_3DSTATE_HS_PerThreadScratchSpace_start  160
   38559 #define GEN8_3DSTATE_HS_PerThreadScratchSpace_start  160
   38560 #define GEN75_3DSTATE_HS_PerThreadScratchSpace_start  128
   38561 #define GEN7_3DSTATE_HS_PerThreadScratchSpace_start  128
   38562 
   38563 static inline uint32_t ATTRIBUTE_PURE
   38564 _3DSTATE_HS_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   38565 {
   38566    switch (devinfo->gen) {
   38567    case 10: return 160;
   38568    case 9: return 160;
   38569    case 8: return 160;
   38570    case 7:
   38571       if (devinfo->is_haswell) {
   38572          return 128;
   38573       } else {
   38574          return 128;
   38575       }
   38576    case 6: return 0;
   38577    case 5: return 0;
   38578    case 4:
   38579       if (devinfo->is_g4x) {
   38580          return 0;
   38581       } else {
   38582          return 0;
   38583       }
   38584    default:
   38585       unreachable("Invalid hardware generation");
   38586    }
   38587 }
   38588 
   38589 
   38590 
   38591 /* 3DSTATE_HS::Sampler Count */
   38592 
   38593 
   38594 #define GEN10_3DSTATE_HS_SamplerCount_bits  3
   38595 #define GEN9_3DSTATE_HS_SamplerCount_bits  3
   38596 #define GEN8_3DSTATE_HS_SamplerCount_bits  3
   38597 #define GEN75_3DSTATE_HS_SamplerCount_bits  3
   38598 #define GEN7_3DSTATE_HS_SamplerCount_bits  3
   38599 
   38600 static inline uint32_t ATTRIBUTE_PURE
   38601 _3DSTATE_HS_SamplerCount_bits(const struct gen_device_info *devinfo)
   38602 {
   38603    switch (devinfo->gen) {
   38604    case 10: return 3;
   38605    case 9: return 3;
   38606    case 8: return 3;
   38607    case 7:
   38608       if (devinfo->is_haswell) {
   38609          return 3;
   38610       } else {
   38611          return 3;
   38612       }
   38613    case 6: return 0;
   38614    case 5: return 0;
   38615    case 4:
   38616       if (devinfo->is_g4x) {
   38617          return 0;
   38618       } else {
   38619          return 0;
   38620       }
   38621    default:
   38622       unreachable("Invalid hardware generation");
   38623    }
   38624 }
   38625 
   38626 
   38627 
   38628 #define GEN10_3DSTATE_HS_SamplerCount_start  59
   38629 #define GEN9_3DSTATE_HS_SamplerCount_start  59
   38630 #define GEN8_3DSTATE_HS_SamplerCount_start  59
   38631 #define GEN75_3DSTATE_HS_SamplerCount_start  59
   38632 #define GEN7_3DSTATE_HS_SamplerCount_start  59
   38633 
   38634 static inline uint32_t ATTRIBUTE_PURE
   38635 _3DSTATE_HS_SamplerCount_start(const struct gen_device_info *devinfo)
   38636 {
   38637    switch (devinfo->gen) {
   38638    case 10: return 59;
   38639    case 9: return 59;
   38640    case 8: return 59;
   38641    case 7:
   38642       if (devinfo->is_haswell) {
   38643          return 59;
   38644       } else {
   38645          return 59;
   38646       }
   38647    case 6: return 0;
   38648    case 5: return 0;
   38649    case 4:
   38650       if (devinfo->is_g4x) {
   38651          return 0;
   38652       } else {
   38653          return 0;
   38654       }
   38655    default:
   38656       unreachable("Invalid hardware generation");
   38657    }
   38658 }
   38659 
   38660 
   38661 
   38662 /* 3DSTATE_HS::Scratch Space Base Pointer */
   38663 
   38664 
   38665 #define GEN10_3DSTATE_HS_ScratchSpaceBasePointer_bits  54
   38666 #define GEN9_3DSTATE_HS_ScratchSpaceBasePointer_bits  54
   38667 #define GEN8_3DSTATE_HS_ScratchSpaceBasePointer_bits  54
   38668 #define GEN75_3DSTATE_HS_ScratchSpaceBasePointer_bits  22
   38669 #define GEN7_3DSTATE_HS_ScratchSpaceBasePointer_bits  22
   38670 
   38671 static inline uint32_t ATTRIBUTE_PURE
   38672 _3DSTATE_HS_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   38673 {
   38674    switch (devinfo->gen) {
   38675    case 10: return 54;
   38676    case 9: return 54;
   38677    case 8: return 54;
   38678    case 7:
   38679       if (devinfo->is_haswell) {
   38680          return 22;
   38681       } else {
   38682          return 22;
   38683       }
   38684    case 6: return 0;
   38685    case 5: return 0;
   38686    case 4:
   38687       if (devinfo->is_g4x) {
   38688          return 0;
   38689       } else {
   38690          return 0;
   38691       }
   38692    default:
   38693       unreachable("Invalid hardware generation");
   38694    }
   38695 }
   38696 
   38697 
   38698 
   38699 #define GEN10_3DSTATE_HS_ScratchSpaceBasePointer_start  170
   38700 #define GEN9_3DSTATE_HS_ScratchSpaceBasePointer_start  170
   38701 #define GEN8_3DSTATE_HS_ScratchSpaceBasePointer_start  170
   38702 #define GEN75_3DSTATE_HS_ScratchSpaceBasePointer_start  138
   38703 #define GEN7_3DSTATE_HS_ScratchSpaceBasePointer_start  138
   38704 
   38705 static inline uint32_t ATTRIBUTE_PURE
   38706 _3DSTATE_HS_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   38707 {
   38708    switch (devinfo->gen) {
   38709    case 10: return 170;
   38710    case 9: return 170;
   38711    case 8: return 170;
   38712    case 7:
   38713       if (devinfo->is_haswell) {
   38714          return 138;
   38715       } else {
   38716          return 138;
   38717       }
   38718    case 6: return 0;
   38719    case 5: return 0;
   38720    case 4:
   38721       if (devinfo->is_g4x) {
   38722          return 0;
   38723       } else {
   38724          return 0;
   38725       }
   38726    default:
   38727       unreachable("Invalid hardware generation");
   38728    }
   38729 }
   38730 
   38731 
   38732 
   38733 /* 3DSTATE_HS::Semaphore Handle */
   38734 
   38735 
   38736 #define GEN75_3DSTATE_HS_SemaphoreHandle_bits  13
   38737 #define GEN7_3DSTATE_HS_SemaphoreHandle_bits  12
   38738 
   38739 static inline uint32_t ATTRIBUTE_PURE
   38740 _3DSTATE_HS_SemaphoreHandle_bits(const struct gen_device_info *devinfo)
   38741 {
   38742    switch (devinfo->gen) {
   38743    case 10: return 0;
   38744    case 9: return 0;
   38745    case 8: return 0;
   38746    case 7:
   38747       if (devinfo->is_haswell) {
   38748          return 13;
   38749       } else {
   38750          return 12;
   38751       }
   38752    case 6: return 0;
   38753    case 5: return 0;
   38754    case 4:
   38755       if (devinfo->is_g4x) {
   38756          return 0;
   38757       } else {
   38758          return 0;
   38759       }
   38760    default:
   38761       unreachable("Invalid hardware generation");
   38762    }
   38763 }
   38764 
   38765 
   38766 
   38767 #define GEN75_3DSTATE_HS_SemaphoreHandle_start  192
   38768 #define GEN7_3DSTATE_HS_SemaphoreHandle_start  192
   38769 
   38770 static inline uint32_t ATTRIBUTE_PURE
   38771 _3DSTATE_HS_SemaphoreHandle_start(const struct gen_device_info *devinfo)
   38772 {
   38773    switch (devinfo->gen) {
   38774    case 10: return 0;
   38775    case 9: return 0;
   38776    case 8: return 0;
   38777    case 7:
   38778       if (devinfo->is_haswell) {
   38779          return 192;
   38780       } else {
   38781          return 192;
   38782       }
   38783    case 6: return 0;
   38784    case 5: return 0;
   38785    case 4:
   38786       if (devinfo->is_g4x) {
   38787          return 0;
   38788       } else {
   38789          return 0;
   38790       }
   38791    default:
   38792       unreachable("Invalid hardware generation");
   38793    }
   38794 }
   38795 
   38796 
   38797 
   38798 /* 3DSTATE_HS::Single Program Flow */
   38799 
   38800 
   38801 #define GEN10_3DSTATE_HS_SingleProgramFlow_bits  1
   38802 #define GEN9_3DSTATE_HS_SingleProgramFlow_bits  1
   38803 #define GEN8_3DSTATE_HS_SingleProgramFlow_bits  1
   38804 #define GEN75_3DSTATE_HS_SingleProgramFlow_bits  1
   38805 #define GEN7_3DSTATE_HS_SingleProgramFlow_bits  1
   38806 
   38807 static inline uint32_t ATTRIBUTE_PURE
   38808 _3DSTATE_HS_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   38809 {
   38810    switch (devinfo->gen) {
   38811    case 10: return 1;
   38812    case 9: return 1;
   38813    case 8: return 1;
   38814    case 7:
   38815       if (devinfo->is_haswell) {
   38816          return 1;
   38817       } else {
   38818          return 1;
   38819       }
   38820    case 6: return 0;
   38821    case 5: return 0;
   38822    case 4:
   38823       if (devinfo->is_g4x) {
   38824          return 0;
   38825       } else {
   38826          return 0;
   38827       }
   38828    default:
   38829       unreachable("Invalid hardware generation");
   38830    }
   38831 }
   38832 
   38833 
   38834 
   38835 #define GEN10_3DSTATE_HS_SingleProgramFlow_start  251
   38836 #define GEN9_3DSTATE_HS_SingleProgramFlow_start  251
   38837 #define GEN8_3DSTATE_HS_SingleProgramFlow_start  251
   38838 #define GEN75_3DSTATE_HS_SingleProgramFlow_start  187
   38839 #define GEN7_3DSTATE_HS_SingleProgramFlow_start  187
   38840 
   38841 static inline uint32_t ATTRIBUTE_PURE
   38842 _3DSTATE_HS_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   38843 {
   38844    switch (devinfo->gen) {
   38845    case 10: return 251;
   38846    case 9: return 251;
   38847    case 8: return 251;
   38848    case 7:
   38849       if (devinfo->is_haswell) {
   38850          return 187;
   38851       } else {
   38852          return 187;
   38853       }
   38854    case 6: return 0;
   38855    case 5: return 0;
   38856    case 4:
   38857       if (devinfo->is_g4x) {
   38858          return 0;
   38859       } else {
   38860          return 0;
   38861       }
   38862    default:
   38863       unreachable("Invalid hardware generation");
   38864    }
   38865 }
   38866 
   38867 
   38868 
   38869 /* 3DSTATE_HS::Software Exception Enable */
   38870 
   38871 
   38872 #define GEN10_3DSTATE_HS_SoftwareExceptionEnable_bits  1
   38873 #define GEN9_3DSTATE_HS_SoftwareExceptionEnable_bits  1
   38874 #define GEN8_3DSTATE_HS_SoftwareExceptionEnable_bits  1
   38875 #define GEN75_3DSTATE_HS_SoftwareExceptionEnable_bits  1
   38876 #define GEN7_3DSTATE_HS_SoftwareExceptionEnable_bits  1
   38877 
   38878 static inline uint32_t ATTRIBUTE_PURE
   38879 _3DSTATE_HS_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   38880 {
   38881    switch (devinfo->gen) {
   38882    case 10: return 1;
   38883    case 9: return 1;
   38884    case 8: return 1;
   38885    case 7:
   38886       if (devinfo->is_haswell) {
   38887          return 1;
   38888       } else {
   38889          return 1;
   38890       }
   38891    case 6: return 0;
   38892    case 5: return 0;
   38893    case 4:
   38894       if (devinfo->is_g4x) {
   38895          return 0;
   38896       } else {
   38897          return 0;
   38898       }
   38899    default:
   38900       unreachable("Invalid hardware generation");
   38901    }
   38902 }
   38903 
   38904 
   38905 
   38906 #define GEN10_3DSTATE_HS_SoftwareExceptionEnable_start  44
   38907 #define GEN9_3DSTATE_HS_SoftwareExceptionEnable_start  44
   38908 #define GEN8_3DSTATE_HS_SoftwareExceptionEnable_start  44
   38909 #define GEN75_3DSTATE_HS_SoftwareExceptionEnable_start  44
   38910 #define GEN7_3DSTATE_HS_SoftwareExceptionEnable_start  39
   38911 
   38912 static inline uint32_t ATTRIBUTE_PURE
   38913 _3DSTATE_HS_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   38914 {
   38915    switch (devinfo->gen) {
   38916    case 10: return 44;
   38917    case 9: return 44;
   38918    case 8: return 44;
   38919    case 7:
   38920       if (devinfo->is_haswell) {
   38921          return 44;
   38922       } else {
   38923          return 39;
   38924       }
   38925    case 6: return 0;
   38926    case 5: return 0;
   38927    case 4:
   38928       if (devinfo->is_g4x) {
   38929          return 0;
   38930       } else {
   38931          return 0;
   38932       }
   38933    default:
   38934       unreachable("Invalid hardware generation");
   38935    }
   38936 }
   38937 
   38938 
   38939 
   38940 /* 3DSTATE_HS::Statistics Enable */
   38941 
   38942 
   38943 #define GEN10_3DSTATE_HS_StatisticsEnable_bits  1
   38944 #define GEN9_3DSTATE_HS_StatisticsEnable_bits  1
   38945 #define GEN8_3DSTATE_HS_StatisticsEnable_bits  1
   38946 #define GEN75_3DSTATE_HS_StatisticsEnable_bits  1
   38947 #define GEN7_3DSTATE_HS_StatisticsEnable_bits  1
   38948 
   38949 static inline uint32_t ATTRIBUTE_PURE
   38950 _3DSTATE_HS_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   38951 {
   38952    switch (devinfo->gen) {
   38953    case 10: return 1;
   38954    case 9: return 1;
   38955    case 8: return 1;
   38956    case 7:
   38957       if (devinfo->is_haswell) {
   38958          return 1;
   38959       } else {
   38960          return 1;
   38961       }
   38962    case 6: return 0;
   38963    case 5: return 0;
   38964    case 4:
   38965       if (devinfo->is_g4x) {
   38966          return 0;
   38967       } else {
   38968          return 0;
   38969       }
   38970    default:
   38971       unreachable("Invalid hardware generation");
   38972    }
   38973 }
   38974 
   38975 
   38976 
   38977 #define GEN10_3DSTATE_HS_StatisticsEnable_start  93
   38978 #define GEN9_3DSTATE_HS_StatisticsEnable_start  93
   38979 #define GEN8_3DSTATE_HS_StatisticsEnable_start  93
   38980 #define GEN75_3DSTATE_HS_StatisticsEnable_start  93
   38981 #define GEN7_3DSTATE_HS_StatisticsEnable_start  93
   38982 
   38983 static inline uint32_t ATTRIBUTE_PURE
   38984 _3DSTATE_HS_StatisticsEnable_start(const struct gen_device_info *devinfo)
   38985 {
   38986    switch (devinfo->gen) {
   38987    case 10: return 93;
   38988    case 9: return 93;
   38989    case 8: return 93;
   38990    case 7:
   38991       if (devinfo->is_haswell) {
   38992          return 93;
   38993       } else {
   38994          return 93;
   38995       }
   38996    case 6: return 0;
   38997    case 5: return 0;
   38998    case 4:
   38999       if (devinfo->is_g4x) {
   39000          return 0;
   39001       } else {
   39002          return 0;
   39003       }
   39004    default:
   39005       unreachable("Invalid hardware generation");
   39006    }
   39007 }
   39008 
   39009 
   39010 
   39011 /* 3DSTATE_HS::Thread Dispatch Priority */
   39012 
   39013 
   39014 #define GEN10_3DSTATE_HS_ThreadDispatchPriority_bits  1
   39015 #define GEN9_3DSTATE_HS_ThreadDispatchPriority_bits  1
   39016 #define GEN8_3DSTATE_HS_ThreadDispatchPriority_bits  1
   39017 #define GEN75_3DSTATE_HS_ThreadDispatchPriority_bits  1
   39018 
   39019 static inline uint32_t ATTRIBUTE_PURE
   39020 _3DSTATE_HS_ThreadDispatchPriority_bits(const struct gen_device_info *devinfo)
   39021 {
   39022    switch (devinfo->gen) {
   39023    case 10: return 1;
   39024    case 9: return 1;
   39025    case 8: return 1;
   39026    case 7:
   39027       if (devinfo->is_haswell) {
   39028          return 1;
   39029       } else {
   39030          return 0;
   39031       }
   39032    case 6: return 0;
   39033    case 5: return 0;
   39034    case 4:
   39035       if (devinfo->is_g4x) {
   39036          return 0;
   39037       } else {
   39038          return 0;
   39039       }
   39040    default:
   39041       unreachable("Invalid hardware generation");
   39042    }
   39043 }
   39044 
   39045 
   39046 
   39047 #define GEN10_3DSTATE_HS_ThreadDispatchPriority_start  49
   39048 #define GEN9_3DSTATE_HS_ThreadDispatchPriority_start  49
   39049 #define GEN8_3DSTATE_HS_ThreadDispatchPriority_start  49
   39050 #define GEN75_3DSTATE_HS_ThreadDispatchPriority_start  49
   39051 
   39052 static inline uint32_t ATTRIBUTE_PURE
   39053 _3DSTATE_HS_ThreadDispatchPriority_start(const struct gen_device_info *devinfo)
   39054 {
   39055    switch (devinfo->gen) {
   39056    case 10: return 49;
   39057    case 9: return 49;
   39058    case 8: return 49;
   39059    case 7:
   39060       if (devinfo->is_haswell) {
   39061          return 49;
   39062       } else {
   39063          return 0;
   39064       }
   39065    case 6: return 0;
   39066    case 5: return 0;
   39067    case 4:
   39068       if (devinfo->is_g4x) {
   39069          return 0;
   39070       } else {
   39071          return 0;
   39072       }
   39073    default:
   39074       unreachable("Invalid hardware generation");
   39075    }
   39076 }
   39077 
   39078 
   39079 
   39080 /* 3DSTATE_HS::Vector Mask Enable */
   39081 
   39082 
   39083 #define GEN10_3DSTATE_HS_VectorMaskEnable_bits  1
   39084 #define GEN9_3DSTATE_HS_VectorMaskEnable_bits  1
   39085 #define GEN8_3DSTATE_HS_VectorMaskEnable_bits  1
   39086 #define GEN75_3DSTATE_HS_VectorMaskEnable_bits  1
   39087 #define GEN7_3DSTATE_HS_VectorMaskEnable_bits  1
   39088 
   39089 static inline uint32_t ATTRIBUTE_PURE
   39090 _3DSTATE_HS_VectorMaskEnable_bits(const struct gen_device_info *devinfo)
   39091 {
   39092    switch (devinfo->gen) {
   39093    case 10: return 1;
   39094    case 9: return 1;
   39095    case 8: return 1;
   39096    case 7:
   39097       if (devinfo->is_haswell) {
   39098          return 1;
   39099       } else {
   39100          return 1;
   39101       }
   39102    case 6: return 0;
   39103    case 5: return 0;
   39104    case 4:
   39105       if (devinfo->is_g4x) {
   39106          return 0;
   39107       } else {
   39108          return 0;
   39109       }
   39110    default:
   39111       unreachable("Invalid hardware generation");
   39112    }
   39113 }
   39114 
   39115 
   39116 
   39117 #define GEN10_3DSTATE_HS_VectorMaskEnable_start  250
   39118 #define GEN9_3DSTATE_HS_VectorMaskEnable_start  250
   39119 #define GEN8_3DSTATE_HS_VectorMaskEnable_start  250
   39120 #define GEN75_3DSTATE_HS_VectorMaskEnable_start  186
   39121 #define GEN7_3DSTATE_HS_VectorMaskEnable_start  186
   39122 
   39123 static inline uint32_t ATTRIBUTE_PURE
   39124 _3DSTATE_HS_VectorMaskEnable_start(const struct gen_device_info *devinfo)
   39125 {
   39126    switch (devinfo->gen) {
   39127    case 10: return 250;
   39128    case 9: return 250;
   39129    case 8: return 250;
   39130    case 7:
   39131       if (devinfo->is_haswell) {
   39132          return 186;
   39133       } else {
   39134          return 186;
   39135       }
   39136    case 6: return 0;
   39137    case 5: return 0;
   39138    case 4:
   39139       if (devinfo->is_g4x) {
   39140          return 0;
   39141       } else {
   39142          return 0;
   39143       }
   39144    default:
   39145       unreachable("Invalid hardware generation");
   39146    }
   39147 }
   39148 
   39149 
   39150 
   39151 /* 3DSTATE_HS::Vertex URB Entry Read Length */
   39152 
   39153 
   39154 #define GEN10_3DSTATE_HS_VertexURBEntryReadLength_bits  6
   39155 #define GEN9_3DSTATE_HS_VertexURBEntryReadLength_bits  6
   39156 #define GEN8_3DSTATE_HS_VertexURBEntryReadLength_bits  6
   39157 #define GEN75_3DSTATE_HS_VertexURBEntryReadLength_bits  6
   39158 #define GEN7_3DSTATE_HS_VertexURBEntryReadLength_bits  6
   39159 
   39160 static inline uint32_t ATTRIBUTE_PURE
   39161 _3DSTATE_HS_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   39162 {
   39163    switch (devinfo->gen) {
   39164    case 10: return 6;
   39165    case 9: return 6;
   39166    case 8: return 6;
   39167    case 7:
   39168       if (devinfo->is_haswell) {
   39169          return 6;
   39170       } else {
   39171          return 6;
   39172       }
   39173    case 6: return 0;
   39174    case 5: return 0;
   39175    case 4:
   39176       if (devinfo->is_g4x) {
   39177          return 0;
   39178       } else {
   39179          return 0;
   39180       }
   39181    default:
   39182       unreachable("Invalid hardware generation");
   39183    }
   39184 }
   39185 
   39186 
   39187 
   39188 #define GEN10_3DSTATE_HS_VertexURBEntryReadLength_start  235
   39189 #define GEN9_3DSTATE_HS_VertexURBEntryReadLength_start  235
   39190 #define GEN8_3DSTATE_HS_VertexURBEntryReadLength_start  235
   39191 #define GEN75_3DSTATE_HS_VertexURBEntryReadLength_start  171
   39192 #define GEN7_3DSTATE_HS_VertexURBEntryReadLength_start  171
   39193 
   39194 static inline uint32_t ATTRIBUTE_PURE
   39195 _3DSTATE_HS_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   39196 {
   39197    switch (devinfo->gen) {
   39198    case 10: return 235;
   39199    case 9: return 235;
   39200    case 8: return 235;
   39201    case 7:
   39202       if (devinfo->is_haswell) {
   39203          return 171;
   39204       } else {
   39205          return 171;
   39206       }
   39207    case 6: return 0;
   39208    case 5: return 0;
   39209    case 4:
   39210       if (devinfo->is_g4x) {
   39211          return 0;
   39212       } else {
   39213          return 0;
   39214       }
   39215    default:
   39216       unreachable("Invalid hardware generation");
   39217    }
   39218 }
   39219 
   39220 
   39221 
   39222 /* 3DSTATE_HS::Vertex URB Entry Read Offset */
   39223 
   39224 
   39225 #define GEN10_3DSTATE_HS_VertexURBEntryReadOffset_bits  6
   39226 #define GEN9_3DSTATE_HS_VertexURBEntryReadOffset_bits  6
   39227 #define GEN8_3DSTATE_HS_VertexURBEntryReadOffset_bits  6
   39228 #define GEN75_3DSTATE_HS_VertexURBEntryReadOffset_bits  6
   39229 #define GEN7_3DSTATE_HS_VertexURBEntryReadOffset_bits  6
   39230 
   39231 static inline uint32_t ATTRIBUTE_PURE
   39232 _3DSTATE_HS_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   39233 {
   39234    switch (devinfo->gen) {
   39235    case 10: return 6;
   39236    case 9: return 6;
   39237    case 8: return 6;
   39238    case 7:
   39239       if (devinfo->is_haswell) {
   39240          return 6;
   39241       } else {
   39242          return 6;
   39243       }
   39244    case 6: return 0;
   39245    case 5: return 0;
   39246    case 4:
   39247       if (devinfo->is_g4x) {
   39248          return 0;
   39249       } else {
   39250          return 0;
   39251       }
   39252    default:
   39253       unreachable("Invalid hardware generation");
   39254    }
   39255 }
   39256 
   39257 
   39258 
   39259 #define GEN10_3DSTATE_HS_VertexURBEntryReadOffset_start  228
   39260 #define GEN9_3DSTATE_HS_VertexURBEntryReadOffset_start  228
   39261 #define GEN8_3DSTATE_HS_VertexURBEntryReadOffset_start  228
   39262 #define GEN75_3DSTATE_HS_VertexURBEntryReadOffset_start  164
   39263 #define GEN7_3DSTATE_HS_VertexURBEntryReadOffset_start  164
   39264 
   39265 static inline uint32_t ATTRIBUTE_PURE
   39266 _3DSTATE_HS_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   39267 {
   39268    switch (devinfo->gen) {
   39269    case 10: return 228;
   39270    case 9: return 228;
   39271    case 8: return 228;
   39272    case 7:
   39273       if (devinfo->is_haswell) {
   39274          return 164;
   39275       } else {
   39276          return 164;
   39277       }
   39278    case 6: return 0;
   39279    case 5: return 0;
   39280    case 4:
   39281       if (devinfo->is_g4x) {
   39282          return 0;
   39283       } else {
   39284          return 0;
   39285       }
   39286    default:
   39287       unreachable("Invalid hardware generation");
   39288    }
   39289 }
   39290 
   39291 
   39292 
   39293 /* 3DSTATE_INDEX_BUFFER */
   39294 
   39295 
   39296 #define GEN10_3DSTATE_INDEX_BUFFER_length  5
   39297 #define GEN9_3DSTATE_INDEX_BUFFER_length  5
   39298 #define GEN8_3DSTATE_INDEX_BUFFER_length  5
   39299 #define GEN75_3DSTATE_INDEX_BUFFER_length  3
   39300 #define GEN7_3DSTATE_INDEX_BUFFER_length  3
   39301 #define GEN6_3DSTATE_INDEX_BUFFER_length  3
   39302 #define GEN5_3DSTATE_INDEX_BUFFER_length  3
   39303 #define GEN45_3DSTATE_INDEX_BUFFER_length  3
   39304 #define GEN4_3DSTATE_INDEX_BUFFER_length  3
   39305 
   39306 static inline uint32_t ATTRIBUTE_PURE
   39307 _3DSTATE_INDEX_BUFFER_length(const struct gen_device_info *devinfo)
   39308 {
   39309    switch (devinfo->gen) {
   39310    case 10: return 5;
   39311    case 9: return 5;
   39312    case 8: return 5;
   39313    case 7:
   39314       if (devinfo->is_haswell) {
   39315          return 3;
   39316       } else {
   39317          return 3;
   39318       }
   39319    case 6: return 3;
   39320    case 5: return 3;
   39321    case 4:
   39322       if (devinfo->is_g4x) {
   39323          return 3;
   39324       } else {
   39325          return 3;
   39326       }
   39327    default:
   39328       unreachable("Invalid hardware generation");
   39329    }
   39330 }
   39331 
   39332 
   39333 
   39334 /* 3DSTATE_INDEX_BUFFER::3D Command Opcode */
   39335 
   39336 
   39337 #define GEN10_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39338 #define GEN9_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39339 #define GEN8_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39340 #define GEN75_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39341 #define GEN7_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39342 #define GEN6_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39343 #define GEN5_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39344 #define GEN45_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39345 #define GEN4_3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits  3
   39346 
   39347 static inline uint32_t ATTRIBUTE_PURE
   39348 _3DSTATE_INDEX_BUFFER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   39349 {
   39350    switch (devinfo->gen) {
   39351    case 10: return 3;
   39352    case 9: return 3;
   39353    case 8: return 3;
   39354    case 7:
   39355       if (devinfo->is_haswell) {
   39356          return 3;
   39357       } else {
   39358          return 3;
   39359       }
   39360    case 6: return 3;
   39361    case 5: return 3;
   39362    case 4:
   39363       if (devinfo->is_g4x) {
   39364          return 3;
   39365       } else {
   39366          return 3;
   39367       }
   39368    default:
   39369       unreachable("Invalid hardware generation");
   39370    }
   39371 }
   39372 
   39373 
   39374 
   39375 #define GEN10_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39376 #define GEN9_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39377 #define GEN8_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39378 #define GEN75_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39379 #define GEN7_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39380 #define GEN6_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39381 #define GEN5_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39382 #define GEN45_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39383 #define GEN4_3DSTATE_INDEX_BUFFER_3DCommandOpcode_start  24
   39384 
   39385 static inline uint32_t ATTRIBUTE_PURE
   39386 _3DSTATE_INDEX_BUFFER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   39387 {
   39388    switch (devinfo->gen) {
   39389    case 10: return 24;
   39390    case 9: return 24;
   39391    case 8: return 24;
   39392    case 7:
   39393       if (devinfo->is_haswell) {
   39394          return 24;
   39395       } else {
   39396          return 24;
   39397       }
   39398    case 6: return 24;
   39399    case 5: return 24;
   39400    case 4:
   39401       if (devinfo->is_g4x) {
   39402          return 24;
   39403       } else {
   39404          return 24;
   39405       }
   39406    default:
   39407       unreachable("Invalid hardware generation");
   39408    }
   39409 }
   39410 
   39411 
   39412 
   39413 /* 3DSTATE_INDEX_BUFFER::3D Command Sub Opcode */
   39414 
   39415 
   39416 #define GEN10_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39417 #define GEN9_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39418 #define GEN8_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39419 #define GEN75_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39420 #define GEN7_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39421 #define GEN6_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39422 #define GEN5_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39423 #define GEN45_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39424 #define GEN4_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits  8
   39425 
   39426 static inline uint32_t ATTRIBUTE_PURE
   39427 _3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   39428 {
   39429    switch (devinfo->gen) {
   39430    case 10: return 8;
   39431    case 9: return 8;
   39432    case 8: return 8;
   39433    case 7:
   39434       if (devinfo->is_haswell) {
   39435          return 8;
   39436       } else {
   39437          return 8;
   39438       }
   39439    case 6: return 8;
   39440    case 5: return 8;
   39441    case 4:
   39442       if (devinfo->is_g4x) {
   39443          return 8;
   39444       } else {
   39445          return 8;
   39446       }
   39447    default:
   39448       unreachable("Invalid hardware generation");
   39449    }
   39450 }
   39451 
   39452 
   39453 
   39454 #define GEN10_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39455 #define GEN9_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39456 #define GEN8_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39457 #define GEN75_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39458 #define GEN7_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39459 #define GEN6_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39460 #define GEN5_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39461 #define GEN45_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39462 #define GEN4_3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start  16
   39463 
   39464 static inline uint32_t ATTRIBUTE_PURE
   39465 _3DSTATE_INDEX_BUFFER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   39466 {
   39467    switch (devinfo->gen) {
   39468    case 10: return 16;
   39469    case 9: return 16;
   39470    case 8: return 16;
   39471    case 7:
   39472       if (devinfo->is_haswell) {
   39473          return 16;
   39474       } else {
   39475          return 16;
   39476       }
   39477    case 6: return 16;
   39478    case 5: return 16;
   39479    case 4:
   39480       if (devinfo->is_g4x) {
   39481          return 16;
   39482       } else {
   39483          return 16;
   39484       }
   39485    default:
   39486       unreachable("Invalid hardware generation");
   39487    }
   39488 }
   39489 
   39490 
   39491 
   39492 /* 3DSTATE_INDEX_BUFFER::Buffer Ending Address */
   39493 
   39494 
   39495 #define GEN75_3DSTATE_INDEX_BUFFER_BufferEndingAddress_bits  32
   39496 #define GEN7_3DSTATE_INDEX_BUFFER_BufferEndingAddress_bits  32
   39497 #define GEN6_3DSTATE_INDEX_BUFFER_BufferEndingAddress_bits  32
   39498 #define GEN5_3DSTATE_INDEX_BUFFER_BufferEndingAddress_bits  32
   39499 #define GEN45_3DSTATE_INDEX_BUFFER_BufferEndingAddress_bits  32
   39500 #define GEN4_3DSTATE_INDEX_BUFFER_BufferEndingAddress_bits  32
   39501 
   39502 static inline uint32_t ATTRIBUTE_PURE
   39503 _3DSTATE_INDEX_BUFFER_BufferEndingAddress_bits(const struct gen_device_info *devinfo)
   39504 {
   39505    switch (devinfo->gen) {
   39506    case 10: return 0;
   39507    case 9: return 0;
   39508    case 8: return 0;
   39509    case 7:
   39510       if (devinfo->is_haswell) {
   39511          return 32;
   39512       } else {
   39513          return 32;
   39514       }
   39515    case 6: return 32;
   39516    case 5: return 32;
   39517    case 4:
   39518       if (devinfo->is_g4x) {
   39519          return 32;
   39520       } else {
   39521          return 32;
   39522       }
   39523    default:
   39524       unreachable("Invalid hardware generation");
   39525    }
   39526 }
   39527 
   39528 
   39529 
   39530 #define GEN75_3DSTATE_INDEX_BUFFER_BufferEndingAddress_start  64
   39531 #define GEN7_3DSTATE_INDEX_BUFFER_BufferEndingAddress_start  64
   39532 #define GEN6_3DSTATE_INDEX_BUFFER_BufferEndingAddress_start  64
   39533 #define GEN5_3DSTATE_INDEX_BUFFER_BufferEndingAddress_start  64
   39534 #define GEN45_3DSTATE_INDEX_BUFFER_BufferEndingAddress_start  64
   39535 #define GEN4_3DSTATE_INDEX_BUFFER_BufferEndingAddress_start  64
   39536 
   39537 static inline uint32_t ATTRIBUTE_PURE
   39538 _3DSTATE_INDEX_BUFFER_BufferEndingAddress_start(const struct gen_device_info *devinfo)
   39539 {
   39540    switch (devinfo->gen) {
   39541    case 10: return 0;
   39542    case 9: return 0;
   39543    case 8: return 0;
   39544    case 7:
   39545       if (devinfo->is_haswell) {
   39546          return 64;
   39547       } else {
   39548          return 64;
   39549       }
   39550    case 6: return 64;
   39551    case 5: return 64;
   39552    case 4:
   39553       if (devinfo->is_g4x) {
   39554          return 64;
   39555       } else {
   39556          return 64;
   39557       }
   39558    default:
   39559       unreachable("Invalid hardware generation");
   39560    }
   39561 }
   39562 
   39563 
   39564 
   39565 /* 3DSTATE_INDEX_BUFFER::Buffer Size */
   39566 
   39567 
   39568 #define GEN10_3DSTATE_INDEX_BUFFER_BufferSize_bits  32
   39569 #define GEN9_3DSTATE_INDEX_BUFFER_BufferSize_bits  32
   39570 #define GEN8_3DSTATE_INDEX_BUFFER_BufferSize_bits  32
   39571 
   39572 static inline uint32_t ATTRIBUTE_PURE
   39573 _3DSTATE_INDEX_BUFFER_BufferSize_bits(const struct gen_device_info *devinfo)
   39574 {
   39575    switch (devinfo->gen) {
   39576    case 10: return 32;
   39577    case 9: return 32;
   39578    case 8: return 32;
   39579    case 7:
   39580       if (devinfo->is_haswell) {
   39581          return 0;
   39582       } else {
   39583          return 0;
   39584       }
   39585    case 6: return 0;
   39586    case 5: return 0;
   39587    case 4:
   39588       if (devinfo->is_g4x) {
   39589          return 0;
   39590       } else {
   39591          return 0;
   39592       }
   39593    default:
   39594       unreachable("Invalid hardware generation");
   39595    }
   39596 }
   39597 
   39598 
   39599 
   39600 #define GEN10_3DSTATE_INDEX_BUFFER_BufferSize_start  128
   39601 #define GEN9_3DSTATE_INDEX_BUFFER_BufferSize_start  128
   39602 #define GEN8_3DSTATE_INDEX_BUFFER_BufferSize_start  128
   39603 
   39604 static inline uint32_t ATTRIBUTE_PURE
   39605 _3DSTATE_INDEX_BUFFER_BufferSize_start(const struct gen_device_info *devinfo)
   39606 {
   39607    switch (devinfo->gen) {
   39608    case 10: return 128;
   39609    case 9: return 128;
   39610    case 8: return 128;
   39611    case 7:
   39612       if (devinfo->is_haswell) {
   39613          return 0;
   39614       } else {
   39615          return 0;
   39616       }
   39617    case 6: return 0;
   39618    case 5: return 0;
   39619    case 4:
   39620       if (devinfo->is_g4x) {
   39621          return 0;
   39622       } else {
   39623          return 0;
   39624       }
   39625    default:
   39626       unreachable("Invalid hardware generation");
   39627    }
   39628 }
   39629 
   39630 
   39631 
   39632 /* 3DSTATE_INDEX_BUFFER::Buffer Starting Address */
   39633 
   39634 
   39635 #define GEN10_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  64
   39636 #define GEN9_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  64
   39637 #define GEN8_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  64
   39638 #define GEN75_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  32
   39639 #define GEN7_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  32
   39640 #define GEN6_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  32
   39641 #define GEN5_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  32
   39642 #define GEN45_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  32
   39643 #define GEN4_3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits  32
   39644 
   39645 static inline uint32_t ATTRIBUTE_PURE
   39646 _3DSTATE_INDEX_BUFFER_BufferStartingAddress_bits(const struct gen_device_info *devinfo)
   39647 {
   39648    switch (devinfo->gen) {
   39649    case 10: return 64;
   39650    case 9: return 64;
   39651    case 8: return 64;
   39652    case 7:
   39653       if (devinfo->is_haswell) {
   39654          return 32;
   39655       } else {
   39656          return 32;
   39657       }
   39658    case 6: return 32;
   39659    case 5: return 32;
   39660    case 4:
   39661       if (devinfo->is_g4x) {
   39662          return 32;
   39663       } else {
   39664          return 32;
   39665       }
   39666    default:
   39667       unreachable("Invalid hardware generation");
   39668    }
   39669 }
   39670 
   39671 
   39672 
   39673 #define GEN10_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  64
   39674 #define GEN9_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  64
   39675 #define GEN8_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  64
   39676 #define GEN75_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  32
   39677 #define GEN7_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  32
   39678 #define GEN6_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  32
   39679 #define GEN5_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  32
   39680 #define GEN45_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  32
   39681 #define GEN4_3DSTATE_INDEX_BUFFER_BufferStartingAddress_start  32
   39682 
   39683 static inline uint32_t ATTRIBUTE_PURE
   39684 _3DSTATE_INDEX_BUFFER_BufferStartingAddress_start(const struct gen_device_info *devinfo)
   39685 {
   39686    switch (devinfo->gen) {
   39687    case 10: return 64;
   39688    case 9: return 64;
   39689    case 8: return 64;
   39690    case 7:
   39691       if (devinfo->is_haswell) {
   39692          return 32;
   39693       } else {
   39694          return 32;
   39695       }
   39696    case 6: return 32;
   39697    case 5: return 32;
   39698    case 4:
   39699       if (devinfo->is_g4x) {
   39700          return 32;
   39701       } else {
   39702          return 32;
   39703       }
   39704    default:
   39705       unreachable("Invalid hardware generation");
   39706    }
   39707 }
   39708 
   39709 
   39710 
   39711 /* 3DSTATE_INDEX_BUFFER::Command SubType */
   39712 
   39713 
   39714 #define GEN10_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39715 #define GEN9_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39716 #define GEN8_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39717 #define GEN75_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39718 #define GEN7_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39719 #define GEN6_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39720 #define GEN5_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39721 #define GEN45_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39722 #define GEN4_3DSTATE_INDEX_BUFFER_CommandSubType_bits  2
   39723 
   39724 static inline uint32_t ATTRIBUTE_PURE
   39725 _3DSTATE_INDEX_BUFFER_CommandSubType_bits(const struct gen_device_info *devinfo)
   39726 {
   39727    switch (devinfo->gen) {
   39728    case 10: return 2;
   39729    case 9: return 2;
   39730    case 8: return 2;
   39731    case 7:
   39732       if (devinfo->is_haswell) {
   39733          return 2;
   39734       } else {
   39735          return 2;
   39736       }
   39737    case 6: return 2;
   39738    case 5: return 2;
   39739    case 4:
   39740       if (devinfo->is_g4x) {
   39741          return 2;
   39742       } else {
   39743          return 2;
   39744       }
   39745    default:
   39746       unreachable("Invalid hardware generation");
   39747    }
   39748 }
   39749 
   39750 
   39751 
   39752 #define GEN10_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39753 #define GEN9_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39754 #define GEN8_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39755 #define GEN75_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39756 #define GEN7_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39757 #define GEN6_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39758 #define GEN5_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39759 #define GEN45_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39760 #define GEN4_3DSTATE_INDEX_BUFFER_CommandSubType_start  27
   39761 
   39762 static inline uint32_t ATTRIBUTE_PURE
   39763 _3DSTATE_INDEX_BUFFER_CommandSubType_start(const struct gen_device_info *devinfo)
   39764 {
   39765    switch (devinfo->gen) {
   39766    case 10: return 27;
   39767    case 9: return 27;
   39768    case 8: return 27;
   39769    case 7:
   39770       if (devinfo->is_haswell) {
   39771          return 27;
   39772       } else {
   39773          return 27;
   39774       }
   39775    case 6: return 27;
   39776    case 5: return 27;
   39777    case 4:
   39778       if (devinfo->is_g4x) {
   39779          return 27;
   39780       } else {
   39781          return 27;
   39782       }
   39783    default:
   39784       unreachable("Invalid hardware generation");
   39785    }
   39786 }
   39787 
   39788 
   39789 
   39790 /* 3DSTATE_INDEX_BUFFER::Command Type */
   39791 
   39792 
   39793 #define GEN10_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39794 #define GEN9_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39795 #define GEN8_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39796 #define GEN75_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39797 #define GEN7_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39798 #define GEN6_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39799 #define GEN5_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39800 #define GEN45_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39801 #define GEN4_3DSTATE_INDEX_BUFFER_CommandType_bits  3
   39802 
   39803 static inline uint32_t ATTRIBUTE_PURE
   39804 _3DSTATE_INDEX_BUFFER_CommandType_bits(const struct gen_device_info *devinfo)
   39805 {
   39806    switch (devinfo->gen) {
   39807    case 10: return 3;
   39808    case 9: return 3;
   39809    case 8: return 3;
   39810    case 7:
   39811       if (devinfo->is_haswell) {
   39812          return 3;
   39813       } else {
   39814          return 3;
   39815       }
   39816    case 6: return 3;
   39817    case 5: return 3;
   39818    case 4:
   39819       if (devinfo->is_g4x) {
   39820          return 3;
   39821       } else {
   39822          return 3;
   39823       }
   39824    default:
   39825       unreachable("Invalid hardware generation");
   39826    }
   39827 }
   39828 
   39829 
   39830 
   39831 #define GEN10_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39832 #define GEN9_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39833 #define GEN8_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39834 #define GEN75_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39835 #define GEN7_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39836 #define GEN6_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39837 #define GEN5_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39838 #define GEN45_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39839 #define GEN4_3DSTATE_INDEX_BUFFER_CommandType_start  29
   39840 
   39841 static inline uint32_t ATTRIBUTE_PURE
   39842 _3DSTATE_INDEX_BUFFER_CommandType_start(const struct gen_device_info *devinfo)
   39843 {
   39844    switch (devinfo->gen) {
   39845    case 10: return 29;
   39846    case 9: return 29;
   39847    case 8: return 29;
   39848    case 7:
   39849       if (devinfo->is_haswell) {
   39850          return 29;
   39851       } else {
   39852          return 29;
   39853       }
   39854    case 6: return 29;
   39855    case 5: return 29;
   39856    case 4:
   39857       if (devinfo->is_g4x) {
   39858          return 29;
   39859       } else {
   39860          return 29;
   39861       }
   39862    default:
   39863       unreachable("Invalid hardware generation");
   39864    }
   39865 }
   39866 
   39867 
   39868 
   39869 /* 3DSTATE_INDEX_BUFFER::Cut Index Enable */
   39870 
   39871 
   39872 #define GEN7_3DSTATE_INDEX_BUFFER_CutIndexEnable_bits  1
   39873 #define GEN6_3DSTATE_INDEX_BUFFER_CutIndexEnable_bits  1
   39874 #define GEN5_3DSTATE_INDEX_BUFFER_CutIndexEnable_bits  1
   39875 #define GEN45_3DSTATE_INDEX_BUFFER_CutIndexEnable_bits  1
   39876 #define GEN4_3DSTATE_INDEX_BUFFER_CutIndexEnable_bits  1
   39877 
   39878 static inline uint32_t ATTRIBUTE_PURE
   39879 _3DSTATE_INDEX_BUFFER_CutIndexEnable_bits(const struct gen_device_info *devinfo)
   39880 {
   39881    switch (devinfo->gen) {
   39882    case 10: return 0;
   39883    case 9: return 0;
   39884    case 8: return 0;
   39885    case 7:
   39886       if (devinfo->is_haswell) {
   39887          return 0;
   39888       } else {
   39889          return 1;
   39890       }
   39891    case 6: return 1;
   39892    case 5: return 1;
   39893    case 4:
   39894       if (devinfo->is_g4x) {
   39895          return 1;
   39896       } else {
   39897          return 1;
   39898       }
   39899    default:
   39900       unreachable("Invalid hardware generation");
   39901    }
   39902 }
   39903 
   39904 
   39905 
   39906 #define GEN7_3DSTATE_INDEX_BUFFER_CutIndexEnable_start  10
   39907 #define GEN6_3DSTATE_INDEX_BUFFER_CutIndexEnable_start  10
   39908 #define GEN5_3DSTATE_INDEX_BUFFER_CutIndexEnable_start  10
   39909 #define GEN45_3DSTATE_INDEX_BUFFER_CutIndexEnable_start  10
   39910 #define GEN4_3DSTATE_INDEX_BUFFER_CutIndexEnable_start  10
   39911 
   39912 static inline uint32_t ATTRIBUTE_PURE
   39913 _3DSTATE_INDEX_BUFFER_CutIndexEnable_start(const struct gen_device_info *devinfo)
   39914 {
   39915    switch (devinfo->gen) {
   39916    case 10: return 0;
   39917    case 9: return 0;
   39918    case 8: return 0;
   39919    case 7:
   39920       if (devinfo->is_haswell) {
   39921          return 0;
   39922       } else {
   39923          return 10;
   39924       }
   39925    case 6: return 10;
   39926    case 5: return 10;
   39927    case 4:
   39928       if (devinfo->is_g4x) {
   39929          return 10;
   39930       } else {
   39931          return 10;
   39932       }
   39933    default:
   39934       unreachable("Invalid hardware generation");
   39935    }
   39936 }
   39937 
   39938 
   39939 
   39940 /* 3DSTATE_INDEX_BUFFER::DWord Length */
   39941 
   39942 
   39943 #define GEN10_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39944 #define GEN9_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39945 #define GEN8_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39946 #define GEN75_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39947 #define GEN7_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39948 #define GEN6_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39949 #define GEN5_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39950 #define GEN45_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39951 #define GEN4_3DSTATE_INDEX_BUFFER_DWordLength_bits  8
   39952 
   39953 static inline uint32_t ATTRIBUTE_PURE
   39954 _3DSTATE_INDEX_BUFFER_DWordLength_bits(const struct gen_device_info *devinfo)
   39955 {
   39956    switch (devinfo->gen) {
   39957    case 10: return 8;
   39958    case 9: return 8;
   39959    case 8: return 8;
   39960    case 7:
   39961       if (devinfo->is_haswell) {
   39962          return 8;
   39963       } else {
   39964          return 8;
   39965       }
   39966    case 6: return 8;
   39967    case 5: return 8;
   39968    case 4:
   39969       if (devinfo->is_g4x) {
   39970          return 8;
   39971       } else {
   39972          return 8;
   39973       }
   39974    default:
   39975       unreachable("Invalid hardware generation");
   39976    }
   39977 }
   39978 
   39979 
   39980 
   39981 #define GEN10_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39982 #define GEN9_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39983 #define GEN8_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39984 #define GEN75_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39985 #define GEN7_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39986 #define GEN6_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39987 #define GEN5_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39988 #define GEN45_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39989 #define GEN4_3DSTATE_INDEX_BUFFER_DWordLength_start  0
   39990 
   39991 static inline uint32_t ATTRIBUTE_PURE
   39992 _3DSTATE_INDEX_BUFFER_DWordLength_start(const struct gen_device_info *devinfo)
   39993 {
   39994    switch (devinfo->gen) {
   39995    case 10: return 0;
   39996    case 9: return 0;
   39997    case 8: return 0;
   39998    case 7:
   39999       if (devinfo->is_haswell) {
   40000          return 0;
   40001       } else {
   40002          return 0;
   40003       }
   40004    case 6: return 0;
   40005    case 5: return 0;
   40006    case 4:
   40007       if (devinfo->is_g4x) {
   40008          return 0;
   40009       } else {
   40010          return 0;
   40011       }
   40012    default:
   40013       unreachable("Invalid hardware generation");
   40014    }
   40015 }
   40016 
   40017 
   40018 
   40019 /* 3DSTATE_INDEX_BUFFER::Index Format */
   40020 
   40021 
   40022 #define GEN10_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40023 #define GEN9_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40024 #define GEN8_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40025 #define GEN75_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40026 #define GEN7_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40027 #define GEN6_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40028 #define GEN5_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40029 #define GEN45_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40030 #define GEN4_3DSTATE_INDEX_BUFFER_IndexFormat_bits  2
   40031 
   40032 static inline uint32_t ATTRIBUTE_PURE
   40033 _3DSTATE_INDEX_BUFFER_IndexFormat_bits(const struct gen_device_info *devinfo)
   40034 {
   40035    switch (devinfo->gen) {
   40036    case 10: return 2;
   40037    case 9: return 2;
   40038    case 8: return 2;
   40039    case 7:
   40040       if (devinfo->is_haswell) {
   40041          return 2;
   40042       } else {
   40043          return 2;
   40044       }
   40045    case 6: return 2;
   40046    case 5: return 2;
   40047    case 4:
   40048       if (devinfo->is_g4x) {
   40049          return 2;
   40050       } else {
   40051          return 2;
   40052       }
   40053    default:
   40054       unreachable("Invalid hardware generation");
   40055    }
   40056 }
   40057 
   40058 
   40059 
   40060 #define GEN10_3DSTATE_INDEX_BUFFER_IndexFormat_start  40
   40061 #define GEN9_3DSTATE_INDEX_BUFFER_IndexFormat_start  40
   40062 #define GEN8_3DSTATE_INDEX_BUFFER_IndexFormat_start  40
   40063 #define GEN75_3DSTATE_INDEX_BUFFER_IndexFormat_start  8
   40064 #define GEN7_3DSTATE_INDEX_BUFFER_IndexFormat_start  8
   40065 #define GEN6_3DSTATE_INDEX_BUFFER_IndexFormat_start  8
   40066 #define GEN5_3DSTATE_INDEX_BUFFER_IndexFormat_start  8
   40067 #define GEN45_3DSTATE_INDEX_BUFFER_IndexFormat_start  8
   40068 #define GEN4_3DSTATE_INDEX_BUFFER_IndexFormat_start  8
   40069 
   40070 static inline uint32_t ATTRIBUTE_PURE
   40071 _3DSTATE_INDEX_BUFFER_IndexFormat_start(const struct gen_device_info *devinfo)
   40072 {
   40073    switch (devinfo->gen) {
   40074    case 10: return 40;
   40075    case 9: return 40;
   40076    case 8: return 40;
   40077    case 7:
   40078       if (devinfo->is_haswell) {
   40079          return 8;
   40080       } else {
   40081          return 8;
   40082       }
   40083    case 6: return 8;
   40084    case 5: return 8;
   40085    case 4:
   40086       if (devinfo->is_g4x) {
   40087          return 8;
   40088       } else {
   40089          return 8;
   40090       }
   40091    default:
   40092       unreachable("Invalid hardware generation");
   40093    }
   40094 }
   40095 
   40096 
   40097 
   40098 /* 3DSTATE_INDEX_BUFFER::IndexBufferMOCS */
   40099 
   40100 
   40101 #define GEN10_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_bits  7
   40102 #define GEN9_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_bits  7
   40103 #define GEN8_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_bits  7
   40104 #define GEN75_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_bits  4
   40105 #define GEN7_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_bits  4
   40106 #define GEN6_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_bits  4
   40107 
   40108 static inline uint32_t ATTRIBUTE_PURE
   40109 _3DSTATE_INDEX_BUFFER_IndexBufferMOCS_bits(const struct gen_device_info *devinfo)
   40110 {
   40111    switch (devinfo->gen) {
   40112    case 10: return 7;
   40113    case 9: return 7;
   40114    case 8: return 7;
   40115    case 7:
   40116       if (devinfo->is_haswell) {
   40117          return 4;
   40118       } else {
   40119          return 4;
   40120       }
   40121    case 6: return 4;
   40122    case 5: return 0;
   40123    case 4:
   40124       if (devinfo->is_g4x) {
   40125          return 0;
   40126       } else {
   40127          return 0;
   40128       }
   40129    default:
   40130       unreachable("Invalid hardware generation");
   40131    }
   40132 }
   40133 
   40134 
   40135 
   40136 #define GEN10_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_start  32
   40137 #define GEN9_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_start  32
   40138 #define GEN8_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_start  32
   40139 #define GEN75_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_start  12
   40140 #define GEN7_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_start  12
   40141 #define GEN6_3DSTATE_INDEX_BUFFER_IndexBufferMOCS_start  12
   40142 
   40143 static inline uint32_t ATTRIBUTE_PURE
   40144 _3DSTATE_INDEX_BUFFER_IndexBufferMOCS_start(const struct gen_device_info *devinfo)
   40145 {
   40146    switch (devinfo->gen) {
   40147    case 10: return 32;
   40148    case 9: return 32;
   40149    case 8: return 32;
   40150    case 7:
   40151       if (devinfo->is_haswell) {
   40152          return 12;
   40153       } else {
   40154          return 12;
   40155       }
   40156    case 6: return 12;
   40157    case 5: return 0;
   40158    case 4:
   40159       if (devinfo->is_g4x) {
   40160          return 0;
   40161       } else {
   40162          return 0;
   40163       }
   40164    default:
   40165       unreachable("Invalid hardware generation");
   40166    }
   40167 }
   40168 
   40169 
   40170 
   40171 /* 3DSTATE_INDEX_BUFFER::Memory Object Control State */
   40172 
   40173 
   40174 #define GEN10_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_bits  7
   40175 #define GEN9_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_bits  7
   40176 #define GEN8_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_bits  7
   40177 #define GEN75_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_bits  4
   40178 #define GEN7_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_bits  4
   40179 #define GEN6_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_bits  4
   40180 
   40181 static inline uint32_t ATTRIBUTE_PURE
   40182 _3DSTATE_INDEX_BUFFER_MemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   40183 {
   40184    switch (devinfo->gen) {
   40185    case 10: return 7;
   40186    case 9: return 7;
   40187    case 8: return 7;
   40188    case 7:
   40189       if (devinfo->is_haswell) {
   40190          return 4;
   40191       } else {
   40192          return 4;
   40193       }
   40194    case 6: return 4;
   40195    case 5: return 0;
   40196    case 4:
   40197       if (devinfo->is_g4x) {
   40198          return 0;
   40199       } else {
   40200          return 0;
   40201       }
   40202    default:
   40203       unreachable("Invalid hardware generation");
   40204    }
   40205 }
   40206 
   40207 
   40208 
   40209 #define GEN10_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_start  32
   40210 #define GEN9_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_start  32
   40211 #define GEN8_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_start  32
   40212 #define GEN75_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_start  12
   40213 #define GEN7_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_start  12
   40214 #define GEN6_3DSTATE_INDEX_BUFFER_MemoryObjectControlState_start  12
   40215 
   40216 static inline uint32_t ATTRIBUTE_PURE
   40217 _3DSTATE_INDEX_BUFFER_MemoryObjectControlState_start(const struct gen_device_info *devinfo)
   40218 {
   40219    switch (devinfo->gen) {
   40220    case 10: return 32;
   40221    case 9: return 32;
   40222    case 8: return 32;
   40223    case 7:
   40224       if (devinfo->is_haswell) {
   40225          return 12;
   40226       } else {
   40227          return 12;
   40228       }
   40229    case 6: return 12;
   40230    case 5: return 0;
   40231    case 4:
   40232       if (devinfo->is_g4x) {
   40233          return 0;
   40234       } else {
   40235          return 0;
   40236       }
   40237    default:
   40238       unreachable("Invalid hardware generation");
   40239    }
   40240 }
   40241 
   40242 
   40243 
   40244 /* 3DSTATE_LINE_STIPPLE */
   40245 
   40246 
   40247 #define GEN10_3DSTATE_LINE_STIPPLE_length  3
   40248 #define GEN9_3DSTATE_LINE_STIPPLE_length  3
   40249 #define GEN8_3DSTATE_LINE_STIPPLE_length  3
   40250 #define GEN75_3DSTATE_LINE_STIPPLE_length  3
   40251 #define GEN7_3DSTATE_LINE_STIPPLE_length  3
   40252 #define GEN6_3DSTATE_LINE_STIPPLE_length  3
   40253 #define GEN5_3DSTATE_LINE_STIPPLE_length  3
   40254 #define GEN45_3DSTATE_LINE_STIPPLE_length  3
   40255 #define GEN4_3DSTATE_LINE_STIPPLE_length  3
   40256 
   40257 static inline uint32_t ATTRIBUTE_PURE
   40258 _3DSTATE_LINE_STIPPLE_length(const struct gen_device_info *devinfo)
   40259 {
   40260    switch (devinfo->gen) {
   40261    case 10: return 3;
   40262    case 9: return 3;
   40263    case 8: return 3;
   40264    case 7:
   40265       if (devinfo->is_haswell) {
   40266          return 3;
   40267       } else {
   40268          return 3;
   40269       }
   40270    case 6: return 3;
   40271    case 5: return 3;
   40272    case 4:
   40273       if (devinfo->is_g4x) {
   40274          return 3;
   40275       } else {
   40276          return 3;
   40277       }
   40278    default:
   40279       unreachable("Invalid hardware generation");
   40280    }
   40281 }
   40282 
   40283 
   40284 
   40285 /* 3DSTATE_LINE_STIPPLE::3D Command Opcode */
   40286 
   40287 
   40288 #define GEN10_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40289 #define GEN9_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40290 #define GEN8_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40291 #define GEN75_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40292 #define GEN7_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40293 #define GEN6_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40294 #define GEN5_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40295 #define GEN45_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40296 #define GEN4_3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits  3
   40297 
   40298 static inline uint32_t ATTRIBUTE_PURE
   40299 _3DSTATE_LINE_STIPPLE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   40300 {
   40301    switch (devinfo->gen) {
   40302    case 10: return 3;
   40303    case 9: return 3;
   40304    case 8: return 3;
   40305    case 7:
   40306       if (devinfo->is_haswell) {
   40307          return 3;
   40308       } else {
   40309          return 3;
   40310       }
   40311    case 6: return 3;
   40312    case 5: return 3;
   40313    case 4:
   40314       if (devinfo->is_g4x) {
   40315          return 3;
   40316       } else {
   40317          return 3;
   40318       }
   40319    default:
   40320       unreachable("Invalid hardware generation");
   40321    }
   40322 }
   40323 
   40324 
   40325 
   40326 #define GEN10_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40327 #define GEN9_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40328 #define GEN8_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40329 #define GEN75_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40330 #define GEN7_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40331 #define GEN6_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40332 #define GEN5_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40333 #define GEN45_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40334 #define GEN4_3DSTATE_LINE_STIPPLE_3DCommandOpcode_start  24
   40335 
   40336 static inline uint32_t ATTRIBUTE_PURE
   40337 _3DSTATE_LINE_STIPPLE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   40338 {
   40339    switch (devinfo->gen) {
   40340    case 10: return 24;
   40341    case 9: return 24;
   40342    case 8: return 24;
   40343    case 7:
   40344       if (devinfo->is_haswell) {
   40345          return 24;
   40346       } else {
   40347          return 24;
   40348       }
   40349    case 6: return 24;
   40350    case 5: return 24;
   40351    case 4:
   40352       if (devinfo->is_g4x) {
   40353          return 24;
   40354       } else {
   40355          return 24;
   40356       }
   40357    default:
   40358       unreachable("Invalid hardware generation");
   40359    }
   40360 }
   40361 
   40362 
   40363 
   40364 /* 3DSTATE_LINE_STIPPLE::3D Command Sub Opcode */
   40365 
   40366 
   40367 #define GEN10_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40368 #define GEN9_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40369 #define GEN8_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40370 #define GEN75_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40371 #define GEN7_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40372 #define GEN6_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40373 #define GEN5_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40374 #define GEN45_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40375 #define GEN4_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits  8
   40376 
   40377 static inline uint32_t ATTRIBUTE_PURE
   40378 _3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   40379 {
   40380    switch (devinfo->gen) {
   40381    case 10: return 8;
   40382    case 9: return 8;
   40383    case 8: return 8;
   40384    case 7:
   40385       if (devinfo->is_haswell) {
   40386          return 8;
   40387       } else {
   40388          return 8;
   40389       }
   40390    case 6: return 8;
   40391    case 5: return 8;
   40392    case 4:
   40393       if (devinfo->is_g4x) {
   40394          return 8;
   40395       } else {
   40396          return 8;
   40397       }
   40398    default:
   40399       unreachable("Invalid hardware generation");
   40400    }
   40401 }
   40402 
   40403 
   40404 
   40405 #define GEN10_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40406 #define GEN9_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40407 #define GEN8_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40408 #define GEN75_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40409 #define GEN7_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40410 #define GEN6_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40411 #define GEN5_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40412 #define GEN45_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40413 #define GEN4_3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start  16
   40414 
   40415 static inline uint32_t ATTRIBUTE_PURE
   40416 _3DSTATE_LINE_STIPPLE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   40417 {
   40418    switch (devinfo->gen) {
   40419    case 10: return 16;
   40420    case 9: return 16;
   40421    case 8: return 16;
   40422    case 7:
   40423       if (devinfo->is_haswell) {
   40424          return 16;
   40425       } else {
   40426          return 16;
   40427       }
   40428    case 6: return 16;
   40429    case 5: return 16;
   40430    case 4:
   40431       if (devinfo->is_g4x) {
   40432          return 16;
   40433       } else {
   40434          return 16;
   40435       }
   40436    default:
   40437       unreachable("Invalid hardware generation");
   40438    }
   40439 }
   40440 
   40441 
   40442 
   40443 /* 3DSTATE_LINE_STIPPLE::Command SubType */
   40444 
   40445 
   40446 #define GEN10_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40447 #define GEN9_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40448 #define GEN8_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40449 #define GEN75_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40450 #define GEN7_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40451 #define GEN6_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40452 #define GEN5_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40453 #define GEN45_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40454 #define GEN4_3DSTATE_LINE_STIPPLE_CommandSubType_bits  2
   40455 
   40456 static inline uint32_t ATTRIBUTE_PURE
   40457 _3DSTATE_LINE_STIPPLE_CommandSubType_bits(const struct gen_device_info *devinfo)
   40458 {
   40459    switch (devinfo->gen) {
   40460    case 10: return 2;
   40461    case 9: return 2;
   40462    case 8: return 2;
   40463    case 7:
   40464       if (devinfo->is_haswell) {
   40465          return 2;
   40466       } else {
   40467          return 2;
   40468       }
   40469    case 6: return 2;
   40470    case 5: return 2;
   40471    case 4:
   40472       if (devinfo->is_g4x) {
   40473          return 2;
   40474       } else {
   40475          return 2;
   40476       }
   40477    default:
   40478       unreachable("Invalid hardware generation");
   40479    }
   40480 }
   40481 
   40482 
   40483 
   40484 #define GEN10_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40485 #define GEN9_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40486 #define GEN8_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40487 #define GEN75_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40488 #define GEN7_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40489 #define GEN6_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40490 #define GEN5_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40491 #define GEN45_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40492 #define GEN4_3DSTATE_LINE_STIPPLE_CommandSubType_start  27
   40493 
   40494 static inline uint32_t ATTRIBUTE_PURE
   40495 _3DSTATE_LINE_STIPPLE_CommandSubType_start(const struct gen_device_info *devinfo)
   40496 {
   40497    switch (devinfo->gen) {
   40498    case 10: return 27;
   40499    case 9: return 27;
   40500    case 8: return 27;
   40501    case 7:
   40502       if (devinfo->is_haswell) {
   40503          return 27;
   40504       } else {
   40505          return 27;
   40506       }
   40507    case 6: return 27;
   40508    case 5: return 27;
   40509    case 4:
   40510       if (devinfo->is_g4x) {
   40511          return 27;
   40512       } else {
   40513          return 27;
   40514       }
   40515    default:
   40516       unreachable("Invalid hardware generation");
   40517    }
   40518 }
   40519 
   40520 
   40521 
   40522 /* 3DSTATE_LINE_STIPPLE::Command Type */
   40523 
   40524 
   40525 #define GEN10_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40526 #define GEN9_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40527 #define GEN8_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40528 #define GEN75_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40529 #define GEN7_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40530 #define GEN6_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40531 #define GEN5_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40532 #define GEN45_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40533 #define GEN4_3DSTATE_LINE_STIPPLE_CommandType_bits  3
   40534 
   40535 static inline uint32_t ATTRIBUTE_PURE
   40536 _3DSTATE_LINE_STIPPLE_CommandType_bits(const struct gen_device_info *devinfo)
   40537 {
   40538    switch (devinfo->gen) {
   40539    case 10: return 3;
   40540    case 9: return 3;
   40541    case 8: return 3;
   40542    case 7:
   40543       if (devinfo->is_haswell) {
   40544          return 3;
   40545       } else {
   40546          return 3;
   40547       }
   40548    case 6: return 3;
   40549    case 5: return 3;
   40550    case 4:
   40551       if (devinfo->is_g4x) {
   40552          return 3;
   40553       } else {
   40554          return 3;
   40555       }
   40556    default:
   40557       unreachable("Invalid hardware generation");
   40558    }
   40559 }
   40560 
   40561 
   40562 
   40563 #define GEN10_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40564 #define GEN9_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40565 #define GEN8_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40566 #define GEN75_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40567 #define GEN7_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40568 #define GEN6_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40569 #define GEN5_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40570 #define GEN45_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40571 #define GEN4_3DSTATE_LINE_STIPPLE_CommandType_start  29
   40572 
   40573 static inline uint32_t ATTRIBUTE_PURE
   40574 _3DSTATE_LINE_STIPPLE_CommandType_start(const struct gen_device_info *devinfo)
   40575 {
   40576    switch (devinfo->gen) {
   40577    case 10: return 29;
   40578    case 9: return 29;
   40579    case 8: return 29;
   40580    case 7:
   40581       if (devinfo->is_haswell) {
   40582          return 29;
   40583       } else {
   40584          return 29;
   40585       }
   40586    case 6: return 29;
   40587    case 5: return 29;
   40588    case 4:
   40589       if (devinfo->is_g4x) {
   40590          return 29;
   40591       } else {
   40592          return 29;
   40593       }
   40594    default:
   40595       unreachable("Invalid hardware generation");
   40596    }
   40597 }
   40598 
   40599 
   40600 
   40601 /* 3DSTATE_LINE_STIPPLE::Current Repeat Counter */
   40602 
   40603 
   40604 #define GEN10_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40605 #define GEN9_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40606 #define GEN8_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40607 #define GEN75_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40608 #define GEN7_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40609 #define GEN6_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40610 #define GEN5_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40611 #define GEN45_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40612 #define GEN4_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits  9
   40613 
   40614 static inline uint32_t ATTRIBUTE_PURE
   40615 _3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_bits(const struct gen_device_info *devinfo)
   40616 {
   40617    switch (devinfo->gen) {
   40618    case 10: return 9;
   40619    case 9: return 9;
   40620    case 8: return 9;
   40621    case 7:
   40622       if (devinfo->is_haswell) {
   40623          return 9;
   40624       } else {
   40625          return 9;
   40626       }
   40627    case 6: return 9;
   40628    case 5: return 9;
   40629    case 4:
   40630       if (devinfo->is_g4x) {
   40631          return 9;
   40632       } else {
   40633          return 9;
   40634       }
   40635    default:
   40636       unreachable("Invalid hardware generation");
   40637    }
   40638 }
   40639 
   40640 
   40641 
   40642 #define GEN10_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40643 #define GEN9_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40644 #define GEN8_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40645 #define GEN75_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40646 #define GEN7_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40647 #define GEN6_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40648 #define GEN5_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40649 #define GEN45_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40650 #define GEN4_3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start  53
   40651 
   40652 static inline uint32_t ATTRIBUTE_PURE
   40653 _3DSTATE_LINE_STIPPLE_CurrentRepeatCounter_start(const struct gen_device_info *devinfo)
   40654 {
   40655    switch (devinfo->gen) {
   40656    case 10: return 53;
   40657    case 9: return 53;
   40658    case 8: return 53;
   40659    case 7:
   40660       if (devinfo->is_haswell) {
   40661          return 53;
   40662       } else {
   40663          return 53;
   40664       }
   40665    case 6: return 53;
   40666    case 5: return 53;
   40667    case 4:
   40668       if (devinfo->is_g4x) {
   40669          return 53;
   40670       } else {
   40671          return 53;
   40672       }
   40673    default:
   40674       unreachable("Invalid hardware generation");
   40675    }
   40676 }
   40677 
   40678 
   40679 
   40680 /* 3DSTATE_LINE_STIPPLE::Current Stipple Index */
   40681 
   40682 
   40683 #define GEN10_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40684 #define GEN9_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40685 #define GEN8_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40686 #define GEN75_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40687 #define GEN7_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40688 #define GEN6_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40689 #define GEN5_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40690 #define GEN45_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40691 #define GEN4_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits  4
   40692 
   40693 static inline uint32_t ATTRIBUTE_PURE
   40694 _3DSTATE_LINE_STIPPLE_CurrentStippleIndex_bits(const struct gen_device_info *devinfo)
   40695 {
   40696    switch (devinfo->gen) {
   40697    case 10: return 4;
   40698    case 9: return 4;
   40699    case 8: return 4;
   40700    case 7:
   40701       if (devinfo->is_haswell) {
   40702          return 4;
   40703       } else {
   40704          return 4;
   40705       }
   40706    case 6: return 4;
   40707    case 5: return 4;
   40708    case 4:
   40709       if (devinfo->is_g4x) {
   40710          return 4;
   40711       } else {
   40712          return 4;
   40713       }
   40714    default:
   40715       unreachable("Invalid hardware generation");
   40716    }
   40717 }
   40718 
   40719 
   40720 
   40721 #define GEN10_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40722 #define GEN9_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40723 #define GEN8_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40724 #define GEN75_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40725 #define GEN7_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40726 #define GEN6_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40727 #define GEN5_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40728 #define GEN45_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40729 #define GEN4_3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start  48
   40730 
   40731 static inline uint32_t ATTRIBUTE_PURE
   40732 _3DSTATE_LINE_STIPPLE_CurrentStippleIndex_start(const struct gen_device_info *devinfo)
   40733 {
   40734    switch (devinfo->gen) {
   40735    case 10: return 48;
   40736    case 9: return 48;
   40737    case 8: return 48;
   40738    case 7:
   40739       if (devinfo->is_haswell) {
   40740          return 48;
   40741       } else {
   40742          return 48;
   40743       }
   40744    case 6: return 48;
   40745    case 5: return 48;
   40746    case 4:
   40747       if (devinfo->is_g4x) {
   40748          return 48;
   40749       } else {
   40750          return 48;
   40751       }
   40752    default:
   40753       unreachable("Invalid hardware generation");
   40754    }
   40755 }
   40756 
   40757 
   40758 
   40759 /* 3DSTATE_LINE_STIPPLE::DWord Length */
   40760 
   40761 
   40762 #define GEN10_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40763 #define GEN9_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40764 #define GEN8_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40765 #define GEN75_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40766 #define GEN7_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40767 #define GEN6_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40768 #define GEN5_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40769 #define GEN45_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40770 #define GEN4_3DSTATE_LINE_STIPPLE_DWordLength_bits  8
   40771 
   40772 static inline uint32_t ATTRIBUTE_PURE
   40773 _3DSTATE_LINE_STIPPLE_DWordLength_bits(const struct gen_device_info *devinfo)
   40774 {
   40775    switch (devinfo->gen) {
   40776    case 10: return 8;
   40777    case 9: return 8;
   40778    case 8: return 8;
   40779    case 7:
   40780       if (devinfo->is_haswell) {
   40781          return 8;
   40782       } else {
   40783          return 8;
   40784       }
   40785    case 6: return 8;
   40786    case 5: return 8;
   40787    case 4:
   40788       if (devinfo->is_g4x) {
   40789          return 8;
   40790       } else {
   40791          return 8;
   40792       }
   40793    default:
   40794       unreachable("Invalid hardware generation");
   40795    }
   40796 }
   40797 
   40798 
   40799 
   40800 #define GEN10_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40801 #define GEN9_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40802 #define GEN8_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40803 #define GEN75_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40804 #define GEN7_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40805 #define GEN6_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40806 #define GEN5_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40807 #define GEN45_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40808 #define GEN4_3DSTATE_LINE_STIPPLE_DWordLength_start  0
   40809 
   40810 static inline uint32_t ATTRIBUTE_PURE
   40811 _3DSTATE_LINE_STIPPLE_DWordLength_start(const struct gen_device_info *devinfo)
   40812 {
   40813    switch (devinfo->gen) {
   40814    case 10: return 0;
   40815    case 9: return 0;
   40816    case 8: return 0;
   40817    case 7:
   40818       if (devinfo->is_haswell) {
   40819          return 0;
   40820       } else {
   40821          return 0;
   40822       }
   40823    case 6: return 0;
   40824    case 5: return 0;
   40825    case 4:
   40826       if (devinfo->is_g4x) {
   40827          return 0;
   40828       } else {
   40829          return 0;
   40830       }
   40831    default:
   40832       unreachable("Invalid hardware generation");
   40833    }
   40834 }
   40835 
   40836 
   40837 
   40838 /* 3DSTATE_LINE_STIPPLE::Line Stipple Inverse Repeat Count */
   40839 
   40840 
   40841 #define GEN10_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  17
   40842 #define GEN9_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  17
   40843 #define GEN8_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  17
   40844 #define GEN75_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  17
   40845 #define GEN7_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  17
   40846 #define GEN6_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  16
   40847 #define GEN5_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  16
   40848 #define GEN45_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  16
   40849 #define GEN4_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits  16
   40850 
   40851 static inline uint32_t ATTRIBUTE_PURE
   40852 _3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_bits(const struct gen_device_info *devinfo)
   40853 {
   40854    switch (devinfo->gen) {
   40855    case 10: return 17;
   40856    case 9: return 17;
   40857    case 8: return 17;
   40858    case 7:
   40859       if (devinfo->is_haswell) {
   40860          return 17;
   40861       } else {
   40862          return 17;
   40863       }
   40864    case 6: return 16;
   40865    case 5: return 16;
   40866    case 4:
   40867       if (devinfo->is_g4x) {
   40868          return 16;
   40869       } else {
   40870          return 16;
   40871       }
   40872    default:
   40873       unreachable("Invalid hardware generation");
   40874    }
   40875 }
   40876 
   40877 
   40878 
   40879 #define GEN10_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  79
   40880 #define GEN9_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  79
   40881 #define GEN8_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  79
   40882 #define GEN75_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  79
   40883 #define GEN7_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  79
   40884 #define GEN6_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  80
   40885 #define GEN5_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  80
   40886 #define GEN45_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  80
   40887 #define GEN4_3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start  80
   40888 
   40889 static inline uint32_t ATTRIBUTE_PURE
   40890 _3DSTATE_LINE_STIPPLE_LineStippleInverseRepeatCount_start(const struct gen_device_info *devinfo)
   40891 {
   40892    switch (devinfo->gen) {
   40893    case 10: return 79;
   40894    case 9: return 79;
   40895    case 8: return 79;
   40896    case 7:
   40897       if (devinfo->is_haswell) {
   40898          return 79;
   40899       } else {
   40900          return 79;
   40901       }
   40902    case 6: return 80;
   40903    case 5: return 80;
   40904    case 4:
   40905       if (devinfo->is_g4x) {
   40906          return 80;
   40907       } else {
   40908          return 80;
   40909       }
   40910    default:
   40911       unreachable("Invalid hardware generation");
   40912    }
   40913 }
   40914 
   40915 
   40916 
   40917 /* 3DSTATE_LINE_STIPPLE::Line Stipple Pattern */
   40918 
   40919 
   40920 #define GEN10_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40921 #define GEN9_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40922 #define GEN8_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40923 #define GEN75_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40924 #define GEN7_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40925 #define GEN6_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40926 #define GEN5_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40927 #define GEN45_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40928 #define GEN4_3DSTATE_LINE_STIPPLE_LineStipplePattern_bits  16
   40929 
   40930 static inline uint32_t ATTRIBUTE_PURE
   40931 _3DSTATE_LINE_STIPPLE_LineStipplePattern_bits(const struct gen_device_info *devinfo)
   40932 {
   40933    switch (devinfo->gen) {
   40934    case 10: return 16;
   40935    case 9: return 16;
   40936    case 8: return 16;
   40937    case 7:
   40938       if (devinfo->is_haswell) {
   40939          return 16;
   40940       } else {
   40941          return 16;
   40942       }
   40943    case 6: return 16;
   40944    case 5: return 16;
   40945    case 4:
   40946       if (devinfo->is_g4x) {
   40947          return 16;
   40948       } else {
   40949          return 16;
   40950       }
   40951    default:
   40952       unreachable("Invalid hardware generation");
   40953    }
   40954 }
   40955 
   40956 
   40957 
   40958 #define GEN10_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40959 #define GEN9_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40960 #define GEN8_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40961 #define GEN75_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40962 #define GEN7_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40963 #define GEN6_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40964 #define GEN5_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40965 #define GEN45_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40966 #define GEN4_3DSTATE_LINE_STIPPLE_LineStipplePattern_start  32
   40967 
   40968 static inline uint32_t ATTRIBUTE_PURE
   40969 _3DSTATE_LINE_STIPPLE_LineStipplePattern_start(const struct gen_device_info *devinfo)
   40970 {
   40971    switch (devinfo->gen) {
   40972    case 10: return 32;
   40973    case 9: return 32;
   40974    case 8: return 32;
   40975    case 7:
   40976       if (devinfo->is_haswell) {
   40977          return 32;
   40978       } else {
   40979          return 32;
   40980       }
   40981    case 6: return 32;
   40982    case 5: return 32;
   40983    case 4:
   40984       if (devinfo->is_g4x) {
   40985          return 32;
   40986       } else {
   40987          return 32;
   40988       }
   40989    default:
   40990       unreachable("Invalid hardware generation");
   40991    }
   40992 }
   40993 
   40994 
   40995 
   40996 /* 3DSTATE_LINE_STIPPLE::Line Stipple Repeat Count */
   40997 
   40998 
   40999 #define GEN10_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41000 #define GEN9_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41001 #define GEN8_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41002 #define GEN75_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41003 #define GEN7_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41004 #define GEN6_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41005 #define GEN5_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41006 #define GEN45_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41007 #define GEN4_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits  9
   41008 
   41009 static inline uint32_t ATTRIBUTE_PURE
   41010 _3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_bits(const struct gen_device_info *devinfo)
   41011 {
   41012    switch (devinfo->gen) {
   41013    case 10: return 9;
   41014    case 9: return 9;
   41015    case 8: return 9;
   41016    case 7:
   41017       if (devinfo->is_haswell) {
   41018          return 9;
   41019       } else {
   41020          return 9;
   41021       }
   41022    case 6: return 9;
   41023    case 5: return 9;
   41024    case 4:
   41025       if (devinfo->is_g4x) {
   41026          return 9;
   41027       } else {
   41028          return 9;
   41029       }
   41030    default:
   41031       unreachable("Invalid hardware generation");
   41032    }
   41033 }
   41034 
   41035 
   41036 
   41037 #define GEN10_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41038 #define GEN9_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41039 #define GEN8_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41040 #define GEN75_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41041 #define GEN7_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41042 #define GEN6_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41043 #define GEN5_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41044 #define GEN45_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41045 #define GEN4_3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start  64
   41046 
   41047 static inline uint32_t ATTRIBUTE_PURE
   41048 _3DSTATE_LINE_STIPPLE_LineStippleRepeatCount_start(const struct gen_device_info *devinfo)
   41049 {
   41050    switch (devinfo->gen) {
   41051    case 10: return 64;
   41052    case 9: return 64;
   41053    case 8: return 64;
   41054    case 7:
   41055       if (devinfo->is_haswell) {
   41056          return 64;
   41057       } else {
   41058          return 64;
   41059       }
   41060    case 6: return 64;
   41061    case 5: return 64;
   41062    case 4:
   41063       if (devinfo->is_g4x) {
   41064          return 64;
   41065       } else {
   41066          return 64;
   41067       }
   41068    default:
   41069       unreachable("Invalid hardware generation");
   41070    }
   41071 }
   41072 
   41073 
   41074 
   41075 /* 3DSTATE_LINE_STIPPLE::Modify Enable */
   41076 
   41077 
   41078 #define GEN5_3DSTATE_LINE_STIPPLE_ModifyEnable_bits  1
   41079 #define GEN4_3DSTATE_LINE_STIPPLE_ModifyEnable_bits  1
   41080 
   41081 static inline uint32_t ATTRIBUTE_PURE
   41082 _3DSTATE_LINE_STIPPLE_ModifyEnable_bits(const struct gen_device_info *devinfo)
   41083 {
   41084    switch (devinfo->gen) {
   41085    case 10: return 0;
   41086    case 9: return 0;
   41087    case 8: return 0;
   41088    case 7:
   41089       if (devinfo->is_haswell) {
   41090          return 0;
   41091       } else {
   41092          return 0;
   41093       }
   41094    case 6: return 0;
   41095    case 5: return 1;
   41096    case 4:
   41097       if (devinfo->is_g4x) {
   41098          return 0;
   41099       } else {
   41100          return 1;
   41101       }
   41102    default:
   41103       unreachable("Invalid hardware generation");
   41104    }
   41105 }
   41106 
   41107 
   41108 
   41109 #define GEN5_3DSTATE_LINE_STIPPLE_ModifyEnable_start  63
   41110 #define GEN4_3DSTATE_LINE_STIPPLE_ModifyEnable_start  63
   41111 
   41112 static inline uint32_t ATTRIBUTE_PURE
   41113 _3DSTATE_LINE_STIPPLE_ModifyEnable_start(const struct gen_device_info *devinfo)
   41114 {
   41115    switch (devinfo->gen) {
   41116    case 10: return 0;
   41117    case 9: return 0;
   41118    case 8: return 0;
   41119    case 7:
   41120       if (devinfo->is_haswell) {
   41121          return 0;
   41122       } else {
   41123          return 0;
   41124       }
   41125    case 6: return 0;
   41126    case 5: return 63;
   41127    case 4:
   41128       if (devinfo->is_g4x) {
   41129          return 0;
   41130       } else {
   41131          return 63;
   41132       }
   41133    default:
   41134       unreachable("Invalid hardware generation");
   41135    }
   41136 }
   41137 
   41138 
   41139 
   41140 /* 3DSTATE_LINE_STIPPLE::Modify Enable (Current Repeat Counter, Current Stipple Index) */
   41141 
   41142 
   41143 #define GEN10_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits  1
   41144 #define GEN9_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits  1
   41145 #define GEN8_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits  1
   41146 #define GEN75_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits  1
   41147 #define GEN7_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits  1
   41148 #define GEN6_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits  1
   41149 #define GEN45_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits  1
   41150 
   41151 static inline uint32_t ATTRIBUTE_PURE
   41152 _3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_bits(const struct gen_device_info *devinfo)
   41153 {
   41154    switch (devinfo->gen) {
   41155    case 10: return 1;
   41156    case 9: return 1;
   41157    case 8: return 1;
   41158    case 7:
   41159       if (devinfo->is_haswell) {
   41160          return 1;
   41161       } else {
   41162          return 1;
   41163       }
   41164    case 6: return 1;
   41165    case 5: return 0;
   41166    case 4:
   41167       if (devinfo->is_g4x) {
   41168          return 1;
   41169       } else {
   41170          return 0;
   41171       }
   41172    default:
   41173       unreachable("Invalid hardware generation");
   41174    }
   41175 }
   41176 
   41177 
   41178 
   41179 #define GEN10_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start  63
   41180 #define GEN9_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start  63
   41181 #define GEN8_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start  63
   41182 #define GEN75_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start  63
   41183 #define GEN7_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start  63
   41184 #define GEN6_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start  63
   41185 #define GEN45_3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start  63
   41186 
   41187 static inline uint32_t ATTRIBUTE_PURE
   41188 _3DSTATE_LINE_STIPPLE_ModifyEnableCurrentRepeatCounterCurrentStippleIndex_start(const struct gen_device_info *devinfo)
   41189 {
   41190    switch (devinfo->gen) {
   41191    case 10: return 63;
   41192    case 9: return 63;
   41193    case 8: return 63;
   41194    case 7:
   41195       if (devinfo->is_haswell) {
   41196          return 63;
   41197       } else {
   41198          return 63;
   41199       }
   41200    case 6: return 63;
   41201    case 5: return 0;
   41202    case 4:
   41203       if (devinfo->is_g4x) {
   41204          return 63;
   41205       } else {
   41206          return 0;
   41207       }
   41208    default:
   41209       unreachable("Invalid hardware generation");
   41210    }
   41211 }
   41212 
   41213 
   41214 
   41215 /* 3DSTATE_MONOFILTER_SIZE */
   41216 
   41217 
   41218 #define GEN10_3DSTATE_MONOFILTER_SIZE_length  2
   41219 #define GEN9_3DSTATE_MONOFILTER_SIZE_length  2
   41220 #define GEN8_3DSTATE_MONOFILTER_SIZE_length  2
   41221 #define GEN75_3DSTATE_MONOFILTER_SIZE_length  2
   41222 #define GEN7_3DSTATE_MONOFILTER_SIZE_length  2
   41223 #define GEN6_3DSTATE_MONOFILTER_SIZE_length  2
   41224 
   41225 static inline uint32_t ATTRIBUTE_PURE
   41226 _3DSTATE_MONOFILTER_SIZE_length(const struct gen_device_info *devinfo)
   41227 {
   41228    switch (devinfo->gen) {
   41229    case 10: return 2;
   41230    case 9: return 2;
   41231    case 8: return 2;
   41232    case 7:
   41233       if (devinfo->is_haswell) {
   41234          return 2;
   41235       } else {
   41236          return 2;
   41237       }
   41238    case 6: return 2;
   41239    case 5: return 0;
   41240    case 4:
   41241       if (devinfo->is_g4x) {
   41242          return 0;
   41243       } else {
   41244          return 0;
   41245       }
   41246    default:
   41247       unreachable("Invalid hardware generation");
   41248    }
   41249 }
   41250 
   41251 
   41252 
   41253 /* 3DSTATE_MONOFILTER_SIZE::3D Command Opcode */
   41254 
   41255 
   41256 #define GEN10_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_bits  3
   41257 #define GEN9_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_bits  3
   41258 #define GEN8_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_bits  3
   41259 #define GEN75_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_bits  3
   41260 #define GEN7_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_bits  3
   41261 #define GEN6_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_bits  3
   41262 
   41263 static inline uint32_t ATTRIBUTE_PURE
   41264 _3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   41265 {
   41266    switch (devinfo->gen) {
   41267    case 10: return 3;
   41268    case 9: return 3;
   41269    case 8: return 3;
   41270    case 7:
   41271       if (devinfo->is_haswell) {
   41272          return 3;
   41273       } else {
   41274          return 3;
   41275       }
   41276    case 6: return 3;
   41277    case 5: return 0;
   41278    case 4:
   41279       if (devinfo->is_g4x) {
   41280          return 0;
   41281       } else {
   41282          return 0;
   41283       }
   41284    default:
   41285       unreachable("Invalid hardware generation");
   41286    }
   41287 }
   41288 
   41289 
   41290 
   41291 #define GEN10_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_start  24
   41292 #define GEN9_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_start  24
   41293 #define GEN8_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_start  24
   41294 #define GEN75_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_start  24
   41295 #define GEN7_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_start  24
   41296 #define GEN6_3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_start  24
   41297 
   41298 static inline uint32_t ATTRIBUTE_PURE
   41299 _3DSTATE_MONOFILTER_SIZE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   41300 {
   41301    switch (devinfo->gen) {
   41302    case 10: return 24;
   41303    case 9: return 24;
   41304    case 8: return 24;
   41305    case 7:
   41306       if (devinfo->is_haswell) {
   41307          return 24;
   41308       } else {
   41309          return 24;
   41310       }
   41311    case 6: return 24;
   41312    case 5: return 0;
   41313    case 4:
   41314       if (devinfo->is_g4x) {
   41315          return 0;
   41316       } else {
   41317          return 0;
   41318       }
   41319    default:
   41320       unreachable("Invalid hardware generation");
   41321    }
   41322 }
   41323 
   41324 
   41325 
   41326 /* 3DSTATE_MONOFILTER_SIZE::3D Command Sub Opcode */
   41327 
   41328 
   41329 #define GEN10_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_bits  8
   41330 #define GEN9_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_bits  8
   41331 #define GEN8_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_bits  8
   41332 #define GEN75_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_bits  8
   41333 #define GEN7_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_bits  8
   41334 #define GEN6_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_bits  8
   41335 
   41336 static inline uint32_t ATTRIBUTE_PURE
   41337 _3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   41338 {
   41339    switch (devinfo->gen) {
   41340    case 10: return 8;
   41341    case 9: return 8;
   41342    case 8: return 8;
   41343    case 7:
   41344       if (devinfo->is_haswell) {
   41345          return 8;
   41346       } else {
   41347          return 8;
   41348       }
   41349    case 6: return 8;
   41350    case 5: return 0;
   41351    case 4:
   41352       if (devinfo->is_g4x) {
   41353          return 0;
   41354       } else {
   41355          return 0;
   41356       }
   41357    default:
   41358       unreachable("Invalid hardware generation");
   41359    }
   41360 }
   41361 
   41362 
   41363 
   41364 #define GEN10_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_start  16
   41365 #define GEN9_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_start  16
   41366 #define GEN8_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_start  16
   41367 #define GEN75_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_start  16
   41368 #define GEN7_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_start  16
   41369 #define GEN6_3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_start  16
   41370 
   41371 static inline uint32_t ATTRIBUTE_PURE
   41372 _3DSTATE_MONOFILTER_SIZE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   41373 {
   41374    switch (devinfo->gen) {
   41375    case 10: return 16;
   41376    case 9: return 16;
   41377    case 8: return 16;
   41378    case 7:
   41379       if (devinfo->is_haswell) {
   41380          return 16;
   41381       } else {
   41382          return 16;
   41383       }
   41384    case 6: return 16;
   41385    case 5: return 0;
   41386    case 4:
   41387       if (devinfo->is_g4x) {
   41388          return 0;
   41389       } else {
   41390          return 0;
   41391       }
   41392    default:
   41393       unreachable("Invalid hardware generation");
   41394    }
   41395 }
   41396 
   41397 
   41398 
   41399 /* 3DSTATE_MONOFILTER_SIZE::Command SubType */
   41400 
   41401 
   41402 #define GEN10_3DSTATE_MONOFILTER_SIZE_CommandSubType_bits  2
   41403 #define GEN9_3DSTATE_MONOFILTER_SIZE_CommandSubType_bits  2
   41404 #define GEN8_3DSTATE_MONOFILTER_SIZE_CommandSubType_bits  2
   41405 #define GEN75_3DSTATE_MONOFILTER_SIZE_CommandSubType_bits  2
   41406 #define GEN7_3DSTATE_MONOFILTER_SIZE_CommandSubType_bits  2
   41407 #define GEN6_3DSTATE_MONOFILTER_SIZE_CommandSubType_bits  2
   41408 
   41409 static inline uint32_t ATTRIBUTE_PURE
   41410 _3DSTATE_MONOFILTER_SIZE_CommandSubType_bits(const struct gen_device_info *devinfo)
   41411 {
   41412    switch (devinfo->gen) {
   41413    case 10: return 2;
   41414    case 9: return 2;
   41415    case 8: return 2;
   41416    case 7:
   41417       if (devinfo->is_haswell) {
   41418          return 2;
   41419       } else {
   41420          return 2;
   41421       }
   41422    case 6: return 2;
   41423    case 5: return 0;
   41424    case 4:
   41425       if (devinfo->is_g4x) {
   41426          return 0;
   41427       } else {
   41428          return 0;
   41429       }
   41430    default:
   41431       unreachable("Invalid hardware generation");
   41432    }
   41433 }
   41434 
   41435 
   41436 
   41437 #define GEN10_3DSTATE_MONOFILTER_SIZE_CommandSubType_start  27
   41438 #define GEN9_3DSTATE_MONOFILTER_SIZE_CommandSubType_start  27
   41439 #define GEN8_3DSTATE_MONOFILTER_SIZE_CommandSubType_start  27
   41440 #define GEN75_3DSTATE_MONOFILTER_SIZE_CommandSubType_start  27
   41441 #define GEN7_3DSTATE_MONOFILTER_SIZE_CommandSubType_start  27
   41442 #define GEN6_3DSTATE_MONOFILTER_SIZE_CommandSubType_start  27
   41443 
   41444 static inline uint32_t ATTRIBUTE_PURE
   41445 _3DSTATE_MONOFILTER_SIZE_CommandSubType_start(const struct gen_device_info *devinfo)
   41446 {
   41447    switch (devinfo->gen) {
   41448    case 10: return 27;
   41449    case 9: return 27;
   41450    case 8: return 27;
   41451    case 7:
   41452       if (devinfo->is_haswell) {
   41453          return 27;
   41454       } else {
   41455          return 27;
   41456       }
   41457    case 6: return 27;
   41458    case 5: return 0;
   41459    case 4:
   41460       if (devinfo->is_g4x) {
   41461          return 0;
   41462       } else {
   41463          return 0;
   41464       }
   41465    default:
   41466       unreachable("Invalid hardware generation");
   41467    }
   41468 }
   41469 
   41470 
   41471 
   41472 /* 3DSTATE_MONOFILTER_SIZE::Command Type */
   41473 
   41474 
   41475 #define GEN10_3DSTATE_MONOFILTER_SIZE_CommandType_bits  3
   41476 #define GEN9_3DSTATE_MONOFILTER_SIZE_CommandType_bits  3
   41477 #define GEN8_3DSTATE_MONOFILTER_SIZE_CommandType_bits  3
   41478 #define GEN75_3DSTATE_MONOFILTER_SIZE_CommandType_bits  3
   41479 #define GEN7_3DSTATE_MONOFILTER_SIZE_CommandType_bits  3
   41480 #define GEN6_3DSTATE_MONOFILTER_SIZE_CommandType_bits  3
   41481 
   41482 static inline uint32_t ATTRIBUTE_PURE
   41483 _3DSTATE_MONOFILTER_SIZE_CommandType_bits(const struct gen_device_info *devinfo)
   41484 {
   41485    switch (devinfo->gen) {
   41486    case 10: return 3;
   41487    case 9: return 3;
   41488    case 8: return 3;
   41489    case 7:
   41490       if (devinfo->is_haswell) {
   41491          return 3;
   41492       } else {
   41493          return 3;
   41494       }
   41495    case 6: return 3;
   41496    case 5: return 0;
   41497    case 4:
   41498       if (devinfo->is_g4x) {
   41499          return 0;
   41500       } else {
   41501          return 0;
   41502       }
   41503    default:
   41504       unreachable("Invalid hardware generation");
   41505    }
   41506 }
   41507 
   41508 
   41509 
   41510 #define GEN10_3DSTATE_MONOFILTER_SIZE_CommandType_start  29
   41511 #define GEN9_3DSTATE_MONOFILTER_SIZE_CommandType_start  29
   41512 #define GEN8_3DSTATE_MONOFILTER_SIZE_CommandType_start  29
   41513 #define GEN75_3DSTATE_MONOFILTER_SIZE_CommandType_start  29
   41514 #define GEN7_3DSTATE_MONOFILTER_SIZE_CommandType_start  29
   41515 #define GEN6_3DSTATE_MONOFILTER_SIZE_CommandType_start  29
   41516 
   41517 static inline uint32_t ATTRIBUTE_PURE
   41518 _3DSTATE_MONOFILTER_SIZE_CommandType_start(const struct gen_device_info *devinfo)
   41519 {
   41520    switch (devinfo->gen) {
   41521    case 10: return 29;
   41522    case 9: return 29;
   41523    case 8: return 29;
   41524    case 7:
   41525       if (devinfo->is_haswell) {
   41526          return 29;
   41527       } else {
   41528          return 29;
   41529       }
   41530    case 6: return 29;
   41531    case 5: return 0;
   41532    case 4:
   41533       if (devinfo->is_g4x) {
   41534          return 0;
   41535       } else {
   41536          return 0;
   41537       }
   41538    default:
   41539       unreachable("Invalid hardware generation");
   41540    }
   41541 }
   41542 
   41543 
   41544 
   41545 /* 3DSTATE_MONOFILTER_SIZE::DWord Length */
   41546 
   41547 
   41548 #define GEN10_3DSTATE_MONOFILTER_SIZE_DWordLength_bits  8
   41549 #define GEN9_3DSTATE_MONOFILTER_SIZE_DWordLength_bits  8
   41550 #define GEN8_3DSTATE_MONOFILTER_SIZE_DWordLength_bits  8
   41551 #define GEN75_3DSTATE_MONOFILTER_SIZE_DWordLength_bits  8
   41552 #define GEN7_3DSTATE_MONOFILTER_SIZE_DWordLength_bits  8
   41553 #define GEN6_3DSTATE_MONOFILTER_SIZE_DWordLength_bits  8
   41554 
   41555 static inline uint32_t ATTRIBUTE_PURE
   41556 _3DSTATE_MONOFILTER_SIZE_DWordLength_bits(const struct gen_device_info *devinfo)
   41557 {
   41558    switch (devinfo->gen) {
   41559    case 10: return 8;
   41560    case 9: return 8;
   41561    case 8: return 8;
   41562    case 7:
   41563       if (devinfo->is_haswell) {
   41564          return 8;
   41565       } else {
   41566          return 8;
   41567       }
   41568    case 6: return 8;
   41569    case 5: return 0;
   41570    case 4:
   41571       if (devinfo->is_g4x) {
   41572          return 0;
   41573       } else {
   41574          return 0;
   41575       }
   41576    default:
   41577       unreachable("Invalid hardware generation");
   41578    }
   41579 }
   41580 
   41581 
   41582 
   41583 #define GEN10_3DSTATE_MONOFILTER_SIZE_DWordLength_start  0
   41584 #define GEN9_3DSTATE_MONOFILTER_SIZE_DWordLength_start  0
   41585 #define GEN8_3DSTATE_MONOFILTER_SIZE_DWordLength_start  0
   41586 #define GEN75_3DSTATE_MONOFILTER_SIZE_DWordLength_start  0
   41587 #define GEN7_3DSTATE_MONOFILTER_SIZE_DWordLength_start  0
   41588 #define GEN6_3DSTATE_MONOFILTER_SIZE_DWordLength_start  0
   41589 
   41590 static inline uint32_t ATTRIBUTE_PURE
   41591 _3DSTATE_MONOFILTER_SIZE_DWordLength_start(const struct gen_device_info *devinfo)
   41592 {
   41593    switch (devinfo->gen) {
   41594    case 10: return 0;
   41595    case 9: return 0;
   41596    case 8: return 0;
   41597    case 7:
   41598       if (devinfo->is_haswell) {
   41599          return 0;
   41600       } else {
   41601          return 0;
   41602       }
   41603    case 6: return 0;
   41604    case 5: return 0;
   41605    case 4:
   41606       if (devinfo->is_g4x) {
   41607          return 0;
   41608       } else {
   41609          return 0;
   41610       }
   41611    default:
   41612       unreachable("Invalid hardware generation");
   41613    }
   41614 }
   41615 
   41616 
   41617 
   41618 /* 3DSTATE_MONOFILTER_SIZE::Monochrome Filter Height */
   41619 
   41620 
   41621 #define GEN10_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_bits  3
   41622 #define GEN9_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_bits  3
   41623 #define GEN8_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_bits  3
   41624 #define GEN75_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_bits  3
   41625 #define GEN7_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_bits  3
   41626 #define GEN6_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_bits  3
   41627 
   41628 static inline uint32_t ATTRIBUTE_PURE
   41629 _3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_bits(const struct gen_device_info *devinfo)
   41630 {
   41631    switch (devinfo->gen) {
   41632    case 10: return 3;
   41633    case 9: return 3;
   41634    case 8: return 3;
   41635    case 7:
   41636       if (devinfo->is_haswell) {
   41637          return 3;
   41638       } else {
   41639          return 3;
   41640       }
   41641    case 6: return 3;
   41642    case 5: return 0;
   41643    case 4:
   41644       if (devinfo->is_g4x) {
   41645          return 0;
   41646       } else {
   41647          return 0;
   41648       }
   41649    default:
   41650       unreachable("Invalid hardware generation");
   41651    }
   41652 }
   41653 
   41654 
   41655 
   41656 #define GEN10_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_start  32
   41657 #define GEN9_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_start  32
   41658 #define GEN8_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_start  32
   41659 #define GEN75_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_start  32
   41660 #define GEN7_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_start  32
   41661 #define GEN6_3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_start  32
   41662 
   41663 static inline uint32_t ATTRIBUTE_PURE
   41664 _3DSTATE_MONOFILTER_SIZE_MonochromeFilterHeight_start(const struct gen_device_info *devinfo)
   41665 {
   41666    switch (devinfo->gen) {
   41667    case 10: return 32;
   41668    case 9: return 32;
   41669    case 8: return 32;
   41670    case 7:
   41671       if (devinfo->is_haswell) {
   41672          return 32;
   41673       } else {
   41674          return 32;
   41675       }
   41676    case 6: return 32;
   41677    case 5: return 0;
   41678    case 4:
   41679       if (devinfo->is_g4x) {
   41680          return 0;
   41681       } else {
   41682          return 0;
   41683       }
   41684    default:
   41685       unreachable("Invalid hardware generation");
   41686    }
   41687 }
   41688 
   41689 
   41690 
   41691 /* 3DSTATE_MONOFILTER_SIZE::Monochrome Filter Width */
   41692 
   41693 
   41694 #define GEN10_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_bits  3
   41695 #define GEN9_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_bits  3
   41696 #define GEN8_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_bits  3
   41697 #define GEN75_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_bits  3
   41698 #define GEN7_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_bits  3
   41699 #define GEN6_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_bits  3
   41700 
   41701 static inline uint32_t ATTRIBUTE_PURE
   41702 _3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_bits(const struct gen_device_info *devinfo)
   41703 {
   41704    switch (devinfo->gen) {
   41705    case 10: return 3;
   41706    case 9: return 3;
   41707    case 8: return 3;
   41708    case 7:
   41709       if (devinfo->is_haswell) {
   41710          return 3;
   41711       } else {
   41712          return 3;
   41713       }
   41714    case 6: return 3;
   41715    case 5: return 0;
   41716    case 4:
   41717       if (devinfo->is_g4x) {
   41718          return 0;
   41719       } else {
   41720          return 0;
   41721       }
   41722    default:
   41723       unreachable("Invalid hardware generation");
   41724    }
   41725 }
   41726 
   41727 
   41728 
   41729 #define GEN10_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_start  35
   41730 #define GEN9_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_start  35
   41731 #define GEN8_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_start  35
   41732 #define GEN75_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_start  35
   41733 #define GEN7_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_start  35
   41734 #define GEN6_3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_start  35
   41735 
   41736 static inline uint32_t ATTRIBUTE_PURE
   41737 _3DSTATE_MONOFILTER_SIZE_MonochromeFilterWidth_start(const struct gen_device_info *devinfo)
   41738 {
   41739    switch (devinfo->gen) {
   41740    case 10: return 35;
   41741    case 9: return 35;
   41742    case 8: return 35;
   41743    case 7:
   41744       if (devinfo->is_haswell) {
   41745          return 35;
   41746       } else {
   41747          return 35;
   41748       }
   41749    case 6: return 35;
   41750    case 5: return 0;
   41751    case 4:
   41752       if (devinfo->is_g4x) {
   41753          return 0;
   41754       } else {
   41755          return 0;
   41756       }
   41757    default:
   41758       unreachable("Invalid hardware generation");
   41759    }
   41760 }
   41761 
   41762 
   41763 
   41764 /* 3DSTATE_MULTISAMPLE */
   41765 
   41766 
   41767 #define GEN10_3DSTATE_MULTISAMPLE_length  2
   41768 #define GEN9_3DSTATE_MULTISAMPLE_length  2
   41769 #define GEN8_3DSTATE_MULTISAMPLE_length  2
   41770 #define GEN75_3DSTATE_MULTISAMPLE_length  4
   41771 #define GEN7_3DSTATE_MULTISAMPLE_length  4
   41772 #define GEN6_3DSTATE_MULTISAMPLE_length  3
   41773 
   41774 static inline uint32_t ATTRIBUTE_PURE
   41775 _3DSTATE_MULTISAMPLE_length(const struct gen_device_info *devinfo)
   41776 {
   41777    switch (devinfo->gen) {
   41778    case 10: return 2;
   41779    case 9: return 2;
   41780    case 8: return 2;
   41781    case 7:
   41782       if (devinfo->is_haswell) {
   41783          return 4;
   41784       } else {
   41785          return 4;
   41786       }
   41787    case 6: return 3;
   41788    case 5: return 0;
   41789    case 4:
   41790       if (devinfo->is_g4x) {
   41791          return 0;
   41792       } else {
   41793          return 0;
   41794       }
   41795    default:
   41796       unreachable("Invalid hardware generation");
   41797    }
   41798 }
   41799 
   41800 
   41801 
   41802 /* 3DSTATE_MULTISAMPLE::3D Command Opcode */
   41803 
   41804 
   41805 #define GEN10_3DSTATE_MULTISAMPLE_3DCommandOpcode_bits  3
   41806 #define GEN9_3DSTATE_MULTISAMPLE_3DCommandOpcode_bits  3
   41807 #define GEN8_3DSTATE_MULTISAMPLE_3DCommandOpcode_bits  3
   41808 #define GEN75_3DSTATE_MULTISAMPLE_3DCommandOpcode_bits  3
   41809 #define GEN7_3DSTATE_MULTISAMPLE_3DCommandOpcode_bits  3
   41810 #define GEN6_3DSTATE_MULTISAMPLE_3DCommandOpcode_bits  3
   41811 
   41812 static inline uint32_t ATTRIBUTE_PURE
   41813 _3DSTATE_MULTISAMPLE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   41814 {
   41815    switch (devinfo->gen) {
   41816    case 10: return 3;
   41817    case 9: return 3;
   41818    case 8: return 3;
   41819    case 7:
   41820       if (devinfo->is_haswell) {
   41821          return 3;
   41822       } else {
   41823          return 3;
   41824       }
   41825    case 6: return 3;
   41826    case 5: return 0;
   41827    case 4:
   41828       if (devinfo->is_g4x) {
   41829          return 0;
   41830       } else {
   41831          return 0;
   41832       }
   41833    default:
   41834       unreachable("Invalid hardware generation");
   41835    }
   41836 }
   41837 
   41838 
   41839 
   41840 #define GEN10_3DSTATE_MULTISAMPLE_3DCommandOpcode_start  24
   41841 #define GEN9_3DSTATE_MULTISAMPLE_3DCommandOpcode_start  24
   41842 #define GEN8_3DSTATE_MULTISAMPLE_3DCommandOpcode_start  24
   41843 #define GEN75_3DSTATE_MULTISAMPLE_3DCommandOpcode_start  24
   41844 #define GEN7_3DSTATE_MULTISAMPLE_3DCommandOpcode_start  24
   41845 #define GEN6_3DSTATE_MULTISAMPLE_3DCommandOpcode_start  24
   41846 
   41847 static inline uint32_t ATTRIBUTE_PURE
   41848 _3DSTATE_MULTISAMPLE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   41849 {
   41850    switch (devinfo->gen) {
   41851    case 10: return 24;
   41852    case 9: return 24;
   41853    case 8: return 24;
   41854    case 7:
   41855       if (devinfo->is_haswell) {
   41856          return 24;
   41857       } else {
   41858          return 24;
   41859       }
   41860    case 6: return 24;
   41861    case 5: return 0;
   41862    case 4:
   41863       if (devinfo->is_g4x) {
   41864          return 0;
   41865       } else {
   41866          return 0;
   41867       }
   41868    default:
   41869       unreachable("Invalid hardware generation");
   41870    }
   41871 }
   41872 
   41873 
   41874 
   41875 /* 3DSTATE_MULTISAMPLE::3D Command Sub Opcode */
   41876 
   41877 
   41878 #define GEN10_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_bits  8
   41879 #define GEN9_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_bits  8
   41880 #define GEN8_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_bits  8
   41881 #define GEN75_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_bits  8
   41882 #define GEN7_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_bits  8
   41883 #define GEN6_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_bits  8
   41884 
   41885 static inline uint32_t ATTRIBUTE_PURE
   41886 _3DSTATE_MULTISAMPLE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   41887 {
   41888    switch (devinfo->gen) {
   41889    case 10: return 8;
   41890    case 9: return 8;
   41891    case 8: return 8;
   41892    case 7:
   41893       if (devinfo->is_haswell) {
   41894          return 8;
   41895       } else {
   41896          return 8;
   41897       }
   41898    case 6: return 8;
   41899    case 5: return 0;
   41900    case 4:
   41901       if (devinfo->is_g4x) {
   41902          return 0;
   41903       } else {
   41904          return 0;
   41905       }
   41906    default:
   41907       unreachable("Invalid hardware generation");
   41908    }
   41909 }
   41910 
   41911 
   41912 
   41913 #define GEN10_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_start  16
   41914 #define GEN9_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_start  16
   41915 #define GEN8_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_start  16
   41916 #define GEN75_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_start  16
   41917 #define GEN7_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_start  16
   41918 #define GEN6_3DSTATE_MULTISAMPLE_3DCommandSubOpcode_start  16
   41919 
   41920 static inline uint32_t ATTRIBUTE_PURE
   41921 _3DSTATE_MULTISAMPLE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   41922 {
   41923    switch (devinfo->gen) {
   41924    case 10: return 16;
   41925    case 9: return 16;
   41926    case 8: return 16;
   41927    case 7:
   41928       if (devinfo->is_haswell) {
   41929          return 16;
   41930       } else {
   41931          return 16;
   41932       }
   41933    case 6: return 16;
   41934    case 5: return 0;
   41935    case 4:
   41936       if (devinfo->is_g4x) {
   41937          return 0;
   41938       } else {
   41939          return 0;
   41940       }
   41941    default:
   41942       unreachable("Invalid hardware generation");
   41943    }
   41944 }
   41945 
   41946 
   41947 
   41948 /* 3DSTATE_MULTISAMPLE::Command SubType */
   41949 
   41950 
   41951 #define GEN10_3DSTATE_MULTISAMPLE_CommandSubType_bits  2
   41952 #define GEN9_3DSTATE_MULTISAMPLE_CommandSubType_bits  2
   41953 #define GEN8_3DSTATE_MULTISAMPLE_CommandSubType_bits  2
   41954 #define GEN75_3DSTATE_MULTISAMPLE_CommandSubType_bits  2
   41955 #define GEN7_3DSTATE_MULTISAMPLE_CommandSubType_bits  2
   41956 #define GEN6_3DSTATE_MULTISAMPLE_CommandSubType_bits  2
   41957 
   41958 static inline uint32_t ATTRIBUTE_PURE
   41959 _3DSTATE_MULTISAMPLE_CommandSubType_bits(const struct gen_device_info *devinfo)
   41960 {
   41961    switch (devinfo->gen) {
   41962    case 10: return 2;
   41963    case 9: return 2;
   41964    case 8: return 2;
   41965    case 7:
   41966       if (devinfo->is_haswell) {
   41967          return 2;
   41968       } else {
   41969          return 2;
   41970       }
   41971    case 6: return 2;
   41972    case 5: return 0;
   41973    case 4:
   41974       if (devinfo->is_g4x) {
   41975          return 0;
   41976       } else {
   41977          return 0;
   41978       }
   41979    default:
   41980       unreachable("Invalid hardware generation");
   41981    }
   41982 }
   41983 
   41984 
   41985 
   41986 #define GEN10_3DSTATE_MULTISAMPLE_CommandSubType_start  27
   41987 #define GEN9_3DSTATE_MULTISAMPLE_CommandSubType_start  27
   41988 #define GEN8_3DSTATE_MULTISAMPLE_CommandSubType_start  27
   41989 #define GEN75_3DSTATE_MULTISAMPLE_CommandSubType_start  27
   41990 #define GEN7_3DSTATE_MULTISAMPLE_CommandSubType_start  27
   41991 #define GEN6_3DSTATE_MULTISAMPLE_CommandSubType_start  27
   41992 
   41993 static inline uint32_t ATTRIBUTE_PURE
   41994 _3DSTATE_MULTISAMPLE_CommandSubType_start(const struct gen_device_info *devinfo)
   41995 {
   41996    switch (devinfo->gen) {
   41997    case 10: return 27;
   41998    case 9: return 27;
   41999    case 8: return 27;
   42000    case 7:
   42001       if (devinfo->is_haswell) {
   42002          return 27;
   42003       } else {
   42004          return 27;
   42005       }
   42006    case 6: return 27;
   42007    case 5: return 0;
   42008    case 4:
   42009       if (devinfo->is_g4x) {
   42010          return 0;
   42011       } else {
   42012          return 0;
   42013       }
   42014    default:
   42015       unreachable("Invalid hardware generation");
   42016    }
   42017 }
   42018 
   42019 
   42020 
   42021 /* 3DSTATE_MULTISAMPLE::Command Type */
   42022 
   42023 
   42024 #define GEN10_3DSTATE_MULTISAMPLE_CommandType_bits  3
   42025 #define GEN9_3DSTATE_MULTISAMPLE_CommandType_bits  3
   42026 #define GEN8_3DSTATE_MULTISAMPLE_CommandType_bits  3
   42027 #define GEN75_3DSTATE_MULTISAMPLE_CommandType_bits  3
   42028 #define GEN7_3DSTATE_MULTISAMPLE_CommandType_bits  3
   42029 #define GEN6_3DSTATE_MULTISAMPLE_CommandType_bits  3
   42030 
   42031 static inline uint32_t ATTRIBUTE_PURE
   42032 _3DSTATE_MULTISAMPLE_CommandType_bits(const struct gen_device_info *devinfo)
   42033 {
   42034    switch (devinfo->gen) {
   42035    case 10: return 3;
   42036    case 9: return 3;
   42037    case 8: return 3;
   42038    case 7:
   42039       if (devinfo->is_haswell) {
   42040          return 3;
   42041       } else {
   42042          return 3;
   42043       }
   42044    case 6: return 3;
   42045    case 5: return 0;
   42046    case 4:
   42047       if (devinfo->is_g4x) {
   42048          return 0;
   42049       } else {
   42050          return 0;
   42051       }
   42052    default:
   42053       unreachable("Invalid hardware generation");
   42054    }
   42055 }
   42056 
   42057 
   42058 
   42059 #define GEN10_3DSTATE_MULTISAMPLE_CommandType_start  29
   42060 #define GEN9_3DSTATE_MULTISAMPLE_CommandType_start  29
   42061 #define GEN8_3DSTATE_MULTISAMPLE_CommandType_start  29
   42062 #define GEN75_3DSTATE_MULTISAMPLE_CommandType_start  29
   42063 #define GEN7_3DSTATE_MULTISAMPLE_CommandType_start  29
   42064 #define GEN6_3DSTATE_MULTISAMPLE_CommandType_start  29
   42065 
   42066 static inline uint32_t ATTRIBUTE_PURE
   42067 _3DSTATE_MULTISAMPLE_CommandType_start(const struct gen_device_info *devinfo)
   42068 {
   42069    switch (devinfo->gen) {
   42070    case 10: return 29;
   42071    case 9: return 29;
   42072    case 8: return 29;
   42073    case 7:
   42074       if (devinfo->is_haswell) {
   42075          return 29;
   42076       } else {
   42077          return 29;
   42078       }
   42079    case 6: return 29;
   42080    case 5: return 0;
   42081    case 4:
   42082       if (devinfo->is_g4x) {
   42083          return 0;
   42084       } else {
   42085          return 0;
   42086       }
   42087    default:
   42088       unreachable("Invalid hardware generation");
   42089    }
   42090 }
   42091 
   42092 
   42093 
   42094 /* 3DSTATE_MULTISAMPLE::DWord Length */
   42095 
   42096 
   42097 #define GEN10_3DSTATE_MULTISAMPLE_DWordLength_bits  8
   42098 #define GEN9_3DSTATE_MULTISAMPLE_DWordLength_bits  8
   42099 #define GEN8_3DSTATE_MULTISAMPLE_DWordLength_bits  8
   42100 #define GEN75_3DSTATE_MULTISAMPLE_DWordLength_bits  8
   42101 #define GEN7_3DSTATE_MULTISAMPLE_DWordLength_bits  8
   42102 #define GEN6_3DSTATE_MULTISAMPLE_DWordLength_bits  8
   42103 
   42104 static inline uint32_t ATTRIBUTE_PURE
   42105 _3DSTATE_MULTISAMPLE_DWordLength_bits(const struct gen_device_info *devinfo)
   42106 {
   42107    switch (devinfo->gen) {
   42108    case 10: return 8;
   42109    case 9: return 8;
   42110    case 8: return 8;
   42111    case 7:
   42112       if (devinfo->is_haswell) {
   42113          return 8;
   42114       } else {
   42115          return 8;
   42116       }
   42117    case 6: return 8;
   42118    case 5: return 0;
   42119    case 4:
   42120       if (devinfo->is_g4x) {
   42121          return 0;
   42122       } else {
   42123          return 0;
   42124       }
   42125    default:
   42126       unreachable("Invalid hardware generation");
   42127    }
   42128 }
   42129 
   42130 
   42131 
   42132 #define GEN10_3DSTATE_MULTISAMPLE_DWordLength_start  0
   42133 #define GEN9_3DSTATE_MULTISAMPLE_DWordLength_start  0
   42134 #define GEN8_3DSTATE_MULTISAMPLE_DWordLength_start  0
   42135 #define GEN75_3DSTATE_MULTISAMPLE_DWordLength_start  0
   42136 #define GEN7_3DSTATE_MULTISAMPLE_DWordLength_start  0
   42137 #define GEN6_3DSTATE_MULTISAMPLE_DWordLength_start  0
   42138 
   42139 static inline uint32_t ATTRIBUTE_PURE
   42140 _3DSTATE_MULTISAMPLE_DWordLength_start(const struct gen_device_info *devinfo)
   42141 {
   42142    switch (devinfo->gen) {
   42143    case 10: return 0;
   42144    case 9: return 0;
   42145    case 8: return 0;
   42146    case 7:
   42147       if (devinfo->is_haswell) {
   42148          return 0;
   42149       } else {
   42150          return 0;
   42151       }
   42152    case 6: return 0;
   42153    case 5: return 0;
   42154    case 4:
   42155       if (devinfo->is_g4x) {
   42156          return 0;
   42157       } else {
   42158          return 0;
   42159       }
   42160    default:
   42161       unreachable("Invalid hardware generation");
   42162    }
   42163 }
   42164 
   42165 
   42166 
   42167 /* 3DSTATE_MULTISAMPLE::Multi Sample Enable */
   42168 
   42169 
   42170 #define GEN75_3DSTATE_MULTISAMPLE_MultiSampleEnable_bits  1
   42171 
   42172 static inline uint32_t ATTRIBUTE_PURE
   42173 _3DSTATE_MULTISAMPLE_MultiSampleEnable_bits(const struct gen_device_info *devinfo)
   42174 {
   42175    switch (devinfo->gen) {
   42176    case 10: return 0;
   42177    case 9: return 0;
   42178    case 8: return 0;
   42179    case 7:
   42180       if (devinfo->is_haswell) {
   42181          return 1;
   42182       } else {
   42183          return 0;
   42184       }
   42185    case 6: return 0;
   42186    case 5: return 0;
   42187    case 4:
   42188       if (devinfo->is_g4x) {
   42189          return 0;
   42190       } else {
   42191          return 0;
   42192       }
   42193    default:
   42194       unreachable("Invalid hardware generation");
   42195    }
   42196 }
   42197 
   42198 
   42199 
   42200 #define GEN75_3DSTATE_MULTISAMPLE_MultiSampleEnable_start  37
   42201 
   42202 static inline uint32_t ATTRIBUTE_PURE
   42203 _3DSTATE_MULTISAMPLE_MultiSampleEnable_start(const struct gen_device_info *devinfo)
   42204 {
   42205    switch (devinfo->gen) {
   42206    case 10: return 0;
   42207    case 9: return 0;
   42208    case 8: return 0;
   42209    case 7:
   42210       if (devinfo->is_haswell) {
   42211          return 37;
   42212       } else {
   42213          return 0;
   42214       }
   42215    case 6: return 0;
   42216    case 5: return 0;
   42217    case 4:
   42218       if (devinfo->is_g4x) {
   42219          return 0;
   42220       } else {
   42221          return 0;
   42222       }
   42223    default:
   42224       unreachable("Invalid hardware generation");
   42225    }
   42226 }
   42227 
   42228 
   42229 
   42230 /* 3DSTATE_MULTISAMPLE::Number of Multisamples */
   42231 
   42232 
   42233 #define GEN10_3DSTATE_MULTISAMPLE_NumberofMultisamples_bits  3
   42234 #define GEN9_3DSTATE_MULTISAMPLE_NumberofMultisamples_bits  3
   42235 #define GEN8_3DSTATE_MULTISAMPLE_NumberofMultisamples_bits  3
   42236 #define GEN75_3DSTATE_MULTISAMPLE_NumberofMultisamples_bits  3
   42237 #define GEN7_3DSTATE_MULTISAMPLE_NumberofMultisamples_bits  3
   42238 #define GEN6_3DSTATE_MULTISAMPLE_NumberofMultisamples_bits  3
   42239 
   42240 static inline uint32_t ATTRIBUTE_PURE
   42241 _3DSTATE_MULTISAMPLE_NumberofMultisamples_bits(const struct gen_device_info *devinfo)
   42242 {
   42243    switch (devinfo->gen) {
   42244    case 10: return 3;
   42245    case 9: return 3;
   42246    case 8: return 3;
   42247    case 7:
   42248       if (devinfo->is_haswell) {
   42249          return 3;
   42250       } else {
   42251          return 3;
   42252       }
   42253    case 6: return 3;
   42254    case 5: return 0;
   42255    case 4:
   42256       if (devinfo->is_g4x) {
   42257          return 0;
   42258       } else {
   42259          return 0;
   42260       }
   42261    default:
   42262       unreachable("Invalid hardware generation");
   42263    }
   42264 }
   42265 
   42266 
   42267 
   42268 #define GEN10_3DSTATE_MULTISAMPLE_NumberofMultisamples_start  33
   42269 #define GEN9_3DSTATE_MULTISAMPLE_NumberofMultisamples_start  33
   42270 #define GEN8_3DSTATE_MULTISAMPLE_NumberofMultisamples_start  33
   42271 #define GEN75_3DSTATE_MULTISAMPLE_NumberofMultisamples_start  33
   42272 #define GEN7_3DSTATE_MULTISAMPLE_NumberofMultisamples_start  33
   42273 #define GEN6_3DSTATE_MULTISAMPLE_NumberofMultisamples_start  33
   42274 
   42275 static inline uint32_t ATTRIBUTE_PURE
   42276 _3DSTATE_MULTISAMPLE_NumberofMultisamples_start(const struct gen_device_info *devinfo)
   42277 {
   42278    switch (devinfo->gen) {
   42279    case 10: return 33;
   42280    case 9: return 33;
   42281    case 8: return 33;
   42282    case 7:
   42283       if (devinfo->is_haswell) {
   42284          return 33;
   42285       } else {
   42286          return 33;
   42287       }
   42288    case 6: return 33;
   42289    case 5: return 0;
   42290    case 4:
   42291       if (devinfo->is_g4x) {
   42292          return 0;
   42293       } else {
   42294          return 0;
   42295       }
   42296    default:
   42297       unreachable("Invalid hardware generation");
   42298    }
   42299 }
   42300 
   42301 
   42302 
   42303 /* 3DSTATE_MULTISAMPLE::Pixel Location */
   42304 
   42305 
   42306 #define GEN10_3DSTATE_MULTISAMPLE_PixelLocation_bits  1
   42307 #define GEN9_3DSTATE_MULTISAMPLE_PixelLocation_bits  1
   42308 #define GEN8_3DSTATE_MULTISAMPLE_PixelLocation_bits  1
   42309 #define GEN75_3DSTATE_MULTISAMPLE_PixelLocation_bits  1
   42310 #define GEN7_3DSTATE_MULTISAMPLE_PixelLocation_bits  1
   42311 #define GEN6_3DSTATE_MULTISAMPLE_PixelLocation_bits  1
   42312 
   42313 static inline uint32_t ATTRIBUTE_PURE
   42314 _3DSTATE_MULTISAMPLE_PixelLocation_bits(const struct gen_device_info *devinfo)
   42315 {
   42316    switch (devinfo->gen) {
   42317    case 10: return 1;
   42318    case 9: return 1;
   42319    case 8: return 1;
   42320    case 7:
   42321       if (devinfo->is_haswell) {
   42322          return 1;
   42323       } else {
   42324          return 1;
   42325       }
   42326    case 6: return 1;
   42327    case 5: return 0;
   42328    case 4:
   42329       if (devinfo->is_g4x) {
   42330          return 0;
   42331       } else {
   42332          return 0;
   42333       }
   42334    default:
   42335       unreachable("Invalid hardware generation");
   42336    }
   42337 }
   42338 
   42339 
   42340 
   42341 #define GEN10_3DSTATE_MULTISAMPLE_PixelLocation_start  36
   42342 #define GEN9_3DSTATE_MULTISAMPLE_PixelLocation_start  36
   42343 #define GEN8_3DSTATE_MULTISAMPLE_PixelLocation_start  36
   42344 #define GEN75_3DSTATE_MULTISAMPLE_PixelLocation_start  36
   42345 #define GEN7_3DSTATE_MULTISAMPLE_PixelLocation_start  36
   42346 #define GEN6_3DSTATE_MULTISAMPLE_PixelLocation_start  36
   42347 
   42348 static inline uint32_t ATTRIBUTE_PURE
   42349 _3DSTATE_MULTISAMPLE_PixelLocation_start(const struct gen_device_info *devinfo)
   42350 {
   42351    switch (devinfo->gen) {
   42352    case 10: return 36;
   42353    case 9: return 36;
   42354    case 8: return 36;
   42355    case 7:
   42356       if (devinfo->is_haswell) {
   42357          return 36;
   42358       } else {
   42359          return 36;
   42360       }
   42361    case 6: return 36;
   42362    case 5: return 0;
   42363    case 4:
   42364       if (devinfo->is_g4x) {
   42365          return 0;
   42366       } else {
   42367          return 0;
   42368       }
   42369    default:
   42370       unreachable("Invalid hardware generation");
   42371    }
   42372 }
   42373 
   42374 
   42375 
   42376 /* 3DSTATE_MULTISAMPLE::Pixel Position Offset Enable */
   42377 
   42378 
   42379 #define GEN10_3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_bits  1
   42380 #define GEN9_3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_bits  1
   42381 #define GEN8_3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_bits  1
   42382 
   42383 static inline uint32_t ATTRIBUTE_PURE
   42384 _3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_bits(const struct gen_device_info *devinfo)
   42385 {
   42386    switch (devinfo->gen) {
   42387    case 10: return 1;
   42388    case 9: return 1;
   42389    case 8: return 1;
   42390    case 7:
   42391       if (devinfo->is_haswell) {
   42392          return 0;
   42393       } else {
   42394          return 0;
   42395       }
   42396    case 6: return 0;
   42397    case 5: return 0;
   42398    case 4:
   42399       if (devinfo->is_g4x) {
   42400          return 0;
   42401       } else {
   42402          return 0;
   42403       }
   42404    default:
   42405       unreachable("Invalid hardware generation");
   42406    }
   42407 }
   42408 
   42409 
   42410 
   42411 #define GEN10_3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_start  37
   42412 #define GEN9_3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_start  37
   42413 #define GEN8_3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_start  37
   42414 
   42415 static inline uint32_t ATTRIBUTE_PURE
   42416 _3DSTATE_MULTISAMPLE_PixelPositionOffsetEnable_start(const struct gen_device_info *devinfo)
   42417 {
   42418    switch (devinfo->gen) {
   42419    case 10: return 37;
   42420    case 9: return 37;
   42421    case 8: return 37;
   42422    case 7:
   42423       if (devinfo->is_haswell) {
   42424          return 0;
   42425       } else {
   42426          return 0;
   42427       }
   42428    case 6: return 0;
   42429    case 5: return 0;
   42430    case 4:
   42431       if (devinfo->is_g4x) {
   42432          return 0;
   42433       } else {
   42434          return 0;
   42435       }
   42436    default:
   42437       unreachable("Invalid hardware generation");
   42438    }
   42439 }
   42440 
   42441 
   42442 
   42443 /* 3DSTATE_MULTISAMPLE::Sample0 X Offset */
   42444 
   42445 
   42446 #define GEN75_3DSTATE_MULTISAMPLE_Sample0XOffset_bits  4
   42447 #define GEN7_3DSTATE_MULTISAMPLE_Sample0XOffset_bits  4
   42448 #define GEN6_3DSTATE_MULTISAMPLE_Sample0XOffset_bits  4
   42449 
   42450 static inline uint32_t ATTRIBUTE_PURE
   42451 _3DSTATE_MULTISAMPLE_Sample0XOffset_bits(const struct gen_device_info *devinfo)
   42452 {
   42453    switch (devinfo->gen) {
   42454    case 10: return 0;
   42455    case 9: return 0;
   42456    case 8: return 0;
   42457    case 7:
   42458       if (devinfo->is_haswell) {
   42459          return 4;
   42460       } else {
   42461          return 4;
   42462       }
   42463    case 6: return 4;
   42464    case 5: return 0;
   42465    case 4:
   42466       if (devinfo->is_g4x) {
   42467          return 0;
   42468       } else {
   42469          return 0;
   42470       }
   42471    default:
   42472       unreachable("Invalid hardware generation");
   42473    }
   42474 }
   42475 
   42476 
   42477 
   42478 #define GEN75_3DSTATE_MULTISAMPLE_Sample0XOffset_start  68
   42479 #define GEN7_3DSTATE_MULTISAMPLE_Sample0XOffset_start  68
   42480 #define GEN6_3DSTATE_MULTISAMPLE_Sample0XOffset_start  68
   42481 
   42482 static inline uint32_t ATTRIBUTE_PURE
   42483 _3DSTATE_MULTISAMPLE_Sample0XOffset_start(const struct gen_device_info *devinfo)
   42484 {
   42485    switch (devinfo->gen) {
   42486    case 10: return 0;
   42487    case 9: return 0;
   42488    case 8: return 0;
   42489    case 7:
   42490       if (devinfo->is_haswell) {
   42491          return 68;
   42492       } else {
   42493          return 68;
   42494       }
   42495    case 6: return 68;
   42496    case 5: return 0;
   42497    case 4:
   42498       if (devinfo->is_g4x) {
   42499          return 0;
   42500       } else {
   42501          return 0;
   42502       }
   42503    default:
   42504       unreachable("Invalid hardware generation");
   42505    }
   42506 }
   42507 
   42508 
   42509 
   42510 /* 3DSTATE_MULTISAMPLE::Sample0 Y Offset */
   42511 
   42512 
   42513 #define GEN75_3DSTATE_MULTISAMPLE_Sample0YOffset_bits  4
   42514 #define GEN7_3DSTATE_MULTISAMPLE_Sample0YOffset_bits  4
   42515 #define GEN6_3DSTATE_MULTISAMPLE_Sample0YOffset_bits  4
   42516 
   42517 static inline uint32_t ATTRIBUTE_PURE
   42518 _3DSTATE_MULTISAMPLE_Sample0YOffset_bits(const struct gen_device_info *devinfo)
   42519 {
   42520    switch (devinfo->gen) {
   42521    case 10: return 0;
   42522    case 9: return 0;
   42523    case 8: return 0;
   42524    case 7:
   42525       if (devinfo->is_haswell) {
   42526          return 4;
   42527       } else {
   42528          return 4;
   42529       }
   42530    case 6: return 4;
   42531    case 5: return 0;
   42532    case 4:
   42533       if (devinfo->is_g4x) {
   42534          return 0;
   42535       } else {
   42536          return 0;
   42537       }
   42538    default:
   42539       unreachable("Invalid hardware generation");
   42540    }
   42541 }
   42542 
   42543 
   42544 
   42545 #define GEN75_3DSTATE_MULTISAMPLE_Sample0YOffset_start  64
   42546 #define GEN7_3DSTATE_MULTISAMPLE_Sample0YOffset_start  64
   42547 #define GEN6_3DSTATE_MULTISAMPLE_Sample0YOffset_start  64
   42548 
   42549 static inline uint32_t ATTRIBUTE_PURE
   42550 _3DSTATE_MULTISAMPLE_Sample0YOffset_start(const struct gen_device_info *devinfo)
   42551 {
   42552    switch (devinfo->gen) {
   42553    case 10: return 0;
   42554    case 9: return 0;
   42555    case 8: return 0;
   42556    case 7:
   42557       if (devinfo->is_haswell) {
   42558          return 64;
   42559       } else {
   42560          return 64;
   42561       }
   42562    case 6: return 64;
   42563    case 5: return 0;
   42564    case 4:
   42565       if (devinfo->is_g4x) {
   42566          return 0;
   42567       } else {
   42568          return 0;
   42569       }
   42570    default:
   42571       unreachable("Invalid hardware generation");
   42572    }
   42573 }
   42574 
   42575 
   42576 
   42577 /* 3DSTATE_MULTISAMPLE::Sample1 X Offset */
   42578 
   42579 
   42580 #define GEN75_3DSTATE_MULTISAMPLE_Sample1XOffset_bits  4
   42581 #define GEN7_3DSTATE_MULTISAMPLE_Sample1XOffset_bits  4
   42582 #define GEN6_3DSTATE_MULTISAMPLE_Sample1XOffset_bits  4
   42583 
   42584 static inline uint32_t ATTRIBUTE_PURE
   42585 _3DSTATE_MULTISAMPLE_Sample1XOffset_bits(const struct gen_device_info *devinfo)
   42586 {
   42587    switch (devinfo->gen) {
   42588    case 10: return 0;
   42589    case 9: return 0;
   42590    case 8: return 0;
   42591    case 7:
   42592       if (devinfo->is_haswell) {
   42593          return 4;
   42594       } else {
   42595          return 4;
   42596       }
   42597    case 6: return 4;
   42598    case 5: return 0;
   42599    case 4:
   42600       if (devinfo->is_g4x) {
   42601          return 0;
   42602       } else {
   42603          return 0;
   42604       }
   42605    default:
   42606       unreachable("Invalid hardware generation");
   42607    }
   42608 }
   42609 
   42610 
   42611 
   42612 #define GEN75_3DSTATE_MULTISAMPLE_Sample1XOffset_start  76
   42613 #define GEN7_3DSTATE_MULTISAMPLE_Sample1XOffset_start  76
   42614 #define GEN6_3DSTATE_MULTISAMPLE_Sample1XOffset_start  76
   42615 
   42616 static inline uint32_t ATTRIBUTE_PURE
   42617 _3DSTATE_MULTISAMPLE_Sample1XOffset_start(const struct gen_device_info *devinfo)
   42618 {
   42619    switch (devinfo->gen) {
   42620    case 10: return 0;
   42621    case 9: return 0;
   42622    case 8: return 0;
   42623    case 7:
   42624       if (devinfo->is_haswell) {
   42625          return 76;
   42626       } else {
   42627          return 76;
   42628       }
   42629    case 6: return 76;
   42630    case 5: return 0;
   42631    case 4:
   42632       if (devinfo->is_g4x) {
   42633          return 0;
   42634       } else {
   42635          return 0;
   42636       }
   42637    default:
   42638       unreachable("Invalid hardware generation");
   42639    }
   42640 }
   42641 
   42642 
   42643 
   42644 /* 3DSTATE_MULTISAMPLE::Sample1 Y Offset */
   42645 
   42646 
   42647 #define GEN75_3DSTATE_MULTISAMPLE_Sample1YOffset_bits  4
   42648 #define GEN7_3DSTATE_MULTISAMPLE_Sample1YOffset_bits  4
   42649 #define GEN6_3DSTATE_MULTISAMPLE_Sample1YOffset_bits  4
   42650 
   42651 static inline uint32_t ATTRIBUTE_PURE
   42652 _3DSTATE_MULTISAMPLE_Sample1YOffset_bits(const struct gen_device_info *devinfo)
   42653 {
   42654    switch (devinfo->gen) {
   42655    case 10: return 0;
   42656    case 9: return 0;
   42657    case 8: return 0;
   42658    case 7:
   42659       if (devinfo->is_haswell) {
   42660          return 4;
   42661       } else {
   42662          return 4;
   42663       }
   42664    case 6: return 4;
   42665    case 5: return 0;
   42666    case 4:
   42667       if (devinfo->is_g4x) {
   42668          return 0;
   42669       } else {
   42670          return 0;
   42671       }
   42672    default:
   42673       unreachable("Invalid hardware generation");
   42674    }
   42675 }
   42676 
   42677 
   42678 
   42679 #define GEN75_3DSTATE_MULTISAMPLE_Sample1YOffset_start  72
   42680 #define GEN7_3DSTATE_MULTISAMPLE_Sample1YOffset_start  72
   42681 #define GEN6_3DSTATE_MULTISAMPLE_Sample1YOffset_start  72
   42682 
   42683 static inline uint32_t ATTRIBUTE_PURE
   42684 _3DSTATE_MULTISAMPLE_Sample1YOffset_start(const struct gen_device_info *devinfo)
   42685 {
   42686    switch (devinfo->gen) {
   42687    case 10: return 0;
   42688    case 9: return 0;
   42689    case 8: return 0;
   42690    case 7:
   42691       if (devinfo->is_haswell) {
   42692          return 72;
   42693       } else {
   42694          return 72;
   42695       }
   42696    case 6: return 72;
   42697    case 5: return 0;
   42698    case 4:
   42699       if (devinfo->is_g4x) {
   42700          return 0;
   42701       } else {
   42702          return 0;
   42703       }
   42704    default:
   42705       unreachable("Invalid hardware generation");
   42706    }
   42707 }
   42708 
   42709 
   42710 
   42711 /* 3DSTATE_MULTISAMPLE::Sample2 X Offset */
   42712 
   42713 
   42714 #define GEN75_3DSTATE_MULTISAMPLE_Sample2XOffset_bits  4
   42715 #define GEN7_3DSTATE_MULTISAMPLE_Sample2XOffset_bits  4
   42716 #define GEN6_3DSTATE_MULTISAMPLE_Sample2XOffset_bits  4
   42717 
   42718 static inline uint32_t ATTRIBUTE_PURE
   42719 _3DSTATE_MULTISAMPLE_Sample2XOffset_bits(const struct gen_device_info *devinfo)
   42720 {
   42721    switch (devinfo->gen) {
   42722    case 10: return 0;
   42723    case 9: return 0;
   42724    case 8: return 0;
   42725    case 7:
   42726       if (devinfo->is_haswell) {
   42727          return 4;
   42728       } else {
   42729          return 4;
   42730       }
   42731    case 6: return 4;
   42732    case 5: return 0;
   42733    case 4:
   42734       if (devinfo->is_g4x) {
   42735          return 0;
   42736       } else {
   42737          return 0;
   42738       }
   42739    default:
   42740       unreachable("Invalid hardware generation");
   42741    }
   42742 }
   42743 
   42744 
   42745 
   42746 #define GEN75_3DSTATE_MULTISAMPLE_Sample2XOffset_start  84
   42747 #define GEN7_3DSTATE_MULTISAMPLE_Sample2XOffset_start  84
   42748 #define GEN6_3DSTATE_MULTISAMPLE_Sample2XOffset_start  84
   42749 
   42750 static inline uint32_t ATTRIBUTE_PURE
   42751 _3DSTATE_MULTISAMPLE_Sample2XOffset_start(const struct gen_device_info *devinfo)
   42752 {
   42753    switch (devinfo->gen) {
   42754    case 10: return 0;
   42755    case 9: return 0;
   42756    case 8: return 0;
   42757    case 7:
   42758       if (devinfo->is_haswell) {
   42759          return 84;
   42760       } else {
   42761          return 84;
   42762       }
   42763    case 6: return 84;
   42764    case 5: return 0;
   42765    case 4:
   42766       if (devinfo->is_g4x) {
   42767          return 0;
   42768       } else {
   42769          return 0;
   42770       }
   42771    default:
   42772       unreachable("Invalid hardware generation");
   42773    }
   42774 }
   42775 
   42776 
   42777 
   42778 /* 3DSTATE_MULTISAMPLE::Sample2 Y Offset */
   42779 
   42780 
   42781 #define GEN75_3DSTATE_MULTISAMPLE_Sample2YOffset_bits  4
   42782 #define GEN7_3DSTATE_MULTISAMPLE_Sample2YOffset_bits  4
   42783 #define GEN6_3DSTATE_MULTISAMPLE_Sample2YOffset_bits  4
   42784 
   42785 static inline uint32_t ATTRIBUTE_PURE
   42786 _3DSTATE_MULTISAMPLE_Sample2YOffset_bits(const struct gen_device_info *devinfo)
   42787 {
   42788    switch (devinfo->gen) {
   42789    case 10: return 0;
   42790    case 9: return 0;
   42791    case 8: return 0;
   42792    case 7:
   42793       if (devinfo->is_haswell) {
   42794          return 4;
   42795       } else {
   42796          return 4;
   42797       }
   42798    case 6: return 4;
   42799    case 5: return 0;
   42800    case 4:
   42801       if (devinfo->is_g4x) {
   42802          return 0;
   42803       } else {
   42804          return 0;
   42805       }
   42806    default:
   42807       unreachable("Invalid hardware generation");
   42808    }
   42809 }
   42810 
   42811 
   42812 
   42813 #define GEN75_3DSTATE_MULTISAMPLE_Sample2YOffset_start  80
   42814 #define GEN7_3DSTATE_MULTISAMPLE_Sample2YOffset_start  80
   42815 #define GEN6_3DSTATE_MULTISAMPLE_Sample2YOffset_start  80
   42816 
   42817 static inline uint32_t ATTRIBUTE_PURE
   42818 _3DSTATE_MULTISAMPLE_Sample2YOffset_start(const struct gen_device_info *devinfo)
   42819 {
   42820    switch (devinfo->gen) {
   42821    case 10: return 0;
   42822    case 9: return 0;
   42823    case 8: return 0;
   42824    case 7:
   42825       if (devinfo->is_haswell) {
   42826          return 80;
   42827       } else {
   42828          return 80;
   42829       }
   42830    case 6: return 80;
   42831    case 5: return 0;
   42832    case 4:
   42833       if (devinfo->is_g4x) {
   42834          return 0;
   42835       } else {
   42836          return 0;
   42837       }
   42838    default:
   42839       unreachable("Invalid hardware generation");
   42840    }
   42841 }
   42842 
   42843 
   42844 
   42845 /* 3DSTATE_MULTISAMPLE::Sample3 X Offset */
   42846 
   42847 
   42848 #define GEN75_3DSTATE_MULTISAMPLE_Sample3XOffset_bits  4
   42849 #define GEN7_3DSTATE_MULTISAMPLE_Sample3XOffset_bits  4
   42850 #define GEN6_3DSTATE_MULTISAMPLE_Sample3XOffset_bits  4
   42851 
   42852 static inline uint32_t ATTRIBUTE_PURE
   42853 _3DSTATE_MULTISAMPLE_Sample3XOffset_bits(const struct gen_device_info *devinfo)
   42854 {
   42855    switch (devinfo->gen) {
   42856    case 10: return 0;
   42857    case 9: return 0;
   42858    case 8: return 0;
   42859    case 7:
   42860       if (devinfo->is_haswell) {
   42861          return 4;
   42862       } else {
   42863          return 4;
   42864       }
   42865    case 6: return 4;
   42866    case 5: return 0;
   42867    case 4:
   42868       if (devinfo->is_g4x) {
   42869          return 0;
   42870       } else {
   42871          return 0;
   42872       }
   42873    default:
   42874       unreachable("Invalid hardware generation");
   42875    }
   42876 }
   42877 
   42878 
   42879 
   42880 #define GEN75_3DSTATE_MULTISAMPLE_Sample3XOffset_start  92
   42881 #define GEN7_3DSTATE_MULTISAMPLE_Sample3XOffset_start  92
   42882 #define GEN6_3DSTATE_MULTISAMPLE_Sample3XOffset_start  92
   42883 
   42884 static inline uint32_t ATTRIBUTE_PURE
   42885 _3DSTATE_MULTISAMPLE_Sample3XOffset_start(const struct gen_device_info *devinfo)
   42886 {
   42887    switch (devinfo->gen) {
   42888    case 10: return 0;
   42889    case 9: return 0;
   42890    case 8: return 0;
   42891    case 7:
   42892       if (devinfo->is_haswell) {
   42893          return 92;
   42894       } else {
   42895          return 92;
   42896       }
   42897    case 6: return 92;
   42898    case 5: return 0;
   42899    case 4:
   42900       if (devinfo->is_g4x) {
   42901          return 0;
   42902       } else {
   42903          return 0;
   42904       }
   42905    default:
   42906       unreachable("Invalid hardware generation");
   42907    }
   42908 }
   42909 
   42910 
   42911 
   42912 /* 3DSTATE_MULTISAMPLE::Sample3 Y Offset */
   42913 
   42914 
   42915 #define GEN75_3DSTATE_MULTISAMPLE_Sample3YOffset_bits  4
   42916 #define GEN7_3DSTATE_MULTISAMPLE_Sample3YOffset_bits  4
   42917 #define GEN6_3DSTATE_MULTISAMPLE_Sample3YOffset_bits  4
   42918 
   42919 static inline uint32_t ATTRIBUTE_PURE
   42920 _3DSTATE_MULTISAMPLE_Sample3YOffset_bits(const struct gen_device_info *devinfo)
   42921 {
   42922    switch (devinfo->gen) {
   42923    case 10: return 0;
   42924    case 9: return 0;
   42925    case 8: return 0;
   42926    case 7:
   42927       if (devinfo->is_haswell) {
   42928          return 4;
   42929       } else {
   42930          return 4;
   42931       }
   42932    case 6: return 4;
   42933    case 5: return 0;
   42934    case 4:
   42935       if (devinfo->is_g4x) {
   42936          return 0;
   42937       } else {
   42938          return 0;
   42939       }
   42940    default:
   42941       unreachable("Invalid hardware generation");
   42942    }
   42943 }
   42944 
   42945 
   42946 
   42947 #define GEN75_3DSTATE_MULTISAMPLE_Sample3YOffset_start  88
   42948 #define GEN7_3DSTATE_MULTISAMPLE_Sample3YOffset_start  88
   42949 #define GEN6_3DSTATE_MULTISAMPLE_Sample3YOffset_start  88
   42950 
   42951 static inline uint32_t ATTRIBUTE_PURE
   42952 _3DSTATE_MULTISAMPLE_Sample3YOffset_start(const struct gen_device_info *devinfo)
   42953 {
   42954    switch (devinfo->gen) {
   42955    case 10: return 0;
   42956    case 9: return 0;
   42957    case 8: return 0;
   42958    case 7:
   42959       if (devinfo->is_haswell) {
   42960          return 88;
   42961       } else {
   42962          return 88;
   42963       }
   42964    case 6: return 88;
   42965    case 5: return 0;
   42966    case 4:
   42967       if (devinfo->is_g4x) {
   42968          return 0;
   42969       } else {
   42970          return 0;
   42971       }
   42972    default:
   42973       unreachable("Invalid hardware generation");
   42974    }
   42975 }
   42976 
   42977 
   42978 
   42979 /* 3DSTATE_MULTISAMPLE::Sample4 X Offset */
   42980 
   42981 
   42982 #define GEN75_3DSTATE_MULTISAMPLE_Sample4XOffset_bits  4
   42983 #define GEN7_3DSTATE_MULTISAMPLE_Sample4XOffset_bits  4
   42984 
   42985 static inline uint32_t ATTRIBUTE_PURE
   42986 _3DSTATE_MULTISAMPLE_Sample4XOffset_bits(const struct gen_device_info *devinfo)
   42987 {
   42988    switch (devinfo->gen) {
   42989    case 10: return 0;
   42990    case 9: return 0;
   42991    case 8: return 0;
   42992    case 7:
   42993       if (devinfo->is_haswell) {
   42994          return 4;
   42995       } else {
   42996          return 4;
   42997       }
   42998    case 6: return 0;
   42999    case 5: return 0;
   43000    case 4:
   43001       if (devinfo->is_g4x) {
   43002          return 0;
   43003       } else {
   43004          return 0;
   43005       }
   43006    default:
   43007       unreachable("Invalid hardware generation");
   43008    }
   43009 }
   43010 
   43011 
   43012 
   43013 #define GEN75_3DSTATE_MULTISAMPLE_Sample4XOffset_start  100
   43014 #define GEN7_3DSTATE_MULTISAMPLE_Sample4XOffset_start  100
   43015 
   43016 static inline uint32_t ATTRIBUTE_PURE
   43017 _3DSTATE_MULTISAMPLE_Sample4XOffset_start(const struct gen_device_info *devinfo)
   43018 {
   43019    switch (devinfo->gen) {
   43020    case 10: return 0;
   43021    case 9: return 0;
   43022    case 8: return 0;
   43023    case 7:
   43024       if (devinfo->is_haswell) {
   43025          return 100;
   43026       } else {
   43027          return 100;
   43028       }
   43029    case 6: return 0;
   43030    case 5: return 0;
   43031    case 4:
   43032       if (devinfo->is_g4x) {
   43033          return 0;
   43034       } else {
   43035          return 0;
   43036       }
   43037    default:
   43038       unreachable("Invalid hardware generation");
   43039    }
   43040 }
   43041 
   43042 
   43043 
   43044 /* 3DSTATE_MULTISAMPLE::Sample4 Y Offset */
   43045 
   43046 
   43047 #define GEN75_3DSTATE_MULTISAMPLE_Sample4YOffset_bits  4
   43048 #define GEN7_3DSTATE_MULTISAMPLE_Sample4YOffset_bits  4
   43049 
   43050 static inline uint32_t ATTRIBUTE_PURE
   43051 _3DSTATE_MULTISAMPLE_Sample4YOffset_bits(const struct gen_device_info *devinfo)
   43052 {
   43053    switch (devinfo->gen) {
   43054    case 10: return 0;
   43055    case 9: return 0;
   43056    case 8: return 0;
   43057    case 7:
   43058       if (devinfo->is_haswell) {
   43059          return 4;
   43060       } else {
   43061          return 4;
   43062       }
   43063    case 6: return 0;
   43064    case 5: return 0;
   43065    case 4:
   43066       if (devinfo->is_g4x) {
   43067          return 0;
   43068       } else {
   43069          return 0;
   43070       }
   43071    default:
   43072       unreachable("Invalid hardware generation");
   43073    }
   43074 }
   43075 
   43076 
   43077 
   43078 #define GEN75_3DSTATE_MULTISAMPLE_Sample4YOffset_start  96
   43079 #define GEN7_3DSTATE_MULTISAMPLE_Sample4YOffset_start  96
   43080 
   43081 static inline uint32_t ATTRIBUTE_PURE
   43082 _3DSTATE_MULTISAMPLE_Sample4YOffset_start(const struct gen_device_info *devinfo)
   43083 {
   43084    switch (devinfo->gen) {
   43085    case 10: return 0;
   43086    case 9: return 0;
   43087    case 8: return 0;
   43088    case 7:
   43089       if (devinfo->is_haswell) {
   43090          return 96;
   43091       } else {
   43092          return 96;
   43093       }
   43094    case 6: return 0;
   43095    case 5: return 0;
   43096    case 4:
   43097       if (devinfo->is_g4x) {
   43098          return 0;
   43099       } else {
   43100          return 0;
   43101       }
   43102    default:
   43103       unreachable("Invalid hardware generation");
   43104    }
   43105 }
   43106 
   43107 
   43108 
   43109 /* 3DSTATE_MULTISAMPLE::Sample5 X Offset */
   43110 
   43111 
   43112 #define GEN75_3DSTATE_MULTISAMPLE_Sample5XOffset_bits  4
   43113 #define GEN7_3DSTATE_MULTISAMPLE_Sample5XOffset_bits  4
   43114 
   43115 static inline uint32_t ATTRIBUTE_PURE
   43116 _3DSTATE_MULTISAMPLE_Sample5XOffset_bits(const struct gen_device_info *devinfo)
   43117 {
   43118    switch (devinfo->gen) {
   43119    case 10: return 0;
   43120    case 9: return 0;
   43121    case 8: return 0;
   43122    case 7:
   43123       if (devinfo->is_haswell) {
   43124          return 4;
   43125       } else {
   43126          return 4;
   43127       }
   43128    case 6: return 0;
   43129    case 5: return 0;
   43130    case 4:
   43131       if (devinfo->is_g4x) {
   43132          return 0;
   43133       } else {
   43134          return 0;
   43135       }
   43136    default:
   43137       unreachable("Invalid hardware generation");
   43138    }
   43139 }
   43140 
   43141 
   43142 
   43143 #define GEN75_3DSTATE_MULTISAMPLE_Sample5XOffset_start  108
   43144 #define GEN7_3DSTATE_MULTISAMPLE_Sample5XOffset_start  108
   43145 
   43146 static inline uint32_t ATTRIBUTE_PURE
   43147 _3DSTATE_MULTISAMPLE_Sample5XOffset_start(const struct gen_device_info *devinfo)
   43148 {
   43149    switch (devinfo->gen) {
   43150    case 10: return 0;
   43151    case 9: return 0;
   43152    case 8: return 0;
   43153    case 7:
   43154       if (devinfo->is_haswell) {
   43155          return 108;
   43156       } else {
   43157          return 108;
   43158       }
   43159    case 6: return 0;
   43160    case 5: return 0;
   43161    case 4:
   43162       if (devinfo->is_g4x) {
   43163          return 0;
   43164       } else {
   43165          return 0;
   43166       }
   43167    default:
   43168       unreachable("Invalid hardware generation");
   43169    }
   43170 }
   43171 
   43172 
   43173 
   43174 /* 3DSTATE_MULTISAMPLE::Sample5 Y Offset */
   43175 
   43176 
   43177 #define GEN75_3DSTATE_MULTISAMPLE_Sample5YOffset_bits  4
   43178 #define GEN7_3DSTATE_MULTISAMPLE_Sample5YOffset_bits  4
   43179 
   43180 static inline uint32_t ATTRIBUTE_PURE
   43181 _3DSTATE_MULTISAMPLE_Sample5YOffset_bits(const struct gen_device_info *devinfo)
   43182 {
   43183    switch (devinfo->gen) {
   43184    case 10: return 0;
   43185    case 9: return 0;
   43186    case 8: return 0;
   43187    case 7:
   43188       if (devinfo->is_haswell) {
   43189          return 4;
   43190       } else {
   43191          return 4;
   43192       }
   43193    case 6: return 0;
   43194    case 5: return 0;
   43195    case 4:
   43196       if (devinfo->is_g4x) {
   43197          return 0;
   43198       } else {
   43199          return 0;
   43200       }
   43201    default:
   43202       unreachable("Invalid hardware generation");
   43203    }
   43204 }
   43205 
   43206 
   43207 
   43208 #define GEN75_3DSTATE_MULTISAMPLE_Sample5YOffset_start  104
   43209 #define GEN7_3DSTATE_MULTISAMPLE_Sample5YOffset_start  104
   43210 
   43211 static inline uint32_t ATTRIBUTE_PURE
   43212 _3DSTATE_MULTISAMPLE_Sample5YOffset_start(const struct gen_device_info *devinfo)
   43213 {
   43214    switch (devinfo->gen) {
   43215    case 10: return 0;
   43216    case 9: return 0;
   43217    case 8: return 0;
   43218    case 7:
   43219       if (devinfo->is_haswell) {
   43220          return 104;
   43221       } else {
   43222          return 104;
   43223       }
   43224    case 6: return 0;
   43225    case 5: return 0;
   43226    case 4:
   43227       if (devinfo->is_g4x) {
   43228          return 0;
   43229       } else {
   43230          return 0;
   43231       }
   43232    default:
   43233       unreachable("Invalid hardware generation");
   43234    }
   43235 }
   43236 
   43237 
   43238 
   43239 /* 3DSTATE_MULTISAMPLE::Sample6 X Offset */
   43240 
   43241 
   43242 #define GEN75_3DSTATE_MULTISAMPLE_Sample6XOffset_bits  4
   43243 #define GEN7_3DSTATE_MULTISAMPLE_Sample6XOffset_bits  4
   43244 
   43245 static inline uint32_t ATTRIBUTE_PURE
   43246 _3DSTATE_MULTISAMPLE_Sample6XOffset_bits(const struct gen_device_info *devinfo)
   43247 {
   43248    switch (devinfo->gen) {
   43249    case 10: return 0;
   43250    case 9: return 0;
   43251    case 8: return 0;
   43252    case 7:
   43253       if (devinfo->is_haswell) {
   43254          return 4;
   43255       } else {
   43256          return 4;
   43257       }
   43258    case 6: return 0;
   43259    case 5: return 0;
   43260    case 4:
   43261       if (devinfo->is_g4x) {
   43262          return 0;
   43263       } else {
   43264          return 0;
   43265       }
   43266    default:
   43267       unreachable("Invalid hardware generation");
   43268    }
   43269 }
   43270 
   43271 
   43272 
   43273 #define GEN75_3DSTATE_MULTISAMPLE_Sample6XOffset_start  116
   43274 #define GEN7_3DSTATE_MULTISAMPLE_Sample6XOffset_start  116
   43275 
   43276 static inline uint32_t ATTRIBUTE_PURE
   43277 _3DSTATE_MULTISAMPLE_Sample6XOffset_start(const struct gen_device_info *devinfo)
   43278 {
   43279    switch (devinfo->gen) {
   43280    case 10: return 0;
   43281    case 9: return 0;
   43282    case 8: return 0;
   43283    case 7:
   43284       if (devinfo->is_haswell) {
   43285          return 116;
   43286       } else {
   43287          return 116;
   43288       }
   43289    case 6: return 0;
   43290    case 5: return 0;
   43291    case 4:
   43292       if (devinfo->is_g4x) {
   43293          return 0;
   43294       } else {
   43295          return 0;
   43296       }
   43297    default:
   43298       unreachable("Invalid hardware generation");
   43299    }
   43300 }
   43301 
   43302 
   43303 
   43304 /* 3DSTATE_MULTISAMPLE::Sample6 Y Offset */
   43305 
   43306 
   43307 #define GEN75_3DSTATE_MULTISAMPLE_Sample6YOffset_bits  4
   43308 #define GEN7_3DSTATE_MULTISAMPLE_Sample6YOffset_bits  4
   43309 
   43310 static inline uint32_t ATTRIBUTE_PURE
   43311 _3DSTATE_MULTISAMPLE_Sample6YOffset_bits(const struct gen_device_info *devinfo)
   43312 {
   43313    switch (devinfo->gen) {
   43314    case 10: return 0;
   43315    case 9: return 0;
   43316    case 8: return 0;
   43317    case 7:
   43318       if (devinfo->is_haswell) {
   43319          return 4;
   43320       } else {
   43321          return 4;
   43322       }
   43323    case 6: return 0;
   43324    case 5: return 0;
   43325    case 4:
   43326       if (devinfo->is_g4x) {
   43327          return 0;
   43328       } else {
   43329          return 0;
   43330       }
   43331    default:
   43332       unreachable("Invalid hardware generation");
   43333    }
   43334 }
   43335 
   43336 
   43337 
   43338 #define GEN75_3DSTATE_MULTISAMPLE_Sample6YOffset_start  112
   43339 #define GEN7_3DSTATE_MULTISAMPLE_Sample6YOffset_start  112
   43340 
   43341 static inline uint32_t ATTRIBUTE_PURE
   43342 _3DSTATE_MULTISAMPLE_Sample6YOffset_start(const struct gen_device_info *devinfo)
   43343 {
   43344    switch (devinfo->gen) {
   43345    case 10: return 0;
   43346    case 9: return 0;
   43347    case 8: return 0;
   43348    case 7:
   43349       if (devinfo->is_haswell) {
   43350          return 112;
   43351       } else {
   43352          return 112;
   43353       }
   43354    case 6: return 0;
   43355    case 5: return 0;
   43356    case 4:
   43357       if (devinfo->is_g4x) {
   43358          return 0;
   43359       } else {
   43360          return 0;
   43361       }
   43362    default:
   43363       unreachable("Invalid hardware generation");
   43364    }
   43365 }
   43366 
   43367 
   43368 
   43369 /* 3DSTATE_MULTISAMPLE::Sample7 X Offset */
   43370 
   43371 
   43372 #define GEN75_3DSTATE_MULTISAMPLE_Sample7XOffset_bits  4
   43373 #define GEN7_3DSTATE_MULTISAMPLE_Sample7XOffset_bits  4
   43374 
   43375 static inline uint32_t ATTRIBUTE_PURE
   43376 _3DSTATE_MULTISAMPLE_Sample7XOffset_bits(const struct gen_device_info *devinfo)
   43377 {
   43378    switch (devinfo->gen) {
   43379    case 10: return 0;
   43380    case 9: return 0;
   43381    case 8: return 0;
   43382    case 7:
   43383       if (devinfo->is_haswell) {
   43384          return 4;
   43385       } else {
   43386          return 4;
   43387       }
   43388    case 6: return 0;
   43389    case 5: return 0;
   43390    case 4:
   43391       if (devinfo->is_g4x) {
   43392          return 0;
   43393       } else {
   43394          return 0;
   43395       }
   43396    default:
   43397       unreachable("Invalid hardware generation");
   43398    }
   43399 }
   43400 
   43401 
   43402 
   43403 #define GEN75_3DSTATE_MULTISAMPLE_Sample7XOffset_start  124
   43404 #define GEN7_3DSTATE_MULTISAMPLE_Sample7XOffset_start  124
   43405 
   43406 static inline uint32_t ATTRIBUTE_PURE
   43407 _3DSTATE_MULTISAMPLE_Sample7XOffset_start(const struct gen_device_info *devinfo)
   43408 {
   43409    switch (devinfo->gen) {
   43410    case 10: return 0;
   43411    case 9: return 0;
   43412    case 8: return 0;
   43413    case 7:
   43414       if (devinfo->is_haswell) {
   43415          return 124;
   43416       } else {
   43417          return 124;
   43418       }
   43419    case 6: return 0;
   43420    case 5: return 0;
   43421    case 4:
   43422       if (devinfo->is_g4x) {
   43423          return 0;
   43424       } else {
   43425          return 0;
   43426       }
   43427    default:
   43428       unreachable("Invalid hardware generation");
   43429    }
   43430 }
   43431 
   43432 
   43433 
   43434 /* 3DSTATE_MULTISAMPLE::Sample7 Y Offset */
   43435 
   43436 
   43437 #define GEN75_3DSTATE_MULTISAMPLE_Sample7YOffset_bits  4
   43438 #define GEN7_3DSTATE_MULTISAMPLE_Sample7YOffset_bits  4
   43439 
   43440 static inline uint32_t ATTRIBUTE_PURE
   43441 _3DSTATE_MULTISAMPLE_Sample7YOffset_bits(const struct gen_device_info *devinfo)
   43442 {
   43443    switch (devinfo->gen) {
   43444    case 10: return 0;
   43445    case 9: return 0;
   43446    case 8: return 0;
   43447    case 7:
   43448       if (devinfo->is_haswell) {
   43449          return 4;
   43450       } else {
   43451          return 4;
   43452       }
   43453    case 6: return 0;
   43454    case 5: return 0;
   43455    case 4:
   43456       if (devinfo->is_g4x) {
   43457          return 0;
   43458       } else {
   43459          return 0;
   43460       }
   43461    default:
   43462       unreachable("Invalid hardware generation");
   43463    }
   43464 }
   43465 
   43466 
   43467 
   43468 #define GEN75_3DSTATE_MULTISAMPLE_Sample7YOffset_start  120
   43469 #define GEN7_3DSTATE_MULTISAMPLE_Sample7YOffset_start  120
   43470 
   43471 static inline uint32_t ATTRIBUTE_PURE
   43472 _3DSTATE_MULTISAMPLE_Sample7YOffset_start(const struct gen_device_info *devinfo)
   43473 {
   43474    switch (devinfo->gen) {
   43475    case 10: return 0;
   43476    case 9: return 0;
   43477    case 8: return 0;
   43478    case 7:
   43479       if (devinfo->is_haswell) {
   43480          return 120;
   43481       } else {
   43482          return 120;
   43483       }
   43484    case 6: return 0;
   43485    case 5: return 0;
   43486    case 4:
   43487       if (devinfo->is_g4x) {
   43488          return 0;
   43489       } else {
   43490          return 0;
   43491       }
   43492    default:
   43493       unreachable("Invalid hardware generation");
   43494    }
   43495 }
   43496 
   43497 
   43498 
   43499 /* 3DSTATE_PIPELINED_POINTERS */
   43500 
   43501 
   43502 #define GEN5_3DSTATE_PIPELINED_POINTERS_length  7
   43503 #define GEN45_3DSTATE_PIPELINED_POINTERS_length  7
   43504 #define GEN4_3DSTATE_PIPELINED_POINTERS_length  7
   43505 
   43506 static inline uint32_t ATTRIBUTE_PURE
   43507 _3DSTATE_PIPELINED_POINTERS_length(const struct gen_device_info *devinfo)
   43508 {
   43509    switch (devinfo->gen) {
   43510    case 10: return 0;
   43511    case 9: return 0;
   43512    case 8: return 0;
   43513    case 7:
   43514       if (devinfo->is_haswell) {
   43515          return 0;
   43516       } else {
   43517          return 0;
   43518       }
   43519    case 6: return 0;
   43520    case 5: return 7;
   43521    case 4:
   43522       if (devinfo->is_g4x) {
   43523          return 7;
   43524       } else {
   43525          return 7;
   43526       }
   43527    default:
   43528       unreachable("Invalid hardware generation");
   43529    }
   43530 }
   43531 
   43532 
   43533 
   43534 /* 3DSTATE_PIPELINED_POINTERS::3D Command Opcode */
   43535 
   43536 
   43537 #define GEN5_3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_bits  3
   43538 #define GEN45_3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_bits  3
   43539 #define GEN4_3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_bits  3
   43540 
   43541 static inline uint32_t ATTRIBUTE_PURE
   43542 _3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   43543 {
   43544    switch (devinfo->gen) {
   43545    case 10: return 0;
   43546    case 9: return 0;
   43547    case 8: return 0;
   43548    case 7:
   43549       if (devinfo->is_haswell) {
   43550          return 0;
   43551       } else {
   43552          return 0;
   43553       }
   43554    case 6: return 0;
   43555    case 5: return 3;
   43556    case 4:
   43557       if (devinfo->is_g4x) {
   43558          return 3;
   43559       } else {
   43560          return 3;
   43561       }
   43562    default:
   43563       unreachable("Invalid hardware generation");
   43564    }
   43565 }
   43566 
   43567 
   43568 
   43569 #define GEN5_3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_start  24
   43570 #define GEN45_3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_start  24
   43571 #define GEN4_3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_start  24
   43572 
   43573 static inline uint32_t ATTRIBUTE_PURE
   43574 _3DSTATE_PIPELINED_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   43575 {
   43576    switch (devinfo->gen) {
   43577    case 10: return 0;
   43578    case 9: return 0;
   43579    case 8: return 0;
   43580    case 7:
   43581       if (devinfo->is_haswell) {
   43582          return 0;
   43583       } else {
   43584          return 0;
   43585       }
   43586    case 6: return 0;
   43587    case 5: return 24;
   43588    case 4:
   43589       if (devinfo->is_g4x) {
   43590          return 24;
   43591       } else {
   43592          return 24;
   43593       }
   43594    default:
   43595       unreachable("Invalid hardware generation");
   43596    }
   43597 }
   43598 
   43599 
   43600 
   43601 /* 3DSTATE_PIPELINED_POINTERS::3D Command Sub Opcode */
   43602 
   43603 
   43604 #define GEN5_3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_bits  8
   43605 #define GEN45_3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_bits  8
   43606 #define GEN4_3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_bits  8
   43607 
   43608 static inline uint32_t ATTRIBUTE_PURE
   43609 _3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   43610 {
   43611    switch (devinfo->gen) {
   43612    case 10: return 0;
   43613    case 9: return 0;
   43614    case 8: return 0;
   43615    case 7:
   43616       if (devinfo->is_haswell) {
   43617          return 0;
   43618       } else {
   43619          return 0;
   43620       }
   43621    case 6: return 0;
   43622    case 5: return 8;
   43623    case 4:
   43624       if (devinfo->is_g4x) {
   43625          return 8;
   43626       } else {
   43627          return 8;
   43628       }
   43629    default:
   43630       unreachable("Invalid hardware generation");
   43631    }
   43632 }
   43633 
   43634 
   43635 
   43636 #define GEN5_3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_start  16
   43637 #define GEN45_3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_start  16
   43638 #define GEN4_3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_start  16
   43639 
   43640 static inline uint32_t ATTRIBUTE_PURE
   43641 _3DSTATE_PIPELINED_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   43642 {
   43643    switch (devinfo->gen) {
   43644    case 10: return 0;
   43645    case 9: return 0;
   43646    case 8: return 0;
   43647    case 7:
   43648       if (devinfo->is_haswell) {
   43649          return 0;
   43650       } else {
   43651          return 0;
   43652       }
   43653    case 6: return 0;
   43654    case 5: return 16;
   43655    case 4:
   43656       if (devinfo->is_g4x) {
   43657          return 16;
   43658       } else {
   43659          return 16;
   43660       }
   43661    default:
   43662       unreachable("Invalid hardware generation");
   43663    }
   43664 }
   43665 
   43666 
   43667 
   43668 /* 3DSTATE_PIPELINED_POINTERS::Clip Enable */
   43669 
   43670 
   43671 #define GEN5_3DSTATE_PIPELINED_POINTERS_ClipEnable_bits  1
   43672 #define GEN45_3DSTATE_PIPELINED_POINTERS_ClipEnable_bits  1
   43673 #define GEN4_3DSTATE_PIPELINED_POINTERS_ClipEnable_bits  1
   43674 
   43675 static inline uint32_t ATTRIBUTE_PURE
   43676 _3DSTATE_PIPELINED_POINTERS_ClipEnable_bits(const struct gen_device_info *devinfo)
   43677 {
   43678    switch (devinfo->gen) {
   43679    case 10: return 0;
   43680    case 9: return 0;
   43681    case 8: return 0;
   43682    case 7:
   43683       if (devinfo->is_haswell) {
   43684          return 0;
   43685       } else {
   43686          return 0;
   43687       }
   43688    case 6: return 0;
   43689    case 5: return 1;
   43690    case 4:
   43691       if (devinfo->is_g4x) {
   43692          return 1;
   43693       } else {
   43694          return 1;
   43695       }
   43696    default:
   43697       unreachable("Invalid hardware generation");
   43698    }
   43699 }
   43700 
   43701 
   43702 
   43703 #define GEN5_3DSTATE_PIPELINED_POINTERS_ClipEnable_start  96
   43704 #define GEN45_3DSTATE_PIPELINED_POINTERS_ClipEnable_start  96
   43705 #define GEN4_3DSTATE_PIPELINED_POINTERS_ClipEnable_start  96
   43706 
   43707 static inline uint32_t ATTRIBUTE_PURE
   43708 _3DSTATE_PIPELINED_POINTERS_ClipEnable_start(const struct gen_device_info *devinfo)
   43709 {
   43710    switch (devinfo->gen) {
   43711    case 10: return 0;
   43712    case 9: return 0;
   43713    case 8: return 0;
   43714    case 7:
   43715       if (devinfo->is_haswell) {
   43716          return 0;
   43717       } else {
   43718          return 0;
   43719       }
   43720    case 6: return 0;
   43721    case 5: return 96;
   43722    case 4:
   43723       if (devinfo->is_g4x) {
   43724          return 96;
   43725       } else {
   43726          return 96;
   43727       }
   43728    default:
   43729       unreachable("Invalid hardware generation");
   43730    }
   43731 }
   43732 
   43733 
   43734 
   43735 /* 3DSTATE_PIPELINED_POINTERS::Command SubType */
   43736 
   43737 
   43738 #define GEN5_3DSTATE_PIPELINED_POINTERS_CommandSubType_bits  2
   43739 #define GEN45_3DSTATE_PIPELINED_POINTERS_CommandSubType_bits  2
   43740 #define GEN4_3DSTATE_PIPELINED_POINTERS_CommandSubType_bits  2
   43741 
   43742 static inline uint32_t ATTRIBUTE_PURE
   43743 _3DSTATE_PIPELINED_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   43744 {
   43745    switch (devinfo->gen) {
   43746    case 10: return 0;
   43747    case 9: return 0;
   43748    case 8: return 0;
   43749    case 7:
   43750       if (devinfo->is_haswell) {
   43751          return 0;
   43752       } else {
   43753          return 0;
   43754       }
   43755    case 6: return 0;
   43756    case 5: return 2;
   43757    case 4:
   43758       if (devinfo->is_g4x) {
   43759          return 2;
   43760       } else {
   43761          return 2;
   43762       }
   43763    default:
   43764       unreachable("Invalid hardware generation");
   43765    }
   43766 }
   43767 
   43768 
   43769 
   43770 #define GEN5_3DSTATE_PIPELINED_POINTERS_CommandSubType_start  27
   43771 #define GEN45_3DSTATE_PIPELINED_POINTERS_CommandSubType_start  27
   43772 #define GEN4_3DSTATE_PIPELINED_POINTERS_CommandSubType_start  27
   43773 
   43774 static inline uint32_t ATTRIBUTE_PURE
   43775 _3DSTATE_PIPELINED_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   43776 {
   43777    switch (devinfo->gen) {
   43778    case 10: return 0;
   43779    case 9: return 0;
   43780    case 8: return 0;
   43781    case 7:
   43782       if (devinfo->is_haswell) {
   43783          return 0;
   43784       } else {
   43785          return 0;
   43786       }
   43787    case 6: return 0;
   43788    case 5: return 27;
   43789    case 4:
   43790       if (devinfo->is_g4x) {
   43791          return 27;
   43792       } else {
   43793          return 27;
   43794       }
   43795    default:
   43796       unreachable("Invalid hardware generation");
   43797    }
   43798 }
   43799 
   43800 
   43801 
   43802 /* 3DSTATE_PIPELINED_POINTERS::Command Type */
   43803 
   43804 
   43805 #define GEN5_3DSTATE_PIPELINED_POINTERS_CommandType_bits  3
   43806 #define GEN45_3DSTATE_PIPELINED_POINTERS_CommandType_bits  3
   43807 #define GEN4_3DSTATE_PIPELINED_POINTERS_CommandType_bits  3
   43808 
   43809 static inline uint32_t ATTRIBUTE_PURE
   43810 _3DSTATE_PIPELINED_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   43811 {
   43812    switch (devinfo->gen) {
   43813    case 10: return 0;
   43814    case 9: return 0;
   43815    case 8: return 0;
   43816    case 7:
   43817       if (devinfo->is_haswell) {
   43818          return 0;
   43819       } else {
   43820          return 0;
   43821       }
   43822    case 6: return 0;
   43823    case 5: return 3;
   43824    case 4:
   43825       if (devinfo->is_g4x) {
   43826          return 3;
   43827       } else {
   43828          return 3;
   43829       }
   43830    default:
   43831       unreachable("Invalid hardware generation");
   43832    }
   43833 }
   43834 
   43835 
   43836 
   43837 #define GEN5_3DSTATE_PIPELINED_POINTERS_CommandType_start  29
   43838 #define GEN45_3DSTATE_PIPELINED_POINTERS_CommandType_start  29
   43839 #define GEN4_3DSTATE_PIPELINED_POINTERS_CommandType_start  29
   43840 
   43841 static inline uint32_t ATTRIBUTE_PURE
   43842 _3DSTATE_PIPELINED_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   43843 {
   43844    switch (devinfo->gen) {
   43845    case 10: return 0;
   43846    case 9: return 0;
   43847    case 8: return 0;
   43848    case 7:
   43849       if (devinfo->is_haswell) {
   43850          return 0;
   43851       } else {
   43852          return 0;
   43853       }
   43854    case 6: return 0;
   43855    case 5: return 29;
   43856    case 4:
   43857       if (devinfo->is_g4x) {
   43858          return 29;
   43859       } else {
   43860          return 29;
   43861       }
   43862    default:
   43863       unreachable("Invalid hardware generation");
   43864    }
   43865 }
   43866 
   43867 
   43868 
   43869 /* 3DSTATE_PIPELINED_POINTERS::DWord Length */
   43870 
   43871 
   43872 #define GEN5_3DSTATE_PIPELINED_POINTERS_DWordLength_bits  8
   43873 #define GEN45_3DSTATE_PIPELINED_POINTERS_DWordLength_bits  8
   43874 #define GEN4_3DSTATE_PIPELINED_POINTERS_DWordLength_bits  8
   43875 
   43876 static inline uint32_t ATTRIBUTE_PURE
   43877 _3DSTATE_PIPELINED_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   43878 {
   43879    switch (devinfo->gen) {
   43880    case 10: return 0;
   43881    case 9: return 0;
   43882    case 8: return 0;
   43883    case 7:
   43884       if (devinfo->is_haswell) {
   43885          return 0;
   43886       } else {
   43887          return 0;
   43888       }
   43889    case 6: return 0;
   43890    case 5: return 8;
   43891    case 4:
   43892       if (devinfo->is_g4x) {
   43893          return 8;
   43894       } else {
   43895          return 8;
   43896       }
   43897    default:
   43898       unreachable("Invalid hardware generation");
   43899    }
   43900 }
   43901 
   43902 
   43903 
   43904 #define GEN5_3DSTATE_PIPELINED_POINTERS_DWordLength_start  0
   43905 #define GEN45_3DSTATE_PIPELINED_POINTERS_DWordLength_start  0
   43906 #define GEN4_3DSTATE_PIPELINED_POINTERS_DWordLength_start  0
   43907 
   43908 static inline uint32_t ATTRIBUTE_PURE
   43909 _3DSTATE_PIPELINED_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   43910 {
   43911    switch (devinfo->gen) {
   43912    case 10: return 0;
   43913    case 9: return 0;
   43914    case 8: return 0;
   43915    case 7:
   43916       if (devinfo->is_haswell) {
   43917          return 0;
   43918       } else {
   43919          return 0;
   43920       }
   43921    case 6: return 0;
   43922    case 5: return 0;
   43923    case 4:
   43924       if (devinfo->is_g4x) {
   43925          return 0;
   43926       } else {
   43927          return 0;
   43928       }
   43929    default:
   43930       unreachable("Invalid hardware generation");
   43931    }
   43932 }
   43933 
   43934 
   43935 
   43936 /* 3DSTATE_PIPELINED_POINTERS::GS Enable */
   43937 
   43938 
   43939 #define GEN5_3DSTATE_PIPELINED_POINTERS_GSEnable_bits  1
   43940 #define GEN45_3DSTATE_PIPELINED_POINTERS_GSEnable_bits  1
   43941 #define GEN4_3DSTATE_PIPELINED_POINTERS_GSEnable_bits  1
   43942 
   43943 static inline uint32_t ATTRIBUTE_PURE
   43944 _3DSTATE_PIPELINED_POINTERS_GSEnable_bits(const struct gen_device_info *devinfo)
   43945 {
   43946    switch (devinfo->gen) {
   43947    case 10: return 0;
   43948    case 9: return 0;
   43949    case 8: return 0;
   43950    case 7:
   43951       if (devinfo->is_haswell) {
   43952          return 0;
   43953       } else {
   43954          return 0;
   43955       }
   43956    case 6: return 0;
   43957    case 5: return 1;
   43958    case 4:
   43959       if (devinfo->is_g4x) {
   43960          return 1;
   43961       } else {
   43962          return 1;
   43963       }
   43964    default:
   43965       unreachable("Invalid hardware generation");
   43966    }
   43967 }
   43968 
   43969 
   43970 
   43971 #define GEN5_3DSTATE_PIPELINED_POINTERS_GSEnable_start  64
   43972 #define GEN45_3DSTATE_PIPELINED_POINTERS_GSEnable_start  64
   43973 #define GEN4_3DSTATE_PIPELINED_POINTERS_GSEnable_start  64
   43974 
   43975 static inline uint32_t ATTRIBUTE_PURE
   43976 _3DSTATE_PIPELINED_POINTERS_GSEnable_start(const struct gen_device_info *devinfo)
   43977 {
   43978    switch (devinfo->gen) {
   43979    case 10: return 0;
   43980    case 9: return 0;
   43981    case 8: return 0;
   43982    case 7:
   43983       if (devinfo->is_haswell) {
   43984          return 0;
   43985       } else {
   43986          return 0;
   43987       }
   43988    case 6: return 0;
   43989    case 5: return 64;
   43990    case 4:
   43991       if (devinfo->is_g4x) {
   43992          return 64;
   43993       } else {
   43994          return 64;
   43995       }
   43996    default:
   43997       unreachable("Invalid hardware generation");
   43998    }
   43999 }
   44000 
   44001 
   44002 
   44003 /* 3DSTATE_PIPELINED_POINTERS::Pointer to CLIP State */
   44004 
   44005 
   44006 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_bits  27
   44007 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_bits  27
   44008 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_bits  27
   44009 
   44010 static inline uint32_t ATTRIBUTE_PURE
   44011 _3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_bits(const struct gen_device_info *devinfo)
   44012 {
   44013    switch (devinfo->gen) {
   44014    case 10: return 0;
   44015    case 9: return 0;
   44016    case 8: return 0;
   44017    case 7:
   44018       if (devinfo->is_haswell) {
   44019          return 0;
   44020       } else {
   44021          return 0;
   44022       }
   44023    case 6: return 0;
   44024    case 5: return 27;
   44025    case 4:
   44026       if (devinfo->is_g4x) {
   44027          return 27;
   44028       } else {
   44029          return 27;
   44030       }
   44031    default:
   44032       unreachable("Invalid hardware generation");
   44033    }
   44034 }
   44035 
   44036 
   44037 
   44038 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_start  101
   44039 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_start  101
   44040 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_start  101
   44041 
   44042 static inline uint32_t ATTRIBUTE_PURE
   44043 _3DSTATE_PIPELINED_POINTERS_PointertoCLIPState_start(const struct gen_device_info *devinfo)
   44044 {
   44045    switch (devinfo->gen) {
   44046    case 10: return 0;
   44047    case 9: return 0;
   44048    case 8: return 0;
   44049    case 7:
   44050       if (devinfo->is_haswell) {
   44051          return 0;
   44052       } else {
   44053          return 0;
   44054       }
   44055    case 6: return 0;
   44056    case 5: return 101;
   44057    case 4:
   44058       if (devinfo->is_g4x) {
   44059          return 101;
   44060       } else {
   44061          return 101;
   44062       }
   44063    default:
   44064       unreachable("Invalid hardware generation");
   44065    }
   44066 }
   44067 
   44068 
   44069 
   44070 /* 3DSTATE_PIPELINED_POINTERS::Pointer to Color Calc State */
   44071 
   44072 
   44073 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_bits  27
   44074 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_bits  27
   44075 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_bits  27
   44076 
   44077 static inline uint32_t ATTRIBUTE_PURE
   44078 _3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_bits(const struct gen_device_info *devinfo)
   44079 {
   44080    switch (devinfo->gen) {
   44081    case 10: return 0;
   44082    case 9: return 0;
   44083    case 8: return 0;
   44084    case 7:
   44085       if (devinfo->is_haswell) {
   44086          return 0;
   44087       } else {
   44088          return 0;
   44089       }
   44090    case 6: return 0;
   44091    case 5: return 27;
   44092    case 4:
   44093       if (devinfo->is_g4x) {
   44094          return 27;
   44095       } else {
   44096          return 27;
   44097       }
   44098    default:
   44099       unreachable("Invalid hardware generation");
   44100    }
   44101 }
   44102 
   44103 
   44104 
   44105 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_start  197
   44106 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_start  197
   44107 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_start  197
   44108 
   44109 static inline uint32_t ATTRIBUTE_PURE
   44110 _3DSTATE_PIPELINED_POINTERS_PointertoColorCalcState_start(const struct gen_device_info *devinfo)
   44111 {
   44112    switch (devinfo->gen) {
   44113    case 10: return 0;
   44114    case 9: return 0;
   44115    case 8: return 0;
   44116    case 7:
   44117       if (devinfo->is_haswell) {
   44118          return 0;
   44119       } else {
   44120          return 0;
   44121       }
   44122    case 6: return 0;
   44123    case 5: return 197;
   44124    case 4:
   44125       if (devinfo->is_g4x) {
   44126          return 197;
   44127       } else {
   44128          return 197;
   44129       }
   44130    default:
   44131       unreachable("Invalid hardware generation");
   44132    }
   44133 }
   44134 
   44135 
   44136 
   44137 /* 3DSTATE_PIPELINED_POINTERS::Pointer to GS State */
   44138 
   44139 
   44140 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoGSState_bits  27
   44141 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoGSState_bits  27
   44142 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoGSState_bits  27
   44143 
   44144 static inline uint32_t ATTRIBUTE_PURE
   44145 _3DSTATE_PIPELINED_POINTERS_PointertoGSState_bits(const struct gen_device_info *devinfo)
   44146 {
   44147    switch (devinfo->gen) {
   44148    case 10: return 0;
   44149    case 9: return 0;
   44150    case 8: return 0;
   44151    case 7:
   44152       if (devinfo->is_haswell) {
   44153          return 0;
   44154       } else {
   44155          return 0;
   44156       }
   44157    case 6: return 0;
   44158    case 5: return 27;
   44159    case 4:
   44160       if (devinfo->is_g4x) {
   44161          return 27;
   44162       } else {
   44163          return 27;
   44164       }
   44165    default:
   44166       unreachable("Invalid hardware generation");
   44167    }
   44168 }
   44169 
   44170 
   44171 
   44172 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoGSState_start  69
   44173 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoGSState_start  69
   44174 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoGSState_start  69
   44175 
   44176 static inline uint32_t ATTRIBUTE_PURE
   44177 _3DSTATE_PIPELINED_POINTERS_PointertoGSState_start(const struct gen_device_info *devinfo)
   44178 {
   44179    switch (devinfo->gen) {
   44180    case 10: return 0;
   44181    case 9: return 0;
   44182    case 8: return 0;
   44183    case 7:
   44184       if (devinfo->is_haswell) {
   44185          return 0;
   44186       } else {
   44187          return 0;
   44188       }
   44189    case 6: return 0;
   44190    case 5: return 69;
   44191    case 4:
   44192       if (devinfo->is_g4x) {
   44193          return 69;
   44194       } else {
   44195          return 69;
   44196       }
   44197    default:
   44198       unreachable("Invalid hardware generation");
   44199    }
   44200 }
   44201 
   44202 
   44203 
   44204 /* 3DSTATE_PIPELINED_POINTERS::Pointer to SF State */
   44205 
   44206 
   44207 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoSFState_bits  27
   44208 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoSFState_bits  27
   44209 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoSFState_bits  27
   44210 
   44211 static inline uint32_t ATTRIBUTE_PURE
   44212 _3DSTATE_PIPELINED_POINTERS_PointertoSFState_bits(const struct gen_device_info *devinfo)
   44213 {
   44214    switch (devinfo->gen) {
   44215    case 10: return 0;
   44216    case 9: return 0;
   44217    case 8: return 0;
   44218    case 7:
   44219       if (devinfo->is_haswell) {
   44220          return 0;
   44221       } else {
   44222          return 0;
   44223       }
   44224    case 6: return 0;
   44225    case 5: return 27;
   44226    case 4:
   44227       if (devinfo->is_g4x) {
   44228          return 27;
   44229       } else {
   44230          return 27;
   44231       }
   44232    default:
   44233       unreachable("Invalid hardware generation");
   44234    }
   44235 }
   44236 
   44237 
   44238 
   44239 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoSFState_start  133
   44240 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoSFState_start  133
   44241 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoSFState_start  133
   44242 
   44243 static inline uint32_t ATTRIBUTE_PURE
   44244 _3DSTATE_PIPELINED_POINTERS_PointertoSFState_start(const struct gen_device_info *devinfo)
   44245 {
   44246    switch (devinfo->gen) {
   44247    case 10: return 0;
   44248    case 9: return 0;
   44249    case 8: return 0;
   44250    case 7:
   44251       if (devinfo->is_haswell) {
   44252          return 0;
   44253       } else {
   44254          return 0;
   44255       }
   44256    case 6: return 0;
   44257    case 5: return 133;
   44258    case 4:
   44259       if (devinfo->is_g4x) {
   44260          return 133;
   44261       } else {
   44262          return 133;
   44263       }
   44264    default:
   44265       unreachable("Invalid hardware generation");
   44266    }
   44267 }
   44268 
   44269 
   44270 
   44271 /* 3DSTATE_PIPELINED_POINTERS::Pointer to VS State */
   44272 
   44273 
   44274 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoVSState_bits  27
   44275 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoVSState_bits  27
   44276 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoVSState_bits  27
   44277 
   44278 static inline uint32_t ATTRIBUTE_PURE
   44279 _3DSTATE_PIPELINED_POINTERS_PointertoVSState_bits(const struct gen_device_info *devinfo)
   44280 {
   44281    switch (devinfo->gen) {
   44282    case 10: return 0;
   44283    case 9: return 0;
   44284    case 8: return 0;
   44285    case 7:
   44286       if (devinfo->is_haswell) {
   44287          return 0;
   44288       } else {
   44289          return 0;
   44290       }
   44291    case 6: return 0;
   44292    case 5: return 27;
   44293    case 4:
   44294       if (devinfo->is_g4x) {
   44295          return 27;
   44296       } else {
   44297          return 27;
   44298       }
   44299    default:
   44300       unreachable("Invalid hardware generation");
   44301    }
   44302 }
   44303 
   44304 
   44305 
   44306 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoVSState_start  37
   44307 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoVSState_start  37
   44308 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoVSState_start  37
   44309 
   44310 static inline uint32_t ATTRIBUTE_PURE
   44311 _3DSTATE_PIPELINED_POINTERS_PointertoVSState_start(const struct gen_device_info *devinfo)
   44312 {
   44313    switch (devinfo->gen) {
   44314    case 10: return 0;
   44315    case 9: return 0;
   44316    case 8: return 0;
   44317    case 7:
   44318       if (devinfo->is_haswell) {
   44319          return 0;
   44320       } else {
   44321          return 0;
   44322       }
   44323    case 6: return 0;
   44324    case 5: return 37;
   44325    case 4:
   44326       if (devinfo->is_g4x) {
   44327          return 37;
   44328       } else {
   44329          return 37;
   44330       }
   44331    default:
   44332       unreachable("Invalid hardware generation");
   44333    }
   44334 }
   44335 
   44336 
   44337 
   44338 /* 3DSTATE_PIPELINED_POINTERS::Pointer to WM State */
   44339 
   44340 
   44341 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoWMState_bits  27
   44342 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoWMState_bits  27
   44343 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoWMState_bits  27
   44344 
   44345 static inline uint32_t ATTRIBUTE_PURE
   44346 _3DSTATE_PIPELINED_POINTERS_PointertoWMState_bits(const struct gen_device_info *devinfo)
   44347 {
   44348    switch (devinfo->gen) {
   44349    case 10: return 0;
   44350    case 9: return 0;
   44351    case 8: return 0;
   44352    case 7:
   44353       if (devinfo->is_haswell) {
   44354          return 0;
   44355       } else {
   44356          return 0;
   44357       }
   44358    case 6: return 0;
   44359    case 5: return 27;
   44360    case 4:
   44361       if (devinfo->is_g4x) {
   44362          return 27;
   44363       } else {
   44364          return 27;
   44365       }
   44366    default:
   44367       unreachable("Invalid hardware generation");
   44368    }
   44369 }
   44370 
   44371 
   44372 
   44373 #define GEN5_3DSTATE_PIPELINED_POINTERS_PointertoWMState_start  165
   44374 #define GEN45_3DSTATE_PIPELINED_POINTERS_PointertoWMState_start  165
   44375 #define GEN4_3DSTATE_PIPELINED_POINTERS_PointertoWMState_start  165
   44376 
   44377 static inline uint32_t ATTRIBUTE_PURE
   44378 _3DSTATE_PIPELINED_POINTERS_PointertoWMState_start(const struct gen_device_info *devinfo)
   44379 {
   44380    switch (devinfo->gen) {
   44381    case 10: return 0;
   44382    case 9: return 0;
   44383    case 8: return 0;
   44384    case 7:
   44385       if (devinfo->is_haswell) {
   44386          return 0;
   44387       } else {
   44388          return 0;
   44389       }
   44390    case 6: return 0;
   44391    case 5: return 165;
   44392    case 4:
   44393       if (devinfo->is_g4x) {
   44394          return 165;
   44395       } else {
   44396          return 165;
   44397       }
   44398    default:
   44399       unreachable("Invalid hardware generation");
   44400    }
   44401 }
   44402 
   44403 
   44404 
   44405 /* 3DSTATE_POLY_STIPPLE_OFFSET */
   44406 
   44407 
   44408 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44409 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44410 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44411 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44412 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44413 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44414 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44415 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44416 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_length  2
   44417 
   44418 static inline uint32_t ATTRIBUTE_PURE
   44419 _3DSTATE_POLY_STIPPLE_OFFSET_length(const struct gen_device_info *devinfo)
   44420 {
   44421    switch (devinfo->gen) {
   44422    case 10: return 2;
   44423    case 9: return 2;
   44424    case 8: return 2;
   44425    case 7:
   44426       if (devinfo->is_haswell) {
   44427          return 2;
   44428       } else {
   44429          return 2;
   44430       }
   44431    case 6: return 2;
   44432    case 5: return 2;
   44433    case 4:
   44434       if (devinfo->is_g4x) {
   44435          return 2;
   44436       } else {
   44437          return 2;
   44438       }
   44439    default:
   44440       unreachable("Invalid hardware generation");
   44441    }
   44442 }
   44443 
   44444 
   44445 
   44446 /* 3DSTATE_POLY_STIPPLE_OFFSET::3D Command Opcode */
   44447 
   44448 
   44449 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44450 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44451 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44452 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44453 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44454 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44455 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44456 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44457 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits  3
   44458 
   44459 static inline uint32_t ATTRIBUTE_PURE
   44460 _3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   44461 {
   44462    switch (devinfo->gen) {
   44463    case 10: return 3;
   44464    case 9: return 3;
   44465    case 8: return 3;
   44466    case 7:
   44467       if (devinfo->is_haswell) {
   44468          return 3;
   44469       } else {
   44470          return 3;
   44471       }
   44472    case 6: return 3;
   44473    case 5: return 3;
   44474    case 4:
   44475       if (devinfo->is_g4x) {
   44476          return 3;
   44477       } else {
   44478          return 3;
   44479       }
   44480    default:
   44481       unreachable("Invalid hardware generation");
   44482    }
   44483 }
   44484 
   44485 
   44486 
   44487 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44488 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44489 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44490 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44491 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44492 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44493 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44494 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44495 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start  24
   44496 
   44497 static inline uint32_t ATTRIBUTE_PURE
   44498 _3DSTATE_POLY_STIPPLE_OFFSET_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   44499 {
   44500    switch (devinfo->gen) {
   44501    case 10: return 24;
   44502    case 9: return 24;
   44503    case 8: return 24;
   44504    case 7:
   44505       if (devinfo->is_haswell) {
   44506          return 24;
   44507       } else {
   44508          return 24;
   44509       }
   44510    case 6: return 24;
   44511    case 5: return 24;
   44512    case 4:
   44513       if (devinfo->is_g4x) {
   44514          return 24;
   44515       } else {
   44516          return 24;
   44517       }
   44518    default:
   44519       unreachable("Invalid hardware generation");
   44520    }
   44521 }
   44522 
   44523 
   44524 
   44525 /* 3DSTATE_POLY_STIPPLE_OFFSET::3D Command Sub Opcode */
   44526 
   44527 
   44528 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44529 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44530 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44531 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44532 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44533 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44534 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44535 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44536 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits  8
   44537 
   44538 static inline uint32_t ATTRIBUTE_PURE
   44539 _3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   44540 {
   44541    switch (devinfo->gen) {
   44542    case 10: return 8;
   44543    case 9: return 8;
   44544    case 8: return 8;
   44545    case 7:
   44546       if (devinfo->is_haswell) {
   44547          return 8;
   44548       } else {
   44549          return 8;
   44550       }
   44551    case 6: return 8;
   44552    case 5: return 8;
   44553    case 4:
   44554       if (devinfo->is_g4x) {
   44555          return 8;
   44556       } else {
   44557          return 8;
   44558       }
   44559    default:
   44560       unreachable("Invalid hardware generation");
   44561    }
   44562 }
   44563 
   44564 
   44565 
   44566 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44567 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44568 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44569 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44570 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44571 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44572 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44573 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44574 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start  16
   44575 
   44576 static inline uint32_t ATTRIBUTE_PURE
   44577 _3DSTATE_POLY_STIPPLE_OFFSET_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   44578 {
   44579    switch (devinfo->gen) {
   44580    case 10: return 16;
   44581    case 9: return 16;
   44582    case 8: return 16;
   44583    case 7:
   44584       if (devinfo->is_haswell) {
   44585          return 16;
   44586       } else {
   44587          return 16;
   44588       }
   44589    case 6: return 16;
   44590    case 5: return 16;
   44591    case 4:
   44592       if (devinfo->is_g4x) {
   44593          return 16;
   44594       } else {
   44595          return 16;
   44596       }
   44597    default:
   44598       unreachable("Invalid hardware generation");
   44599    }
   44600 }
   44601 
   44602 
   44603 
   44604 /* 3DSTATE_POLY_STIPPLE_OFFSET::Command SubType */
   44605 
   44606 
   44607 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44608 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44609 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44610 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44611 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44612 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44613 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44614 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44615 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits  2
   44616 
   44617 static inline uint32_t ATTRIBUTE_PURE
   44618 _3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_bits(const struct gen_device_info *devinfo)
   44619 {
   44620    switch (devinfo->gen) {
   44621    case 10: return 2;
   44622    case 9: return 2;
   44623    case 8: return 2;
   44624    case 7:
   44625       if (devinfo->is_haswell) {
   44626          return 2;
   44627       } else {
   44628          return 2;
   44629       }
   44630    case 6: return 2;
   44631    case 5: return 2;
   44632    case 4:
   44633       if (devinfo->is_g4x) {
   44634          return 2;
   44635       } else {
   44636          return 2;
   44637       }
   44638    default:
   44639       unreachable("Invalid hardware generation");
   44640    }
   44641 }
   44642 
   44643 
   44644 
   44645 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44646 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44647 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44648 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44649 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44650 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44651 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44652 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44653 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start  27
   44654 
   44655 static inline uint32_t ATTRIBUTE_PURE
   44656 _3DSTATE_POLY_STIPPLE_OFFSET_CommandSubType_start(const struct gen_device_info *devinfo)
   44657 {
   44658    switch (devinfo->gen) {
   44659    case 10: return 27;
   44660    case 9: return 27;
   44661    case 8: return 27;
   44662    case 7:
   44663       if (devinfo->is_haswell) {
   44664          return 27;
   44665       } else {
   44666          return 27;
   44667       }
   44668    case 6: return 27;
   44669    case 5: return 27;
   44670    case 4:
   44671       if (devinfo->is_g4x) {
   44672          return 27;
   44673       } else {
   44674          return 27;
   44675       }
   44676    default:
   44677       unreachable("Invalid hardware generation");
   44678    }
   44679 }
   44680 
   44681 
   44682 
   44683 /* 3DSTATE_POLY_STIPPLE_OFFSET::Command Type */
   44684 
   44685 
   44686 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44687 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44688 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44689 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44690 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44691 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44692 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44693 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44694 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits  3
   44695 
   44696 static inline uint32_t ATTRIBUTE_PURE
   44697 _3DSTATE_POLY_STIPPLE_OFFSET_CommandType_bits(const struct gen_device_info *devinfo)
   44698 {
   44699    switch (devinfo->gen) {
   44700    case 10: return 3;
   44701    case 9: return 3;
   44702    case 8: return 3;
   44703    case 7:
   44704       if (devinfo->is_haswell) {
   44705          return 3;
   44706       } else {
   44707          return 3;
   44708       }
   44709    case 6: return 3;
   44710    case 5: return 3;
   44711    case 4:
   44712       if (devinfo->is_g4x) {
   44713          return 3;
   44714       } else {
   44715          return 3;
   44716       }
   44717    default:
   44718       unreachable("Invalid hardware generation");
   44719    }
   44720 }
   44721 
   44722 
   44723 
   44724 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44725 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44726 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44727 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44728 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44729 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44730 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44731 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44732 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start  29
   44733 
   44734 static inline uint32_t ATTRIBUTE_PURE
   44735 _3DSTATE_POLY_STIPPLE_OFFSET_CommandType_start(const struct gen_device_info *devinfo)
   44736 {
   44737    switch (devinfo->gen) {
   44738    case 10: return 29;
   44739    case 9: return 29;
   44740    case 8: return 29;
   44741    case 7:
   44742       if (devinfo->is_haswell) {
   44743          return 29;
   44744       } else {
   44745          return 29;
   44746       }
   44747    case 6: return 29;
   44748    case 5: return 29;
   44749    case 4:
   44750       if (devinfo->is_g4x) {
   44751          return 29;
   44752       } else {
   44753          return 29;
   44754       }
   44755    default:
   44756       unreachable("Invalid hardware generation");
   44757    }
   44758 }
   44759 
   44760 
   44761 
   44762 /* 3DSTATE_POLY_STIPPLE_OFFSET::DWord Length */
   44763 
   44764 
   44765 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44766 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44767 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44768 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44769 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44770 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44771 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44772 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44773 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits  8
   44774 
   44775 static inline uint32_t ATTRIBUTE_PURE
   44776 _3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_bits(const struct gen_device_info *devinfo)
   44777 {
   44778    switch (devinfo->gen) {
   44779    case 10: return 8;
   44780    case 9: return 8;
   44781    case 8: return 8;
   44782    case 7:
   44783       if (devinfo->is_haswell) {
   44784          return 8;
   44785       } else {
   44786          return 8;
   44787       }
   44788    case 6: return 8;
   44789    case 5: return 8;
   44790    case 4:
   44791       if (devinfo->is_g4x) {
   44792          return 8;
   44793       } else {
   44794          return 8;
   44795       }
   44796    default:
   44797       unreachable("Invalid hardware generation");
   44798    }
   44799 }
   44800 
   44801 
   44802 
   44803 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44804 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44805 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44806 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44807 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44808 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44809 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44810 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44811 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start  0
   44812 
   44813 static inline uint32_t ATTRIBUTE_PURE
   44814 _3DSTATE_POLY_STIPPLE_OFFSET_DWordLength_start(const struct gen_device_info *devinfo)
   44815 {
   44816    switch (devinfo->gen) {
   44817    case 10: return 0;
   44818    case 9: return 0;
   44819    case 8: return 0;
   44820    case 7:
   44821       if (devinfo->is_haswell) {
   44822          return 0;
   44823       } else {
   44824          return 0;
   44825       }
   44826    case 6: return 0;
   44827    case 5: return 0;
   44828    case 4:
   44829       if (devinfo->is_g4x) {
   44830          return 0;
   44831       } else {
   44832          return 0;
   44833       }
   44834    default:
   44835       unreachable("Invalid hardware generation");
   44836    }
   44837 }
   44838 
   44839 
   44840 
   44841 /* 3DSTATE_POLY_STIPPLE_OFFSET::Polygon Stipple X Offset */
   44842 
   44843 
   44844 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44845 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44846 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44847 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44848 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44849 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44850 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44851 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44852 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits  5
   44853 
   44854 static inline uint32_t ATTRIBUTE_PURE
   44855 _3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_bits(const struct gen_device_info *devinfo)
   44856 {
   44857    switch (devinfo->gen) {
   44858    case 10: return 5;
   44859    case 9: return 5;
   44860    case 8: return 5;
   44861    case 7:
   44862       if (devinfo->is_haswell) {
   44863          return 5;
   44864       } else {
   44865          return 5;
   44866       }
   44867    case 6: return 5;
   44868    case 5: return 5;
   44869    case 4:
   44870       if (devinfo->is_g4x) {
   44871          return 5;
   44872       } else {
   44873          return 5;
   44874       }
   44875    default:
   44876       unreachable("Invalid hardware generation");
   44877    }
   44878 }
   44879 
   44880 
   44881 
   44882 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44883 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44884 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44885 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44886 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44887 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44888 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44889 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44890 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start  40
   44891 
   44892 static inline uint32_t ATTRIBUTE_PURE
   44893 _3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleXOffset_start(const struct gen_device_info *devinfo)
   44894 {
   44895    switch (devinfo->gen) {
   44896    case 10: return 40;
   44897    case 9: return 40;
   44898    case 8: return 40;
   44899    case 7:
   44900       if (devinfo->is_haswell) {
   44901          return 40;
   44902       } else {
   44903          return 40;
   44904       }
   44905    case 6: return 40;
   44906    case 5: return 40;
   44907    case 4:
   44908       if (devinfo->is_g4x) {
   44909          return 40;
   44910       } else {
   44911          return 40;
   44912       }
   44913    default:
   44914       unreachable("Invalid hardware generation");
   44915    }
   44916 }
   44917 
   44918 
   44919 
   44920 /* 3DSTATE_POLY_STIPPLE_OFFSET::Polygon Stipple Y Offset */
   44921 
   44922 
   44923 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44924 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44925 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44926 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44927 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44928 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44929 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44930 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44931 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits  5
   44932 
   44933 static inline uint32_t ATTRIBUTE_PURE
   44934 _3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_bits(const struct gen_device_info *devinfo)
   44935 {
   44936    switch (devinfo->gen) {
   44937    case 10: return 5;
   44938    case 9: return 5;
   44939    case 8: return 5;
   44940    case 7:
   44941       if (devinfo->is_haswell) {
   44942          return 5;
   44943       } else {
   44944          return 5;
   44945       }
   44946    case 6: return 5;
   44947    case 5: return 5;
   44948    case 4:
   44949       if (devinfo->is_g4x) {
   44950          return 5;
   44951       } else {
   44952          return 5;
   44953       }
   44954    default:
   44955       unreachable("Invalid hardware generation");
   44956    }
   44957 }
   44958 
   44959 
   44960 
   44961 #define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44962 #define GEN9_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44963 #define GEN8_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44964 #define GEN75_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44965 #define GEN7_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44966 #define GEN6_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44967 #define GEN5_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44968 #define GEN45_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44969 #define GEN4_3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start  32
   44970 
   44971 static inline uint32_t ATTRIBUTE_PURE
   44972 _3DSTATE_POLY_STIPPLE_OFFSET_PolygonStippleYOffset_start(const struct gen_device_info *devinfo)
   44973 {
   44974    switch (devinfo->gen) {
   44975    case 10: return 32;
   44976    case 9: return 32;
   44977    case 8: return 32;
   44978    case 7:
   44979       if (devinfo->is_haswell) {
   44980          return 32;
   44981       } else {
   44982          return 32;
   44983       }
   44984    case 6: return 32;
   44985    case 5: return 32;
   44986    case 4:
   44987       if (devinfo->is_g4x) {
   44988          return 32;
   44989       } else {
   44990          return 32;
   44991       }
   44992    default:
   44993       unreachable("Invalid hardware generation");
   44994    }
   44995 }
   44996 
   44997 
   44998 
   44999 /* 3DSTATE_POLY_STIPPLE_PATTERN */
   45000 
   45001 
   45002 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45003 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45004 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45005 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45006 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45007 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45008 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45009 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45010 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_length  33
   45011 
   45012 static inline uint32_t ATTRIBUTE_PURE
   45013 _3DSTATE_POLY_STIPPLE_PATTERN_length(const struct gen_device_info *devinfo)
   45014 {
   45015    switch (devinfo->gen) {
   45016    case 10: return 33;
   45017    case 9: return 33;
   45018    case 8: return 33;
   45019    case 7:
   45020       if (devinfo->is_haswell) {
   45021          return 33;
   45022       } else {
   45023          return 33;
   45024       }
   45025    case 6: return 33;
   45026    case 5: return 33;
   45027    case 4:
   45028       if (devinfo->is_g4x) {
   45029          return 33;
   45030       } else {
   45031          return 33;
   45032       }
   45033    default:
   45034       unreachable("Invalid hardware generation");
   45035    }
   45036 }
   45037 
   45038 
   45039 
   45040 /* 3DSTATE_POLY_STIPPLE_PATTERN::3D Command Opcode */
   45041 
   45042 
   45043 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45044 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45045 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45046 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45047 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45048 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45049 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45050 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45051 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits  3
   45052 
   45053 static inline uint32_t ATTRIBUTE_PURE
   45054 _3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   45055 {
   45056    switch (devinfo->gen) {
   45057    case 10: return 3;
   45058    case 9: return 3;
   45059    case 8: return 3;
   45060    case 7:
   45061       if (devinfo->is_haswell) {
   45062          return 3;
   45063       } else {
   45064          return 3;
   45065       }
   45066    case 6: return 3;
   45067    case 5: return 3;
   45068    case 4:
   45069       if (devinfo->is_g4x) {
   45070          return 3;
   45071       } else {
   45072          return 3;
   45073       }
   45074    default:
   45075       unreachable("Invalid hardware generation");
   45076    }
   45077 }
   45078 
   45079 
   45080 
   45081 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45082 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45083 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45084 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45085 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45086 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45087 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45088 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45089 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start  24
   45090 
   45091 static inline uint32_t ATTRIBUTE_PURE
   45092 _3DSTATE_POLY_STIPPLE_PATTERN_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   45093 {
   45094    switch (devinfo->gen) {
   45095    case 10: return 24;
   45096    case 9: return 24;
   45097    case 8: return 24;
   45098    case 7:
   45099       if (devinfo->is_haswell) {
   45100          return 24;
   45101       } else {
   45102          return 24;
   45103       }
   45104    case 6: return 24;
   45105    case 5: return 24;
   45106    case 4:
   45107       if (devinfo->is_g4x) {
   45108          return 24;
   45109       } else {
   45110          return 24;
   45111       }
   45112    default:
   45113       unreachable("Invalid hardware generation");
   45114    }
   45115 }
   45116 
   45117 
   45118 
   45119 /* 3DSTATE_POLY_STIPPLE_PATTERN::3D Command Sub Opcode */
   45120 
   45121 
   45122 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45123 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45124 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45125 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45126 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45127 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45128 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45129 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45130 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits  8
   45131 
   45132 static inline uint32_t ATTRIBUTE_PURE
   45133 _3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   45134 {
   45135    switch (devinfo->gen) {
   45136    case 10: return 8;
   45137    case 9: return 8;
   45138    case 8: return 8;
   45139    case 7:
   45140       if (devinfo->is_haswell) {
   45141          return 8;
   45142       } else {
   45143          return 8;
   45144       }
   45145    case 6: return 8;
   45146    case 5: return 8;
   45147    case 4:
   45148       if (devinfo->is_g4x) {
   45149          return 8;
   45150       } else {
   45151          return 8;
   45152       }
   45153    default:
   45154       unreachable("Invalid hardware generation");
   45155    }
   45156 }
   45157 
   45158 
   45159 
   45160 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45161 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45162 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45163 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45164 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45165 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45166 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45167 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45168 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start  16
   45169 
   45170 static inline uint32_t ATTRIBUTE_PURE
   45171 _3DSTATE_POLY_STIPPLE_PATTERN_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   45172 {
   45173    switch (devinfo->gen) {
   45174    case 10: return 16;
   45175    case 9: return 16;
   45176    case 8: return 16;
   45177    case 7:
   45178       if (devinfo->is_haswell) {
   45179          return 16;
   45180       } else {
   45181          return 16;
   45182       }
   45183    case 6: return 16;
   45184    case 5: return 16;
   45185    case 4:
   45186       if (devinfo->is_g4x) {
   45187          return 16;
   45188       } else {
   45189          return 16;
   45190       }
   45191    default:
   45192       unreachable("Invalid hardware generation");
   45193    }
   45194 }
   45195 
   45196 
   45197 
   45198 /* 3DSTATE_POLY_STIPPLE_PATTERN::Command SubType */
   45199 
   45200 
   45201 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45202 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45203 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45204 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45205 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45206 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45207 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45208 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45209 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits  2
   45210 
   45211 static inline uint32_t ATTRIBUTE_PURE
   45212 _3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_bits(const struct gen_device_info *devinfo)
   45213 {
   45214    switch (devinfo->gen) {
   45215    case 10: return 2;
   45216    case 9: return 2;
   45217    case 8: return 2;
   45218    case 7:
   45219       if (devinfo->is_haswell) {
   45220          return 2;
   45221       } else {
   45222          return 2;
   45223       }
   45224    case 6: return 2;
   45225    case 5: return 2;
   45226    case 4:
   45227       if (devinfo->is_g4x) {
   45228          return 2;
   45229       } else {
   45230          return 2;
   45231       }
   45232    default:
   45233       unreachable("Invalid hardware generation");
   45234    }
   45235 }
   45236 
   45237 
   45238 
   45239 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45240 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45241 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45242 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45243 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45244 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45245 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45246 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45247 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start  27
   45248 
   45249 static inline uint32_t ATTRIBUTE_PURE
   45250 _3DSTATE_POLY_STIPPLE_PATTERN_CommandSubType_start(const struct gen_device_info *devinfo)
   45251 {
   45252    switch (devinfo->gen) {
   45253    case 10: return 27;
   45254    case 9: return 27;
   45255    case 8: return 27;
   45256    case 7:
   45257       if (devinfo->is_haswell) {
   45258          return 27;
   45259       } else {
   45260          return 27;
   45261       }
   45262    case 6: return 27;
   45263    case 5: return 27;
   45264    case 4:
   45265       if (devinfo->is_g4x) {
   45266          return 27;
   45267       } else {
   45268          return 27;
   45269       }
   45270    default:
   45271       unreachable("Invalid hardware generation");
   45272    }
   45273 }
   45274 
   45275 
   45276 
   45277 /* 3DSTATE_POLY_STIPPLE_PATTERN::Command Type */
   45278 
   45279 
   45280 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45281 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45282 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45283 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45284 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45285 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45286 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45287 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45288 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits  3
   45289 
   45290 static inline uint32_t ATTRIBUTE_PURE
   45291 _3DSTATE_POLY_STIPPLE_PATTERN_CommandType_bits(const struct gen_device_info *devinfo)
   45292 {
   45293    switch (devinfo->gen) {
   45294    case 10: return 3;
   45295    case 9: return 3;
   45296    case 8: return 3;
   45297    case 7:
   45298       if (devinfo->is_haswell) {
   45299          return 3;
   45300       } else {
   45301          return 3;
   45302       }
   45303    case 6: return 3;
   45304    case 5: return 3;
   45305    case 4:
   45306       if (devinfo->is_g4x) {
   45307          return 3;
   45308       } else {
   45309          return 3;
   45310       }
   45311    default:
   45312       unreachable("Invalid hardware generation");
   45313    }
   45314 }
   45315 
   45316 
   45317 
   45318 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45319 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45320 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45321 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45322 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45323 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45324 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45325 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45326 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start  29
   45327 
   45328 static inline uint32_t ATTRIBUTE_PURE
   45329 _3DSTATE_POLY_STIPPLE_PATTERN_CommandType_start(const struct gen_device_info *devinfo)
   45330 {
   45331    switch (devinfo->gen) {
   45332    case 10: return 29;
   45333    case 9: return 29;
   45334    case 8: return 29;
   45335    case 7:
   45336       if (devinfo->is_haswell) {
   45337          return 29;
   45338       } else {
   45339          return 29;
   45340       }
   45341    case 6: return 29;
   45342    case 5: return 29;
   45343    case 4:
   45344       if (devinfo->is_g4x) {
   45345          return 29;
   45346       } else {
   45347          return 29;
   45348       }
   45349    default:
   45350       unreachable("Invalid hardware generation");
   45351    }
   45352 }
   45353 
   45354 
   45355 
   45356 /* 3DSTATE_POLY_STIPPLE_PATTERN::DWord Length */
   45357 
   45358 
   45359 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45360 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45361 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45362 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45363 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45364 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45365 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45366 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45367 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits  8
   45368 
   45369 static inline uint32_t ATTRIBUTE_PURE
   45370 _3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_bits(const struct gen_device_info *devinfo)
   45371 {
   45372    switch (devinfo->gen) {
   45373    case 10: return 8;
   45374    case 9: return 8;
   45375    case 8: return 8;
   45376    case 7:
   45377       if (devinfo->is_haswell) {
   45378          return 8;
   45379       } else {
   45380          return 8;
   45381       }
   45382    case 6: return 8;
   45383    case 5: return 8;
   45384    case 4:
   45385       if (devinfo->is_g4x) {
   45386          return 8;
   45387       } else {
   45388          return 8;
   45389       }
   45390    default:
   45391       unreachable("Invalid hardware generation");
   45392    }
   45393 }
   45394 
   45395 
   45396 
   45397 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45398 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45399 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45400 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45401 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45402 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45403 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45404 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45405 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start  0
   45406 
   45407 static inline uint32_t ATTRIBUTE_PURE
   45408 _3DSTATE_POLY_STIPPLE_PATTERN_DWordLength_start(const struct gen_device_info *devinfo)
   45409 {
   45410    switch (devinfo->gen) {
   45411    case 10: return 0;
   45412    case 9: return 0;
   45413    case 8: return 0;
   45414    case 7:
   45415       if (devinfo->is_haswell) {
   45416          return 0;
   45417       } else {
   45418          return 0;
   45419       }
   45420    case 6: return 0;
   45421    case 5: return 0;
   45422    case 4:
   45423       if (devinfo->is_g4x) {
   45424          return 0;
   45425       } else {
   45426          return 0;
   45427       }
   45428    default:
   45429       unreachable("Invalid hardware generation");
   45430    }
   45431 }
   45432 
   45433 
   45434 
   45435 /* 3DSTATE_POLY_STIPPLE_PATTERN::Pattern Row */
   45436 
   45437 
   45438 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45439 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45440 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45441 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45442 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45443 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45444 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45445 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45446 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits  32
   45447 
   45448 static inline uint32_t ATTRIBUTE_PURE
   45449 _3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_bits(const struct gen_device_info *devinfo)
   45450 {
   45451    switch (devinfo->gen) {
   45452    case 10: return 32;
   45453    case 9: return 32;
   45454    case 8: return 32;
   45455    case 7:
   45456       if (devinfo->is_haswell) {
   45457          return 32;
   45458       } else {
   45459          return 32;
   45460       }
   45461    case 6: return 32;
   45462    case 5: return 32;
   45463    case 4:
   45464       if (devinfo->is_g4x) {
   45465          return 32;
   45466       } else {
   45467          return 32;
   45468       }
   45469    default:
   45470       unreachable("Invalid hardware generation");
   45471    }
   45472 }
   45473 
   45474 
   45475 
   45476 #define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45477 #define GEN9_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45478 #define GEN8_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45479 #define GEN75_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45480 #define GEN7_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45481 #define GEN6_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45482 #define GEN5_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45483 #define GEN45_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45484 #define GEN4_3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start  0
   45485 
   45486 static inline uint32_t ATTRIBUTE_PURE
   45487 _3DSTATE_POLY_STIPPLE_PATTERN_PatternRow_start(const struct gen_device_info *devinfo)
   45488 {
   45489    switch (devinfo->gen) {
   45490    case 10: return 0;
   45491    case 9: return 0;
   45492    case 8: return 0;
   45493    case 7:
   45494       if (devinfo->is_haswell) {
   45495          return 0;
   45496       } else {
   45497          return 0;
   45498       }
   45499    case 6: return 0;
   45500    case 5: return 0;
   45501    case 4:
   45502       if (devinfo->is_g4x) {
   45503          return 0;
   45504       } else {
   45505          return 0;
   45506       }
   45507    default:
   45508       unreachable("Invalid hardware generation");
   45509    }
   45510 }
   45511 
   45512 
   45513 
   45514 /* 3DSTATE_PS */
   45515 
   45516 
   45517 #define GEN10_3DSTATE_PS_length  12
   45518 #define GEN9_3DSTATE_PS_length  12
   45519 #define GEN8_3DSTATE_PS_length  12
   45520 #define GEN75_3DSTATE_PS_length  8
   45521 #define GEN7_3DSTATE_PS_length  8
   45522 
   45523 static inline uint32_t ATTRIBUTE_PURE
   45524 _3DSTATE_PS_length(const struct gen_device_info *devinfo)
   45525 {
   45526    switch (devinfo->gen) {
   45527    case 10: return 12;
   45528    case 9: return 12;
   45529    case 8: return 12;
   45530    case 7:
   45531       if (devinfo->is_haswell) {
   45532          return 8;
   45533       } else {
   45534          return 8;
   45535       }
   45536    case 6: return 0;
   45537    case 5: return 0;
   45538    case 4:
   45539       if (devinfo->is_g4x) {
   45540          return 0;
   45541       } else {
   45542          return 0;
   45543       }
   45544    default:
   45545       unreachable("Invalid hardware generation");
   45546    }
   45547 }
   45548 
   45549 
   45550 
   45551 /* 3DSTATE_PS::16 Pixel Dispatch Enable */
   45552 
   45553 
   45554 #define GEN10_3DSTATE_PS_16PixelDispatchEnable_bits  1
   45555 #define GEN9_3DSTATE_PS_16PixelDispatchEnable_bits  1
   45556 #define GEN8_3DSTATE_PS_16PixelDispatchEnable_bits  1
   45557 #define GEN75_3DSTATE_PS_16PixelDispatchEnable_bits  1
   45558 #define GEN7_3DSTATE_PS_16PixelDispatchEnable_bits  1
   45559 
   45560 static inline uint32_t ATTRIBUTE_PURE
   45561 _3DSTATE_PS_16PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   45562 {
   45563    switch (devinfo->gen) {
   45564    case 10: return 1;
   45565    case 9: return 1;
   45566    case 8: return 1;
   45567    case 7:
   45568       if (devinfo->is_haswell) {
   45569          return 1;
   45570       } else {
   45571          return 1;
   45572       }
   45573    case 6: return 0;
   45574    case 5: return 0;
   45575    case 4:
   45576       if (devinfo->is_g4x) {
   45577          return 0;
   45578       } else {
   45579          return 0;
   45580       }
   45581    default:
   45582       unreachable("Invalid hardware generation");
   45583    }
   45584 }
   45585 
   45586 
   45587 
   45588 #define GEN10_3DSTATE_PS_16PixelDispatchEnable_start  193
   45589 #define GEN9_3DSTATE_PS_16PixelDispatchEnable_start  193
   45590 #define GEN8_3DSTATE_PS_16PixelDispatchEnable_start  193
   45591 #define GEN75_3DSTATE_PS_16PixelDispatchEnable_start  129
   45592 #define GEN7_3DSTATE_PS_16PixelDispatchEnable_start  129
   45593 
   45594 static inline uint32_t ATTRIBUTE_PURE
   45595 _3DSTATE_PS_16PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   45596 {
   45597    switch (devinfo->gen) {
   45598    case 10: return 193;
   45599    case 9: return 193;
   45600    case 8: return 193;
   45601    case 7:
   45602       if (devinfo->is_haswell) {
   45603          return 129;
   45604       } else {
   45605          return 129;
   45606       }
   45607    case 6: return 0;
   45608    case 5: return 0;
   45609    case 4:
   45610       if (devinfo->is_g4x) {
   45611          return 0;
   45612       } else {
   45613          return 0;
   45614       }
   45615    default:
   45616       unreachable("Invalid hardware generation");
   45617    }
   45618 }
   45619 
   45620 
   45621 
   45622 /* 3DSTATE_PS::32 Pixel Dispatch Enable */
   45623 
   45624 
   45625 #define GEN10_3DSTATE_PS_32PixelDispatchEnable_bits  1
   45626 #define GEN9_3DSTATE_PS_32PixelDispatchEnable_bits  1
   45627 #define GEN8_3DSTATE_PS_32PixelDispatchEnable_bits  1
   45628 #define GEN75_3DSTATE_PS_32PixelDispatchEnable_bits  1
   45629 #define GEN7_3DSTATE_PS_32PixelDispatchEnable_bits  1
   45630 
   45631 static inline uint32_t ATTRIBUTE_PURE
   45632 _3DSTATE_PS_32PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   45633 {
   45634    switch (devinfo->gen) {
   45635    case 10: return 1;
   45636    case 9: return 1;
   45637    case 8: return 1;
   45638    case 7:
   45639       if (devinfo->is_haswell) {
   45640          return 1;
   45641       } else {
   45642          return 1;
   45643       }
   45644    case 6: return 0;
   45645    case 5: return 0;
   45646    case 4:
   45647       if (devinfo->is_g4x) {
   45648          return 0;
   45649       } else {
   45650          return 0;
   45651       }
   45652    default:
   45653       unreachable("Invalid hardware generation");
   45654    }
   45655 }
   45656 
   45657 
   45658 
   45659 #define GEN10_3DSTATE_PS_32PixelDispatchEnable_start  194
   45660 #define GEN9_3DSTATE_PS_32PixelDispatchEnable_start  194
   45661 #define GEN8_3DSTATE_PS_32PixelDispatchEnable_start  194
   45662 #define GEN75_3DSTATE_PS_32PixelDispatchEnable_start  130
   45663 #define GEN7_3DSTATE_PS_32PixelDispatchEnable_start  130
   45664 
   45665 static inline uint32_t ATTRIBUTE_PURE
   45666 _3DSTATE_PS_32PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   45667 {
   45668    switch (devinfo->gen) {
   45669    case 10: return 194;
   45670    case 9: return 194;
   45671    case 8: return 194;
   45672    case 7:
   45673       if (devinfo->is_haswell) {
   45674          return 130;
   45675       } else {
   45676          return 130;
   45677       }
   45678    case 6: return 0;
   45679    case 5: return 0;
   45680    case 4:
   45681       if (devinfo->is_g4x) {
   45682          return 0;
   45683       } else {
   45684          return 0;
   45685       }
   45686    default:
   45687       unreachable("Invalid hardware generation");
   45688    }
   45689 }
   45690 
   45691 
   45692 
   45693 /* 3DSTATE_PS::3D Command Opcode */
   45694 
   45695 
   45696 #define GEN10_3DSTATE_PS_3DCommandOpcode_bits  3
   45697 #define GEN9_3DSTATE_PS_3DCommandOpcode_bits  3
   45698 #define GEN8_3DSTATE_PS_3DCommandOpcode_bits  3
   45699 #define GEN75_3DSTATE_PS_3DCommandOpcode_bits  3
   45700 #define GEN7_3DSTATE_PS_3DCommandOpcode_bits  3
   45701 
   45702 static inline uint32_t ATTRIBUTE_PURE
   45703 _3DSTATE_PS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   45704 {
   45705    switch (devinfo->gen) {
   45706    case 10: return 3;
   45707    case 9: return 3;
   45708    case 8: return 3;
   45709    case 7:
   45710       if (devinfo->is_haswell) {
   45711          return 3;
   45712       } else {
   45713          return 3;
   45714       }
   45715    case 6: return 0;
   45716    case 5: return 0;
   45717    case 4:
   45718       if (devinfo->is_g4x) {
   45719          return 0;
   45720       } else {
   45721          return 0;
   45722       }
   45723    default:
   45724       unreachable("Invalid hardware generation");
   45725    }
   45726 }
   45727 
   45728 
   45729 
   45730 #define GEN10_3DSTATE_PS_3DCommandOpcode_start  24
   45731 #define GEN9_3DSTATE_PS_3DCommandOpcode_start  24
   45732 #define GEN8_3DSTATE_PS_3DCommandOpcode_start  24
   45733 #define GEN75_3DSTATE_PS_3DCommandOpcode_start  24
   45734 #define GEN7_3DSTATE_PS_3DCommandOpcode_start  24
   45735 
   45736 static inline uint32_t ATTRIBUTE_PURE
   45737 _3DSTATE_PS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   45738 {
   45739    switch (devinfo->gen) {
   45740    case 10: return 24;
   45741    case 9: return 24;
   45742    case 8: return 24;
   45743    case 7:
   45744       if (devinfo->is_haswell) {
   45745          return 24;
   45746       } else {
   45747          return 24;
   45748       }
   45749    case 6: return 0;
   45750    case 5: return 0;
   45751    case 4:
   45752       if (devinfo->is_g4x) {
   45753          return 0;
   45754       } else {
   45755          return 0;
   45756       }
   45757    default:
   45758       unreachable("Invalid hardware generation");
   45759    }
   45760 }
   45761 
   45762 
   45763 
   45764 /* 3DSTATE_PS::3D Command Sub Opcode */
   45765 
   45766 
   45767 #define GEN10_3DSTATE_PS_3DCommandSubOpcode_bits  8
   45768 #define GEN9_3DSTATE_PS_3DCommandSubOpcode_bits  8
   45769 #define GEN8_3DSTATE_PS_3DCommandSubOpcode_bits  8
   45770 #define GEN75_3DSTATE_PS_3DCommandSubOpcode_bits  8
   45771 #define GEN7_3DSTATE_PS_3DCommandSubOpcode_bits  8
   45772 
   45773 static inline uint32_t ATTRIBUTE_PURE
   45774 _3DSTATE_PS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   45775 {
   45776    switch (devinfo->gen) {
   45777    case 10: return 8;
   45778    case 9: return 8;
   45779    case 8: return 8;
   45780    case 7:
   45781       if (devinfo->is_haswell) {
   45782          return 8;
   45783       } else {
   45784          return 8;
   45785       }
   45786    case 6: return 0;
   45787    case 5: return 0;
   45788    case 4:
   45789       if (devinfo->is_g4x) {
   45790          return 0;
   45791       } else {
   45792          return 0;
   45793       }
   45794    default:
   45795       unreachable("Invalid hardware generation");
   45796    }
   45797 }
   45798 
   45799 
   45800 
   45801 #define GEN10_3DSTATE_PS_3DCommandSubOpcode_start  16
   45802 #define GEN9_3DSTATE_PS_3DCommandSubOpcode_start  16
   45803 #define GEN8_3DSTATE_PS_3DCommandSubOpcode_start  16
   45804 #define GEN75_3DSTATE_PS_3DCommandSubOpcode_start  16
   45805 #define GEN7_3DSTATE_PS_3DCommandSubOpcode_start  16
   45806 
   45807 static inline uint32_t ATTRIBUTE_PURE
   45808 _3DSTATE_PS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   45809 {
   45810    switch (devinfo->gen) {
   45811    case 10: return 16;
   45812    case 9: return 16;
   45813    case 8: return 16;
   45814    case 7:
   45815       if (devinfo->is_haswell) {
   45816          return 16;
   45817       } else {
   45818          return 16;
   45819       }
   45820    case 6: return 0;
   45821    case 5: return 0;
   45822    case 4:
   45823       if (devinfo->is_g4x) {
   45824          return 0;
   45825       } else {
   45826          return 0;
   45827       }
   45828    default:
   45829       unreachable("Invalid hardware generation");
   45830    }
   45831 }
   45832 
   45833 
   45834 
   45835 /* 3DSTATE_PS::8 Pixel Dispatch Enable */
   45836 
   45837 
   45838 #define GEN10_3DSTATE_PS_8PixelDispatchEnable_bits  1
   45839 #define GEN9_3DSTATE_PS_8PixelDispatchEnable_bits  1
   45840 #define GEN8_3DSTATE_PS_8PixelDispatchEnable_bits  1
   45841 #define GEN75_3DSTATE_PS_8PixelDispatchEnable_bits  1
   45842 #define GEN7_3DSTATE_PS_8PixelDispatchEnable_bits  1
   45843 
   45844 static inline uint32_t ATTRIBUTE_PURE
   45845 _3DSTATE_PS_8PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   45846 {
   45847    switch (devinfo->gen) {
   45848    case 10: return 1;
   45849    case 9: return 1;
   45850    case 8: return 1;
   45851    case 7:
   45852       if (devinfo->is_haswell) {
   45853          return 1;
   45854       } else {
   45855          return 1;
   45856       }
   45857    case 6: return 0;
   45858    case 5: return 0;
   45859    case 4:
   45860       if (devinfo->is_g4x) {
   45861          return 0;
   45862       } else {
   45863          return 0;
   45864       }
   45865    default:
   45866       unreachable("Invalid hardware generation");
   45867    }
   45868 }
   45869 
   45870 
   45871 
   45872 #define GEN10_3DSTATE_PS_8PixelDispatchEnable_start  192
   45873 #define GEN9_3DSTATE_PS_8PixelDispatchEnable_start  192
   45874 #define GEN8_3DSTATE_PS_8PixelDispatchEnable_start  192
   45875 #define GEN75_3DSTATE_PS_8PixelDispatchEnable_start  128
   45876 #define GEN7_3DSTATE_PS_8PixelDispatchEnable_start  128
   45877 
   45878 static inline uint32_t ATTRIBUTE_PURE
   45879 _3DSTATE_PS_8PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   45880 {
   45881    switch (devinfo->gen) {
   45882    case 10: return 192;
   45883    case 9: return 192;
   45884    case 8: return 192;
   45885    case 7:
   45886       if (devinfo->is_haswell) {
   45887          return 128;
   45888       } else {
   45889          return 128;
   45890       }
   45891    case 6: return 0;
   45892    case 5: return 0;
   45893    case 4:
   45894       if (devinfo->is_g4x) {
   45895          return 0;
   45896       } else {
   45897          return 0;
   45898       }
   45899    default:
   45900       unreachable("Invalid hardware generation");
   45901    }
   45902 }
   45903 
   45904 
   45905 
   45906 /* 3DSTATE_PS::Attribute Enable */
   45907 
   45908 
   45909 #define GEN75_3DSTATE_PS_AttributeEnable_bits  1
   45910 #define GEN7_3DSTATE_PS_AttributeEnable_bits  1
   45911 
   45912 static inline uint32_t ATTRIBUTE_PURE
   45913 _3DSTATE_PS_AttributeEnable_bits(const struct gen_device_info *devinfo)
   45914 {
   45915    switch (devinfo->gen) {
   45916    case 10: return 0;
   45917    case 9: return 0;
   45918    case 8: return 0;
   45919    case 7:
   45920       if (devinfo->is_haswell) {
   45921          return 1;
   45922       } else {
   45923          return 1;
   45924       }
   45925    case 6: return 0;
   45926    case 5: return 0;
   45927    case 4:
   45928       if (devinfo->is_g4x) {
   45929          return 0;
   45930       } else {
   45931          return 0;
   45932       }
   45933    default:
   45934       unreachable("Invalid hardware generation");
   45935    }
   45936 }
   45937 
   45938 
   45939 
   45940 #define GEN75_3DSTATE_PS_AttributeEnable_start  138
   45941 #define GEN7_3DSTATE_PS_AttributeEnable_start  138
   45942 
   45943 static inline uint32_t ATTRIBUTE_PURE
   45944 _3DSTATE_PS_AttributeEnable_start(const struct gen_device_info *devinfo)
   45945 {
   45946    switch (devinfo->gen) {
   45947    case 10: return 0;
   45948    case 9: return 0;
   45949    case 8: return 0;
   45950    case 7:
   45951       if (devinfo->is_haswell) {
   45952          return 138;
   45953       } else {
   45954          return 138;
   45955       }
   45956    case 6: return 0;
   45957    case 5: return 0;
   45958    case 4:
   45959       if (devinfo->is_g4x) {
   45960          return 0;
   45961       } else {
   45962          return 0;
   45963       }
   45964    default:
   45965       unreachable("Invalid hardware generation");
   45966    }
   45967 }
   45968 
   45969 
   45970 
   45971 /* 3DSTATE_PS::Binding Table Entry Count */
   45972 
   45973 
   45974 #define GEN10_3DSTATE_PS_BindingTableEntryCount_bits  8
   45975 #define GEN9_3DSTATE_PS_BindingTableEntryCount_bits  8
   45976 #define GEN8_3DSTATE_PS_BindingTableEntryCount_bits  8
   45977 #define GEN75_3DSTATE_PS_BindingTableEntryCount_bits  8
   45978 #define GEN7_3DSTATE_PS_BindingTableEntryCount_bits  8
   45979 
   45980 static inline uint32_t ATTRIBUTE_PURE
   45981 _3DSTATE_PS_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   45982 {
   45983    switch (devinfo->gen) {
   45984    case 10: return 8;
   45985    case 9: return 8;
   45986    case 8: return 8;
   45987    case 7:
   45988       if (devinfo->is_haswell) {
   45989          return 8;
   45990       } else {
   45991          return 8;
   45992       }
   45993    case 6: return 0;
   45994    case 5: return 0;
   45995    case 4:
   45996       if (devinfo->is_g4x) {
   45997          return 0;
   45998       } else {
   45999          return 0;
   46000       }
   46001    default:
   46002       unreachable("Invalid hardware generation");
   46003    }
   46004 }
   46005 
   46006 
   46007 
   46008 #define GEN10_3DSTATE_PS_BindingTableEntryCount_start  114
   46009 #define GEN9_3DSTATE_PS_BindingTableEntryCount_start  114
   46010 #define GEN8_3DSTATE_PS_BindingTableEntryCount_start  114
   46011 #define GEN75_3DSTATE_PS_BindingTableEntryCount_start  82
   46012 #define GEN7_3DSTATE_PS_BindingTableEntryCount_start  82
   46013 
   46014 static inline uint32_t ATTRIBUTE_PURE
   46015 _3DSTATE_PS_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   46016 {
   46017    switch (devinfo->gen) {
   46018    case 10: return 114;
   46019    case 9: return 114;
   46020    case 8: return 114;
   46021    case 7:
   46022       if (devinfo->is_haswell) {
   46023          return 82;
   46024       } else {
   46025          return 82;
   46026       }
   46027    case 6: return 0;
   46028    case 5: return 0;
   46029    case 4:
   46030       if (devinfo->is_g4x) {
   46031          return 0;
   46032       } else {
   46033          return 0;
   46034       }
   46035    default:
   46036       unreachable("Invalid hardware generation");
   46037    }
   46038 }
   46039 
   46040 
   46041 
   46042 /* 3DSTATE_PS::Command SubType */
   46043 
   46044 
   46045 #define GEN10_3DSTATE_PS_CommandSubType_bits  2
   46046 #define GEN9_3DSTATE_PS_CommandSubType_bits  2
   46047 #define GEN8_3DSTATE_PS_CommandSubType_bits  2
   46048 #define GEN75_3DSTATE_PS_CommandSubType_bits  2
   46049 #define GEN7_3DSTATE_PS_CommandSubType_bits  2
   46050 
   46051 static inline uint32_t ATTRIBUTE_PURE
   46052 _3DSTATE_PS_CommandSubType_bits(const struct gen_device_info *devinfo)
   46053 {
   46054    switch (devinfo->gen) {
   46055    case 10: return 2;
   46056    case 9: return 2;
   46057    case 8: return 2;
   46058    case 7:
   46059       if (devinfo->is_haswell) {
   46060          return 2;
   46061       } else {
   46062          return 2;
   46063       }
   46064    case 6: return 0;
   46065    case 5: return 0;
   46066    case 4:
   46067       if (devinfo->is_g4x) {
   46068          return 0;
   46069       } else {
   46070          return 0;
   46071       }
   46072    default:
   46073       unreachable("Invalid hardware generation");
   46074    }
   46075 }
   46076 
   46077 
   46078 
   46079 #define GEN10_3DSTATE_PS_CommandSubType_start  27
   46080 #define GEN9_3DSTATE_PS_CommandSubType_start  27
   46081 #define GEN8_3DSTATE_PS_CommandSubType_start  27
   46082 #define GEN75_3DSTATE_PS_CommandSubType_start  27
   46083 #define GEN7_3DSTATE_PS_CommandSubType_start  27
   46084 
   46085 static inline uint32_t ATTRIBUTE_PURE
   46086 _3DSTATE_PS_CommandSubType_start(const struct gen_device_info *devinfo)
   46087 {
   46088    switch (devinfo->gen) {
   46089    case 10: return 27;
   46090    case 9: return 27;
   46091    case 8: return 27;
   46092    case 7:
   46093       if (devinfo->is_haswell) {
   46094          return 27;
   46095       } else {
   46096          return 27;
   46097       }
   46098    case 6: return 0;
   46099    case 5: return 0;
   46100    case 4:
   46101       if (devinfo->is_g4x) {
   46102          return 0;
   46103       } else {
   46104          return 0;
   46105       }
   46106    default:
   46107       unreachable("Invalid hardware generation");
   46108    }
   46109 }
   46110 
   46111 
   46112 
   46113 /* 3DSTATE_PS::Command Type */
   46114 
   46115 
   46116 #define GEN10_3DSTATE_PS_CommandType_bits  3
   46117 #define GEN9_3DSTATE_PS_CommandType_bits  3
   46118 #define GEN8_3DSTATE_PS_CommandType_bits  3
   46119 #define GEN75_3DSTATE_PS_CommandType_bits  3
   46120 #define GEN7_3DSTATE_PS_CommandType_bits  3
   46121 
   46122 static inline uint32_t ATTRIBUTE_PURE
   46123 _3DSTATE_PS_CommandType_bits(const struct gen_device_info *devinfo)
   46124 {
   46125    switch (devinfo->gen) {
   46126    case 10: return 3;
   46127    case 9: return 3;
   46128    case 8: return 3;
   46129    case 7:
   46130       if (devinfo->is_haswell) {
   46131          return 3;
   46132       } else {
   46133          return 3;
   46134       }
   46135    case 6: return 0;
   46136    case 5: return 0;
   46137    case 4:
   46138       if (devinfo->is_g4x) {
   46139          return 0;
   46140       } else {
   46141          return 0;
   46142       }
   46143    default:
   46144       unreachable("Invalid hardware generation");
   46145    }
   46146 }
   46147 
   46148 
   46149 
   46150 #define GEN10_3DSTATE_PS_CommandType_start  29
   46151 #define GEN9_3DSTATE_PS_CommandType_start  29
   46152 #define GEN8_3DSTATE_PS_CommandType_start  29
   46153 #define GEN75_3DSTATE_PS_CommandType_start  29
   46154 #define GEN7_3DSTATE_PS_CommandType_start  29
   46155 
   46156 static inline uint32_t ATTRIBUTE_PURE
   46157 _3DSTATE_PS_CommandType_start(const struct gen_device_info *devinfo)
   46158 {
   46159    switch (devinfo->gen) {
   46160    case 10: return 29;
   46161    case 9: return 29;
   46162    case 8: return 29;
   46163    case 7:
   46164       if (devinfo->is_haswell) {
   46165          return 29;
   46166       } else {
   46167          return 29;
   46168       }
   46169    case 6: return 0;
   46170    case 5: return 0;
   46171    case 4:
   46172       if (devinfo->is_g4x) {
   46173          return 0;
   46174       } else {
   46175          return 0;
   46176       }
   46177    default:
   46178       unreachable("Invalid hardware generation");
   46179    }
   46180 }
   46181 
   46182 
   46183 
   46184 /* 3DSTATE_PS::DWord Length */
   46185 
   46186 
   46187 #define GEN10_3DSTATE_PS_DWordLength_bits  8
   46188 #define GEN9_3DSTATE_PS_DWordLength_bits  8
   46189 #define GEN8_3DSTATE_PS_DWordLength_bits  8
   46190 #define GEN75_3DSTATE_PS_DWordLength_bits  8
   46191 #define GEN7_3DSTATE_PS_DWordLength_bits  8
   46192 
   46193 static inline uint32_t ATTRIBUTE_PURE
   46194 _3DSTATE_PS_DWordLength_bits(const struct gen_device_info *devinfo)
   46195 {
   46196    switch (devinfo->gen) {
   46197    case 10: return 8;
   46198    case 9: return 8;
   46199    case 8: return 8;
   46200    case 7:
   46201       if (devinfo->is_haswell) {
   46202          return 8;
   46203       } else {
   46204          return 8;
   46205       }
   46206    case 6: return 0;
   46207    case 5: return 0;
   46208    case 4:
   46209       if (devinfo->is_g4x) {
   46210          return 0;
   46211       } else {
   46212          return 0;
   46213       }
   46214    default:
   46215       unreachable("Invalid hardware generation");
   46216    }
   46217 }
   46218 
   46219 
   46220 
   46221 #define GEN10_3DSTATE_PS_DWordLength_start  0
   46222 #define GEN9_3DSTATE_PS_DWordLength_start  0
   46223 #define GEN8_3DSTATE_PS_DWordLength_start  0
   46224 #define GEN75_3DSTATE_PS_DWordLength_start  0
   46225 #define GEN7_3DSTATE_PS_DWordLength_start  0
   46226 
   46227 static inline uint32_t ATTRIBUTE_PURE
   46228 _3DSTATE_PS_DWordLength_start(const struct gen_device_info *devinfo)
   46229 {
   46230    switch (devinfo->gen) {
   46231    case 10: return 0;
   46232    case 9: return 0;
   46233    case 8: return 0;
   46234    case 7:
   46235       if (devinfo->is_haswell) {
   46236          return 0;
   46237       } else {
   46238          return 0;
   46239       }
   46240    case 6: return 0;
   46241    case 5: return 0;
   46242    case 4:
   46243       if (devinfo->is_g4x) {
   46244          return 0;
   46245       } else {
   46246          return 0;
   46247       }
   46248    default:
   46249       unreachable("Invalid hardware generation");
   46250    }
   46251 }
   46252 
   46253 
   46254 
   46255 /* 3DSTATE_PS::Denormal Mode */
   46256 
   46257 
   46258 #define GEN75_3DSTATE_PS_DenormalMode_bits  1
   46259 #define GEN7_3DSTATE_PS_DenormalMode_bits  1
   46260 
   46261 static inline uint32_t ATTRIBUTE_PURE
   46262 _3DSTATE_PS_DenormalMode_bits(const struct gen_device_info *devinfo)
   46263 {
   46264    switch (devinfo->gen) {
   46265    case 10: return 0;
   46266    case 9: return 0;
   46267    case 8: return 0;
   46268    case 7:
   46269       if (devinfo->is_haswell) {
   46270          return 1;
   46271       } else {
   46272          return 1;
   46273       }
   46274    case 6: return 0;
   46275    case 5: return 0;
   46276    case 4:
   46277       if (devinfo->is_g4x) {
   46278          return 0;
   46279       } else {
   46280          return 0;
   46281       }
   46282    default:
   46283       unreachable("Invalid hardware generation");
   46284    }
   46285 }
   46286 
   46287 
   46288 
   46289 #define GEN75_3DSTATE_PS_DenormalMode_start  90
   46290 #define GEN7_3DSTATE_PS_DenormalMode_start  90
   46291 
   46292 static inline uint32_t ATTRIBUTE_PURE
   46293 _3DSTATE_PS_DenormalMode_start(const struct gen_device_info *devinfo)
   46294 {
   46295    switch (devinfo->gen) {
   46296    case 10: return 0;
   46297    case 9: return 0;
   46298    case 8: return 0;
   46299    case 7:
   46300       if (devinfo->is_haswell) {
   46301          return 90;
   46302       } else {
   46303          return 90;
   46304       }
   46305    case 6: return 0;
   46306    case 5: return 0;
   46307    case 4:
   46308       if (devinfo->is_g4x) {
   46309          return 0;
   46310       } else {
   46311          return 0;
   46312       }
   46313    default:
   46314       unreachable("Invalid hardware generation");
   46315    }
   46316 }
   46317 
   46318 
   46319 
   46320 /* 3DSTATE_PS::Dispatch GRF Start Register For Constant/Setup Data 0 */
   46321 
   46322 
   46323 #define GEN10_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_bits  7
   46324 #define GEN9_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_bits  7
   46325 #define GEN8_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_bits  7
   46326 #define GEN75_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_bits  7
   46327 #define GEN7_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_bits  7
   46328 
   46329 static inline uint32_t ATTRIBUTE_PURE
   46330 _3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_bits(const struct gen_device_info *devinfo)
   46331 {
   46332    switch (devinfo->gen) {
   46333    case 10: return 7;
   46334    case 9: return 7;
   46335    case 8: return 7;
   46336    case 7:
   46337       if (devinfo->is_haswell) {
   46338          return 7;
   46339       } else {
   46340          return 7;
   46341       }
   46342    case 6: return 0;
   46343    case 5: return 0;
   46344    case 4:
   46345       if (devinfo->is_g4x) {
   46346          return 0;
   46347       } else {
   46348          return 0;
   46349       }
   46350    default:
   46351       unreachable("Invalid hardware generation");
   46352    }
   46353 }
   46354 
   46355 
   46356 
   46357 #define GEN10_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_start  240
   46358 #define GEN9_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_start  240
   46359 #define GEN8_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_start  240
   46360 #define GEN75_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_start  176
   46361 #define GEN7_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_start  176
   46362 
   46363 static inline uint32_t ATTRIBUTE_PURE
   46364 _3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData0_start(const struct gen_device_info *devinfo)
   46365 {
   46366    switch (devinfo->gen) {
   46367    case 10: return 240;
   46368    case 9: return 240;
   46369    case 8: return 240;
   46370    case 7:
   46371       if (devinfo->is_haswell) {
   46372          return 176;
   46373       } else {
   46374          return 176;
   46375       }
   46376    case 6: return 0;
   46377    case 5: return 0;
   46378    case 4:
   46379       if (devinfo->is_g4x) {
   46380          return 0;
   46381       } else {
   46382          return 0;
   46383       }
   46384    default:
   46385       unreachable("Invalid hardware generation");
   46386    }
   46387 }
   46388 
   46389 
   46390 
   46391 /* 3DSTATE_PS::Dispatch GRF Start Register For Constant/Setup Data 1 */
   46392 
   46393 
   46394 #define GEN10_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_bits  7
   46395 #define GEN9_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_bits  7
   46396 #define GEN8_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_bits  7
   46397 #define GEN75_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_bits  7
   46398 #define GEN7_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_bits  7
   46399 
   46400 static inline uint32_t ATTRIBUTE_PURE
   46401 _3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_bits(const struct gen_device_info *devinfo)
   46402 {
   46403    switch (devinfo->gen) {
   46404    case 10: return 7;
   46405    case 9: return 7;
   46406    case 8: return 7;
   46407    case 7:
   46408       if (devinfo->is_haswell) {
   46409          return 7;
   46410       } else {
   46411          return 7;
   46412       }
   46413    case 6: return 0;
   46414    case 5: return 0;
   46415    case 4:
   46416       if (devinfo->is_g4x) {
   46417          return 0;
   46418       } else {
   46419          return 0;
   46420       }
   46421    default:
   46422       unreachable("Invalid hardware generation");
   46423    }
   46424 }
   46425 
   46426 
   46427 
   46428 #define GEN10_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_start  232
   46429 #define GEN9_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_start  232
   46430 #define GEN8_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_start  232
   46431 #define GEN75_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_start  168
   46432 #define GEN7_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_start  168
   46433 
   46434 static inline uint32_t ATTRIBUTE_PURE
   46435 _3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData1_start(const struct gen_device_info *devinfo)
   46436 {
   46437    switch (devinfo->gen) {
   46438    case 10: return 232;
   46439    case 9: return 232;
   46440    case 8: return 232;
   46441    case 7:
   46442       if (devinfo->is_haswell) {
   46443          return 168;
   46444       } else {
   46445          return 168;
   46446       }
   46447    case 6: return 0;
   46448    case 5: return 0;
   46449    case 4:
   46450       if (devinfo->is_g4x) {
   46451          return 0;
   46452       } else {
   46453          return 0;
   46454       }
   46455    default:
   46456       unreachable("Invalid hardware generation");
   46457    }
   46458 }
   46459 
   46460 
   46461 
   46462 /* 3DSTATE_PS::Dispatch GRF Start Register For Constant/Setup Data 2 */
   46463 
   46464 
   46465 #define GEN10_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_bits  7
   46466 #define GEN9_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_bits  7
   46467 #define GEN8_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_bits  7
   46468 #define GEN75_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_bits  7
   46469 #define GEN7_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_bits  7
   46470 
   46471 static inline uint32_t ATTRIBUTE_PURE
   46472 _3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_bits(const struct gen_device_info *devinfo)
   46473 {
   46474    switch (devinfo->gen) {
   46475    case 10: return 7;
   46476    case 9: return 7;
   46477    case 8: return 7;
   46478    case 7:
   46479       if (devinfo->is_haswell) {
   46480          return 7;
   46481       } else {
   46482          return 7;
   46483       }
   46484    case 6: return 0;
   46485    case 5: return 0;
   46486    case 4:
   46487       if (devinfo->is_g4x) {
   46488          return 0;
   46489       } else {
   46490          return 0;
   46491       }
   46492    default:
   46493       unreachable("Invalid hardware generation");
   46494    }
   46495 }
   46496 
   46497 
   46498 
   46499 #define GEN10_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_start  224
   46500 #define GEN9_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_start  224
   46501 #define GEN8_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_start  224
   46502 #define GEN75_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_start  160
   46503 #define GEN7_3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_start  160
   46504 
   46505 static inline uint32_t ATTRIBUTE_PURE
   46506 _3DSTATE_PS_DispatchGRFStartRegisterForConstantSetupData2_start(const struct gen_device_info *devinfo)
   46507 {
   46508    switch (devinfo->gen) {
   46509    case 10: return 224;
   46510    case 9: return 224;
   46511    case 8: return 224;
   46512    case 7:
   46513       if (devinfo->is_haswell) {
   46514          return 160;
   46515       } else {
   46516          return 160;
   46517       }
   46518    case 6: return 0;
   46519    case 5: return 0;
   46520    case 4:
   46521       if (devinfo->is_g4x) {
   46522          return 0;
   46523       } else {
   46524          return 0;
   46525       }
   46526    default:
   46527       unreachable("Invalid hardware generation");
   46528    }
   46529 }
   46530 
   46531 
   46532 
   46533 /* 3DSTATE_PS::Dual Source Blend Enable */
   46534 
   46535 
   46536 #define GEN75_3DSTATE_PS_DualSourceBlendEnable_bits  1
   46537 #define GEN7_3DSTATE_PS_DualSourceBlendEnable_bits  1
   46538 
   46539 static inline uint32_t ATTRIBUTE_PURE
   46540 _3DSTATE_PS_DualSourceBlendEnable_bits(const struct gen_device_info *devinfo)
   46541 {
   46542    switch (devinfo->gen) {
   46543    case 10: return 0;
   46544    case 9: return 0;
   46545    case 8: return 0;
   46546    case 7:
   46547       if (devinfo->is_haswell) {
   46548          return 1;
   46549       } else {
   46550          return 1;
   46551       }
   46552    case 6: return 0;
   46553    case 5: return 0;
   46554    case 4:
   46555       if (devinfo->is_g4x) {
   46556          return 0;
   46557       } else {
   46558          return 0;
   46559       }
   46560    default:
   46561       unreachable("Invalid hardware generation");
   46562    }
   46563 }
   46564 
   46565 
   46566 
   46567 #define GEN75_3DSTATE_PS_DualSourceBlendEnable_start  135
   46568 #define GEN7_3DSTATE_PS_DualSourceBlendEnable_start  135
   46569 
   46570 static inline uint32_t ATTRIBUTE_PURE
   46571 _3DSTATE_PS_DualSourceBlendEnable_start(const struct gen_device_info *devinfo)
   46572 {
   46573    switch (devinfo->gen) {
   46574    case 10: return 0;
   46575    case 9: return 0;
   46576    case 8: return 0;
   46577    case 7:
   46578       if (devinfo->is_haswell) {
   46579          return 135;
   46580       } else {
   46581          return 135;
   46582       }
   46583    case 6: return 0;
   46584    case 5: return 0;
   46585    case 4:
   46586       if (devinfo->is_g4x) {
   46587          return 0;
   46588       } else {
   46589          return 0;
   46590       }
   46591    default:
   46592       unreachable("Invalid hardware generation");
   46593    }
   46594 }
   46595 
   46596 
   46597 
   46598 /* 3DSTATE_PS::Floating Point Mode */
   46599 
   46600 
   46601 #define GEN10_3DSTATE_PS_FloatingPointMode_bits  1
   46602 #define GEN9_3DSTATE_PS_FloatingPointMode_bits  1
   46603 #define GEN8_3DSTATE_PS_FloatingPointMode_bits  1
   46604 #define GEN75_3DSTATE_PS_FloatingPointMode_bits  1
   46605 #define GEN7_3DSTATE_PS_FloatingPointMode_bits  1
   46606 
   46607 static inline uint32_t ATTRIBUTE_PURE
   46608 _3DSTATE_PS_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   46609 {
   46610    switch (devinfo->gen) {
   46611    case 10: return 1;
   46612    case 9: return 1;
   46613    case 8: return 1;
   46614    case 7:
   46615       if (devinfo->is_haswell) {
   46616          return 1;
   46617       } else {
   46618          return 1;
   46619       }
   46620    case 6: return 0;
   46621    case 5: return 0;
   46622    case 4:
   46623       if (devinfo->is_g4x) {
   46624          return 0;
   46625       } else {
   46626          return 0;
   46627       }
   46628    default:
   46629       unreachable("Invalid hardware generation");
   46630    }
   46631 }
   46632 
   46633 
   46634 
   46635 #define GEN10_3DSTATE_PS_FloatingPointMode_start  112
   46636 #define GEN9_3DSTATE_PS_FloatingPointMode_start  112
   46637 #define GEN8_3DSTATE_PS_FloatingPointMode_start  112
   46638 #define GEN75_3DSTATE_PS_FloatingPointMode_start  80
   46639 #define GEN7_3DSTATE_PS_FloatingPointMode_start  80
   46640 
   46641 static inline uint32_t ATTRIBUTE_PURE
   46642 _3DSTATE_PS_FloatingPointMode_start(const struct gen_device_info *devinfo)
   46643 {
   46644    switch (devinfo->gen) {
   46645    case 10: return 112;
   46646    case 9: return 112;
   46647    case 8: return 112;
   46648    case 7:
   46649       if (devinfo->is_haswell) {
   46650          return 80;
   46651       } else {
   46652          return 80;
   46653       }
   46654    case 6: return 0;
   46655    case 5: return 0;
   46656    case 4:
   46657       if (devinfo->is_g4x) {
   46658          return 0;
   46659       } else {
   46660          return 0;
   46661       }
   46662    default:
   46663       unreachable("Invalid hardware generation");
   46664    }
   46665 }
   46666 
   46667 
   46668 
   46669 /* 3DSTATE_PS::Illegal Opcode Exception Enable */
   46670 
   46671 
   46672 #define GEN10_3DSTATE_PS_IllegalOpcodeExceptionEnable_bits  1
   46673 #define GEN9_3DSTATE_PS_IllegalOpcodeExceptionEnable_bits  1
   46674 #define GEN8_3DSTATE_PS_IllegalOpcodeExceptionEnable_bits  1
   46675 #define GEN75_3DSTATE_PS_IllegalOpcodeExceptionEnable_bits  1
   46676 #define GEN7_3DSTATE_PS_IllegalOpcodeExceptionEnable_bits  1
   46677 
   46678 static inline uint32_t ATTRIBUTE_PURE
   46679 _3DSTATE_PS_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   46680 {
   46681    switch (devinfo->gen) {
   46682    case 10: return 1;
   46683    case 9: return 1;
   46684    case 8: return 1;
   46685    case 7:
   46686       if (devinfo->is_haswell) {
   46687          return 1;
   46688       } else {
   46689          return 1;
   46690       }
   46691    case 6: return 0;
   46692    case 5: return 0;
   46693    case 4:
   46694       if (devinfo->is_g4x) {
   46695          return 0;
   46696       } else {
   46697          return 0;
   46698       }
   46699    default:
   46700       unreachable("Invalid hardware generation");
   46701    }
   46702 }
   46703 
   46704 
   46705 
   46706 #define GEN10_3DSTATE_PS_IllegalOpcodeExceptionEnable_start  109
   46707 #define GEN9_3DSTATE_PS_IllegalOpcodeExceptionEnable_start  109
   46708 #define GEN8_3DSTATE_PS_IllegalOpcodeExceptionEnable_start  109
   46709 #define GEN75_3DSTATE_PS_IllegalOpcodeExceptionEnable_start  77
   46710 #define GEN7_3DSTATE_PS_IllegalOpcodeExceptionEnable_start  77
   46711 
   46712 static inline uint32_t ATTRIBUTE_PURE
   46713 _3DSTATE_PS_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   46714 {
   46715    switch (devinfo->gen) {
   46716    case 10: return 109;
   46717    case 9: return 109;
   46718    case 8: return 109;
   46719    case 7:
   46720       if (devinfo->is_haswell) {
   46721          return 77;
   46722       } else {
   46723          return 77;
   46724       }
   46725    case 6: return 0;
   46726    case 5: return 0;
   46727    case 4:
   46728       if (devinfo->is_g4x) {
   46729          return 0;
   46730       } else {
   46731          return 0;
   46732       }
   46733    default:
   46734       unreachable("Invalid hardware generation");
   46735    }
   46736 }
   46737 
   46738 
   46739 
   46740 /* 3DSTATE_PS::Kernel Start Pointer 0 */
   46741 
   46742 
   46743 #define GEN10_3DSTATE_PS_KernelStartPointer0_bits  58
   46744 #define GEN9_3DSTATE_PS_KernelStartPointer0_bits  58
   46745 #define GEN8_3DSTATE_PS_KernelStartPointer0_bits  58
   46746 #define GEN75_3DSTATE_PS_KernelStartPointer0_bits  26
   46747 #define GEN7_3DSTATE_PS_KernelStartPointer0_bits  26
   46748 
   46749 static inline uint32_t ATTRIBUTE_PURE
   46750 _3DSTATE_PS_KernelStartPointer0_bits(const struct gen_device_info *devinfo)
   46751 {
   46752    switch (devinfo->gen) {
   46753    case 10: return 58;
   46754    case 9: return 58;
   46755    case 8: return 58;
   46756    case 7:
   46757       if (devinfo->is_haswell) {
   46758          return 26;
   46759       } else {
   46760          return 26;
   46761       }
   46762    case 6: return 0;
   46763    case 5: return 0;
   46764    case 4:
   46765       if (devinfo->is_g4x) {
   46766          return 0;
   46767       } else {
   46768          return 0;
   46769       }
   46770    default:
   46771       unreachable("Invalid hardware generation");
   46772    }
   46773 }
   46774 
   46775 
   46776 
   46777 #define GEN10_3DSTATE_PS_KernelStartPointer0_start  38
   46778 #define GEN9_3DSTATE_PS_KernelStartPointer0_start  38
   46779 #define GEN8_3DSTATE_PS_KernelStartPointer0_start  38
   46780 #define GEN75_3DSTATE_PS_KernelStartPointer0_start  38
   46781 #define GEN7_3DSTATE_PS_KernelStartPointer0_start  38
   46782 
   46783 static inline uint32_t ATTRIBUTE_PURE
   46784 _3DSTATE_PS_KernelStartPointer0_start(const struct gen_device_info *devinfo)
   46785 {
   46786    switch (devinfo->gen) {
   46787    case 10: return 38;
   46788    case 9: return 38;
   46789    case 8: return 38;
   46790    case 7:
   46791       if (devinfo->is_haswell) {
   46792          return 38;
   46793       } else {
   46794          return 38;
   46795       }
   46796    case 6: return 0;
   46797    case 5: return 0;
   46798    case 4:
   46799       if (devinfo->is_g4x) {
   46800          return 0;
   46801       } else {
   46802          return 0;
   46803       }
   46804    default:
   46805       unreachable("Invalid hardware generation");
   46806    }
   46807 }
   46808 
   46809 
   46810 
   46811 /* 3DSTATE_PS::Kernel Start Pointer 1 */
   46812 
   46813 
   46814 #define GEN10_3DSTATE_PS_KernelStartPointer1_bits  58
   46815 #define GEN9_3DSTATE_PS_KernelStartPointer1_bits  58
   46816 #define GEN8_3DSTATE_PS_KernelStartPointer1_bits  58
   46817 #define GEN75_3DSTATE_PS_KernelStartPointer1_bits  26
   46818 #define GEN7_3DSTATE_PS_KernelStartPointer1_bits  26
   46819 
   46820 static inline uint32_t ATTRIBUTE_PURE
   46821 _3DSTATE_PS_KernelStartPointer1_bits(const struct gen_device_info *devinfo)
   46822 {
   46823    switch (devinfo->gen) {
   46824    case 10: return 58;
   46825    case 9: return 58;
   46826    case 8: return 58;
   46827    case 7:
   46828       if (devinfo->is_haswell) {
   46829          return 26;
   46830       } else {
   46831          return 26;
   46832       }
   46833    case 6: return 0;
   46834    case 5: return 0;
   46835    case 4:
   46836       if (devinfo->is_g4x) {
   46837          return 0;
   46838       } else {
   46839          return 0;
   46840       }
   46841    default:
   46842       unreachable("Invalid hardware generation");
   46843    }
   46844 }
   46845 
   46846 
   46847 
   46848 #define GEN10_3DSTATE_PS_KernelStartPointer1_start  262
   46849 #define GEN9_3DSTATE_PS_KernelStartPointer1_start  262
   46850 #define GEN8_3DSTATE_PS_KernelStartPointer1_start  262
   46851 #define GEN75_3DSTATE_PS_KernelStartPointer1_start  198
   46852 #define GEN7_3DSTATE_PS_KernelStartPointer1_start  198
   46853 
   46854 static inline uint32_t ATTRIBUTE_PURE
   46855 _3DSTATE_PS_KernelStartPointer1_start(const struct gen_device_info *devinfo)
   46856 {
   46857    switch (devinfo->gen) {
   46858    case 10: return 262;
   46859    case 9: return 262;
   46860    case 8: return 262;
   46861    case 7:
   46862       if (devinfo->is_haswell) {
   46863          return 198;
   46864       } else {
   46865          return 198;
   46866       }
   46867    case 6: return 0;
   46868    case 5: return 0;
   46869    case 4:
   46870       if (devinfo->is_g4x) {
   46871          return 0;
   46872       } else {
   46873          return 0;
   46874       }
   46875    default:
   46876       unreachable("Invalid hardware generation");
   46877    }
   46878 }
   46879 
   46880 
   46881 
   46882 /* 3DSTATE_PS::Kernel Start Pointer 2 */
   46883 
   46884 
   46885 #define GEN10_3DSTATE_PS_KernelStartPointer2_bits  58
   46886 #define GEN9_3DSTATE_PS_KernelStartPointer2_bits  58
   46887 #define GEN8_3DSTATE_PS_KernelStartPointer2_bits  58
   46888 #define GEN75_3DSTATE_PS_KernelStartPointer2_bits  26
   46889 #define GEN7_3DSTATE_PS_KernelStartPointer2_bits  26
   46890 
   46891 static inline uint32_t ATTRIBUTE_PURE
   46892 _3DSTATE_PS_KernelStartPointer2_bits(const struct gen_device_info *devinfo)
   46893 {
   46894    switch (devinfo->gen) {
   46895    case 10: return 58;
   46896    case 9: return 58;
   46897    case 8: return 58;
   46898    case 7:
   46899       if (devinfo->is_haswell) {
   46900          return 26;
   46901       } else {
   46902          return 26;
   46903       }
   46904    case 6: return 0;
   46905    case 5: return 0;
   46906    case 4:
   46907       if (devinfo->is_g4x) {
   46908          return 0;
   46909       } else {
   46910          return 0;
   46911       }
   46912    default:
   46913       unreachable("Invalid hardware generation");
   46914    }
   46915 }
   46916 
   46917 
   46918 
   46919 #define GEN10_3DSTATE_PS_KernelStartPointer2_start  326
   46920 #define GEN9_3DSTATE_PS_KernelStartPointer2_start  326
   46921 #define GEN8_3DSTATE_PS_KernelStartPointer2_start  326
   46922 #define GEN75_3DSTATE_PS_KernelStartPointer2_start  230
   46923 #define GEN7_3DSTATE_PS_KernelStartPointer2_start  230
   46924 
   46925 static inline uint32_t ATTRIBUTE_PURE
   46926 _3DSTATE_PS_KernelStartPointer2_start(const struct gen_device_info *devinfo)
   46927 {
   46928    switch (devinfo->gen) {
   46929    case 10: return 326;
   46930    case 9: return 326;
   46931    case 8: return 326;
   46932    case 7:
   46933       if (devinfo->is_haswell) {
   46934          return 230;
   46935       } else {
   46936          return 230;
   46937       }
   46938    case 6: return 0;
   46939    case 5: return 0;
   46940    case 4:
   46941       if (devinfo->is_g4x) {
   46942          return 0;
   46943       } else {
   46944          return 0;
   46945       }
   46946    default:
   46947       unreachable("Invalid hardware generation");
   46948    }
   46949 }
   46950 
   46951 
   46952 
   46953 /* 3DSTATE_PS::Mask Stack Exception Enable */
   46954 
   46955 
   46956 #define GEN10_3DSTATE_PS_MaskStackExceptionEnable_bits  1
   46957 #define GEN9_3DSTATE_PS_MaskStackExceptionEnable_bits  1
   46958 #define GEN8_3DSTATE_PS_MaskStackExceptionEnable_bits  1
   46959 #define GEN75_3DSTATE_PS_MaskStackExceptionEnable_bits  1
   46960 #define GEN7_3DSTATE_PS_MaskStackExceptionEnable_bits  1
   46961 
   46962 static inline uint32_t ATTRIBUTE_PURE
   46963 _3DSTATE_PS_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   46964 {
   46965    switch (devinfo->gen) {
   46966    case 10: return 1;
   46967    case 9: return 1;
   46968    case 8: return 1;
   46969    case 7:
   46970       if (devinfo->is_haswell) {
   46971          return 1;
   46972       } else {
   46973          return 1;
   46974       }
   46975    case 6: return 0;
   46976    case 5: return 0;
   46977    case 4:
   46978       if (devinfo->is_g4x) {
   46979          return 0;
   46980       } else {
   46981          return 0;
   46982       }
   46983    default:
   46984       unreachable("Invalid hardware generation");
   46985    }
   46986 }
   46987 
   46988 
   46989 
   46990 #define GEN10_3DSTATE_PS_MaskStackExceptionEnable_start  107
   46991 #define GEN9_3DSTATE_PS_MaskStackExceptionEnable_start  107
   46992 #define GEN8_3DSTATE_PS_MaskStackExceptionEnable_start  107
   46993 #define GEN75_3DSTATE_PS_MaskStackExceptionEnable_start  75
   46994 #define GEN7_3DSTATE_PS_MaskStackExceptionEnable_start  75
   46995 
   46996 static inline uint32_t ATTRIBUTE_PURE
   46997 _3DSTATE_PS_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   46998 {
   46999    switch (devinfo->gen) {
   47000    case 10: return 107;
   47001    case 9: return 107;
   47002    case 8: return 107;
   47003    case 7:
   47004       if (devinfo->is_haswell) {
   47005          return 75;
   47006       } else {
   47007          return 75;
   47008       }
   47009    case 6: return 0;
   47010    case 5: return 0;
   47011    case 4:
   47012       if (devinfo->is_g4x) {
   47013          return 0;
   47014       } else {
   47015          return 0;
   47016       }
   47017    default:
   47018       unreachable("Invalid hardware generation");
   47019    }
   47020 }
   47021 
   47022 
   47023 
   47024 /* 3DSTATE_PS::Maximum Number of Threads */
   47025 
   47026 
   47027 #define GEN75_3DSTATE_PS_MaximumNumberofThreads_bits  9
   47028 #define GEN7_3DSTATE_PS_MaximumNumberofThreads_bits  8
   47029 
   47030 static inline uint32_t ATTRIBUTE_PURE
   47031 _3DSTATE_PS_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   47032 {
   47033    switch (devinfo->gen) {
   47034    case 10: return 0;
   47035    case 9: return 0;
   47036    case 8: return 0;
   47037    case 7:
   47038       if (devinfo->is_haswell) {
   47039          return 9;
   47040       } else {
   47041          return 8;
   47042       }
   47043    case 6: return 0;
   47044    case 5: return 0;
   47045    case 4:
   47046       if (devinfo->is_g4x) {
   47047          return 0;
   47048       } else {
   47049          return 0;
   47050       }
   47051    default:
   47052       unreachable("Invalid hardware generation");
   47053    }
   47054 }
   47055 
   47056 
   47057 
   47058 #define GEN75_3DSTATE_PS_MaximumNumberofThreads_start  151
   47059 #define GEN7_3DSTATE_PS_MaximumNumberofThreads_start  152
   47060 
   47061 static inline uint32_t ATTRIBUTE_PURE
   47062 _3DSTATE_PS_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   47063 {
   47064    switch (devinfo->gen) {
   47065    case 10: return 0;
   47066    case 9: return 0;
   47067    case 8: return 0;
   47068    case 7:
   47069       if (devinfo->is_haswell) {
   47070          return 151;
   47071       } else {
   47072          return 152;
   47073       }
   47074    case 6: return 0;
   47075    case 5: return 0;
   47076    case 4:
   47077       if (devinfo->is_g4x) {
   47078          return 0;
   47079       } else {
   47080          return 0;
   47081       }
   47082    default:
   47083       unreachable("Invalid hardware generation");
   47084    }
   47085 }
   47086 
   47087 
   47088 
   47089 /* 3DSTATE_PS::Maximum Number of Threads Per PSD */
   47090 
   47091 
   47092 #define GEN10_3DSTATE_PS_MaximumNumberofThreadsPerPSD_bits  9
   47093 #define GEN9_3DSTATE_PS_MaximumNumberofThreadsPerPSD_bits  9
   47094 #define GEN8_3DSTATE_PS_MaximumNumberofThreadsPerPSD_bits  9
   47095 
   47096 static inline uint32_t ATTRIBUTE_PURE
   47097 _3DSTATE_PS_MaximumNumberofThreadsPerPSD_bits(const struct gen_device_info *devinfo)
   47098 {
   47099    switch (devinfo->gen) {
   47100    case 10: return 9;
   47101    case 9: return 9;
   47102    case 8: return 9;
   47103    case 7:
   47104       if (devinfo->is_haswell) {
   47105          return 0;
   47106       } else {
   47107          return 0;
   47108       }
   47109    case 6: return 0;
   47110    case 5: return 0;
   47111    case 4:
   47112       if (devinfo->is_g4x) {
   47113          return 0;
   47114       } else {
   47115          return 0;
   47116       }
   47117    default:
   47118       unreachable("Invalid hardware generation");
   47119    }
   47120 }
   47121 
   47122 
   47123 
   47124 #define GEN10_3DSTATE_PS_MaximumNumberofThreadsPerPSD_start  215
   47125 #define GEN9_3DSTATE_PS_MaximumNumberofThreadsPerPSD_start  215
   47126 #define GEN8_3DSTATE_PS_MaximumNumberofThreadsPerPSD_start  215
   47127 
   47128 static inline uint32_t ATTRIBUTE_PURE
   47129 _3DSTATE_PS_MaximumNumberofThreadsPerPSD_start(const struct gen_device_info *devinfo)
   47130 {
   47131    switch (devinfo->gen) {
   47132    case 10: return 215;
   47133    case 9: return 215;
   47134    case 8: return 215;
   47135    case 7:
   47136       if (devinfo->is_haswell) {
   47137          return 0;
   47138       } else {
   47139          return 0;
   47140       }
   47141    case 6: return 0;
   47142    case 5: return 0;
   47143    case 4:
   47144       if (devinfo->is_g4x) {
   47145          return 0;
   47146       } else {
   47147          return 0;
   47148       }
   47149    default:
   47150       unreachable("Invalid hardware generation");
   47151    }
   47152 }
   47153 
   47154 
   47155 
   47156 /* 3DSTATE_PS::PS Accesses UAV */
   47157 
   47158 
   47159 #define GEN75_3DSTATE_PS_PSAccessesUAV_bits  1
   47160 
   47161 static inline uint32_t ATTRIBUTE_PURE
   47162 _3DSTATE_PS_PSAccessesUAV_bits(const struct gen_device_info *devinfo)
   47163 {
   47164    switch (devinfo->gen) {
   47165    case 10: return 0;
   47166    case 9: return 0;
   47167    case 8: return 0;
   47168    case 7:
   47169       if (devinfo->is_haswell) {
   47170          return 1;
   47171       } else {
   47172          return 0;
   47173       }
   47174    case 6: return 0;
   47175    case 5: return 0;
   47176    case 4:
   47177       if (devinfo->is_g4x) {
   47178          return 0;
   47179       } else {
   47180          return 0;
   47181       }
   47182    default:
   47183       unreachable("Invalid hardware generation");
   47184    }
   47185 }
   47186 
   47187 
   47188 
   47189 #define GEN75_3DSTATE_PS_PSAccessesUAV_start  133
   47190 
   47191 static inline uint32_t ATTRIBUTE_PURE
   47192 _3DSTATE_PS_PSAccessesUAV_start(const struct gen_device_info *devinfo)
   47193 {
   47194    switch (devinfo->gen) {
   47195    case 10: return 0;
   47196    case 9: return 0;
   47197    case 8: return 0;
   47198    case 7:
   47199       if (devinfo->is_haswell) {
   47200          return 133;
   47201       } else {
   47202          return 0;
   47203       }
   47204    case 6: return 0;
   47205    case 5: return 0;
   47206    case 4:
   47207       if (devinfo->is_g4x) {
   47208          return 0;
   47209       } else {
   47210          return 0;
   47211       }
   47212    default:
   47213       unreachable("Invalid hardware generation");
   47214    }
   47215 }
   47216 
   47217 
   47218 
   47219 /* 3DSTATE_PS::Per Thread Scratch Space */
   47220 
   47221 
   47222 #define GEN10_3DSTATE_PS_PerThreadScratchSpace_bits  4
   47223 #define GEN9_3DSTATE_PS_PerThreadScratchSpace_bits  4
   47224 #define GEN8_3DSTATE_PS_PerThreadScratchSpace_bits  4
   47225 #define GEN75_3DSTATE_PS_PerThreadScratchSpace_bits  4
   47226 #define GEN7_3DSTATE_PS_PerThreadScratchSpace_bits  4
   47227 
   47228 static inline uint32_t ATTRIBUTE_PURE
   47229 _3DSTATE_PS_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   47230 {
   47231    switch (devinfo->gen) {
   47232    case 10: return 4;
   47233    case 9: return 4;
   47234    case 8: return 4;
   47235    case 7:
   47236       if (devinfo->is_haswell) {
   47237          return 4;
   47238       } else {
   47239          return 4;
   47240       }
   47241    case 6: return 0;
   47242    case 5: return 0;
   47243    case 4:
   47244       if (devinfo->is_g4x) {
   47245          return 0;
   47246       } else {
   47247          return 0;
   47248       }
   47249    default:
   47250       unreachable("Invalid hardware generation");
   47251    }
   47252 }
   47253 
   47254 
   47255 
   47256 #define GEN10_3DSTATE_PS_PerThreadScratchSpace_start  128
   47257 #define GEN9_3DSTATE_PS_PerThreadScratchSpace_start  128
   47258 #define GEN8_3DSTATE_PS_PerThreadScratchSpace_start  128
   47259 #define GEN75_3DSTATE_PS_PerThreadScratchSpace_start  96
   47260 #define GEN7_3DSTATE_PS_PerThreadScratchSpace_start  96
   47261 
   47262 static inline uint32_t ATTRIBUTE_PURE
   47263 _3DSTATE_PS_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   47264 {
   47265    switch (devinfo->gen) {
   47266    case 10: return 128;
   47267    case 9: return 128;
   47268    case 8: return 128;
   47269    case 7:
   47270       if (devinfo->is_haswell) {
   47271          return 96;
   47272       } else {
   47273          return 96;
   47274       }
   47275    case 6: return 0;
   47276    case 5: return 0;
   47277    case 4:
   47278       if (devinfo->is_g4x) {
   47279          return 0;
   47280       } else {
   47281          return 0;
   47282       }
   47283    default:
   47284       unreachable("Invalid hardware generation");
   47285    }
   47286 }
   47287 
   47288 
   47289 
   47290 /* 3DSTATE_PS::Position XY Offset Select */
   47291 
   47292 
   47293 #define GEN10_3DSTATE_PS_PositionXYOffsetSelect_bits  2
   47294 #define GEN9_3DSTATE_PS_PositionXYOffsetSelect_bits  2
   47295 #define GEN8_3DSTATE_PS_PositionXYOffsetSelect_bits  2
   47296 #define GEN75_3DSTATE_PS_PositionXYOffsetSelect_bits  2
   47297 #define GEN7_3DSTATE_PS_PositionXYOffsetSelect_bits  2
   47298 
   47299 static inline uint32_t ATTRIBUTE_PURE
   47300 _3DSTATE_PS_PositionXYOffsetSelect_bits(const struct gen_device_info *devinfo)
   47301 {
   47302    switch (devinfo->gen) {
   47303    case 10: return 2;
   47304    case 9: return 2;
   47305    case 8: return 2;
   47306    case 7:
   47307       if (devinfo->is_haswell) {
   47308          return 2;
   47309       } else {
   47310          return 2;
   47311       }
   47312    case 6: return 0;
   47313    case 5: return 0;
   47314    case 4:
   47315       if (devinfo->is_g4x) {
   47316          return 0;
   47317       } else {
   47318          return 0;
   47319       }
   47320    default:
   47321       unreachable("Invalid hardware generation");
   47322    }
   47323 }
   47324 
   47325 
   47326 
   47327 #define GEN10_3DSTATE_PS_PositionXYOffsetSelect_start  195
   47328 #define GEN9_3DSTATE_PS_PositionXYOffsetSelect_start  195
   47329 #define GEN8_3DSTATE_PS_PositionXYOffsetSelect_start  195
   47330 #define GEN75_3DSTATE_PS_PositionXYOffsetSelect_start  131
   47331 #define GEN7_3DSTATE_PS_PositionXYOffsetSelect_start  131
   47332 
   47333 static inline uint32_t ATTRIBUTE_PURE
   47334 _3DSTATE_PS_PositionXYOffsetSelect_start(const struct gen_device_info *devinfo)
   47335 {
   47336    switch (devinfo->gen) {
   47337    case 10: return 195;
   47338    case 9: return 195;
   47339    case 8: return 195;
   47340    case 7:
   47341       if (devinfo->is_haswell) {
   47342          return 131;
   47343       } else {
   47344          return 131;
   47345       }
   47346    case 6: return 0;
   47347    case 5: return 0;
   47348    case 4:
   47349       if (devinfo->is_g4x) {
   47350          return 0;
   47351       } else {
   47352          return 0;
   47353       }
   47354    default:
   47355       unreachable("Invalid hardware generation");
   47356    }
   47357 }
   47358 
   47359 
   47360 
   47361 /* 3DSTATE_PS::Push Constant Enable */
   47362 
   47363 
   47364 #define GEN10_3DSTATE_PS_PushConstantEnable_bits  1
   47365 #define GEN9_3DSTATE_PS_PushConstantEnable_bits  1
   47366 #define GEN8_3DSTATE_PS_PushConstantEnable_bits  1
   47367 #define GEN75_3DSTATE_PS_PushConstantEnable_bits  1
   47368 #define GEN7_3DSTATE_PS_PushConstantEnable_bits  1
   47369 
   47370 static inline uint32_t ATTRIBUTE_PURE
   47371 _3DSTATE_PS_PushConstantEnable_bits(const struct gen_device_info *devinfo)
   47372 {
   47373    switch (devinfo->gen) {
   47374    case 10: return 1;
   47375    case 9: return 1;
   47376    case 8: return 1;
   47377    case 7:
   47378       if (devinfo->is_haswell) {
   47379          return 1;
   47380       } else {
   47381          return 1;
   47382       }
   47383    case 6: return 0;
   47384    case 5: return 0;
   47385    case 4:
   47386       if (devinfo->is_g4x) {
   47387          return 0;
   47388       } else {
   47389          return 0;
   47390       }
   47391    default:
   47392       unreachable("Invalid hardware generation");
   47393    }
   47394 }
   47395 
   47396 
   47397 
   47398 #define GEN10_3DSTATE_PS_PushConstantEnable_start  203
   47399 #define GEN9_3DSTATE_PS_PushConstantEnable_start  203
   47400 #define GEN8_3DSTATE_PS_PushConstantEnable_start  203
   47401 #define GEN75_3DSTATE_PS_PushConstantEnable_start  139
   47402 #define GEN7_3DSTATE_PS_PushConstantEnable_start  139
   47403 
   47404 static inline uint32_t ATTRIBUTE_PURE
   47405 _3DSTATE_PS_PushConstantEnable_start(const struct gen_device_info *devinfo)
   47406 {
   47407    switch (devinfo->gen) {
   47408    case 10: return 203;
   47409    case 9: return 203;
   47410    case 8: return 203;
   47411    case 7:
   47412       if (devinfo->is_haswell) {
   47413          return 139;
   47414       } else {
   47415          return 139;
   47416       }
   47417    case 6: return 0;
   47418    case 5: return 0;
   47419    case 4:
   47420       if (devinfo->is_g4x) {
   47421          return 0;
   47422       } else {
   47423          return 0;
   47424       }
   47425    default:
   47426       unreachable("Invalid hardware generation");
   47427    }
   47428 }
   47429 
   47430 
   47431 
   47432 /* 3DSTATE_PS::Render Target Fast Clear Enable */
   47433 
   47434 
   47435 #define GEN10_3DSTATE_PS_RenderTargetFastClearEnable_bits  1
   47436 #define GEN9_3DSTATE_PS_RenderTargetFastClearEnable_bits  1
   47437 #define GEN8_3DSTATE_PS_RenderTargetFastClearEnable_bits  1
   47438 #define GEN75_3DSTATE_PS_RenderTargetFastClearEnable_bits  1
   47439 #define GEN7_3DSTATE_PS_RenderTargetFastClearEnable_bits  1
   47440 
   47441 static inline uint32_t ATTRIBUTE_PURE
   47442 _3DSTATE_PS_RenderTargetFastClearEnable_bits(const struct gen_device_info *devinfo)
   47443 {
   47444    switch (devinfo->gen) {
   47445    case 10: return 1;
   47446    case 9: return 1;
   47447    case 8: return 1;
   47448    case 7:
   47449       if (devinfo->is_haswell) {
   47450          return 1;
   47451       } else {
   47452          return 1;
   47453       }
   47454    case 6: return 0;
   47455    case 5: return 0;
   47456    case 4:
   47457       if (devinfo->is_g4x) {
   47458          return 0;
   47459       } else {
   47460          return 0;
   47461       }
   47462    default:
   47463       unreachable("Invalid hardware generation");
   47464    }
   47465 }
   47466 
   47467 
   47468 
   47469 #define GEN10_3DSTATE_PS_RenderTargetFastClearEnable_start  200
   47470 #define GEN9_3DSTATE_PS_RenderTargetFastClearEnable_start  200
   47471 #define GEN8_3DSTATE_PS_RenderTargetFastClearEnable_start  200
   47472 #define GEN75_3DSTATE_PS_RenderTargetFastClearEnable_start  136
   47473 #define GEN7_3DSTATE_PS_RenderTargetFastClearEnable_start  136
   47474 
   47475 static inline uint32_t ATTRIBUTE_PURE
   47476 _3DSTATE_PS_RenderTargetFastClearEnable_start(const struct gen_device_info *devinfo)
   47477 {
   47478    switch (devinfo->gen) {
   47479    case 10: return 200;
   47480    case 9: return 200;
   47481    case 8: return 200;
   47482    case 7:
   47483       if (devinfo->is_haswell) {
   47484          return 136;
   47485       } else {
   47486          return 136;
   47487       }
   47488    case 6: return 0;
   47489    case 5: return 0;
   47490    case 4:
   47491       if (devinfo->is_g4x) {
   47492          return 0;
   47493       } else {
   47494          return 0;
   47495       }
   47496    default:
   47497       unreachable("Invalid hardware generation");
   47498    }
   47499 }
   47500 
   47501 
   47502 
   47503 /* 3DSTATE_PS::Render Target Resolve Enable */
   47504 
   47505 
   47506 #define GEN8_3DSTATE_PS_RenderTargetResolveEnable_bits  1
   47507 #define GEN75_3DSTATE_PS_RenderTargetResolveEnable_bits  1
   47508 #define GEN7_3DSTATE_PS_RenderTargetResolveEnable_bits  1
   47509 
   47510 static inline uint32_t ATTRIBUTE_PURE
   47511 _3DSTATE_PS_RenderTargetResolveEnable_bits(const struct gen_device_info *devinfo)
   47512 {
   47513    switch (devinfo->gen) {
   47514    case 10: return 0;
   47515    case 9: return 0;
   47516    case 8: return 1;
   47517    case 7:
   47518       if (devinfo->is_haswell) {
   47519          return 1;
   47520       } else {
   47521          return 1;
   47522       }
   47523    case 6: return 0;
   47524    case 5: return 0;
   47525    case 4:
   47526       if (devinfo->is_g4x) {
   47527          return 0;
   47528       } else {
   47529          return 0;
   47530       }
   47531    default:
   47532       unreachable("Invalid hardware generation");
   47533    }
   47534 }
   47535 
   47536 
   47537 
   47538 #define GEN8_3DSTATE_PS_RenderTargetResolveEnable_start  198
   47539 #define GEN75_3DSTATE_PS_RenderTargetResolveEnable_start  134
   47540 #define GEN7_3DSTATE_PS_RenderTargetResolveEnable_start  134
   47541 
   47542 static inline uint32_t ATTRIBUTE_PURE
   47543 _3DSTATE_PS_RenderTargetResolveEnable_start(const struct gen_device_info *devinfo)
   47544 {
   47545    switch (devinfo->gen) {
   47546    case 10: return 0;
   47547    case 9: return 0;
   47548    case 8: return 198;
   47549    case 7:
   47550       if (devinfo->is_haswell) {
   47551          return 134;
   47552       } else {
   47553          return 134;
   47554       }
   47555    case 6: return 0;
   47556    case 5: return 0;
   47557    case 4:
   47558       if (devinfo->is_g4x) {
   47559          return 0;
   47560       } else {
   47561          return 0;
   47562       }
   47563    default:
   47564       unreachable("Invalid hardware generation");
   47565    }
   47566 }
   47567 
   47568 
   47569 
   47570 /* 3DSTATE_PS::Render Target Resolve Type */
   47571 
   47572 
   47573 #define GEN10_3DSTATE_PS_RenderTargetResolveType_bits  2
   47574 #define GEN9_3DSTATE_PS_RenderTargetResolveType_bits  2
   47575 
   47576 static inline uint32_t ATTRIBUTE_PURE
   47577 _3DSTATE_PS_RenderTargetResolveType_bits(const struct gen_device_info *devinfo)
   47578 {
   47579    switch (devinfo->gen) {
   47580    case 10: return 2;
   47581    case 9: return 2;
   47582    case 8: return 0;
   47583    case 7:
   47584       if (devinfo->is_haswell) {
   47585          return 0;
   47586       } else {
   47587          return 0;
   47588       }
   47589    case 6: return 0;
   47590    case 5: return 0;
   47591    case 4:
   47592       if (devinfo->is_g4x) {
   47593          return 0;
   47594       } else {
   47595          return 0;
   47596       }
   47597    default:
   47598       unreachable("Invalid hardware generation");
   47599    }
   47600 }
   47601 
   47602 
   47603 
   47604 #define GEN10_3DSTATE_PS_RenderTargetResolveType_start  198
   47605 #define GEN9_3DSTATE_PS_RenderTargetResolveType_start  198
   47606 
   47607 static inline uint32_t ATTRIBUTE_PURE
   47608 _3DSTATE_PS_RenderTargetResolveType_start(const struct gen_device_info *devinfo)
   47609 {
   47610    switch (devinfo->gen) {
   47611    case 10: return 198;
   47612    case 9: return 198;
   47613    case 8: return 0;
   47614    case 7:
   47615       if (devinfo->is_haswell) {
   47616          return 0;
   47617       } else {
   47618          return 0;
   47619       }
   47620    case 6: return 0;
   47621    case 5: return 0;
   47622    case 4:
   47623       if (devinfo->is_g4x) {
   47624          return 0;
   47625       } else {
   47626          return 0;
   47627       }
   47628    default:
   47629       unreachable("Invalid hardware generation");
   47630    }
   47631 }
   47632 
   47633 
   47634 
   47635 /* 3DSTATE_PS::Rounding Mode */
   47636 
   47637 
   47638 #define GEN10_3DSTATE_PS_RoundingMode_bits  2
   47639 #define GEN9_3DSTATE_PS_RoundingMode_bits  2
   47640 #define GEN8_3DSTATE_PS_RoundingMode_bits  2
   47641 #define GEN75_3DSTATE_PS_RoundingMode_bits  2
   47642 #define GEN7_3DSTATE_PS_RoundingMode_bits  2
   47643 
   47644 static inline uint32_t ATTRIBUTE_PURE
   47645 _3DSTATE_PS_RoundingMode_bits(const struct gen_device_info *devinfo)
   47646 {
   47647    switch (devinfo->gen) {
   47648    case 10: return 2;
   47649    case 9: return 2;
   47650    case 8: return 2;
   47651    case 7:
   47652       if (devinfo->is_haswell) {
   47653          return 2;
   47654       } else {
   47655          return 2;
   47656       }
   47657    case 6: return 0;
   47658    case 5: return 0;
   47659    case 4:
   47660       if (devinfo->is_g4x) {
   47661          return 0;
   47662       } else {
   47663          return 0;
   47664       }
   47665    default:
   47666       unreachable("Invalid hardware generation");
   47667    }
   47668 }
   47669 
   47670 
   47671 
   47672 #define GEN10_3DSTATE_PS_RoundingMode_start  110
   47673 #define GEN9_3DSTATE_PS_RoundingMode_start  110
   47674 #define GEN8_3DSTATE_PS_RoundingMode_start  110
   47675 #define GEN75_3DSTATE_PS_RoundingMode_start  78
   47676 #define GEN7_3DSTATE_PS_RoundingMode_start  78
   47677 
   47678 static inline uint32_t ATTRIBUTE_PURE
   47679 _3DSTATE_PS_RoundingMode_start(const struct gen_device_info *devinfo)
   47680 {
   47681    switch (devinfo->gen) {
   47682    case 10: return 110;
   47683    case 9: return 110;
   47684    case 8: return 110;
   47685    case 7:
   47686       if (devinfo->is_haswell) {
   47687          return 78;
   47688       } else {
   47689          return 78;
   47690       }
   47691    case 6: return 0;
   47692    case 5: return 0;
   47693    case 4:
   47694       if (devinfo->is_g4x) {
   47695          return 0;
   47696       } else {
   47697          return 0;
   47698       }
   47699    default:
   47700       unreachable("Invalid hardware generation");
   47701    }
   47702 }
   47703 
   47704 
   47705 
   47706 /* 3DSTATE_PS::Sample Mask */
   47707 
   47708 
   47709 #define GEN75_3DSTATE_PS_SampleMask_bits  8
   47710 
   47711 static inline uint32_t ATTRIBUTE_PURE
   47712 _3DSTATE_PS_SampleMask_bits(const struct gen_device_info *devinfo)
   47713 {
   47714    switch (devinfo->gen) {
   47715    case 10: return 0;
   47716    case 9: return 0;
   47717    case 8: return 0;
   47718    case 7:
   47719       if (devinfo->is_haswell) {
   47720          return 8;
   47721       } else {
   47722          return 0;
   47723       }
   47724    case 6: return 0;
   47725    case 5: return 0;
   47726    case 4:
   47727       if (devinfo->is_g4x) {
   47728          return 0;
   47729       } else {
   47730          return 0;
   47731       }
   47732    default:
   47733       unreachable("Invalid hardware generation");
   47734    }
   47735 }
   47736 
   47737 
   47738 
   47739 #define GEN75_3DSTATE_PS_SampleMask_start  140
   47740 
   47741 static inline uint32_t ATTRIBUTE_PURE
   47742 _3DSTATE_PS_SampleMask_start(const struct gen_device_info *devinfo)
   47743 {
   47744    switch (devinfo->gen) {
   47745    case 10: return 0;
   47746    case 9: return 0;
   47747    case 8: return 0;
   47748    case 7:
   47749       if (devinfo->is_haswell) {
   47750          return 140;
   47751       } else {
   47752          return 0;
   47753       }
   47754    case 6: return 0;
   47755    case 5: return 0;
   47756    case 4:
   47757       if (devinfo->is_g4x) {
   47758          return 0;
   47759       } else {
   47760          return 0;
   47761       }
   47762    default:
   47763       unreachable("Invalid hardware generation");
   47764    }
   47765 }
   47766 
   47767 
   47768 
   47769 /* 3DSTATE_PS::Sampler Count */
   47770 
   47771 
   47772 #define GEN10_3DSTATE_PS_SamplerCount_bits  3
   47773 #define GEN9_3DSTATE_PS_SamplerCount_bits  3
   47774 #define GEN8_3DSTATE_PS_SamplerCount_bits  3
   47775 #define GEN75_3DSTATE_PS_SamplerCount_bits  3
   47776 #define GEN7_3DSTATE_PS_SamplerCount_bits  3
   47777 
   47778 static inline uint32_t ATTRIBUTE_PURE
   47779 _3DSTATE_PS_SamplerCount_bits(const struct gen_device_info *devinfo)
   47780 {
   47781    switch (devinfo->gen) {
   47782    case 10: return 3;
   47783    case 9: return 3;
   47784    case 8: return 3;
   47785    case 7:
   47786       if (devinfo->is_haswell) {
   47787          return 3;
   47788       } else {
   47789          return 3;
   47790       }
   47791    case 6: return 0;
   47792    case 5: return 0;
   47793    case 4:
   47794       if (devinfo->is_g4x) {
   47795          return 0;
   47796       } else {
   47797          return 0;
   47798       }
   47799    default:
   47800       unreachable("Invalid hardware generation");
   47801    }
   47802 }
   47803 
   47804 
   47805 
   47806 #define GEN10_3DSTATE_PS_SamplerCount_start  123
   47807 #define GEN9_3DSTATE_PS_SamplerCount_start  123
   47808 #define GEN8_3DSTATE_PS_SamplerCount_start  123
   47809 #define GEN75_3DSTATE_PS_SamplerCount_start  91
   47810 #define GEN7_3DSTATE_PS_SamplerCount_start  91
   47811 
   47812 static inline uint32_t ATTRIBUTE_PURE
   47813 _3DSTATE_PS_SamplerCount_start(const struct gen_device_info *devinfo)
   47814 {
   47815    switch (devinfo->gen) {
   47816    case 10: return 123;
   47817    case 9: return 123;
   47818    case 8: return 123;
   47819    case 7:
   47820       if (devinfo->is_haswell) {
   47821          return 91;
   47822       } else {
   47823          return 91;
   47824       }
   47825    case 6: return 0;
   47826    case 5: return 0;
   47827    case 4:
   47828       if (devinfo->is_g4x) {
   47829          return 0;
   47830       } else {
   47831          return 0;
   47832       }
   47833    default:
   47834       unreachable("Invalid hardware generation");
   47835    }
   47836 }
   47837 
   47838 
   47839 
   47840 /* 3DSTATE_PS::Scratch Space Base Pointer */
   47841 
   47842 
   47843 #define GEN10_3DSTATE_PS_ScratchSpaceBasePointer_bits  54
   47844 #define GEN9_3DSTATE_PS_ScratchSpaceBasePointer_bits  54
   47845 #define GEN8_3DSTATE_PS_ScratchSpaceBasePointer_bits  54
   47846 #define GEN75_3DSTATE_PS_ScratchSpaceBasePointer_bits  22
   47847 #define GEN7_3DSTATE_PS_ScratchSpaceBasePointer_bits  22
   47848 
   47849 static inline uint32_t ATTRIBUTE_PURE
   47850 _3DSTATE_PS_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   47851 {
   47852    switch (devinfo->gen) {
   47853    case 10: return 54;
   47854    case 9: return 54;
   47855    case 8: return 54;
   47856    case 7:
   47857       if (devinfo->is_haswell) {
   47858          return 22;
   47859       } else {
   47860          return 22;
   47861       }
   47862    case 6: return 0;
   47863    case 5: return 0;
   47864    case 4:
   47865       if (devinfo->is_g4x) {
   47866          return 0;
   47867       } else {
   47868          return 0;
   47869       }
   47870    default:
   47871       unreachable("Invalid hardware generation");
   47872    }
   47873 }
   47874 
   47875 
   47876 
   47877 #define GEN10_3DSTATE_PS_ScratchSpaceBasePointer_start  138
   47878 #define GEN9_3DSTATE_PS_ScratchSpaceBasePointer_start  138
   47879 #define GEN8_3DSTATE_PS_ScratchSpaceBasePointer_start  138
   47880 #define GEN75_3DSTATE_PS_ScratchSpaceBasePointer_start  106
   47881 #define GEN7_3DSTATE_PS_ScratchSpaceBasePointer_start  106
   47882 
   47883 static inline uint32_t ATTRIBUTE_PURE
   47884 _3DSTATE_PS_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   47885 {
   47886    switch (devinfo->gen) {
   47887    case 10: return 138;
   47888    case 9: return 138;
   47889    case 8: return 138;
   47890    case 7:
   47891       if (devinfo->is_haswell) {
   47892          return 106;
   47893       } else {
   47894          return 106;
   47895       }
   47896    case 6: return 0;
   47897    case 5: return 0;
   47898    case 4:
   47899       if (devinfo->is_g4x) {
   47900          return 0;
   47901       } else {
   47902          return 0;
   47903       }
   47904    default:
   47905       unreachable("Invalid hardware generation");
   47906    }
   47907 }
   47908 
   47909 
   47910 
   47911 /* 3DSTATE_PS::Single Precision Denormal Mode */
   47912 
   47913 
   47914 #define GEN10_3DSTATE_PS_SinglePrecisionDenormalMode_bits  1
   47915 #define GEN9_3DSTATE_PS_SinglePrecisionDenormalMode_bits  1
   47916 #define GEN8_3DSTATE_PS_SinglePrecisionDenormalMode_bits  1
   47917 
   47918 static inline uint32_t ATTRIBUTE_PURE
   47919 _3DSTATE_PS_SinglePrecisionDenormalMode_bits(const struct gen_device_info *devinfo)
   47920 {
   47921    switch (devinfo->gen) {
   47922    case 10: return 1;
   47923    case 9: return 1;
   47924    case 8: return 1;
   47925    case 7:
   47926       if (devinfo->is_haswell) {
   47927          return 0;
   47928       } else {
   47929          return 0;
   47930       }
   47931    case 6: return 0;
   47932    case 5: return 0;
   47933    case 4:
   47934       if (devinfo->is_g4x) {
   47935          return 0;
   47936       } else {
   47937          return 0;
   47938       }
   47939    default:
   47940       unreachable("Invalid hardware generation");
   47941    }
   47942 }
   47943 
   47944 
   47945 
   47946 #define GEN10_3DSTATE_PS_SinglePrecisionDenormalMode_start  122
   47947 #define GEN9_3DSTATE_PS_SinglePrecisionDenormalMode_start  122
   47948 #define GEN8_3DSTATE_PS_SinglePrecisionDenormalMode_start  122
   47949 
   47950 static inline uint32_t ATTRIBUTE_PURE
   47951 _3DSTATE_PS_SinglePrecisionDenormalMode_start(const struct gen_device_info *devinfo)
   47952 {
   47953    switch (devinfo->gen) {
   47954    case 10: return 122;
   47955    case 9: return 122;
   47956    case 8: return 122;
   47957    case 7:
   47958       if (devinfo->is_haswell) {
   47959          return 0;
   47960       } else {
   47961          return 0;
   47962       }
   47963    case 6: return 0;
   47964    case 5: return 0;
   47965    case 4:
   47966       if (devinfo->is_g4x) {
   47967          return 0;
   47968       } else {
   47969          return 0;
   47970       }
   47971    default:
   47972       unreachable("Invalid hardware generation");
   47973    }
   47974 }
   47975 
   47976 
   47977 
   47978 /* 3DSTATE_PS::Single Program Flow */
   47979 
   47980 
   47981 #define GEN10_3DSTATE_PS_SingleProgramFlow_bits  1
   47982 #define GEN9_3DSTATE_PS_SingleProgramFlow_bits  1
   47983 #define GEN8_3DSTATE_PS_SingleProgramFlow_bits  1
   47984 #define GEN75_3DSTATE_PS_SingleProgramFlow_bits  1
   47985 #define GEN7_3DSTATE_PS_SingleProgramFlow_bits  1
   47986 
   47987 static inline uint32_t ATTRIBUTE_PURE
   47988 _3DSTATE_PS_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   47989 {
   47990    switch (devinfo->gen) {
   47991    case 10: return 1;
   47992    case 9: return 1;
   47993    case 8: return 1;
   47994    case 7:
   47995       if (devinfo->is_haswell) {
   47996          return 1;
   47997       } else {
   47998          return 1;
   47999       }
   48000    case 6: return 0;
   48001    case 5: return 0;
   48002    case 4:
   48003       if (devinfo->is_g4x) {
   48004          return 0;
   48005       } else {
   48006          return 0;
   48007       }
   48008    default:
   48009       unreachable("Invalid hardware generation");
   48010    }
   48011 }
   48012 
   48013 
   48014 
   48015 #define GEN10_3DSTATE_PS_SingleProgramFlow_start  127
   48016 #define GEN9_3DSTATE_PS_SingleProgramFlow_start  127
   48017 #define GEN8_3DSTATE_PS_SingleProgramFlow_start  127
   48018 #define GEN75_3DSTATE_PS_SingleProgramFlow_start  95
   48019 #define GEN7_3DSTATE_PS_SingleProgramFlow_start  95
   48020 
   48021 static inline uint32_t ATTRIBUTE_PURE
   48022 _3DSTATE_PS_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   48023 {
   48024    switch (devinfo->gen) {
   48025    case 10: return 127;
   48026    case 9: return 127;
   48027    case 8: return 127;
   48028    case 7:
   48029       if (devinfo->is_haswell) {
   48030          return 95;
   48031       } else {
   48032          return 95;
   48033       }
   48034    case 6: return 0;
   48035    case 5: return 0;
   48036    case 4:
   48037       if (devinfo->is_g4x) {
   48038          return 0;
   48039       } else {
   48040          return 0;
   48041       }
   48042    default:
   48043       unreachable("Invalid hardware generation");
   48044    }
   48045 }
   48046 
   48047 
   48048 
   48049 /* 3DSTATE_PS::Software Exception Enable */
   48050 
   48051 
   48052 #define GEN10_3DSTATE_PS_SoftwareExceptionEnable_bits  1
   48053 #define GEN9_3DSTATE_PS_SoftwareExceptionEnable_bits  1
   48054 #define GEN8_3DSTATE_PS_SoftwareExceptionEnable_bits  1
   48055 #define GEN75_3DSTATE_PS_SoftwareExceptionEnable_bits  1
   48056 #define GEN7_3DSTATE_PS_SoftwareExceptionEnable_bits  1
   48057 
   48058 static inline uint32_t ATTRIBUTE_PURE
   48059 _3DSTATE_PS_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   48060 {
   48061    switch (devinfo->gen) {
   48062    case 10: return 1;
   48063    case 9: return 1;
   48064    case 8: return 1;
   48065    case 7:
   48066       if (devinfo->is_haswell) {
   48067          return 1;
   48068       } else {
   48069          return 1;
   48070       }
   48071    case 6: return 0;
   48072    case 5: return 0;
   48073    case 4:
   48074       if (devinfo->is_g4x) {
   48075          return 0;
   48076       } else {
   48077          return 0;
   48078       }
   48079    default:
   48080       unreachable("Invalid hardware generation");
   48081    }
   48082 }
   48083 
   48084 
   48085 
   48086 #define GEN10_3DSTATE_PS_SoftwareExceptionEnable_start  103
   48087 #define GEN9_3DSTATE_PS_SoftwareExceptionEnable_start  103
   48088 #define GEN8_3DSTATE_PS_SoftwareExceptionEnable_start  103
   48089 #define GEN75_3DSTATE_PS_SoftwareExceptionEnable_start  71
   48090 #define GEN7_3DSTATE_PS_SoftwareExceptionEnable_start  71
   48091 
   48092 static inline uint32_t ATTRIBUTE_PURE
   48093 _3DSTATE_PS_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   48094 {
   48095    switch (devinfo->gen) {
   48096    case 10: return 103;
   48097    case 9: return 103;
   48098    case 8: return 103;
   48099    case 7:
   48100       if (devinfo->is_haswell) {
   48101          return 71;
   48102       } else {
   48103          return 71;
   48104       }
   48105    case 6: return 0;
   48106    case 5: return 0;
   48107    case 4:
   48108       if (devinfo->is_g4x) {
   48109          return 0;
   48110       } else {
   48111          return 0;
   48112       }
   48113    default:
   48114       unreachable("Invalid hardware generation");
   48115    }
   48116 }
   48117 
   48118 
   48119 
   48120 /* 3DSTATE_PS::Thread Dispatch Priority */
   48121 
   48122 
   48123 #define GEN10_3DSTATE_PS_ThreadDispatchPriority_bits  1
   48124 #define GEN9_3DSTATE_PS_ThreadDispatchPriority_bits  1
   48125 #define GEN8_3DSTATE_PS_ThreadDispatchPriority_bits  1
   48126 
   48127 static inline uint32_t ATTRIBUTE_PURE
   48128 _3DSTATE_PS_ThreadDispatchPriority_bits(const struct gen_device_info *devinfo)
   48129 {
   48130    switch (devinfo->gen) {
   48131    case 10: return 1;
   48132    case 9: return 1;
   48133    case 8: return 1;
   48134    case 7:
   48135       if (devinfo->is_haswell) {
   48136          return 0;
   48137       } else {
   48138          return 0;
   48139       }
   48140    case 6: return 0;
   48141    case 5: return 0;
   48142    case 4:
   48143       if (devinfo->is_g4x) {
   48144          return 0;
   48145       } else {
   48146          return 0;
   48147       }
   48148    default:
   48149       unreachable("Invalid hardware generation");
   48150    }
   48151 }
   48152 
   48153 
   48154 
   48155 #define GEN10_3DSTATE_PS_ThreadDispatchPriority_start  113
   48156 #define GEN9_3DSTATE_PS_ThreadDispatchPriority_start  113
   48157 #define GEN8_3DSTATE_PS_ThreadDispatchPriority_start  113
   48158 
   48159 static inline uint32_t ATTRIBUTE_PURE
   48160 _3DSTATE_PS_ThreadDispatchPriority_start(const struct gen_device_info *devinfo)
   48161 {
   48162    switch (devinfo->gen) {
   48163    case 10: return 113;
   48164    case 9: return 113;
   48165    case 8: return 113;
   48166    case 7:
   48167       if (devinfo->is_haswell) {
   48168          return 0;
   48169       } else {
   48170          return 0;
   48171       }
   48172    case 6: return 0;
   48173    case 5: return 0;
   48174    case 4:
   48175       if (devinfo->is_g4x) {
   48176          return 0;
   48177       } else {
   48178          return 0;
   48179       }
   48180    default:
   48181       unreachable("Invalid hardware generation");
   48182    }
   48183 }
   48184 
   48185 
   48186 
   48187 /* 3DSTATE_PS::Thread Priority */
   48188 
   48189 
   48190 #define GEN75_3DSTATE_PS_ThreadPriority_bits  1
   48191 
   48192 static inline uint32_t ATTRIBUTE_PURE
   48193 _3DSTATE_PS_ThreadPriority_bits(const struct gen_device_info *devinfo)
   48194 {
   48195    switch (devinfo->gen) {
   48196    case 10: return 0;
   48197    case 9: return 0;
   48198    case 8: return 0;
   48199    case 7:
   48200       if (devinfo->is_haswell) {
   48201          return 1;
   48202       } else {
   48203          return 0;
   48204       }
   48205    case 6: return 0;
   48206    case 5: return 0;
   48207    case 4:
   48208       if (devinfo->is_g4x) {
   48209          return 0;
   48210       } else {
   48211          return 0;
   48212       }
   48213    default:
   48214       unreachable("Invalid hardware generation");
   48215    }
   48216 }
   48217 
   48218 
   48219 
   48220 #define GEN75_3DSTATE_PS_ThreadPriority_start  81
   48221 
   48222 static inline uint32_t ATTRIBUTE_PURE
   48223 _3DSTATE_PS_ThreadPriority_start(const struct gen_device_info *devinfo)
   48224 {
   48225    switch (devinfo->gen) {
   48226    case 10: return 0;
   48227    case 9: return 0;
   48228    case 8: return 0;
   48229    case 7:
   48230       if (devinfo->is_haswell) {
   48231          return 81;
   48232       } else {
   48233          return 0;
   48234       }
   48235    case 6: return 0;
   48236    case 5: return 0;
   48237    case 4:
   48238       if (devinfo->is_g4x) {
   48239          return 0;
   48240       } else {
   48241          return 0;
   48242       }
   48243    default:
   48244       unreachable("Invalid hardware generation");
   48245    }
   48246 }
   48247 
   48248 
   48249 
   48250 /* 3DSTATE_PS::Vector Mask Enable */
   48251 
   48252 
   48253 #define GEN10_3DSTATE_PS_VectorMaskEnable_bits  1
   48254 #define GEN9_3DSTATE_PS_VectorMaskEnable_bits  1
   48255 #define GEN8_3DSTATE_PS_VectorMaskEnable_bits  1
   48256 #define GEN75_3DSTATE_PS_VectorMaskEnable_bits  1
   48257 #define GEN7_3DSTATE_PS_VectorMaskEnable_bits  1
   48258 
   48259 static inline uint32_t ATTRIBUTE_PURE
   48260 _3DSTATE_PS_VectorMaskEnable_bits(const struct gen_device_info *devinfo)
   48261 {
   48262    switch (devinfo->gen) {
   48263    case 10: return 1;
   48264    case 9: return 1;
   48265    case 8: return 1;
   48266    case 7:
   48267       if (devinfo->is_haswell) {
   48268          return 1;
   48269       } else {
   48270          return 1;
   48271       }
   48272    case 6: return 0;
   48273    case 5: return 0;
   48274    case 4:
   48275       if (devinfo->is_g4x) {
   48276          return 0;
   48277       } else {
   48278          return 0;
   48279       }
   48280    default:
   48281       unreachable("Invalid hardware generation");
   48282    }
   48283 }
   48284 
   48285 
   48286 
   48287 #define GEN10_3DSTATE_PS_VectorMaskEnable_start  126
   48288 #define GEN9_3DSTATE_PS_VectorMaskEnable_start  126
   48289 #define GEN8_3DSTATE_PS_VectorMaskEnable_start  126
   48290 #define GEN75_3DSTATE_PS_VectorMaskEnable_start  94
   48291 #define GEN7_3DSTATE_PS_VectorMaskEnable_start  94
   48292 
   48293 static inline uint32_t ATTRIBUTE_PURE
   48294 _3DSTATE_PS_VectorMaskEnable_start(const struct gen_device_info *devinfo)
   48295 {
   48296    switch (devinfo->gen) {
   48297    case 10: return 126;
   48298    case 9: return 126;
   48299    case 8: return 126;
   48300    case 7:
   48301       if (devinfo->is_haswell) {
   48302          return 94;
   48303       } else {
   48304          return 94;
   48305       }
   48306    case 6: return 0;
   48307    case 5: return 0;
   48308    case 4:
   48309       if (devinfo->is_g4x) {
   48310          return 0;
   48311       } else {
   48312          return 0;
   48313       }
   48314    default:
   48315       unreachable("Invalid hardware generation");
   48316    }
   48317 }
   48318 
   48319 
   48320 
   48321 /* 3DSTATE_PS::oMask Present to RenderTarget */
   48322 
   48323 
   48324 #define GEN75_3DSTATE_PS_oMaskPresenttoRenderTarget_bits  1
   48325 #define GEN7_3DSTATE_PS_oMaskPresenttoRenderTarget_bits  1
   48326 
   48327 static inline uint32_t ATTRIBUTE_PURE
   48328 _3DSTATE_PS_oMaskPresenttoRenderTarget_bits(const struct gen_device_info *devinfo)
   48329 {
   48330    switch (devinfo->gen) {
   48331    case 10: return 0;
   48332    case 9: return 0;
   48333    case 8: return 0;
   48334    case 7:
   48335       if (devinfo->is_haswell) {
   48336          return 1;
   48337       } else {
   48338          return 1;
   48339       }
   48340    case 6: return 0;
   48341    case 5: return 0;
   48342    case 4:
   48343       if (devinfo->is_g4x) {
   48344          return 0;
   48345       } else {
   48346          return 0;
   48347       }
   48348    default:
   48349       unreachable("Invalid hardware generation");
   48350    }
   48351 }
   48352 
   48353 
   48354 
   48355 #define GEN75_3DSTATE_PS_oMaskPresenttoRenderTarget_start  137
   48356 #define GEN7_3DSTATE_PS_oMaskPresenttoRenderTarget_start  137
   48357 
   48358 static inline uint32_t ATTRIBUTE_PURE
   48359 _3DSTATE_PS_oMaskPresenttoRenderTarget_start(const struct gen_device_info *devinfo)
   48360 {
   48361    switch (devinfo->gen) {
   48362    case 10: return 0;
   48363    case 9: return 0;
   48364    case 8: return 0;
   48365    case 7:
   48366       if (devinfo->is_haswell) {
   48367          return 137;
   48368       } else {
   48369          return 137;
   48370       }
   48371    case 6: return 0;
   48372    case 5: return 0;
   48373    case 4:
   48374       if (devinfo->is_g4x) {
   48375          return 0;
   48376       } else {
   48377          return 0;
   48378       }
   48379    default:
   48380       unreachable("Invalid hardware generation");
   48381    }
   48382 }
   48383 
   48384 
   48385 
   48386 /* 3DSTATE_PS_BLEND */
   48387 
   48388 
   48389 #define GEN10_3DSTATE_PS_BLEND_length  2
   48390 #define GEN9_3DSTATE_PS_BLEND_length  2
   48391 #define GEN8_3DSTATE_PS_BLEND_length  2
   48392 
   48393 static inline uint32_t ATTRIBUTE_PURE
   48394 _3DSTATE_PS_BLEND_length(const struct gen_device_info *devinfo)
   48395 {
   48396    switch (devinfo->gen) {
   48397    case 10: return 2;
   48398    case 9: return 2;
   48399    case 8: return 2;
   48400    case 7:
   48401       if (devinfo->is_haswell) {
   48402          return 0;
   48403       } else {
   48404          return 0;
   48405       }
   48406    case 6: return 0;
   48407    case 5: return 0;
   48408    case 4:
   48409       if (devinfo->is_g4x) {
   48410          return 0;
   48411       } else {
   48412          return 0;
   48413       }
   48414    default:
   48415       unreachable("Invalid hardware generation");
   48416    }
   48417 }
   48418 
   48419 
   48420 
   48421 /* 3DSTATE_PS_BLEND::3D Command Opcode */
   48422 
   48423 
   48424 #define GEN10_3DSTATE_PS_BLEND_3DCommandOpcode_bits  3
   48425 #define GEN9_3DSTATE_PS_BLEND_3DCommandOpcode_bits  3
   48426 #define GEN8_3DSTATE_PS_BLEND_3DCommandOpcode_bits  3
   48427 
   48428 static inline uint32_t ATTRIBUTE_PURE
   48429 _3DSTATE_PS_BLEND_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   48430 {
   48431    switch (devinfo->gen) {
   48432    case 10: return 3;
   48433    case 9: return 3;
   48434    case 8: return 3;
   48435    case 7:
   48436       if (devinfo->is_haswell) {
   48437          return 0;
   48438       } else {
   48439          return 0;
   48440       }
   48441    case 6: return 0;
   48442    case 5: return 0;
   48443    case 4:
   48444       if (devinfo->is_g4x) {
   48445          return 0;
   48446       } else {
   48447          return 0;
   48448       }
   48449    default:
   48450       unreachable("Invalid hardware generation");
   48451    }
   48452 }
   48453 
   48454 
   48455 
   48456 #define GEN10_3DSTATE_PS_BLEND_3DCommandOpcode_start  24
   48457 #define GEN9_3DSTATE_PS_BLEND_3DCommandOpcode_start  24
   48458 #define GEN8_3DSTATE_PS_BLEND_3DCommandOpcode_start  24
   48459 
   48460 static inline uint32_t ATTRIBUTE_PURE
   48461 _3DSTATE_PS_BLEND_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   48462 {
   48463    switch (devinfo->gen) {
   48464    case 10: return 24;
   48465    case 9: return 24;
   48466    case 8: return 24;
   48467    case 7:
   48468       if (devinfo->is_haswell) {
   48469          return 0;
   48470       } else {
   48471          return 0;
   48472       }
   48473    case 6: return 0;
   48474    case 5: return 0;
   48475    case 4:
   48476       if (devinfo->is_g4x) {
   48477          return 0;
   48478       } else {
   48479          return 0;
   48480       }
   48481    default:
   48482       unreachable("Invalid hardware generation");
   48483    }
   48484 }
   48485 
   48486 
   48487 
   48488 /* 3DSTATE_PS_BLEND::3D Command Sub Opcode */
   48489 
   48490 
   48491 #define GEN10_3DSTATE_PS_BLEND_3DCommandSubOpcode_bits  8
   48492 #define GEN9_3DSTATE_PS_BLEND_3DCommandSubOpcode_bits  8
   48493 #define GEN8_3DSTATE_PS_BLEND_3DCommandSubOpcode_bits  8
   48494 
   48495 static inline uint32_t ATTRIBUTE_PURE
   48496 _3DSTATE_PS_BLEND_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   48497 {
   48498    switch (devinfo->gen) {
   48499    case 10: return 8;
   48500    case 9: return 8;
   48501    case 8: return 8;
   48502    case 7:
   48503       if (devinfo->is_haswell) {
   48504          return 0;
   48505       } else {
   48506          return 0;
   48507       }
   48508    case 6: return 0;
   48509    case 5: return 0;
   48510    case 4:
   48511       if (devinfo->is_g4x) {
   48512          return 0;
   48513       } else {
   48514          return 0;
   48515       }
   48516    default:
   48517       unreachable("Invalid hardware generation");
   48518    }
   48519 }
   48520 
   48521 
   48522 
   48523 #define GEN10_3DSTATE_PS_BLEND_3DCommandSubOpcode_start  16
   48524 #define GEN9_3DSTATE_PS_BLEND_3DCommandSubOpcode_start  16
   48525 #define GEN8_3DSTATE_PS_BLEND_3DCommandSubOpcode_start  16
   48526 
   48527 static inline uint32_t ATTRIBUTE_PURE
   48528 _3DSTATE_PS_BLEND_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   48529 {
   48530    switch (devinfo->gen) {
   48531    case 10: return 16;
   48532    case 9: return 16;
   48533    case 8: return 16;
   48534    case 7:
   48535       if (devinfo->is_haswell) {
   48536          return 0;
   48537       } else {
   48538          return 0;
   48539       }
   48540    case 6: return 0;
   48541    case 5: return 0;
   48542    case 4:
   48543       if (devinfo->is_g4x) {
   48544          return 0;
   48545       } else {
   48546          return 0;
   48547       }
   48548    default:
   48549       unreachable("Invalid hardware generation");
   48550    }
   48551 }
   48552 
   48553 
   48554 
   48555 /* 3DSTATE_PS_BLEND::Alpha Test Enable */
   48556 
   48557 
   48558 #define GEN10_3DSTATE_PS_BLEND_AlphaTestEnable_bits  1
   48559 #define GEN9_3DSTATE_PS_BLEND_AlphaTestEnable_bits  1
   48560 #define GEN8_3DSTATE_PS_BLEND_AlphaTestEnable_bits  1
   48561 
   48562 static inline uint32_t ATTRIBUTE_PURE
   48563 _3DSTATE_PS_BLEND_AlphaTestEnable_bits(const struct gen_device_info *devinfo)
   48564 {
   48565    switch (devinfo->gen) {
   48566    case 10: return 1;
   48567    case 9: return 1;
   48568    case 8: return 1;
   48569    case 7:
   48570       if (devinfo->is_haswell) {
   48571          return 0;
   48572       } else {
   48573          return 0;
   48574       }
   48575    case 6: return 0;
   48576    case 5: return 0;
   48577    case 4:
   48578       if (devinfo->is_g4x) {
   48579          return 0;
   48580       } else {
   48581          return 0;
   48582       }
   48583    default:
   48584       unreachable("Invalid hardware generation");
   48585    }
   48586 }
   48587 
   48588 
   48589 
   48590 #define GEN10_3DSTATE_PS_BLEND_AlphaTestEnable_start  40
   48591 #define GEN9_3DSTATE_PS_BLEND_AlphaTestEnable_start  40
   48592 #define GEN8_3DSTATE_PS_BLEND_AlphaTestEnable_start  40
   48593 
   48594 static inline uint32_t ATTRIBUTE_PURE
   48595 _3DSTATE_PS_BLEND_AlphaTestEnable_start(const struct gen_device_info *devinfo)
   48596 {
   48597    switch (devinfo->gen) {
   48598    case 10: return 40;
   48599    case 9: return 40;
   48600    case 8: return 40;
   48601    case 7:
   48602       if (devinfo->is_haswell) {
   48603          return 0;
   48604       } else {
   48605          return 0;
   48606       }
   48607    case 6: return 0;
   48608    case 5: return 0;
   48609    case 4:
   48610       if (devinfo->is_g4x) {
   48611          return 0;
   48612       } else {
   48613          return 0;
   48614       }
   48615    default:
   48616       unreachable("Invalid hardware generation");
   48617    }
   48618 }
   48619 
   48620 
   48621 
   48622 /* 3DSTATE_PS_BLEND::Alpha To Coverage Enable */
   48623 
   48624 
   48625 #define GEN10_3DSTATE_PS_BLEND_AlphaToCoverageEnable_bits  1
   48626 #define GEN9_3DSTATE_PS_BLEND_AlphaToCoverageEnable_bits  1
   48627 #define GEN8_3DSTATE_PS_BLEND_AlphaToCoverageEnable_bits  1
   48628 
   48629 static inline uint32_t ATTRIBUTE_PURE
   48630 _3DSTATE_PS_BLEND_AlphaToCoverageEnable_bits(const struct gen_device_info *devinfo)
   48631 {
   48632    switch (devinfo->gen) {
   48633    case 10: return 1;
   48634    case 9: return 1;
   48635    case 8: return 1;
   48636    case 7:
   48637       if (devinfo->is_haswell) {
   48638          return 0;
   48639       } else {
   48640          return 0;
   48641       }
   48642    case 6: return 0;
   48643    case 5: return 0;
   48644    case 4:
   48645       if (devinfo->is_g4x) {
   48646          return 0;
   48647       } else {
   48648          return 0;
   48649       }
   48650    default:
   48651       unreachable("Invalid hardware generation");
   48652    }
   48653 }
   48654 
   48655 
   48656 
   48657 #define GEN10_3DSTATE_PS_BLEND_AlphaToCoverageEnable_start  63
   48658 #define GEN9_3DSTATE_PS_BLEND_AlphaToCoverageEnable_start  63
   48659 #define GEN8_3DSTATE_PS_BLEND_AlphaToCoverageEnable_start  63
   48660 
   48661 static inline uint32_t ATTRIBUTE_PURE
   48662 _3DSTATE_PS_BLEND_AlphaToCoverageEnable_start(const struct gen_device_info *devinfo)
   48663 {
   48664    switch (devinfo->gen) {
   48665    case 10: return 63;
   48666    case 9: return 63;
   48667    case 8: return 63;
   48668    case 7:
   48669       if (devinfo->is_haswell) {
   48670          return 0;
   48671       } else {
   48672          return 0;
   48673       }
   48674    case 6: return 0;
   48675    case 5: return 0;
   48676    case 4:
   48677       if (devinfo->is_g4x) {
   48678          return 0;
   48679       } else {
   48680          return 0;
   48681       }
   48682    default:
   48683       unreachable("Invalid hardware generation");
   48684    }
   48685 }
   48686 
   48687 
   48688 
   48689 /* 3DSTATE_PS_BLEND::Color Buffer Blend Enable */
   48690 
   48691 
   48692 #define GEN10_3DSTATE_PS_BLEND_ColorBufferBlendEnable_bits  1
   48693 #define GEN9_3DSTATE_PS_BLEND_ColorBufferBlendEnable_bits  1
   48694 #define GEN8_3DSTATE_PS_BLEND_ColorBufferBlendEnable_bits  1
   48695 
   48696 static inline uint32_t ATTRIBUTE_PURE
   48697 _3DSTATE_PS_BLEND_ColorBufferBlendEnable_bits(const struct gen_device_info *devinfo)
   48698 {
   48699    switch (devinfo->gen) {
   48700    case 10: return 1;
   48701    case 9: return 1;
   48702    case 8: return 1;
   48703    case 7:
   48704       if (devinfo->is_haswell) {
   48705          return 0;
   48706       } else {
   48707          return 0;
   48708       }
   48709    case 6: return 0;
   48710    case 5: return 0;
   48711    case 4:
   48712       if (devinfo->is_g4x) {
   48713          return 0;
   48714       } else {
   48715          return 0;
   48716       }
   48717    default:
   48718       unreachable("Invalid hardware generation");
   48719    }
   48720 }
   48721 
   48722 
   48723 
   48724 #define GEN10_3DSTATE_PS_BLEND_ColorBufferBlendEnable_start  61
   48725 #define GEN9_3DSTATE_PS_BLEND_ColorBufferBlendEnable_start  61
   48726 #define GEN8_3DSTATE_PS_BLEND_ColorBufferBlendEnable_start  61
   48727 
   48728 static inline uint32_t ATTRIBUTE_PURE
   48729 _3DSTATE_PS_BLEND_ColorBufferBlendEnable_start(const struct gen_device_info *devinfo)
   48730 {
   48731    switch (devinfo->gen) {
   48732    case 10: return 61;
   48733    case 9: return 61;
   48734    case 8: return 61;
   48735    case 7:
   48736       if (devinfo->is_haswell) {
   48737          return 0;
   48738       } else {
   48739          return 0;
   48740       }
   48741    case 6: return 0;
   48742    case 5: return 0;
   48743    case 4:
   48744       if (devinfo->is_g4x) {
   48745          return 0;
   48746       } else {
   48747          return 0;
   48748       }
   48749    default:
   48750       unreachable("Invalid hardware generation");
   48751    }
   48752 }
   48753 
   48754 
   48755 
   48756 /* 3DSTATE_PS_BLEND::Command SubType */
   48757 
   48758 
   48759 #define GEN10_3DSTATE_PS_BLEND_CommandSubType_bits  2
   48760 #define GEN9_3DSTATE_PS_BLEND_CommandSubType_bits  2
   48761 #define GEN8_3DSTATE_PS_BLEND_CommandSubType_bits  2
   48762 
   48763 static inline uint32_t ATTRIBUTE_PURE
   48764 _3DSTATE_PS_BLEND_CommandSubType_bits(const struct gen_device_info *devinfo)
   48765 {
   48766    switch (devinfo->gen) {
   48767    case 10: return 2;
   48768    case 9: return 2;
   48769    case 8: return 2;
   48770    case 7:
   48771       if (devinfo->is_haswell) {
   48772          return 0;
   48773       } else {
   48774          return 0;
   48775       }
   48776    case 6: return 0;
   48777    case 5: return 0;
   48778    case 4:
   48779       if (devinfo->is_g4x) {
   48780          return 0;
   48781       } else {
   48782          return 0;
   48783       }
   48784    default:
   48785       unreachable("Invalid hardware generation");
   48786    }
   48787 }
   48788 
   48789 
   48790 
   48791 #define GEN10_3DSTATE_PS_BLEND_CommandSubType_start  27
   48792 #define GEN9_3DSTATE_PS_BLEND_CommandSubType_start  27
   48793 #define GEN8_3DSTATE_PS_BLEND_CommandSubType_start  27
   48794 
   48795 static inline uint32_t ATTRIBUTE_PURE
   48796 _3DSTATE_PS_BLEND_CommandSubType_start(const struct gen_device_info *devinfo)
   48797 {
   48798    switch (devinfo->gen) {
   48799    case 10: return 27;
   48800    case 9: return 27;
   48801    case 8: return 27;
   48802    case 7:
   48803       if (devinfo->is_haswell) {
   48804          return 0;
   48805       } else {
   48806          return 0;
   48807       }
   48808    case 6: return 0;
   48809    case 5: return 0;
   48810    case 4:
   48811       if (devinfo->is_g4x) {
   48812          return 0;
   48813       } else {
   48814          return 0;
   48815       }
   48816    default:
   48817       unreachable("Invalid hardware generation");
   48818    }
   48819 }
   48820 
   48821 
   48822 
   48823 /* 3DSTATE_PS_BLEND::Command Type */
   48824 
   48825 
   48826 #define GEN10_3DSTATE_PS_BLEND_CommandType_bits  3
   48827 #define GEN9_3DSTATE_PS_BLEND_CommandType_bits  3
   48828 #define GEN8_3DSTATE_PS_BLEND_CommandType_bits  3
   48829 
   48830 static inline uint32_t ATTRIBUTE_PURE
   48831 _3DSTATE_PS_BLEND_CommandType_bits(const struct gen_device_info *devinfo)
   48832 {
   48833    switch (devinfo->gen) {
   48834    case 10: return 3;
   48835    case 9: return 3;
   48836    case 8: return 3;
   48837    case 7:
   48838       if (devinfo->is_haswell) {
   48839          return 0;
   48840       } else {
   48841          return 0;
   48842       }
   48843    case 6: return 0;
   48844    case 5: return 0;
   48845    case 4:
   48846       if (devinfo->is_g4x) {
   48847          return 0;
   48848       } else {
   48849          return 0;
   48850       }
   48851    default:
   48852       unreachable("Invalid hardware generation");
   48853    }
   48854 }
   48855 
   48856 
   48857 
   48858 #define GEN10_3DSTATE_PS_BLEND_CommandType_start  29
   48859 #define GEN9_3DSTATE_PS_BLEND_CommandType_start  29
   48860 #define GEN8_3DSTATE_PS_BLEND_CommandType_start  29
   48861 
   48862 static inline uint32_t ATTRIBUTE_PURE
   48863 _3DSTATE_PS_BLEND_CommandType_start(const struct gen_device_info *devinfo)
   48864 {
   48865    switch (devinfo->gen) {
   48866    case 10: return 29;
   48867    case 9: return 29;
   48868    case 8: return 29;
   48869    case 7:
   48870       if (devinfo->is_haswell) {
   48871          return 0;
   48872       } else {
   48873          return 0;
   48874       }
   48875    case 6: return 0;
   48876    case 5: return 0;
   48877    case 4:
   48878       if (devinfo->is_g4x) {
   48879          return 0;
   48880       } else {
   48881          return 0;
   48882       }
   48883    default:
   48884       unreachable("Invalid hardware generation");
   48885    }
   48886 }
   48887 
   48888 
   48889 
   48890 /* 3DSTATE_PS_BLEND::DWord Length */
   48891 
   48892 
   48893 #define GEN10_3DSTATE_PS_BLEND_DWordLength_bits  8
   48894 #define GEN9_3DSTATE_PS_BLEND_DWordLength_bits  8
   48895 #define GEN8_3DSTATE_PS_BLEND_DWordLength_bits  8
   48896 
   48897 static inline uint32_t ATTRIBUTE_PURE
   48898 _3DSTATE_PS_BLEND_DWordLength_bits(const struct gen_device_info *devinfo)
   48899 {
   48900    switch (devinfo->gen) {
   48901    case 10: return 8;
   48902    case 9: return 8;
   48903    case 8: return 8;
   48904    case 7:
   48905       if (devinfo->is_haswell) {
   48906          return 0;
   48907       } else {
   48908          return 0;
   48909       }
   48910    case 6: return 0;
   48911    case 5: return 0;
   48912    case 4:
   48913       if (devinfo->is_g4x) {
   48914          return 0;
   48915       } else {
   48916          return 0;
   48917       }
   48918    default:
   48919       unreachable("Invalid hardware generation");
   48920    }
   48921 }
   48922 
   48923 
   48924 
   48925 #define GEN10_3DSTATE_PS_BLEND_DWordLength_start  0
   48926 #define GEN9_3DSTATE_PS_BLEND_DWordLength_start  0
   48927 #define GEN8_3DSTATE_PS_BLEND_DWordLength_start  0
   48928 
   48929 static inline uint32_t ATTRIBUTE_PURE
   48930 _3DSTATE_PS_BLEND_DWordLength_start(const struct gen_device_info *devinfo)
   48931 {
   48932    switch (devinfo->gen) {
   48933    case 10: return 0;
   48934    case 9: return 0;
   48935    case 8: return 0;
   48936    case 7:
   48937       if (devinfo->is_haswell) {
   48938          return 0;
   48939       } else {
   48940          return 0;
   48941       }
   48942    case 6: return 0;
   48943    case 5: return 0;
   48944    case 4:
   48945       if (devinfo->is_g4x) {
   48946          return 0;
   48947       } else {
   48948          return 0;
   48949       }
   48950    default:
   48951       unreachable("Invalid hardware generation");
   48952    }
   48953 }
   48954 
   48955 
   48956 
   48957 /* 3DSTATE_PS_BLEND::Destination Alpha Blend Factor */
   48958 
   48959 
   48960 #define GEN10_3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_bits  5
   48961 #define GEN9_3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_bits  5
   48962 #define GEN8_3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_bits  5
   48963 
   48964 static inline uint32_t ATTRIBUTE_PURE
   48965 _3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_bits(const struct gen_device_info *devinfo)
   48966 {
   48967    switch (devinfo->gen) {
   48968    case 10: return 5;
   48969    case 9: return 5;
   48970    case 8: return 5;
   48971    case 7:
   48972       if (devinfo->is_haswell) {
   48973          return 0;
   48974       } else {
   48975          return 0;
   48976       }
   48977    case 6: return 0;
   48978    case 5: return 0;
   48979    case 4:
   48980       if (devinfo->is_g4x) {
   48981          return 0;
   48982       } else {
   48983          return 0;
   48984       }
   48985    default:
   48986       unreachable("Invalid hardware generation");
   48987    }
   48988 }
   48989 
   48990 
   48991 
   48992 #define GEN10_3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_start  51
   48993 #define GEN9_3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_start  51
   48994 #define GEN8_3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_start  51
   48995 
   48996 static inline uint32_t ATTRIBUTE_PURE
   48997 _3DSTATE_PS_BLEND_DestinationAlphaBlendFactor_start(const struct gen_device_info *devinfo)
   48998 {
   48999    switch (devinfo->gen) {
   49000    case 10: return 51;
   49001    case 9: return 51;
   49002    case 8: return 51;
   49003    case 7:
   49004       if (devinfo->is_haswell) {
   49005          return 0;
   49006       } else {
   49007          return 0;
   49008       }
   49009    case 6: return 0;
   49010    case 5: return 0;
   49011    case 4:
   49012       if (devinfo->is_g4x) {
   49013          return 0;
   49014       } else {
   49015          return 0;
   49016       }
   49017    default:
   49018       unreachable("Invalid hardware generation");
   49019    }
   49020 }
   49021 
   49022 
   49023 
   49024 /* 3DSTATE_PS_BLEND::Destination Blend Factor */
   49025 
   49026 
   49027 #define GEN10_3DSTATE_PS_BLEND_DestinationBlendFactor_bits  5
   49028 #define GEN9_3DSTATE_PS_BLEND_DestinationBlendFactor_bits  5
   49029 #define GEN8_3DSTATE_PS_BLEND_DestinationBlendFactor_bits  5
   49030 
   49031 static inline uint32_t ATTRIBUTE_PURE
   49032 _3DSTATE_PS_BLEND_DestinationBlendFactor_bits(const struct gen_device_info *devinfo)
   49033 {
   49034    switch (devinfo->gen) {
   49035    case 10: return 5;
   49036    case 9: return 5;
   49037    case 8: return 5;
   49038    case 7:
   49039       if (devinfo->is_haswell) {
   49040          return 0;
   49041       } else {
   49042          return 0;
   49043       }
   49044    case 6: return 0;
   49045    case 5: return 0;
   49046    case 4:
   49047       if (devinfo->is_g4x) {
   49048          return 0;
   49049       } else {
   49050          return 0;
   49051       }
   49052    default:
   49053       unreachable("Invalid hardware generation");
   49054    }
   49055 }
   49056 
   49057 
   49058 
   49059 #define GEN10_3DSTATE_PS_BLEND_DestinationBlendFactor_start  41
   49060 #define GEN9_3DSTATE_PS_BLEND_DestinationBlendFactor_start  41
   49061 #define GEN8_3DSTATE_PS_BLEND_DestinationBlendFactor_start  41
   49062 
   49063 static inline uint32_t ATTRIBUTE_PURE
   49064 _3DSTATE_PS_BLEND_DestinationBlendFactor_start(const struct gen_device_info *devinfo)
   49065 {
   49066    switch (devinfo->gen) {
   49067    case 10: return 41;
   49068    case 9: return 41;
   49069    case 8: return 41;
   49070    case 7:
   49071       if (devinfo->is_haswell) {
   49072          return 0;
   49073       } else {
   49074          return 0;
   49075       }
   49076    case 6: return 0;
   49077    case 5: return 0;
   49078    case 4:
   49079       if (devinfo->is_g4x) {
   49080          return 0;
   49081       } else {
   49082          return 0;
   49083       }
   49084    default:
   49085       unreachable("Invalid hardware generation");
   49086    }
   49087 }
   49088 
   49089 
   49090 
   49091 /* 3DSTATE_PS_BLEND::Has Writeable RT */
   49092 
   49093 
   49094 #define GEN10_3DSTATE_PS_BLEND_HasWriteableRT_bits  1
   49095 #define GEN9_3DSTATE_PS_BLEND_HasWriteableRT_bits  1
   49096 #define GEN8_3DSTATE_PS_BLEND_HasWriteableRT_bits  1
   49097 
   49098 static inline uint32_t ATTRIBUTE_PURE
   49099 _3DSTATE_PS_BLEND_HasWriteableRT_bits(const struct gen_device_info *devinfo)
   49100 {
   49101    switch (devinfo->gen) {
   49102    case 10: return 1;
   49103    case 9: return 1;
   49104    case 8: return 1;
   49105    case 7:
   49106       if (devinfo->is_haswell) {
   49107          return 0;
   49108       } else {
   49109          return 0;
   49110       }
   49111    case 6: return 0;
   49112    case 5: return 0;
   49113    case 4:
   49114       if (devinfo->is_g4x) {
   49115          return 0;
   49116       } else {
   49117          return 0;
   49118       }
   49119    default:
   49120       unreachable("Invalid hardware generation");
   49121    }
   49122 }
   49123 
   49124 
   49125 
   49126 #define GEN10_3DSTATE_PS_BLEND_HasWriteableRT_start  62
   49127 #define GEN9_3DSTATE_PS_BLEND_HasWriteableRT_start  62
   49128 #define GEN8_3DSTATE_PS_BLEND_HasWriteableRT_start  62
   49129 
   49130 static inline uint32_t ATTRIBUTE_PURE
   49131 _3DSTATE_PS_BLEND_HasWriteableRT_start(const struct gen_device_info *devinfo)
   49132 {
   49133    switch (devinfo->gen) {
   49134    case 10: return 62;
   49135    case 9: return 62;
   49136    case 8: return 62;
   49137    case 7:
   49138       if (devinfo->is_haswell) {
   49139          return 0;
   49140       } else {
   49141          return 0;
   49142       }
   49143    case 6: return 0;
   49144    case 5: return 0;
   49145    case 4:
   49146       if (devinfo->is_g4x) {
   49147          return 0;
   49148       } else {
   49149          return 0;
   49150       }
   49151    default:
   49152       unreachable("Invalid hardware generation");
   49153    }
   49154 }
   49155 
   49156 
   49157 
   49158 /* 3DSTATE_PS_BLEND::Independent Alpha Blend Enable */
   49159 
   49160 
   49161 #define GEN10_3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_bits  1
   49162 #define GEN9_3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_bits  1
   49163 #define GEN8_3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_bits  1
   49164 
   49165 static inline uint32_t ATTRIBUTE_PURE
   49166 _3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_bits(const struct gen_device_info *devinfo)
   49167 {
   49168    switch (devinfo->gen) {
   49169    case 10: return 1;
   49170    case 9: return 1;
   49171    case 8: return 1;
   49172    case 7:
   49173       if (devinfo->is_haswell) {
   49174          return 0;
   49175       } else {
   49176          return 0;
   49177       }
   49178    case 6: return 0;
   49179    case 5: return 0;
   49180    case 4:
   49181       if (devinfo->is_g4x) {
   49182          return 0;
   49183       } else {
   49184          return 0;
   49185       }
   49186    default:
   49187       unreachable("Invalid hardware generation");
   49188    }
   49189 }
   49190 
   49191 
   49192 
   49193 #define GEN10_3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_start  39
   49194 #define GEN9_3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_start  39
   49195 #define GEN8_3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_start  39
   49196 
   49197 static inline uint32_t ATTRIBUTE_PURE
   49198 _3DSTATE_PS_BLEND_IndependentAlphaBlendEnable_start(const struct gen_device_info *devinfo)
   49199 {
   49200    switch (devinfo->gen) {
   49201    case 10: return 39;
   49202    case 9: return 39;
   49203    case 8: return 39;
   49204    case 7:
   49205       if (devinfo->is_haswell) {
   49206          return 0;
   49207       } else {
   49208          return 0;
   49209       }
   49210    case 6: return 0;
   49211    case 5: return 0;
   49212    case 4:
   49213       if (devinfo->is_g4x) {
   49214          return 0;
   49215       } else {
   49216          return 0;
   49217       }
   49218    default:
   49219       unreachable("Invalid hardware generation");
   49220    }
   49221 }
   49222 
   49223 
   49224 
   49225 /* 3DSTATE_PS_BLEND::Source Alpha Blend Factor */
   49226 
   49227 
   49228 #define GEN10_3DSTATE_PS_BLEND_SourceAlphaBlendFactor_bits  5
   49229 #define GEN9_3DSTATE_PS_BLEND_SourceAlphaBlendFactor_bits  5
   49230 #define GEN8_3DSTATE_PS_BLEND_SourceAlphaBlendFactor_bits  5
   49231 
   49232 static inline uint32_t ATTRIBUTE_PURE
   49233 _3DSTATE_PS_BLEND_SourceAlphaBlendFactor_bits(const struct gen_device_info *devinfo)
   49234 {
   49235    switch (devinfo->gen) {
   49236    case 10: return 5;
   49237    case 9: return 5;
   49238    case 8: return 5;
   49239    case 7:
   49240       if (devinfo->is_haswell) {
   49241          return 0;
   49242       } else {
   49243          return 0;
   49244       }
   49245    case 6: return 0;
   49246    case 5: return 0;
   49247    case 4:
   49248       if (devinfo->is_g4x) {
   49249          return 0;
   49250       } else {
   49251          return 0;
   49252       }
   49253    default:
   49254       unreachable("Invalid hardware generation");
   49255    }
   49256 }
   49257 
   49258 
   49259 
   49260 #define GEN10_3DSTATE_PS_BLEND_SourceAlphaBlendFactor_start  56
   49261 #define GEN9_3DSTATE_PS_BLEND_SourceAlphaBlendFactor_start  56
   49262 #define GEN8_3DSTATE_PS_BLEND_SourceAlphaBlendFactor_start  56
   49263 
   49264 static inline uint32_t ATTRIBUTE_PURE
   49265 _3DSTATE_PS_BLEND_SourceAlphaBlendFactor_start(const struct gen_device_info *devinfo)
   49266 {
   49267    switch (devinfo->gen) {
   49268    case 10: return 56;
   49269    case 9: return 56;
   49270    case 8: return 56;
   49271    case 7:
   49272       if (devinfo->is_haswell) {
   49273          return 0;
   49274       } else {
   49275          return 0;
   49276       }
   49277    case 6: return 0;
   49278    case 5: return 0;
   49279    case 4:
   49280       if (devinfo->is_g4x) {
   49281          return 0;
   49282       } else {
   49283          return 0;
   49284       }
   49285    default:
   49286       unreachable("Invalid hardware generation");
   49287    }
   49288 }
   49289 
   49290 
   49291 
   49292 /* 3DSTATE_PS_BLEND::Source Blend Factor */
   49293 
   49294 
   49295 #define GEN10_3DSTATE_PS_BLEND_SourceBlendFactor_bits  5
   49296 #define GEN9_3DSTATE_PS_BLEND_SourceBlendFactor_bits  5
   49297 #define GEN8_3DSTATE_PS_BLEND_SourceBlendFactor_bits  5
   49298 
   49299 static inline uint32_t ATTRIBUTE_PURE
   49300 _3DSTATE_PS_BLEND_SourceBlendFactor_bits(const struct gen_device_info *devinfo)
   49301 {
   49302    switch (devinfo->gen) {
   49303    case 10: return 5;
   49304    case 9: return 5;
   49305    case 8: return 5;
   49306    case 7:
   49307       if (devinfo->is_haswell) {
   49308          return 0;
   49309       } else {
   49310          return 0;
   49311       }
   49312    case 6: return 0;
   49313    case 5: return 0;
   49314    case 4:
   49315       if (devinfo->is_g4x) {
   49316          return 0;
   49317       } else {
   49318          return 0;
   49319       }
   49320    default:
   49321       unreachable("Invalid hardware generation");
   49322    }
   49323 }
   49324 
   49325 
   49326 
   49327 #define GEN10_3DSTATE_PS_BLEND_SourceBlendFactor_start  46
   49328 #define GEN9_3DSTATE_PS_BLEND_SourceBlendFactor_start  46
   49329 #define GEN8_3DSTATE_PS_BLEND_SourceBlendFactor_start  46
   49330 
   49331 static inline uint32_t ATTRIBUTE_PURE
   49332 _3DSTATE_PS_BLEND_SourceBlendFactor_start(const struct gen_device_info *devinfo)
   49333 {
   49334    switch (devinfo->gen) {
   49335    case 10: return 46;
   49336    case 9: return 46;
   49337    case 8: return 46;
   49338    case 7:
   49339       if (devinfo->is_haswell) {
   49340          return 0;
   49341       } else {
   49342          return 0;
   49343       }
   49344    case 6: return 0;
   49345    case 5: return 0;
   49346    case 4:
   49347       if (devinfo->is_g4x) {
   49348          return 0;
   49349       } else {
   49350          return 0;
   49351       }
   49352    default:
   49353       unreachable("Invalid hardware generation");
   49354    }
   49355 }
   49356 
   49357 
   49358 
   49359 /* 3DSTATE_PS_EXTRA */
   49360 
   49361 
   49362 #define GEN10_3DSTATE_PS_EXTRA_length  2
   49363 #define GEN9_3DSTATE_PS_EXTRA_length  2
   49364 #define GEN8_3DSTATE_PS_EXTRA_length  2
   49365 
   49366 static inline uint32_t ATTRIBUTE_PURE
   49367 _3DSTATE_PS_EXTRA_length(const struct gen_device_info *devinfo)
   49368 {
   49369    switch (devinfo->gen) {
   49370    case 10: return 2;
   49371    case 9: return 2;
   49372    case 8: return 2;
   49373    case 7:
   49374       if (devinfo->is_haswell) {
   49375          return 0;
   49376       } else {
   49377          return 0;
   49378       }
   49379    case 6: return 0;
   49380    case 5: return 0;
   49381    case 4:
   49382       if (devinfo->is_g4x) {
   49383          return 0;
   49384       } else {
   49385          return 0;
   49386       }
   49387    default:
   49388       unreachable("Invalid hardware generation");
   49389    }
   49390 }
   49391 
   49392 
   49393 
   49394 /* 3DSTATE_PS_EXTRA::3D Command Opcode */
   49395 
   49396 
   49397 #define GEN10_3DSTATE_PS_EXTRA_3DCommandOpcode_bits  3
   49398 #define GEN9_3DSTATE_PS_EXTRA_3DCommandOpcode_bits  3
   49399 #define GEN8_3DSTATE_PS_EXTRA_3DCommandOpcode_bits  3
   49400 
   49401 static inline uint32_t ATTRIBUTE_PURE
   49402 _3DSTATE_PS_EXTRA_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   49403 {
   49404    switch (devinfo->gen) {
   49405    case 10: return 3;
   49406    case 9: return 3;
   49407    case 8: return 3;
   49408    case 7:
   49409       if (devinfo->is_haswell) {
   49410          return 0;
   49411       } else {
   49412          return 0;
   49413       }
   49414    case 6: return 0;
   49415    case 5: return 0;
   49416    case 4:
   49417       if (devinfo->is_g4x) {
   49418          return 0;
   49419       } else {
   49420          return 0;
   49421       }
   49422    default:
   49423       unreachable("Invalid hardware generation");
   49424    }
   49425 }
   49426 
   49427 
   49428 
   49429 #define GEN10_3DSTATE_PS_EXTRA_3DCommandOpcode_start  24
   49430 #define GEN9_3DSTATE_PS_EXTRA_3DCommandOpcode_start  24
   49431 #define GEN8_3DSTATE_PS_EXTRA_3DCommandOpcode_start  24
   49432 
   49433 static inline uint32_t ATTRIBUTE_PURE
   49434 _3DSTATE_PS_EXTRA_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   49435 {
   49436    switch (devinfo->gen) {
   49437    case 10: return 24;
   49438    case 9: return 24;
   49439    case 8: return 24;
   49440    case 7:
   49441       if (devinfo->is_haswell) {
   49442          return 0;
   49443       } else {
   49444          return 0;
   49445       }
   49446    case 6: return 0;
   49447    case 5: return 0;
   49448    case 4:
   49449       if (devinfo->is_g4x) {
   49450          return 0;
   49451       } else {
   49452          return 0;
   49453       }
   49454    default:
   49455       unreachable("Invalid hardware generation");
   49456    }
   49457 }
   49458 
   49459 
   49460 
   49461 /* 3DSTATE_PS_EXTRA::3D Command Sub Opcode */
   49462 
   49463 
   49464 #define GEN10_3DSTATE_PS_EXTRA_3DCommandSubOpcode_bits  8
   49465 #define GEN9_3DSTATE_PS_EXTRA_3DCommandSubOpcode_bits  8
   49466 #define GEN8_3DSTATE_PS_EXTRA_3DCommandSubOpcode_bits  8
   49467 
   49468 static inline uint32_t ATTRIBUTE_PURE
   49469 _3DSTATE_PS_EXTRA_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   49470 {
   49471    switch (devinfo->gen) {
   49472    case 10: return 8;
   49473    case 9: return 8;
   49474    case 8: return 8;
   49475    case 7:
   49476       if (devinfo->is_haswell) {
   49477          return 0;
   49478       } else {
   49479          return 0;
   49480       }
   49481    case 6: return 0;
   49482    case 5: return 0;
   49483    case 4:
   49484       if (devinfo->is_g4x) {
   49485          return 0;
   49486       } else {
   49487          return 0;
   49488       }
   49489    default:
   49490       unreachable("Invalid hardware generation");
   49491    }
   49492 }
   49493 
   49494 
   49495 
   49496 #define GEN10_3DSTATE_PS_EXTRA_3DCommandSubOpcode_start  16
   49497 #define GEN9_3DSTATE_PS_EXTRA_3DCommandSubOpcode_start  16
   49498 #define GEN8_3DSTATE_PS_EXTRA_3DCommandSubOpcode_start  16
   49499 
   49500 static inline uint32_t ATTRIBUTE_PURE
   49501 _3DSTATE_PS_EXTRA_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   49502 {
   49503    switch (devinfo->gen) {
   49504    case 10: return 16;
   49505    case 9: return 16;
   49506    case 8: return 16;
   49507    case 7:
   49508       if (devinfo->is_haswell) {
   49509          return 0;
   49510       } else {
   49511          return 0;
   49512       }
   49513    case 6: return 0;
   49514    case 5: return 0;
   49515    case 4:
   49516       if (devinfo->is_g4x) {
   49517          return 0;
   49518       } else {
   49519          return 0;
   49520       }
   49521    default:
   49522       unreachable("Invalid hardware generation");
   49523    }
   49524 }
   49525 
   49526 
   49527 
   49528 /* 3DSTATE_PS_EXTRA::Attribute Enable */
   49529 
   49530 
   49531 #define GEN10_3DSTATE_PS_EXTRA_AttributeEnable_bits  1
   49532 #define GEN9_3DSTATE_PS_EXTRA_AttributeEnable_bits  1
   49533 #define GEN8_3DSTATE_PS_EXTRA_AttributeEnable_bits  1
   49534 
   49535 static inline uint32_t ATTRIBUTE_PURE
   49536 _3DSTATE_PS_EXTRA_AttributeEnable_bits(const struct gen_device_info *devinfo)
   49537 {
   49538    switch (devinfo->gen) {
   49539    case 10: return 1;
   49540    case 9: return 1;
   49541    case 8: return 1;
   49542    case 7:
   49543       if (devinfo->is_haswell) {
   49544          return 0;
   49545       } else {
   49546          return 0;
   49547       }
   49548    case 6: return 0;
   49549    case 5: return 0;
   49550    case 4:
   49551       if (devinfo->is_g4x) {
   49552          return 0;
   49553       } else {
   49554          return 0;
   49555       }
   49556    default:
   49557       unreachable("Invalid hardware generation");
   49558    }
   49559 }
   49560 
   49561 
   49562 
   49563 #define GEN10_3DSTATE_PS_EXTRA_AttributeEnable_start  40
   49564 #define GEN9_3DSTATE_PS_EXTRA_AttributeEnable_start  40
   49565 #define GEN8_3DSTATE_PS_EXTRA_AttributeEnable_start  40
   49566 
   49567 static inline uint32_t ATTRIBUTE_PURE
   49568 _3DSTATE_PS_EXTRA_AttributeEnable_start(const struct gen_device_info *devinfo)
   49569 {
   49570    switch (devinfo->gen) {
   49571    case 10: return 40;
   49572    case 9: return 40;
   49573    case 8: return 40;
   49574    case 7:
   49575       if (devinfo->is_haswell) {
   49576          return 0;
   49577       } else {
   49578          return 0;
   49579       }
   49580    case 6: return 0;
   49581    case 5: return 0;
   49582    case 4:
   49583       if (devinfo->is_g4x) {
   49584          return 0;
   49585       } else {
   49586          return 0;
   49587       }
   49588    default:
   49589       unreachable("Invalid hardware generation");
   49590    }
   49591 }
   49592 
   49593 
   49594 
   49595 /* 3DSTATE_PS_EXTRA::Command SubType */
   49596 
   49597 
   49598 #define GEN10_3DSTATE_PS_EXTRA_CommandSubType_bits  2
   49599 #define GEN9_3DSTATE_PS_EXTRA_CommandSubType_bits  2
   49600 #define GEN8_3DSTATE_PS_EXTRA_CommandSubType_bits  2
   49601 
   49602 static inline uint32_t ATTRIBUTE_PURE
   49603 _3DSTATE_PS_EXTRA_CommandSubType_bits(const struct gen_device_info *devinfo)
   49604 {
   49605    switch (devinfo->gen) {
   49606    case 10: return 2;
   49607    case 9: return 2;
   49608    case 8: return 2;
   49609    case 7:
   49610       if (devinfo->is_haswell) {
   49611          return 0;
   49612       } else {
   49613          return 0;
   49614       }
   49615    case 6: return 0;
   49616    case 5: return 0;
   49617    case 4:
   49618       if (devinfo->is_g4x) {
   49619          return 0;
   49620       } else {
   49621          return 0;
   49622       }
   49623    default:
   49624       unreachable("Invalid hardware generation");
   49625    }
   49626 }
   49627 
   49628 
   49629 
   49630 #define GEN10_3DSTATE_PS_EXTRA_CommandSubType_start  27
   49631 #define GEN9_3DSTATE_PS_EXTRA_CommandSubType_start  27
   49632 #define GEN8_3DSTATE_PS_EXTRA_CommandSubType_start  27
   49633 
   49634 static inline uint32_t ATTRIBUTE_PURE
   49635 _3DSTATE_PS_EXTRA_CommandSubType_start(const struct gen_device_info *devinfo)
   49636 {
   49637    switch (devinfo->gen) {
   49638    case 10: return 27;
   49639    case 9: return 27;
   49640    case 8: return 27;
   49641    case 7:
   49642       if (devinfo->is_haswell) {
   49643          return 0;
   49644       } else {
   49645          return 0;
   49646       }
   49647    case 6: return 0;
   49648    case 5: return 0;
   49649    case 4:
   49650       if (devinfo->is_g4x) {
   49651          return 0;
   49652       } else {
   49653          return 0;
   49654       }
   49655    default:
   49656       unreachable("Invalid hardware generation");
   49657    }
   49658 }
   49659 
   49660 
   49661 
   49662 /* 3DSTATE_PS_EXTRA::Command Type */
   49663 
   49664 
   49665 #define GEN10_3DSTATE_PS_EXTRA_CommandType_bits  3
   49666 #define GEN9_3DSTATE_PS_EXTRA_CommandType_bits  3
   49667 #define GEN8_3DSTATE_PS_EXTRA_CommandType_bits  3
   49668 
   49669 static inline uint32_t ATTRIBUTE_PURE
   49670 _3DSTATE_PS_EXTRA_CommandType_bits(const struct gen_device_info *devinfo)
   49671 {
   49672    switch (devinfo->gen) {
   49673    case 10: return 3;
   49674    case 9: return 3;
   49675    case 8: return 3;
   49676    case 7:
   49677       if (devinfo->is_haswell) {
   49678          return 0;
   49679       } else {
   49680          return 0;
   49681       }
   49682    case 6: return 0;
   49683    case 5: return 0;
   49684    case 4:
   49685       if (devinfo->is_g4x) {
   49686          return 0;
   49687       } else {
   49688          return 0;
   49689       }
   49690    default:
   49691       unreachable("Invalid hardware generation");
   49692    }
   49693 }
   49694 
   49695 
   49696 
   49697 #define GEN10_3DSTATE_PS_EXTRA_CommandType_start  29
   49698 #define GEN9_3DSTATE_PS_EXTRA_CommandType_start  29
   49699 #define GEN8_3DSTATE_PS_EXTRA_CommandType_start  29
   49700 
   49701 static inline uint32_t ATTRIBUTE_PURE
   49702 _3DSTATE_PS_EXTRA_CommandType_start(const struct gen_device_info *devinfo)
   49703 {
   49704    switch (devinfo->gen) {
   49705    case 10: return 29;
   49706    case 9: return 29;
   49707    case 8: return 29;
   49708    case 7:
   49709       if (devinfo->is_haswell) {
   49710          return 0;
   49711       } else {
   49712          return 0;
   49713       }
   49714    case 6: return 0;
   49715    case 5: return 0;
   49716    case 4:
   49717       if (devinfo->is_g4x) {
   49718          return 0;
   49719       } else {
   49720          return 0;
   49721       }
   49722    default:
   49723       unreachable("Invalid hardware generation");
   49724    }
   49725 }
   49726 
   49727 
   49728 
   49729 /* 3DSTATE_PS_EXTRA::DWord Length */
   49730 
   49731 
   49732 #define GEN10_3DSTATE_PS_EXTRA_DWordLength_bits  8
   49733 #define GEN9_3DSTATE_PS_EXTRA_DWordLength_bits  8
   49734 #define GEN8_3DSTATE_PS_EXTRA_DWordLength_bits  8
   49735 
   49736 static inline uint32_t ATTRIBUTE_PURE
   49737 _3DSTATE_PS_EXTRA_DWordLength_bits(const struct gen_device_info *devinfo)
   49738 {
   49739    switch (devinfo->gen) {
   49740    case 10: return 8;
   49741    case 9: return 8;
   49742    case 8: return 8;
   49743    case 7:
   49744       if (devinfo->is_haswell) {
   49745          return 0;
   49746       } else {
   49747          return 0;
   49748       }
   49749    case 6: return 0;
   49750    case 5: return 0;
   49751    case 4:
   49752       if (devinfo->is_g4x) {
   49753          return 0;
   49754       } else {
   49755          return 0;
   49756       }
   49757    default:
   49758       unreachable("Invalid hardware generation");
   49759    }
   49760 }
   49761 
   49762 
   49763 
   49764 #define GEN10_3DSTATE_PS_EXTRA_DWordLength_start  0
   49765 #define GEN9_3DSTATE_PS_EXTRA_DWordLength_start  0
   49766 #define GEN8_3DSTATE_PS_EXTRA_DWordLength_start  0
   49767 
   49768 static inline uint32_t ATTRIBUTE_PURE
   49769 _3DSTATE_PS_EXTRA_DWordLength_start(const struct gen_device_info *devinfo)
   49770 {
   49771    switch (devinfo->gen) {
   49772    case 10: return 0;
   49773    case 9: return 0;
   49774    case 8: return 0;
   49775    case 7:
   49776       if (devinfo->is_haswell) {
   49777          return 0;
   49778       } else {
   49779          return 0;
   49780       }
   49781    case 6: return 0;
   49782    case 5: return 0;
   49783    case 4:
   49784       if (devinfo->is_g4x) {
   49785          return 0;
   49786       } else {
   49787          return 0;
   49788       }
   49789    default:
   49790       unreachable("Invalid hardware generation");
   49791    }
   49792 }
   49793 
   49794 
   49795 
   49796 /* 3DSTATE_PS_EXTRA::Force Computed Depth */
   49797 
   49798 
   49799 #define GEN10_3DSTATE_PS_EXTRA_ForceComputedDepth_bits  1
   49800 #define GEN9_3DSTATE_PS_EXTRA_ForceComputedDepth_bits  1
   49801 #define GEN8_3DSTATE_PS_EXTRA_ForceComputedDepth_bits  1
   49802 
   49803 static inline uint32_t ATTRIBUTE_PURE
   49804 _3DSTATE_PS_EXTRA_ForceComputedDepth_bits(const struct gen_device_info *devinfo)
   49805 {
   49806    switch (devinfo->gen) {
   49807    case 10: return 1;
   49808    case 9: return 1;
   49809    case 8: return 1;
   49810    case 7:
   49811       if (devinfo->is_haswell) {
   49812          return 0;
   49813       } else {
   49814          return 0;
   49815       }
   49816    case 6: return 0;
   49817    case 5: return 0;
   49818    case 4:
   49819       if (devinfo->is_g4x) {
   49820          return 0;
   49821       } else {
   49822          return 0;
   49823       }
   49824    default:
   49825       unreachable("Invalid hardware generation");
   49826    }
   49827 }
   49828 
   49829 
   49830 
   49831 #define GEN10_3DSTATE_PS_EXTRA_ForceComputedDepth_start  57
   49832 #define GEN9_3DSTATE_PS_EXTRA_ForceComputedDepth_start  57
   49833 #define GEN8_3DSTATE_PS_EXTRA_ForceComputedDepth_start  57
   49834 
   49835 static inline uint32_t ATTRIBUTE_PURE
   49836 _3DSTATE_PS_EXTRA_ForceComputedDepth_start(const struct gen_device_info *devinfo)
   49837 {
   49838    switch (devinfo->gen) {
   49839    case 10: return 57;
   49840    case 9: return 57;
   49841    case 8: return 57;
   49842    case 7:
   49843       if (devinfo->is_haswell) {
   49844          return 0;
   49845       } else {
   49846          return 0;
   49847       }
   49848    case 6: return 0;
   49849    case 5: return 0;
   49850    case 4:
   49851       if (devinfo->is_g4x) {
   49852          return 0;
   49853       } else {
   49854          return 0;
   49855       }
   49856    default:
   49857       unreachable("Invalid hardware generation");
   49858    }
   49859 }
   49860 
   49861 
   49862 
   49863 /* 3DSTATE_PS_EXTRA::Input Coverage Mask State */
   49864 
   49865 
   49866 #define GEN10_3DSTATE_PS_EXTRA_InputCoverageMaskState_bits  2
   49867 #define GEN9_3DSTATE_PS_EXTRA_InputCoverageMaskState_bits  2
   49868 
   49869 static inline uint32_t ATTRIBUTE_PURE
   49870 _3DSTATE_PS_EXTRA_InputCoverageMaskState_bits(const struct gen_device_info *devinfo)
   49871 {
   49872    switch (devinfo->gen) {
   49873    case 10: return 2;
   49874    case 9: return 2;
   49875    case 8: return 0;
   49876    case 7:
   49877       if (devinfo->is_haswell) {
   49878          return 0;
   49879       } else {
   49880          return 0;
   49881       }
   49882    case 6: return 0;
   49883    case 5: return 0;
   49884    case 4:
   49885       if (devinfo->is_g4x) {
   49886          return 0;
   49887       } else {
   49888          return 0;
   49889       }
   49890    default:
   49891       unreachable("Invalid hardware generation");
   49892    }
   49893 }
   49894 
   49895 
   49896 
   49897 #define GEN10_3DSTATE_PS_EXTRA_InputCoverageMaskState_start  32
   49898 #define GEN9_3DSTATE_PS_EXTRA_InputCoverageMaskState_start  32
   49899 
   49900 static inline uint32_t ATTRIBUTE_PURE
   49901 _3DSTATE_PS_EXTRA_InputCoverageMaskState_start(const struct gen_device_info *devinfo)
   49902 {
   49903    switch (devinfo->gen) {
   49904    case 10: return 32;
   49905    case 9: return 32;
   49906    case 8: return 0;
   49907    case 7:
   49908       if (devinfo->is_haswell) {
   49909          return 0;
   49910       } else {
   49911          return 0;
   49912       }
   49913    case 6: return 0;
   49914    case 5: return 0;
   49915    case 4:
   49916       if (devinfo->is_g4x) {
   49917          return 0;
   49918       } else {
   49919          return 0;
   49920       }
   49921    default:
   49922       unreachable("Invalid hardware generation");
   49923    }
   49924 }
   49925 
   49926 
   49927 
   49928 /* 3DSTATE_PS_EXTRA::Pixel Shader Computed Depth Mode */
   49929 
   49930 
   49931 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_bits  2
   49932 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_bits  2
   49933 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_bits  2
   49934 
   49935 static inline uint32_t ATTRIBUTE_PURE
   49936 _3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_bits(const struct gen_device_info *devinfo)
   49937 {
   49938    switch (devinfo->gen) {
   49939    case 10: return 2;
   49940    case 9: return 2;
   49941    case 8: return 2;
   49942    case 7:
   49943       if (devinfo->is_haswell) {
   49944          return 0;
   49945       } else {
   49946          return 0;
   49947       }
   49948    case 6: return 0;
   49949    case 5: return 0;
   49950    case 4:
   49951       if (devinfo->is_g4x) {
   49952          return 0;
   49953       } else {
   49954          return 0;
   49955       }
   49956    default:
   49957       unreachable("Invalid hardware generation");
   49958    }
   49959 }
   49960 
   49961 
   49962 
   49963 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_start  58
   49964 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_start  58
   49965 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_start  58
   49966 
   49967 static inline uint32_t ATTRIBUTE_PURE
   49968 _3DSTATE_PS_EXTRA_PixelShaderComputedDepthMode_start(const struct gen_device_info *devinfo)
   49969 {
   49970    switch (devinfo->gen) {
   49971    case 10: return 58;
   49972    case 9: return 58;
   49973    case 8: return 58;
   49974    case 7:
   49975       if (devinfo->is_haswell) {
   49976          return 0;
   49977       } else {
   49978          return 0;
   49979       }
   49980    case 6: return 0;
   49981    case 5: return 0;
   49982    case 4:
   49983       if (devinfo->is_g4x) {
   49984          return 0;
   49985       } else {
   49986          return 0;
   49987       }
   49988    default:
   49989       unreachable("Invalid hardware generation");
   49990    }
   49991 }
   49992 
   49993 
   49994 
   49995 /* 3DSTATE_PS_EXTRA::Pixel Shader Computes Stencil */
   49996 
   49997 
   49998 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderComputesStencil_bits  1
   49999 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderComputesStencil_bits  1
   50000 
   50001 static inline uint32_t ATTRIBUTE_PURE
   50002 _3DSTATE_PS_EXTRA_PixelShaderComputesStencil_bits(const struct gen_device_info *devinfo)
   50003 {
   50004    switch (devinfo->gen) {
   50005    case 10: return 1;
   50006    case 9: return 1;
   50007    case 8: return 0;
   50008    case 7:
   50009       if (devinfo->is_haswell) {
   50010          return 0;
   50011       } else {
   50012          return 0;
   50013       }
   50014    case 6: return 0;
   50015    case 5: return 0;
   50016    case 4:
   50017       if (devinfo->is_g4x) {
   50018          return 0;
   50019       } else {
   50020          return 0;
   50021       }
   50022    default:
   50023       unreachable("Invalid hardware generation");
   50024    }
   50025 }
   50026 
   50027 
   50028 
   50029 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderComputesStencil_start  37
   50030 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderComputesStencil_start  37
   50031 
   50032 static inline uint32_t ATTRIBUTE_PURE
   50033 _3DSTATE_PS_EXTRA_PixelShaderComputesStencil_start(const struct gen_device_info *devinfo)
   50034 {
   50035    switch (devinfo->gen) {
   50036    case 10: return 37;
   50037    case 9: return 37;
   50038    case 8: return 0;
   50039    case 7:
   50040       if (devinfo->is_haswell) {
   50041          return 0;
   50042       } else {
   50043          return 0;
   50044       }
   50045    case 6: return 0;
   50046    case 5: return 0;
   50047    case 4:
   50048       if (devinfo->is_g4x) {
   50049          return 0;
   50050       } else {
   50051          return 0;
   50052       }
   50053    default:
   50054       unreachable("Invalid hardware generation");
   50055    }
   50056 }
   50057 
   50058 
   50059 
   50060 /* 3DSTATE_PS_EXTRA::Pixel Shader Disables Alpha To Coverage */
   50061 
   50062 
   50063 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_bits  1
   50064 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_bits  1
   50065 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_bits  1
   50066 
   50067 static inline uint32_t ATTRIBUTE_PURE
   50068 _3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_bits(const struct gen_device_info *devinfo)
   50069 {
   50070    switch (devinfo->gen) {
   50071    case 10: return 1;
   50072    case 9: return 1;
   50073    case 8: return 1;
   50074    case 7:
   50075       if (devinfo->is_haswell) {
   50076          return 0;
   50077       } else {
   50078          return 0;
   50079       }
   50080    case 6: return 0;
   50081    case 5: return 0;
   50082    case 4:
   50083       if (devinfo->is_g4x) {
   50084          return 0;
   50085       } else {
   50086          return 0;
   50087       }
   50088    default:
   50089       unreachable("Invalid hardware generation");
   50090    }
   50091 }
   50092 
   50093 
   50094 
   50095 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_start  39
   50096 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_start  39
   50097 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_start  39
   50098 
   50099 static inline uint32_t ATTRIBUTE_PURE
   50100 _3DSTATE_PS_EXTRA_PixelShaderDisablesAlphaToCoverage_start(const struct gen_device_info *devinfo)
   50101 {
   50102    switch (devinfo->gen) {
   50103    case 10: return 39;
   50104    case 9: return 39;
   50105    case 8: return 39;
   50106    case 7:
   50107       if (devinfo->is_haswell) {
   50108          return 0;
   50109       } else {
   50110          return 0;
   50111       }
   50112    case 6: return 0;
   50113    case 5: return 0;
   50114    case 4:
   50115       if (devinfo->is_g4x) {
   50116          return 0;
   50117       } else {
   50118          return 0;
   50119       }
   50120    default:
   50121       unreachable("Invalid hardware generation");
   50122    }
   50123 }
   50124 
   50125 
   50126 
   50127 /* 3DSTATE_PS_EXTRA::Pixel Shader Does not write to RT */
   50128 
   50129 
   50130 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_bits  1
   50131 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_bits  1
   50132 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_bits  1
   50133 
   50134 static inline uint32_t ATTRIBUTE_PURE
   50135 _3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_bits(const struct gen_device_info *devinfo)
   50136 {
   50137    switch (devinfo->gen) {
   50138    case 10: return 1;
   50139    case 9: return 1;
   50140    case 8: return 1;
   50141    case 7:
   50142       if (devinfo->is_haswell) {
   50143          return 0;
   50144       } else {
   50145          return 0;
   50146       }
   50147    case 6: return 0;
   50148    case 5: return 0;
   50149    case 4:
   50150       if (devinfo->is_g4x) {
   50151          return 0;
   50152       } else {
   50153          return 0;
   50154       }
   50155    default:
   50156       unreachable("Invalid hardware generation");
   50157    }
   50158 }
   50159 
   50160 
   50161 
   50162 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_start  62
   50163 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_start  62
   50164 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_start  62
   50165 
   50166 static inline uint32_t ATTRIBUTE_PURE
   50167 _3DSTATE_PS_EXTRA_PixelShaderDoesnotwritetoRT_start(const struct gen_device_info *devinfo)
   50168 {
   50169    switch (devinfo->gen) {
   50170    case 10: return 62;
   50171    case 9: return 62;
   50172    case 8: return 62;
   50173    case 7:
   50174       if (devinfo->is_haswell) {
   50175          return 0;
   50176       } else {
   50177          return 0;
   50178       }
   50179    case 6: return 0;
   50180    case 5: return 0;
   50181    case 4:
   50182       if (devinfo->is_g4x) {
   50183          return 0;
   50184       } else {
   50185          return 0;
   50186       }
   50187    default:
   50188       unreachable("Invalid hardware generation");
   50189    }
   50190 }
   50191 
   50192 
   50193 
   50194 /* 3DSTATE_PS_EXTRA::Pixel Shader Has UAV */
   50195 
   50196 
   50197 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderHasUAV_bits  1
   50198 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderHasUAV_bits  1
   50199 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderHasUAV_bits  1
   50200 
   50201 static inline uint32_t ATTRIBUTE_PURE
   50202 _3DSTATE_PS_EXTRA_PixelShaderHasUAV_bits(const struct gen_device_info *devinfo)
   50203 {
   50204    switch (devinfo->gen) {
   50205    case 10: return 1;
   50206    case 9: return 1;
   50207    case 8: return 1;
   50208    case 7:
   50209       if (devinfo->is_haswell) {
   50210          return 0;
   50211       } else {
   50212          return 0;
   50213       }
   50214    case 6: return 0;
   50215    case 5: return 0;
   50216    case 4:
   50217       if (devinfo->is_g4x) {
   50218          return 0;
   50219       } else {
   50220          return 0;
   50221       }
   50222    default:
   50223       unreachable("Invalid hardware generation");
   50224    }
   50225 }
   50226 
   50227 
   50228 
   50229 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderHasUAV_start  34
   50230 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderHasUAV_start  34
   50231 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderHasUAV_start  34
   50232 
   50233 static inline uint32_t ATTRIBUTE_PURE
   50234 _3DSTATE_PS_EXTRA_PixelShaderHasUAV_start(const struct gen_device_info *devinfo)
   50235 {
   50236    switch (devinfo->gen) {
   50237    case 10: return 34;
   50238    case 9: return 34;
   50239    case 8: return 34;
   50240    case 7:
   50241       if (devinfo->is_haswell) {
   50242          return 0;
   50243       } else {
   50244          return 0;
   50245       }
   50246    case 6: return 0;
   50247    case 5: return 0;
   50248    case 4:
   50249       if (devinfo->is_g4x) {
   50250          return 0;
   50251       } else {
   50252          return 0;
   50253       }
   50254    default:
   50255       unreachable("Invalid hardware generation");
   50256    }
   50257 }
   50258 
   50259 
   50260 
   50261 /* 3DSTATE_PS_EXTRA::Pixel Shader Is Per Sample */
   50262 
   50263 
   50264 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderIsPerSample_bits  1
   50265 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderIsPerSample_bits  1
   50266 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderIsPerSample_bits  1
   50267 
   50268 static inline uint32_t ATTRIBUTE_PURE
   50269 _3DSTATE_PS_EXTRA_PixelShaderIsPerSample_bits(const struct gen_device_info *devinfo)
   50270 {
   50271    switch (devinfo->gen) {
   50272    case 10: return 1;
   50273    case 9: return 1;
   50274    case 8: return 1;
   50275    case 7:
   50276       if (devinfo->is_haswell) {
   50277          return 0;
   50278       } else {
   50279          return 0;
   50280       }
   50281    case 6: return 0;
   50282    case 5: return 0;
   50283    case 4:
   50284       if (devinfo->is_g4x) {
   50285          return 0;
   50286       } else {
   50287          return 0;
   50288       }
   50289    default:
   50290       unreachable("Invalid hardware generation");
   50291    }
   50292 }
   50293 
   50294 
   50295 
   50296 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderIsPerSample_start  38
   50297 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderIsPerSample_start  38
   50298 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderIsPerSample_start  38
   50299 
   50300 static inline uint32_t ATTRIBUTE_PURE
   50301 _3DSTATE_PS_EXTRA_PixelShaderIsPerSample_start(const struct gen_device_info *devinfo)
   50302 {
   50303    switch (devinfo->gen) {
   50304    case 10: return 38;
   50305    case 9: return 38;
   50306    case 8: return 38;
   50307    case 7:
   50308       if (devinfo->is_haswell) {
   50309          return 0;
   50310       } else {
   50311          return 0;
   50312       }
   50313    case 6: return 0;
   50314    case 5: return 0;
   50315    case 4:
   50316       if (devinfo->is_g4x) {
   50317          return 0;
   50318       } else {
   50319          return 0;
   50320       }
   50321    default:
   50322       unreachable("Invalid hardware generation");
   50323    }
   50324 }
   50325 
   50326 
   50327 
   50328 /* 3DSTATE_PS_EXTRA::Pixel Shader Kills Pixel */
   50329 
   50330 
   50331 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderKillsPixel_bits  1
   50332 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderKillsPixel_bits  1
   50333 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderKillsPixel_bits  1
   50334 
   50335 static inline uint32_t ATTRIBUTE_PURE
   50336 _3DSTATE_PS_EXTRA_PixelShaderKillsPixel_bits(const struct gen_device_info *devinfo)
   50337 {
   50338    switch (devinfo->gen) {
   50339    case 10: return 1;
   50340    case 9: return 1;
   50341    case 8: return 1;
   50342    case 7:
   50343       if (devinfo->is_haswell) {
   50344          return 0;
   50345       } else {
   50346          return 0;
   50347       }
   50348    case 6: return 0;
   50349    case 5: return 0;
   50350    case 4:
   50351       if (devinfo->is_g4x) {
   50352          return 0;
   50353       } else {
   50354          return 0;
   50355       }
   50356    default:
   50357       unreachable("Invalid hardware generation");
   50358    }
   50359 }
   50360 
   50361 
   50362 
   50363 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderKillsPixel_start  60
   50364 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderKillsPixel_start  60
   50365 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderKillsPixel_start  60
   50366 
   50367 static inline uint32_t ATTRIBUTE_PURE
   50368 _3DSTATE_PS_EXTRA_PixelShaderKillsPixel_start(const struct gen_device_info *devinfo)
   50369 {
   50370    switch (devinfo->gen) {
   50371    case 10: return 60;
   50372    case 9: return 60;
   50373    case 8: return 60;
   50374    case 7:
   50375       if (devinfo->is_haswell) {
   50376          return 0;
   50377       } else {
   50378          return 0;
   50379       }
   50380    case 6: return 0;
   50381    case 5: return 0;
   50382    case 4:
   50383       if (devinfo->is_g4x) {
   50384          return 0;
   50385       } else {
   50386          return 0;
   50387       }
   50388    default:
   50389       unreachable("Invalid hardware generation");
   50390    }
   50391 }
   50392 
   50393 
   50394 
   50395 /* 3DSTATE_PS_EXTRA::Pixel Shader Pulls Bary */
   50396 
   50397 
   50398 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderPullsBary_bits  1
   50399 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderPullsBary_bits  1
   50400 
   50401 static inline uint32_t ATTRIBUTE_PURE
   50402 _3DSTATE_PS_EXTRA_PixelShaderPullsBary_bits(const struct gen_device_info *devinfo)
   50403 {
   50404    switch (devinfo->gen) {
   50405    case 10: return 1;
   50406    case 9: return 1;
   50407    case 8: return 0;
   50408    case 7:
   50409       if (devinfo->is_haswell) {
   50410          return 0;
   50411       } else {
   50412          return 0;
   50413       }
   50414    case 6: return 0;
   50415    case 5: return 0;
   50416    case 4:
   50417       if (devinfo->is_g4x) {
   50418          return 0;
   50419       } else {
   50420          return 0;
   50421       }
   50422    default:
   50423       unreachable("Invalid hardware generation");
   50424    }
   50425 }
   50426 
   50427 
   50428 
   50429 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderPullsBary_start  35
   50430 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderPullsBary_start  35
   50431 
   50432 static inline uint32_t ATTRIBUTE_PURE
   50433 _3DSTATE_PS_EXTRA_PixelShaderPullsBary_start(const struct gen_device_info *devinfo)
   50434 {
   50435    switch (devinfo->gen) {
   50436    case 10: return 35;
   50437    case 9: return 35;
   50438    case 8: return 0;
   50439    case 7:
   50440       if (devinfo->is_haswell) {
   50441          return 0;
   50442       } else {
   50443          return 0;
   50444       }
   50445    case 6: return 0;
   50446    case 5: return 0;
   50447    case 4:
   50448       if (devinfo->is_g4x) {
   50449          return 0;
   50450       } else {
   50451          return 0;
   50452       }
   50453    default:
   50454       unreachable("Invalid hardware generation");
   50455    }
   50456 }
   50457 
   50458 
   50459 
   50460 /* 3DSTATE_PS_EXTRA::Pixel Shader Requires Non-Perspective Bary Plane Coefficients */
   50461 
   50462 
   50463 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients_bits  1
   50464 
   50465 static inline uint32_t ATTRIBUTE_PURE
   50466 _3DSTATE_PS_EXTRA_PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients_bits(const struct gen_device_info *devinfo)
   50467 {
   50468    switch (devinfo->gen) {
   50469    case 10: return 1;
   50470    case 9: return 0;
   50471    case 8: return 0;
   50472    case 7:
   50473       if (devinfo->is_haswell) {
   50474          return 0;
   50475       } else {
   50476          return 0;
   50477       }
   50478    case 6: return 0;
   50479    case 5: return 0;
   50480    case 4:
   50481       if (devinfo->is_g4x) {
   50482          return 0;
   50483       } else {
   50484          return 0;
   50485       }
   50486    default:
   50487       unreachable("Invalid hardware generation");
   50488    }
   50489 }
   50490 
   50491 
   50492 
   50493 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients_start  51
   50494 
   50495 static inline uint32_t ATTRIBUTE_PURE
   50496 _3DSTATE_PS_EXTRA_PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients_start(const struct gen_device_info *devinfo)
   50497 {
   50498    switch (devinfo->gen) {
   50499    case 10: return 51;
   50500    case 9: return 0;
   50501    case 8: return 0;
   50502    case 7:
   50503       if (devinfo->is_haswell) {
   50504          return 0;
   50505       } else {
   50506          return 0;
   50507       }
   50508    case 6: return 0;
   50509    case 5: return 0;
   50510    case 4:
   50511       if (devinfo->is_g4x) {
   50512          return 0;
   50513       } else {
   50514          return 0;
   50515       }
   50516    default:
   50517       unreachable("Invalid hardware generation");
   50518    }
   50519 }
   50520 
   50521 
   50522 
   50523 /* 3DSTATE_PS_EXTRA::Pixel Shader Requires Perspective Bary Plane Coefficients */
   50524 
   50525 
   50526 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresPerspectiveBaryPlaneCoefficients_bits  1
   50527 
   50528 static inline uint32_t ATTRIBUTE_PURE
   50529 _3DSTATE_PS_EXTRA_PixelShaderRequiresPerspectiveBaryPlaneCoefficients_bits(const struct gen_device_info *devinfo)
   50530 {
   50531    switch (devinfo->gen) {
   50532    case 10: return 1;
   50533    case 9: return 0;
   50534    case 8: return 0;
   50535    case 7:
   50536       if (devinfo->is_haswell) {
   50537          return 0;
   50538       } else {
   50539          return 0;
   50540       }
   50541    case 6: return 0;
   50542    case 5: return 0;
   50543    case 4:
   50544       if (devinfo->is_g4x) {
   50545          return 0;
   50546       } else {
   50547          return 0;
   50548       }
   50549    default:
   50550       unreachable("Invalid hardware generation");
   50551    }
   50552 }
   50553 
   50554 
   50555 
   50556 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresPerspectiveBaryPlaneCoefficients_start  52
   50557 
   50558 static inline uint32_t ATTRIBUTE_PURE
   50559 _3DSTATE_PS_EXTRA_PixelShaderRequiresPerspectiveBaryPlaneCoefficients_start(const struct gen_device_info *devinfo)
   50560 {
   50561    switch (devinfo->gen) {
   50562    case 10: return 52;
   50563    case 9: return 0;
   50564    case 8: return 0;
   50565    case 7:
   50566       if (devinfo->is_haswell) {
   50567          return 0;
   50568       } else {
   50569          return 0;
   50570       }
   50571    case 6: return 0;
   50572    case 5: return 0;
   50573    case 4:
   50574       if (devinfo->is_g4x) {
   50575          return 0;
   50576       } else {
   50577          return 0;
   50578       }
   50579    default:
   50580       unreachable("Invalid hardware generation");
   50581    }
   50582 }
   50583 
   50584 
   50585 
   50586 /* 3DSTATE_PS_EXTRA::Pixel Shader Requires Source Depth and/or W Plane Coefficients */
   50587 
   50588 
   50589 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresSourceDepthandorWPlaneCoefficients_bits  1
   50590 
   50591 static inline uint32_t ATTRIBUTE_PURE
   50592 _3DSTATE_PS_EXTRA_PixelShaderRequiresSourceDepthandorWPlaneCoefficients_bits(const struct gen_device_info *devinfo)
   50593 {
   50594    switch (devinfo->gen) {
   50595    case 10: return 1;
   50596    case 9: return 0;
   50597    case 8: return 0;
   50598    case 7:
   50599       if (devinfo->is_haswell) {
   50600          return 0;
   50601       } else {
   50602          return 0;
   50603       }
   50604    case 6: return 0;
   50605    case 5: return 0;
   50606    case 4:
   50607       if (devinfo->is_g4x) {
   50608          return 0;
   50609       } else {
   50610          return 0;
   50611       }
   50612    default:
   50613       unreachable("Invalid hardware generation");
   50614    }
   50615 }
   50616 
   50617 
   50618 
   50619 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresSourceDepthandorWPlaneCoefficients_start  53
   50620 
   50621 static inline uint32_t ATTRIBUTE_PURE
   50622 _3DSTATE_PS_EXTRA_PixelShaderRequiresSourceDepthandorWPlaneCoefficients_start(const struct gen_device_info *devinfo)
   50623 {
   50624    switch (devinfo->gen) {
   50625    case 10: return 53;
   50626    case 9: return 0;
   50627    case 8: return 0;
   50628    case 7:
   50629       if (devinfo->is_haswell) {
   50630          return 0;
   50631       } else {
   50632          return 0;
   50633       }
   50634    case 6: return 0;
   50635    case 5: return 0;
   50636    case 4:
   50637       if (devinfo->is_g4x) {
   50638          return 0;
   50639       } else {
   50640          return 0;
   50641       }
   50642    default:
   50643       unreachable("Invalid hardware generation");
   50644    }
   50645 }
   50646 
   50647 
   50648 
   50649 /* 3DSTATE_PS_EXTRA::Pixel Shader Requires Subpixel Sample Offsets */
   50650 
   50651 
   50652 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresSubpixelSampleOffsets_bits  1
   50653 
   50654 static inline uint32_t ATTRIBUTE_PURE
   50655 _3DSTATE_PS_EXTRA_PixelShaderRequiresSubpixelSampleOffsets_bits(const struct gen_device_info *devinfo)
   50656 {
   50657    switch (devinfo->gen) {
   50658    case 10: return 1;
   50659    case 9: return 0;
   50660    case 8: return 0;
   50661    case 7:
   50662       if (devinfo->is_haswell) {
   50663          return 0;
   50664       } else {
   50665          return 0;
   50666       }
   50667    case 6: return 0;
   50668    case 5: return 0;
   50669    case 4:
   50670       if (devinfo->is_g4x) {
   50671          return 0;
   50672       } else {
   50673          return 0;
   50674       }
   50675    default:
   50676       unreachable("Invalid hardware generation");
   50677    }
   50678 }
   50679 
   50680 
   50681 
   50682 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderRequiresSubpixelSampleOffsets_start  50
   50683 
   50684 static inline uint32_t ATTRIBUTE_PURE
   50685 _3DSTATE_PS_EXTRA_PixelShaderRequiresSubpixelSampleOffsets_start(const struct gen_device_info *devinfo)
   50686 {
   50687    switch (devinfo->gen) {
   50688    case 10: return 50;
   50689    case 9: return 0;
   50690    case 8: return 0;
   50691    case 7:
   50692       if (devinfo->is_haswell) {
   50693          return 0;
   50694       } else {
   50695          return 0;
   50696       }
   50697    case 6: return 0;
   50698    case 5: return 0;
   50699    case 4:
   50700       if (devinfo->is_g4x) {
   50701          return 0;
   50702       } else {
   50703          return 0;
   50704       }
   50705    default:
   50706       unreachable("Invalid hardware generation");
   50707    }
   50708 }
   50709 
   50710 
   50711 
   50712 /* 3DSTATE_PS_EXTRA::Pixel Shader Uses Input Coverage Mask */
   50713 
   50714 
   50715 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderUsesInputCoverageMask_bits  1
   50716 
   50717 static inline uint32_t ATTRIBUTE_PURE
   50718 _3DSTATE_PS_EXTRA_PixelShaderUsesInputCoverageMask_bits(const struct gen_device_info *devinfo)
   50719 {
   50720    switch (devinfo->gen) {
   50721    case 10: return 0;
   50722    case 9: return 0;
   50723    case 8: return 1;
   50724    case 7:
   50725       if (devinfo->is_haswell) {
   50726          return 0;
   50727       } else {
   50728          return 0;
   50729       }
   50730    case 6: return 0;
   50731    case 5: return 0;
   50732    case 4:
   50733       if (devinfo->is_g4x) {
   50734          return 0;
   50735       } else {
   50736          return 0;
   50737       }
   50738    default:
   50739       unreachable("Invalid hardware generation");
   50740    }
   50741 }
   50742 
   50743 
   50744 
   50745 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderUsesInputCoverageMask_start  33
   50746 
   50747 static inline uint32_t ATTRIBUTE_PURE
   50748 _3DSTATE_PS_EXTRA_PixelShaderUsesInputCoverageMask_start(const struct gen_device_info *devinfo)
   50749 {
   50750    switch (devinfo->gen) {
   50751    case 10: return 0;
   50752    case 9: return 0;
   50753    case 8: return 33;
   50754    case 7:
   50755       if (devinfo->is_haswell) {
   50756          return 0;
   50757       } else {
   50758          return 0;
   50759       }
   50760    case 6: return 0;
   50761    case 5: return 0;
   50762    case 4:
   50763       if (devinfo->is_g4x) {
   50764          return 0;
   50765       } else {
   50766          return 0;
   50767       }
   50768    default:
   50769       unreachable("Invalid hardware generation");
   50770    }
   50771 }
   50772 
   50773 
   50774 
   50775 /* 3DSTATE_PS_EXTRA::Pixel Shader Uses Source Depth */
   50776 
   50777 
   50778 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_bits  1
   50779 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_bits  1
   50780 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_bits  1
   50781 
   50782 static inline uint32_t ATTRIBUTE_PURE
   50783 _3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_bits(const struct gen_device_info *devinfo)
   50784 {
   50785    switch (devinfo->gen) {
   50786    case 10: return 1;
   50787    case 9: return 1;
   50788    case 8: return 1;
   50789    case 7:
   50790       if (devinfo->is_haswell) {
   50791          return 0;
   50792       } else {
   50793          return 0;
   50794       }
   50795    case 6: return 0;
   50796    case 5: return 0;
   50797    case 4:
   50798       if (devinfo->is_g4x) {
   50799          return 0;
   50800       } else {
   50801          return 0;
   50802       }
   50803    default:
   50804       unreachable("Invalid hardware generation");
   50805    }
   50806 }
   50807 
   50808 
   50809 
   50810 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_start  56
   50811 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_start  56
   50812 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_start  56
   50813 
   50814 static inline uint32_t ATTRIBUTE_PURE
   50815 _3DSTATE_PS_EXTRA_PixelShaderUsesSourceDepth_start(const struct gen_device_info *devinfo)
   50816 {
   50817    switch (devinfo->gen) {
   50818    case 10: return 56;
   50819    case 9: return 56;
   50820    case 8: return 56;
   50821    case 7:
   50822       if (devinfo->is_haswell) {
   50823          return 0;
   50824       } else {
   50825          return 0;
   50826       }
   50827    case 6: return 0;
   50828    case 5: return 0;
   50829    case 4:
   50830       if (devinfo->is_g4x) {
   50831          return 0;
   50832       } else {
   50833          return 0;
   50834       }
   50835    default:
   50836       unreachable("Invalid hardware generation");
   50837    }
   50838 }
   50839 
   50840 
   50841 
   50842 /* 3DSTATE_PS_EXTRA::Pixel Shader Uses Source W */
   50843 
   50844 
   50845 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_bits  1
   50846 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_bits  1
   50847 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_bits  1
   50848 
   50849 static inline uint32_t ATTRIBUTE_PURE
   50850 _3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_bits(const struct gen_device_info *devinfo)
   50851 {
   50852    switch (devinfo->gen) {
   50853    case 10: return 1;
   50854    case 9: return 1;
   50855    case 8: return 1;
   50856    case 7:
   50857       if (devinfo->is_haswell) {
   50858          return 0;
   50859       } else {
   50860          return 0;
   50861       }
   50862    case 6: return 0;
   50863    case 5: return 0;
   50864    case 4:
   50865       if (devinfo->is_g4x) {
   50866          return 0;
   50867       } else {
   50868          return 0;
   50869       }
   50870    default:
   50871       unreachable("Invalid hardware generation");
   50872    }
   50873 }
   50874 
   50875 
   50876 
   50877 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_start  55
   50878 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_start  55
   50879 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_start  55
   50880 
   50881 static inline uint32_t ATTRIBUTE_PURE
   50882 _3DSTATE_PS_EXTRA_PixelShaderUsesSourceW_start(const struct gen_device_info *devinfo)
   50883 {
   50884    switch (devinfo->gen) {
   50885    case 10: return 55;
   50886    case 9: return 55;
   50887    case 8: return 55;
   50888    case 7:
   50889       if (devinfo->is_haswell) {
   50890          return 0;
   50891       } else {
   50892          return 0;
   50893       }
   50894    case 6: return 0;
   50895    case 5: return 0;
   50896    case 4:
   50897       if (devinfo->is_g4x) {
   50898          return 0;
   50899       } else {
   50900          return 0;
   50901       }
   50902    default:
   50903       unreachable("Invalid hardware generation");
   50904    }
   50905 }
   50906 
   50907 
   50908 
   50909 /* 3DSTATE_PS_EXTRA::Pixel Shader Valid */
   50910 
   50911 
   50912 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderValid_bits  1
   50913 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderValid_bits  1
   50914 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderValid_bits  1
   50915 
   50916 static inline uint32_t ATTRIBUTE_PURE
   50917 _3DSTATE_PS_EXTRA_PixelShaderValid_bits(const struct gen_device_info *devinfo)
   50918 {
   50919    switch (devinfo->gen) {
   50920    case 10: return 1;
   50921    case 9: return 1;
   50922    case 8: return 1;
   50923    case 7:
   50924       if (devinfo->is_haswell) {
   50925          return 0;
   50926       } else {
   50927          return 0;
   50928       }
   50929    case 6: return 0;
   50930    case 5: return 0;
   50931    case 4:
   50932       if (devinfo->is_g4x) {
   50933          return 0;
   50934       } else {
   50935          return 0;
   50936       }
   50937    default:
   50938       unreachable("Invalid hardware generation");
   50939    }
   50940 }
   50941 
   50942 
   50943 
   50944 #define GEN10_3DSTATE_PS_EXTRA_PixelShaderValid_start  63
   50945 #define GEN9_3DSTATE_PS_EXTRA_PixelShaderValid_start  63
   50946 #define GEN8_3DSTATE_PS_EXTRA_PixelShaderValid_start  63
   50947 
   50948 static inline uint32_t ATTRIBUTE_PURE
   50949 _3DSTATE_PS_EXTRA_PixelShaderValid_start(const struct gen_device_info *devinfo)
   50950 {
   50951    switch (devinfo->gen) {
   50952    case 10: return 63;
   50953    case 9: return 63;
   50954    case 8: return 63;
   50955    case 7:
   50956       if (devinfo->is_haswell) {
   50957          return 0;
   50958       } else {
   50959          return 0;
   50960       }
   50961    case 6: return 0;
   50962    case 5: return 0;
   50963    case 4:
   50964       if (devinfo->is_g4x) {
   50965          return 0;
   50966       } else {
   50967          return 0;
   50968       }
   50969    default:
   50970       unreachable("Invalid hardware generation");
   50971    }
   50972 }
   50973 
   50974 
   50975 
   50976 /* 3DSTATE_PS_EXTRA::Simple PS Hint */
   50977 
   50978 
   50979 #define GEN10_3DSTATE_PS_EXTRA_SimplePSHint_bits  1
   50980 
   50981 static inline uint32_t ATTRIBUTE_PURE
   50982 _3DSTATE_PS_EXTRA_SimplePSHint_bits(const struct gen_device_info *devinfo)
   50983 {
   50984    switch (devinfo->gen) {
   50985    case 10: return 1;
   50986    case 9: return 0;
   50987    case 8: return 0;
   50988    case 7:
   50989       if (devinfo->is_haswell) {
   50990          return 0;
   50991       } else {
   50992          return 0;
   50993       }
   50994    case 6: return 0;
   50995    case 5: return 0;
   50996    case 4:
   50997       if (devinfo->is_g4x) {
   50998          return 0;
   50999       } else {
   51000          return 0;
   51001       }
   51002    default:
   51003       unreachable("Invalid hardware generation");
   51004    }
   51005 }
   51006 
   51007 
   51008 
   51009 #define GEN10_3DSTATE_PS_EXTRA_SimplePSHint_start  41
   51010 
   51011 static inline uint32_t ATTRIBUTE_PURE
   51012 _3DSTATE_PS_EXTRA_SimplePSHint_start(const struct gen_device_info *devinfo)
   51013 {
   51014    switch (devinfo->gen) {
   51015    case 10: return 41;
   51016    case 9: return 0;
   51017    case 8: return 0;
   51018    case 7:
   51019       if (devinfo->is_haswell) {
   51020          return 0;
   51021       } else {
   51022          return 0;
   51023       }
   51024    case 6: return 0;
   51025    case 5: return 0;
   51026    case 4:
   51027       if (devinfo->is_g4x) {
   51028          return 0;
   51029       } else {
   51030          return 0;
   51031       }
   51032    default:
   51033       unreachable("Invalid hardware generation");
   51034    }
   51035 }
   51036 
   51037 
   51038 
   51039 /* 3DSTATE_PS_EXTRA::oMask Present to Render Target */
   51040 
   51041 
   51042 #define GEN10_3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_bits  1
   51043 #define GEN9_3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_bits  1
   51044 #define GEN8_3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_bits  1
   51045 
   51046 static inline uint32_t ATTRIBUTE_PURE
   51047 _3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_bits(const struct gen_device_info *devinfo)
   51048 {
   51049    switch (devinfo->gen) {
   51050    case 10: return 1;
   51051    case 9: return 1;
   51052    case 8: return 1;
   51053    case 7:
   51054       if (devinfo->is_haswell) {
   51055          return 0;
   51056       } else {
   51057          return 0;
   51058       }
   51059    case 6: return 0;
   51060    case 5: return 0;
   51061    case 4:
   51062       if (devinfo->is_g4x) {
   51063          return 0;
   51064       } else {
   51065          return 0;
   51066       }
   51067    default:
   51068       unreachable("Invalid hardware generation");
   51069    }
   51070 }
   51071 
   51072 
   51073 
   51074 #define GEN10_3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_start  61
   51075 #define GEN9_3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_start  61
   51076 #define GEN8_3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_start  61
   51077 
   51078 static inline uint32_t ATTRIBUTE_PURE
   51079 _3DSTATE_PS_EXTRA_oMaskPresenttoRenderTarget_start(const struct gen_device_info *devinfo)
   51080 {
   51081    switch (devinfo->gen) {
   51082    case 10: return 61;
   51083    case 9: return 61;
   51084    case 8: return 61;
   51085    case 7:
   51086       if (devinfo->is_haswell) {
   51087          return 0;
   51088       } else {
   51089          return 0;
   51090       }
   51091    case 6: return 0;
   51092    case 5: return 0;
   51093    case 4:
   51094       if (devinfo->is_g4x) {
   51095          return 0;
   51096       } else {
   51097          return 0;
   51098       }
   51099    default:
   51100       unreachable("Invalid hardware generation");
   51101    }
   51102 }
   51103 
   51104 
   51105 
   51106 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS */
   51107 
   51108 
   51109 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length  2
   51110 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length  2
   51111 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length  2
   51112 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length  2
   51113 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length  2
   51114 
   51115 static inline uint32_t ATTRIBUTE_PURE
   51116 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_length(const struct gen_device_info *devinfo)
   51117 {
   51118    switch (devinfo->gen) {
   51119    case 10: return 2;
   51120    case 9: return 2;
   51121    case 8: return 2;
   51122    case 7:
   51123       if (devinfo->is_haswell) {
   51124          return 2;
   51125       } else {
   51126          return 2;
   51127       }
   51128    case 6: return 0;
   51129    case 5: return 0;
   51130    case 4:
   51131       if (devinfo->is_g4x) {
   51132          return 0;
   51133       } else {
   51134          return 0;
   51135       }
   51136    default:
   51137       unreachable("Invalid hardware generation");
   51138    }
   51139 }
   51140 
   51141 
   51142 
   51143 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS::3D Command Opcode */
   51144 
   51145 
   51146 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_bits  3
   51147 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_bits  3
   51148 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_bits  3
   51149 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_bits  3
   51150 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_bits  3
   51151 
   51152 static inline uint32_t ATTRIBUTE_PURE
   51153 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   51154 {
   51155    switch (devinfo->gen) {
   51156    case 10: return 3;
   51157    case 9: return 3;
   51158    case 8: return 3;
   51159    case 7:
   51160       if (devinfo->is_haswell) {
   51161          return 3;
   51162       } else {
   51163          return 3;
   51164       }
   51165    case 6: return 0;
   51166    case 5: return 0;
   51167    case 4:
   51168       if (devinfo->is_g4x) {
   51169          return 0;
   51170       } else {
   51171          return 0;
   51172       }
   51173    default:
   51174       unreachable("Invalid hardware generation");
   51175    }
   51176 }
   51177 
   51178 
   51179 
   51180 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_start  24
   51181 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_start  24
   51182 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_start  24
   51183 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_start  24
   51184 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_start  24
   51185 
   51186 static inline uint32_t ATTRIBUTE_PURE
   51187 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   51188 {
   51189    switch (devinfo->gen) {
   51190    case 10: return 24;
   51191    case 9: return 24;
   51192    case 8: return 24;
   51193    case 7:
   51194       if (devinfo->is_haswell) {
   51195          return 24;
   51196       } else {
   51197          return 24;
   51198       }
   51199    case 6: return 0;
   51200    case 5: return 0;
   51201    case 4:
   51202       if (devinfo->is_g4x) {
   51203          return 0;
   51204       } else {
   51205          return 0;
   51206       }
   51207    default:
   51208       unreachable("Invalid hardware generation");
   51209    }
   51210 }
   51211 
   51212 
   51213 
   51214 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS::3D Command Sub Opcode */
   51215 
   51216 
   51217 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_bits  8
   51218 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_bits  8
   51219 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_bits  8
   51220 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_bits  8
   51221 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_bits  8
   51222 
   51223 static inline uint32_t ATTRIBUTE_PURE
   51224 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   51225 {
   51226    switch (devinfo->gen) {
   51227    case 10: return 8;
   51228    case 9: return 8;
   51229    case 8: return 8;
   51230    case 7:
   51231       if (devinfo->is_haswell) {
   51232          return 8;
   51233       } else {
   51234          return 8;
   51235       }
   51236    case 6: return 0;
   51237    case 5: return 0;
   51238    case 4:
   51239       if (devinfo->is_g4x) {
   51240          return 0;
   51241       } else {
   51242          return 0;
   51243       }
   51244    default:
   51245       unreachable("Invalid hardware generation");
   51246    }
   51247 }
   51248 
   51249 
   51250 
   51251 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_start  16
   51252 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_start  16
   51253 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_start  16
   51254 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_start  16
   51255 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_start  16
   51256 
   51257 static inline uint32_t ATTRIBUTE_PURE
   51258 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   51259 {
   51260    switch (devinfo->gen) {
   51261    case 10: return 16;
   51262    case 9: return 16;
   51263    case 8: return 16;
   51264    case 7:
   51265       if (devinfo->is_haswell) {
   51266          return 16;
   51267       } else {
   51268          return 16;
   51269       }
   51270    case 6: return 0;
   51271    case 5: return 0;
   51272    case 4:
   51273       if (devinfo->is_g4x) {
   51274          return 0;
   51275       } else {
   51276          return 0;
   51277       }
   51278    default:
   51279       unreachable("Invalid hardware generation");
   51280    }
   51281 }
   51282 
   51283 
   51284 
   51285 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS::Command SubType */
   51286 
   51287 
   51288 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_bits  2
   51289 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_bits  2
   51290 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_bits  2
   51291 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_bits  2
   51292 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_bits  2
   51293 
   51294 static inline uint32_t ATTRIBUTE_PURE
   51295 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   51296 {
   51297    switch (devinfo->gen) {
   51298    case 10: return 2;
   51299    case 9: return 2;
   51300    case 8: return 2;
   51301    case 7:
   51302       if (devinfo->is_haswell) {
   51303          return 2;
   51304       } else {
   51305          return 2;
   51306       }
   51307    case 6: return 0;
   51308    case 5: return 0;
   51309    case 4:
   51310       if (devinfo->is_g4x) {
   51311          return 0;
   51312       } else {
   51313          return 0;
   51314       }
   51315    default:
   51316       unreachable("Invalid hardware generation");
   51317    }
   51318 }
   51319 
   51320 
   51321 
   51322 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_start  27
   51323 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_start  27
   51324 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_start  27
   51325 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_start  27
   51326 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_start  27
   51327 
   51328 static inline uint32_t ATTRIBUTE_PURE
   51329 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   51330 {
   51331    switch (devinfo->gen) {
   51332    case 10: return 27;
   51333    case 9: return 27;
   51334    case 8: return 27;
   51335    case 7:
   51336       if (devinfo->is_haswell) {
   51337          return 27;
   51338       } else {
   51339          return 27;
   51340       }
   51341    case 6: return 0;
   51342    case 5: return 0;
   51343    case 4:
   51344       if (devinfo->is_g4x) {
   51345          return 0;
   51346       } else {
   51347          return 0;
   51348       }
   51349    default:
   51350       unreachable("Invalid hardware generation");
   51351    }
   51352 }
   51353 
   51354 
   51355 
   51356 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS::Command Type */
   51357 
   51358 
   51359 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_bits  3
   51360 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_bits  3
   51361 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_bits  3
   51362 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_bits  3
   51363 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_bits  3
   51364 
   51365 static inline uint32_t ATTRIBUTE_PURE
   51366 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_bits(const struct gen_device_info *devinfo)
   51367 {
   51368    switch (devinfo->gen) {
   51369    case 10: return 3;
   51370    case 9: return 3;
   51371    case 8: return 3;
   51372    case 7:
   51373       if (devinfo->is_haswell) {
   51374          return 3;
   51375       } else {
   51376          return 3;
   51377       }
   51378    case 6: return 0;
   51379    case 5: return 0;
   51380    case 4:
   51381       if (devinfo->is_g4x) {
   51382          return 0;
   51383       } else {
   51384          return 0;
   51385       }
   51386    default:
   51387       unreachable("Invalid hardware generation");
   51388    }
   51389 }
   51390 
   51391 
   51392 
   51393 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_start  29
   51394 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_start  29
   51395 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_start  29
   51396 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_start  29
   51397 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_start  29
   51398 
   51399 static inline uint32_t ATTRIBUTE_PURE
   51400 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_CommandType_start(const struct gen_device_info *devinfo)
   51401 {
   51402    switch (devinfo->gen) {
   51403    case 10: return 29;
   51404    case 9: return 29;
   51405    case 8: return 29;
   51406    case 7:
   51407       if (devinfo->is_haswell) {
   51408          return 29;
   51409       } else {
   51410          return 29;
   51411       }
   51412    case 6: return 0;
   51413    case 5: return 0;
   51414    case 4:
   51415       if (devinfo->is_g4x) {
   51416          return 0;
   51417       } else {
   51418          return 0;
   51419       }
   51420    default:
   51421       unreachable("Invalid hardware generation");
   51422    }
   51423 }
   51424 
   51425 
   51426 
   51427 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS::Constant Buffer Offset */
   51428 
   51429 
   51430 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_bits  5
   51431 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_bits  5
   51432 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_bits  5
   51433 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_bits  5
   51434 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_bits  4
   51435 
   51436 static inline uint32_t ATTRIBUTE_PURE
   51437 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_bits(const struct gen_device_info *devinfo)
   51438 {
   51439    switch (devinfo->gen) {
   51440    case 10: return 5;
   51441    case 9: return 5;
   51442    case 8: return 5;
   51443    case 7:
   51444       if (devinfo->is_haswell) {
   51445          return 5;
   51446       } else {
   51447          return 4;
   51448       }
   51449    case 6: return 0;
   51450    case 5: return 0;
   51451    case 4:
   51452       if (devinfo->is_g4x) {
   51453          return 0;
   51454       } else {
   51455          return 0;
   51456       }
   51457    default:
   51458       unreachable("Invalid hardware generation");
   51459    }
   51460 }
   51461 
   51462 
   51463 
   51464 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_start  48
   51465 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_start  48
   51466 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_start  48
   51467 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_start  48
   51468 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_start  48
   51469 
   51470 static inline uint32_t ATTRIBUTE_PURE
   51471 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferOffset_start(const struct gen_device_info *devinfo)
   51472 {
   51473    switch (devinfo->gen) {
   51474    case 10: return 48;
   51475    case 9: return 48;
   51476    case 8: return 48;
   51477    case 7:
   51478       if (devinfo->is_haswell) {
   51479          return 48;
   51480       } else {
   51481          return 48;
   51482       }
   51483    case 6: return 0;
   51484    case 5: return 0;
   51485    case 4:
   51486       if (devinfo->is_g4x) {
   51487          return 0;
   51488       } else {
   51489          return 0;
   51490       }
   51491    default:
   51492       unreachable("Invalid hardware generation");
   51493    }
   51494 }
   51495 
   51496 
   51497 
   51498 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS::Constant Buffer Size */
   51499 
   51500 
   51501 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_bits  6
   51502 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_bits  6
   51503 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_bits  6
   51504 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_bits  6
   51505 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_bits  5
   51506 
   51507 static inline uint32_t ATTRIBUTE_PURE
   51508 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_bits(const struct gen_device_info *devinfo)
   51509 {
   51510    switch (devinfo->gen) {
   51511    case 10: return 6;
   51512    case 9: return 6;
   51513    case 8: return 6;
   51514    case 7:
   51515       if (devinfo->is_haswell) {
   51516          return 6;
   51517       } else {
   51518          return 5;
   51519       }
   51520    case 6: return 0;
   51521    case 5: return 0;
   51522    case 4:
   51523       if (devinfo->is_g4x) {
   51524          return 0;
   51525       } else {
   51526          return 0;
   51527       }
   51528    default:
   51529       unreachable("Invalid hardware generation");
   51530    }
   51531 }
   51532 
   51533 
   51534 
   51535 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_start  32
   51536 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_start  32
   51537 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_start  32
   51538 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_start  32
   51539 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_start  32
   51540 
   51541 static inline uint32_t ATTRIBUTE_PURE
   51542 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_ConstantBufferSize_start(const struct gen_device_info *devinfo)
   51543 {
   51544    switch (devinfo->gen) {
   51545    case 10: return 32;
   51546    case 9: return 32;
   51547    case 8: return 32;
   51548    case 7:
   51549       if (devinfo->is_haswell) {
   51550          return 32;
   51551       } else {
   51552          return 32;
   51553       }
   51554    case 6: return 0;
   51555    case 5: return 0;
   51556    case 4:
   51557       if (devinfo->is_g4x) {
   51558          return 0;
   51559       } else {
   51560          return 0;
   51561       }
   51562    default:
   51563       unreachable("Invalid hardware generation");
   51564    }
   51565 }
   51566 
   51567 
   51568 
   51569 /* 3DSTATE_PUSH_CONSTANT_ALLOC_DS::DWord Length */
   51570 
   51571 
   51572 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_bits  8
   51573 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_bits  8
   51574 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_bits  8
   51575 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_bits  8
   51576 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_bits  8
   51577 
   51578 static inline uint32_t ATTRIBUTE_PURE
   51579 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   51580 {
   51581    switch (devinfo->gen) {
   51582    case 10: return 8;
   51583    case 9: return 8;
   51584    case 8: return 8;
   51585    case 7:
   51586       if (devinfo->is_haswell) {
   51587          return 8;
   51588       } else {
   51589          return 8;
   51590       }
   51591    case 6: return 0;
   51592    case 5: return 0;
   51593    case 4:
   51594       if (devinfo->is_g4x) {
   51595          return 0;
   51596       } else {
   51597          return 0;
   51598       }
   51599    default:
   51600       unreachable("Invalid hardware generation");
   51601    }
   51602 }
   51603 
   51604 
   51605 
   51606 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_start  0
   51607 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_start  0
   51608 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_start  0
   51609 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_start  0
   51610 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_start  0
   51611 
   51612 static inline uint32_t ATTRIBUTE_PURE
   51613 _3DSTATE_PUSH_CONSTANT_ALLOC_DS_DWordLength_start(const struct gen_device_info *devinfo)
   51614 {
   51615    switch (devinfo->gen) {
   51616    case 10: return 0;
   51617    case 9: return 0;
   51618    case 8: return 0;
   51619    case 7:
   51620       if (devinfo->is_haswell) {
   51621          return 0;
   51622       } else {
   51623          return 0;
   51624       }
   51625    case 6: return 0;
   51626    case 5: return 0;
   51627    case 4:
   51628       if (devinfo->is_g4x) {
   51629          return 0;
   51630       } else {
   51631          return 0;
   51632       }
   51633    default:
   51634       unreachable("Invalid hardware generation");
   51635    }
   51636 }
   51637 
   51638 
   51639 
   51640 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS */
   51641 
   51642 
   51643 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length  2
   51644 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length  2
   51645 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length  2
   51646 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length  2
   51647 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length  2
   51648 
   51649 static inline uint32_t ATTRIBUTE_PURE
   51650 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_length(const struct gen_device_info *devinfo)
   51651 {
   51652    switch (devinfo->gen) {
   51653    case 10: return 2;
   51654    case 9: return 2;
   51655    case 8: return 2;
   51656    case 7:
   51657       if (devinfo->is_haswell) {
   51658          return 2;
   51659       } else {
   51660          return 2;
   51661       }
   51662    case 6: return 0;
   51663    case 5: return 0;
   51664    case 4:
   51665       if (devinfo->is_g4x) {
   51666          return 0;
   51667       } else {
   51668          return 0;
   51669       }
   51670    default:
   51671       unreachable("Invalid hardware generation");
   51672    }
   51673 }
   51674 
   51675 
   51676 
   51677 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS::3D Command Opcode */
   51678 
   51679 
   51680 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_bits  3
   51681 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_bits  3
   51682 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_bits  3
   51683 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_bits  3
   51684 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_bits  3
   51685 
   51686 static inline uint32_t ATTRIBUTE_PURE
   51687 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   51688 {
   51689    switch (devinfo->gen) {
   51690    case 10: return 3;
   51691    case 9: return 3;
   51692    case 8: return 3;
   51693    case 7:
   51694       if (devinfo->is_haswell) {
   51695          return 3;
   51696       } else {
   51697          return 3;
   51698       }
   51699    case 6: return 0;
   51700    case 5: return 0;
   51701    case 4:
   51702       if (devinfo->is_g4x) {
   51703          return 0;
   51704       } else {
   51705          return 0;
   51706       }
   51707    default:
   51708       unreachable("Invalid hardware generation");
   51709    }
   51710 }
   51711 
   51712 
   51713 
   51714 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_start  24
   51715 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_start  24
   51716 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_start  24
   51717 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_start  24
   51718 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_start  24
   51719 
   51720 static inline uint32_t ATTRIBUTE_PURE
   51721 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   51722 {
   51723    switch (devinfo->gen) {
   51724    case 10: return 24;
   51725    case 9: return 24;
   51726    case 8: return 24;
   51727    case 7:
   51728       if (devinfo->is_haswell) {
   51729          return 24;
   51730       } else {
   51731          return 24;
   51732       }
   51733    case 6: return 0;
   51734    case 5: return 0;
   51735    case 4:
   51736       if (devinfo->is_g4x) {
   51737          return 0;
   51738       } else {
   51739          return 0;
   51740       }
   51741    default:
   51742       unreachable("Invalid hardware generation");
   51743    }
   51744 }
   51745 
   51746 
   51747 
   51748 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS::3D Command Sub Opcode */
   51749 
   51750 
   51751 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_bits  8
   51752 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_bits  8
   51753 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_bits  8
   51754 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_bits  8
   51755 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_bits  8
   51756 
   51757 static inline uint32_t ATTRIBUTE_PURE
   51758 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   51759 {
   51760    switch (devinfo->gen) {
   51761    case 10: return 8;
   51762    case 9: return 8;
   51763    case 8: return 8;
   51764    case 7:
   51765       if (devinfo->is_haswell) {
   51766          return 8;
   51767       } else {
   51768          return 8;
   51769       }
   51770    case 6: return 0;
   51771    case 5: return 0;
   51772    case 4:
   51773       if (devinfo->is_g4x) {
   51774          return 0;
   51775       } else {
   51776          return 0;
   51777       }
   51778    default:
   51779       unreachable("Invalid hardware generation");
   51780    }
   51781 }
   51782 
   51783 
   51784 
   51785 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_start  16
   51786 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_start  16
   51787 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_start  16
   51788 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_start  16
   51789 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_start  16
   51790 
   51791 static inline uint32_t ATTRIBUTE_PURE
   51792 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   51793 {
   51794    switch (devinfo->gen) {
   51795    case 10: return 16;
   51796    case 9: return 16;
   51797    case 8: return 16;
   51798    case 7:
   51799       if (devinfo->is_haswell) {
   51800          return 16;
   51801       } else {
   51802          return 16;
   51803       }
   51804    case 6: return 0;
   51805    case 5: return 0;
   51806    case 4:
   51807       if (devinfo->is_g4x) {
   51808          return 0;
   51809       } else {
   51810          return 0;
   51811       }
   51812    default:
   51813       unreachable("Invalid hardware generation");
   51814    }
   51815 }
   51816 
   51817 
   51818 
   51819 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS::Command SubType */
   51820 
   51821 
   51822 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_bits  2
   51823 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_bits  2
   51824 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_bits  2
   51825 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_bits  2
   51826 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_bits  2
   51827 
   51828 static inline uint32_t ATTRIBUTE_PURE
   51829 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   51830 {
   51831    switch (devinfo->gen) {
   51832    case 10: return 2;
   51833    case 9: return 2;
   51834    case 8: return 2;
   51835    case 7:
   51836       if (devinfo->is_haswell) {
   51837          return 2;
   51838       } else {
   51839          return 2;
   51840       }
   51841    case 6: return 0;
   51842    case 5: return 0;
   51843    case 4:
   51844       if (devinfo->is_g4x) {
   51845          return 0;
   51846       } else {
   51847          return 0;
   51848       }
   51849    default:
   51850       unreachable("Invalid hardware generation");
   51851    }
   51852 }
   51853 
   51854 
   51855 
   51856 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_start  27
   51857 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_start  27
   51858 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_start  27
   51859 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_start  27
   51860 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_start  27
   51861 
   51862 static inline uint32_t ATTRIBUTE_PURE
   51863 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   51864 {
   51865    switch (devinfo->gen) {
   51866    case 10: return 27;
   51867    case 9: return 27;
   51868    case 8: return 27;
   51869    case 7:
   51870       if (devinfo->is_haswell) {
   51871          return 27;
   51872       } else {
   51873          return 27;
   51874       }
   51875    case 6: return 0;
   51876    case 5: return 0;
   51877    case 4:
   51878       if (devinfo->is_g4x) {
   51879          return 0;
   51880       } else {
   51881          return 0;
   51882       }
   51883    default:
   51884       unreachable("Invalid hardware generation");
   51885    }
   51886 }
   51887 
   51888 
   51889 
   51890 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS::Command Type */
   51891 
   51892 
   51893 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_bits  3
   51894 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_bits  3
   51895 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_bits  3
   51896 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_bits  3
   51897 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_bits  3
   51898 
   51899 static inline uint32_t ATTRIBUTE_PURE
   51900 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_bits(const struct gen_device_info *devinfo)
   51901 {
   51902    switch (devinfo->gen) {
   51903    case 10: return 3;
   51904    case 9: return 3;
   51905    case 8: return 3;
   51906    case 7:
   51907       if (devinfo->is_haswell) {
   51908          return 3;
   51909       } else {
   51910          return 3;
   51911       }
   51912    case 6: return 0;
   51913    case 5: return 0;
   51914    case 4:
   51915       if (devinfo->is_g4x) {
   51916          return 0;
   51917       } else {
   51918          return 0;
   51919       }
   51920    default:
   51921       unreachable("Invalid hardware generation");
   51922    }
   51923 }
   51924 
   51925 
   51926 
   51927 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_start  29
   51928 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_start  29
   51929 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_start  29
   51930 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_start  29
   51931 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_start  29
   51932 
   51933 static inline uint32_t ATTRIBUTE_PURE
   51934 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_CommandType_start(const struct gen_device_info *devinfo)
   51935 {
   51936    switch (devinfo->gen) {
   51937    case 10: return 29;
   51938    case 9: return 29;
   51939    case 8: return 29;
   51940    case 7:
   51941       if (devinfo->is_haswell) {
   51942          return 29;
   51943       } else {
   51944          return 29;
   51945       }
   51946    case 6: return 0;
   51947    case 5: return 0;
   51948    case 4:
   51949       if (devinfo->is_g4x) {
   51950          return 0;
   51951       } else {
   51952          return 0;
   51953       }
   51954    default:
   51955       unreachable("Invalid hardware generation");
   51956    }
   51957 }
   51958 
   51959 
   51960 
   51961 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS::Constant Buffer Offset */
   51962 
   51963 
   51964 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_bits  5
   51965 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_bits  5
   51966 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_bits  5
   51967 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_bits  5
   51968 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_bits  4
   51969 
   51970 static inline uint32_t ATTRIBUTE_PURE
   51971 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_bits(const struct gen_device_info *devinfo)
   51972 {
   51973    switch (devinfo->gen) {
   51974    case 10: return 5;
   51975    case 9: return 5;
   51976    case 8: return 5;
   51977    case 7:
   51978       if (devinfo->is_haswell) {
   51979          return 5;
   51980       } else {
   51981          return 4;
   51982       }
   51983    case 6: return 0;
   51984    case 5: return 0;
   51985    case 4:
   51986       if (devinfo->is_g4x) {
   51987          return 0;
   51988       } else {
   51989          return 0;
   51990       }
   51991    default:
   51992       unreachable("Invalid hardware generation");
   51993    }
   51994 }
   51995 
   51996 
   51997 
   51998 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_start  48
   51999 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_start  48
   52000 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_start  48
   52001 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_start  48
   52002 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_start  48
   52003 
   52004 static inline uint32_t ATTRIBUTE_PURE
   52005 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferOffset_start(const struct gen_device_info *devinfo)
   52006 {
   52007    switch (devinfo->gen) {
   52008    case 10: return 48;
   52009    case 9: return 48;
   52010    case 8: return 48;
   52011    case 7:
   52012       if (devinfo->is_haswell) {
   52013          return 48;
   52014       } else {
   52015          return 48;
   52016       }
   52017    case 6: return 0;
   52018    case 5: return 0;
   52019    case 4:
   52020       if (devinfo->is_g4x) {
   52021          return 0;
   52022       } else {
   52023          return 0;
   52024       }
   52025    default:
   52026       unreachable("Invalid hardware generation");
   52027    }
   52028 }
   52029 
   52030 
   52031 
   52032 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS::Constant Buffer Size */
   52033 
   52034 
   52035 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_bits  6
   52036 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_bits  6
   52037 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_bits  6
   52038 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_bits  6
   52039 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_bits  5
   52040 
   52041 static inline uint32_t ATTRIBUTE_PURE
   52042 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_bits(const struct gen_device_info *devinfo)
   52043 {
   52044    switch (devinfo->gen) {
   52045    case 10: return 6;
   52046    case 9: return 6;
   52047    case 8: return 6;
   52048    case 7:
   52049       if (devinfo->is_haswell) {
   52050          return 6;
   52051       } else {
   52052          return 5;
   52053       }
   52054    case 6: return 0;
   52055    case 5: return 0;
   52056    case 4:
   52057       if (devinfo->is_g4x) {
   52058          return 0;
   52059       } else {
   52060          return 0;
   52061       }
   52062    default:
   52063       unreachable("Invalid hardware generation");
   52064    }
   52065 }
   52066 
   52067 
   52068 
   52069 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_start  32
   52070 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_start  32
   52071 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_start  32
   52072 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_start  32
   52073 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_start  32
   52074 
   52075 static inline uint32_t ATTRIBUTE_PURE
   52076 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_ConstantBufferSize_start(const struct gen_device_info *devinfo)
   52077 {
   52078    switch (devinfo->gen) {
   52079    case 10: return 32;
   52080    case 9: return 32;
   52081    case 8: return 32;
   52082    case 7:
   52083       if (devinfo->is_haswell) {
   52084          return 32;
   52085       } else {
   52086          return 32;
   52087       }
   52088    case 6: return 0;
   52089    case 5: return 0;
   52090    case 4:
   52091       if (devinfo->is_g4x) {
   52092          return 0;
   52093       } else {
   52094          return 0;
   52095       }
   52096    default:
   52097       unreachable("Invalid hardware generation");
   52098    }
   52099 }
   52100 
   52101 
   52102 
   52103 /* 3DSTATE_PUSH_CONSTANT_ALLOC_GS::DWord Length */
   52104 
   52105 
   52106 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_bits  8
   52107 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_bits  8
   52108 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_bits  8
   52109 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_bits  8
   52110 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_bits  8
   52111 
   52112 static inline uint32_t ATTRIBUTE_PURE
   52113 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   52114 {
   52115    switch (devinfo->gen) {
   52116    case 10: return 8;
   52117    case 9: return 8;
   52118    case 8: return 8;
   52119    case 7:
   52120       if (devinfo->is_haswell) {
   52121          return 8;
   52122       } else {
   52123          return 8;
   52124       }
   52125    case 6: return 0;
   52126    case 5: return 0;
   52127    case 4:
   52128       if (devinfo->is_g4x) {
   52129          return 0;
   52130       } else {
   52131          return 0;
   52132       }
   52133    default:
   52134       unreachable("Invalid hardware generation");
   52135    }
   52136 }
   52137 
   52138 
   52139 
   52140 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_start  0
   52141 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_start  0
   52142 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_start  0
   52143 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_start  0
   52144 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_start  0
   52145 
   52146 static inline uint32_t ATTRIBUTE_PURE
   52147 _3DSTATE_PUSH_CONSTANT_ALLOC_GS_DWordLength_start(const struct gen_device_info *devinfo)
   52148 {
   52149    switch (devinfo->gen) {
   52150    case 10: return 0;
   52151    case 9: return 0;
   52152    case 8: return 0;
   52153    case 7:
   52154       if (devinfo->is_haswell) {
   52155          return 0;
   52156       } else {
   52157          return 0;
   52158       }
   52159    case 6: return 0;
   52160    case 5: return 0;
   52161    case 4:
   52162       if (devinfo->is_g4x) {
   52163          return 0;
   52164       } else {
   52165          return 0;
   52166       }
   52167    default:
   52168       unreachable("Invalid hardware generation");
   52169    }
   52170 }
   52171 
   52172 
   52173 
   52174 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS */
   52175 
   52176 
   52177 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length  2
   52178 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length  2
   52179 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length  2
   52180 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length  2
   52181 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length  2
   52182 
   52183 static inline uint32_t ATTRIBUTE_PURE
   52184 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_length(const struct gen_device_info *devinfo)
   52185 {
   52186    switch (devinfo->gen) {
   52187    case 10: return 2;
   52188    case 9: return 2;
   52189    case 8: return 2;
   52190    case 7:
   52191       if (devinfo->is_haswell) {
   52192          return 2;
   52193       } else {
   52194          return 2;
   52195       }
   52196    case 6: return 0;
   52197    case 5: return 0;
   52198    case 4:
   52199       if (devinfo->is_g4x) {
   52200          return 0;
   52201       } else {
   52202          return 0;
   52203       }
   52204    default:
   52205       unreachable("Invalid hardware generation");
   52206    }
   52207 }
   52208 
   52209 
   52210 
   52211 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS::3D Command Opcode */
   52212 
   52213 
   52214 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_bits  3
   52215 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_bits  3
   52216 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_bits  3
   52217 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_bits  3
   52218 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_bits  3
   52219 
   52220 static inline uint32_t ATTRIBUTE_PURE
   52221 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   52222 {
   52223    switch (devinfo->gen) {
   52224    case 10: return 3;
   52225    case 9: return 3;
   52226    case 8: return 3;
   52227    case 7:
   52228       if (devinfo->is_haswell) {
   52229          return 3;
   52230       } else {
   52231          return 3;
   52232       }
   52233    case 6: return 0;
   52234    case 5: return 0;
   52235    case 4:
   52236       if (devinfo->is_g4x) {
   52237          return 0;
   52238       } else {
   52239          return 0;
   52240       }
   52241    default:
   52242       unreachable("Invalid hardware generation");
   52243    }
   52244 }
   52245 
   52246 
   52247 
   52248 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_start  24
   52249 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_start  24
   52250 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_start  24
   52251 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_start  24
   52252 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_start  24
   52253 
   52254 static inline uint32_t ATTRIBUTE_PURE
   52255 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   52256 {
   52257    switch (devinfo->gen) {
   52258    case 10: return 24;
   52259    case 9: return 24;
   52260    case 8: return 24;
   52261    case 7:
   52262       if (devinfo->is_haswell) {
   52263          return 24;
   52264       } else {
   52265          return 24;
   52266       }
   52267    case 6: return 0;
   52268    case 5: return 0;
   52269    case 4:
   52270       if (devinfo->is_g4x) {
   52271          return 0;
   52272       } else {
   52273          return 0;
   52274       }
   52275    default:
   52276       unreachable("Invalid hardware generation");
   52277    }
   52278 }
   52279 
   52280 
   52281 
   52282 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS::3D Command Sub Opcode */
   52283 
   52284 
   52285 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_bits  8
   52286 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_bits  8
   52287 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_bits  8
   52288 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_bits  8
   52289 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_bits  8
   52290 
   52291 static inline uint32_t ATTRIBUTE_PURE
   52292 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   52293 {
   52294    switch (devinfo->gen) {
   52295    case 10: return 8;
   52296    case 9: return 8;
   52297    case 8: return 8;
   52298    case 7:
   52299       if (devinfo->is_haswell) {
   52300          return 8;
   52301       } else {
   52302          return 8;
   52303       }
   52304    case 6: return 0;
   52305    case 5: return 0;
   52306    case 4:
   52307       if (devinfo->is_g4x) {
   52308          return 0;
   52309       } else {
   52310          return 0;
   52311       }
   52312    default:
   52313       unreachable("Invalid hardware generation");
   52314    }
   52315 }
   52316 
   52317 
   52318 
   52319 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_start  16
   52320 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_start  16
   52321 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_start  16
   52322 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_start  16
   52323 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_start  16
   52324 
   52325 static inline uint32_t ATTRIBUTE_PURE
   52326 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   52327 {
   52328    switch (devinfo->gen) {
   52329    case 10: return 16;
   52330    case 9: return 16;
   52331    case 8: return 16;
   52332    case 7:
   52333       if (devinfo->is_haswell) {
   52334          return 16;
   52335       } else {
   52336          return 16;
   52337       }
   52338    case 6: return 0;
   52339    case 5: return 0;
   52340    case 4:
   52341       if (devinfo->is_g4x) {
   52342          return 0;
   52343       } else {
   52344          return 0;
   52345       }
   52346    default:
   52347       unreachable("Invalid hardware generation");
   52348    }
   52349 }
   52350 
   52351 
   52352 
   52353 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS::Command SubType */
   52354 
   52355 
   52356 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_bits  2
   52357 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_bits  2
   52358 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_bits  2
   52359 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_bits  2
   52360 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_bits  2
   52361 
   52362 static inline uint32_t ATTRIBUTE_PURE
   52363 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   52364 {
   52365    switch (devinfo->gen) {
   52366    case 10: return 2;
   52367    case 9: return 2;
   52368    case 8: return 2;
   52369    case 7:
   52370       if (devinfo->is_haswell) {
   52371          return 2;
   52372       } else {
   52373          return 2;
   52374       }
   52375    case 6: return 0;
   52376    case 5: return 0;
   52377    case 4:
   52378       if (devinfo->is_g4x) {
   52379          return 0;
   52380       } else {
   52381          return 0;
   52382       }
   52383    default:
   52384       unreachable("Invalid hardware generation");
   52385    }
   52386 }
   52387 
   52388 
   52389 
   52390 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_start  27
   52391 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_start  27
   52392 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_start  27
   52393 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_start  27
   52394 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_start  27
   52395 
   52396 static inline uint32_t ATTRIBUTE_PURE
   52397 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   52398 {
   52399    switch (devinfo->gen) {
   52400    case 10: return 27;
   52401    case 9: return 27;
   52402    case 8: return 27;
   52403    case 7:
   52404       if (devinfo->is_haswell) {
   52405          return 27;
   52406       } else {
   52407          return 27;
   52408       }
   52409    case 6: return 0;
   52410    case 5: return 0;
   52411    case 4:
   52412       if (devinfo->is_g4x) {
   52413          return 0;
   52414       } else {
   52415          return 0;
   52416       }
   52417    default:
   52418       unreachable("Invalid hardware generation");
   52419    }
   52420 }
   52421 
   52422 
   52423 
   52424 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS::Command Type */
   52425 
   52426 
   52427 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_bits  3
   52428 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_bits  3
   52429 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_bits  3
   52430 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_bits  3
   52431 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_bits  3
   52432 
   52433 static inline uint32_t ATTRIBUTE_PURE
   52434 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_bits(const struct gen_device_info *devinfo)
   52435 {
   52436    switch (devinfo->gen) {
   52437    case 10: return 3;
   52438    case 9: return 3;
   52439    case 8: return 3;
   52440    case 7:
   52441       if (devinfo->is_haswell) {
   52442          return 3;
   52443       } else {
   52444          return 3;
   52445       }
   52446    case 6: return 0;
   52447    case 5: return 0;
   52448    case 4:
   52449       if (devinfo->is_g4x) {
   52450          return 0;
   52451       } else {
   52452          return 0;
   52453       }
   52454    default:
   52455       unreachable("Invalid hardware generation");
   52456    }
   52457 }
   52458 
   52459 
   52460 
   52461 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_start  29
   52462 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_start  29
   52463 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_start  29
   52464 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_start  29
   52465 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_start  29
   52466 
   52467 static inline uint32_t ATTRIBUTE_PURE
   52468 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_CommandType_start(const struct gen_device_info *devinfo)
   52469 {
   52470    switch (devinfo->gen) {
   52471    case 10: return 29;
   52472    case 9: return 29;
   52473    case 8: return 29;
   52474    case 7:
   52475       if (devinfo->is_haswell) {
   52476          return 29;
   52477       } else {
   52478          return 29;
   52479       }
   52480    case 6: return 0;
   52481    case 5: return 0;
   52482    case 4:
   52483       if (devinfo->is_g4x) {
   52484          return 0;
   52485       } else {
   52486          return 0;
   52487       }
   52488    default:
   52489       unreachable("Invalid hardware generation");
   52490    }
   52491 }
   52492 
   52493 
   52494 
   52495 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS::Constant Buffer Offset */
   52496 
   52497 
   52498 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_bits  5
   52499 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_bits  5
   52500 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_bits  5
   52501 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_bits  5
   52502 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_bits  4
   52503 
   52504 static inline uint32_t ATTRIBUTE_PURE
   52505 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_bits(const struct gen_device_info *devinfo)
   52506 {
   52507    switch (devinfo->gen) {
   52508    case 10: return 5;
   52509    case 9: return 5;
   52510    case 8: return 5;
   52511    case 7:
   52512       if (devinfo->is_haswell) {
   52513          return 5;
   52514       } else {
   52515          return 4;
   52516       }
   52517    case 6: return 0;
   52518    case 5: return 0;
   52519    case 4:
   52520       if (devinfo->is_g4x) {
   52521          return 0;
   52522       } else {
   52523          return 0;
   52524       }
   52525    default:
   52526       unreachable("Invalid hardware generation");
   52527    }
   52528 }
   52529 
   52530 
   52531 
   52532 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_start  48
   52533 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_start  48
   52534 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_start  48
   52535 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_start  48
   52536 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_start  48
   52537 
   52538 static inline uint32_t ATTRIBUTE_PURE
   52539 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferOffset_start(const struct gen_device_info *devinfo)
   52540 {
   52541    switch (devinfo->gen) {
   52542    case 10: return 48;
   52543    case 9: return 48;
   52544    case 8: return 48;
   52545    case 7:
   52546       if (devinfo->is_haswell) {
   52547          return 48;
   52548       } else {
   52549          return 48;
   52550       }
   52551    case 6: return 0;
   52552    case 5: return 0;
   52553    case 4:
   52554       if (devinfo->is_g4x) {
   52555          return 0;
   52556       } else {
   52557          return 0;
   52558       }
   52559    default:
   52560       unreachable("Invalid hardware generation");
   52561    }
   52562 }
   52563 
   52564 
   52565 
   52566 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS::Constant Buffer Size */
   52567 
   52568 
   52569 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_bits  6
   52570 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_bits  6
   52571 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_bits  6
   52572 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_bits  6
   52573 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_bits  5
   52574 
   52575 static inline uint32_t ATTRIBUTE_PURE
   52576 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_bits(const struct gen_device_info *devinfo)
   52577 {
   52578    switch (devinfo->gen) {
   52579    case 10: return 6;
   52580    case 9: return 6;
   52581    case 8: return 6;
   52582    case 7:
   52583       if (devinfo->is_haswell) {
   52584          return 6;
   52585       } else {
   52586          return 5;
   52587       }
   52588    case 6: return 0;
   52589    case 5: return 0;
   52590    case 4:
   52591       if (devinfo->is_g4x) {
   52592          return 0;
   52593       } else {
   52594          return 0;
   52595       }
   52596    default:
   52597       unreachable("Invalid hardware generation");
   52598    }
   52599 }
   52600 
   52601 
   52602 
   52603 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_start  32
   52604 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_start  32
   52605 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_start  32
   52606 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_start  32
   52607 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_start  32
   52608 
   52609 static inline uint32_t ATTRIBUTE_PURE
   52610 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_ConstantBufferSize_start(const struct gen_device_info *devinfo)
   52611 {
   52612    switch (devinfo->gen) {
   52613    case 10: return 32;
   52614    case 9: return 32;
   52615    case 8: return 32;
   52616    case 7:
   52617       if (devinfo->is_haswell) {
   52618          return 32;
   52619       } else {
   52620          return 32;
   52621       }
   52622    case 6: return 0;
   52623    case 5: return 0;
   52624    case 4:
   52625       if (devinfo->is_g4x) {
   52626          return 0;
   52627       } else {
   52628          return 0;
   52629       }
   52630    default:
   52631       unreachable("Invalid hardware generation");
   52632    }
   52633 }
   52634 
   52635 
   52636 
   52637 /* 3DSTATE_PUSH_CONSTANT_ALLOC_HS::DWord Length */
   52638 
   52639 
   52640 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_bits  8
   52641 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_bits  8
   52642 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_bits  8
   52643 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_bits  8
   52644 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_bits  8
   52645 
   52646 static inline uint32_t ATTRIBUTE_PURE
   52647 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   52648 {
   52649    switch (devinfo->gen) {
   52650    case 10: return 8;
   52651    case 9: return 8;
   52652    case 8: return 8;
   52653    case 7:
   52654       if (devinfo->is_haswell) {
   52655          return 8;
   52656       } else {
   52657          return 8;
   52658       }
   52659    case 6: return 0;
   52660    case 5: return 0;
   52661    case 4:
   52662       if (devinfo->is_g4x) {
   52663          return 0;
   52664       } else {
   52665          return 0;
   52666       }
   52667    default:
   52668       unreachable("Invalid hardware generation");
   52669    }
   52670 }
   52671 
   52672 
   52673 
   52674 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_start  0
   52675 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_start  0
   52676 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_start  0
   52677 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_start  0
   52678 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_start  0
   52679 
   52680 static inline uint32_t ATTRIBUTE_PURE
   52681 _3DSTATE_PUSH_CONSTANT_ALLOC_HS_DWordLength_start(const struct gen_device_info *devinfo)
   52682 {
   52683    switch (devinfo->gen) {
   52684    case 10: return 0;
   52685    case 9: return 0;
   52686    case 8: return 0;
   52687    case 7:
   52688       if (devinfo->is_haswell) {
   52689          return 0;
   52690       } else {
   52691          return 0;
   52692       }
   52693    case 6: return 0;
   52694    case 5: return 0;
   52695    case 4:
   52696       if (devinfo->is_g4x) {
   52697          return 0;
   52698       } else {
   52699          return 0;
   52700       }
   52701    default:
   52702       unreachable("Invalid hardware generation");
   52703    }
   52704 }
   52705 
   52706 
   52707 
   52708 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS */
   52709 
   52710 
   52711 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length  2
   52712 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length  2
   52713 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length  2
   52714 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length  2
   52715 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length  2
   52716 
   52717 static inline uint32_t ATTRIBUTE_PURE
   52718 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_length(const struct gen_device_info *devinfo)
   52719 {
   52720    switch (devinfo->gen) {
   52721    case 10: return 2;
   52722    case 9: return 2;
   52723    case 8: return 2;
   52724    case 7:
   52725       if (devinfo->is_haswell) {
   52726          return 2;
   52727       } else {
   52728          return 2;
   52729       }
   52730    case 6: return 0;
   52731    case 5: return 0;
   52732    case 4:
   52733       if (devinfo->is_g4x) {
   52734          return 0;
   52735       } else {
   52736          return 0;
   52737       }
   52738    default:
   52739       unreachable("Invalid hardware generation");
   52740    }
   52741 }
   52742 
   52743 
   52744 
   52745 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS::3D Command Opcode */
   52746 
   52747 
   52748 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_bits  3
   52749 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_bits  3
   52750 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_bits  3
   52751 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_bits  3
   52752 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_bits  3
   52753 
   52754 static inline uint32_t ATTRIBUTE_PURE
   52755 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   52756 {
   52757    switch (devinfo->gen) {
   52758    case 10: return 3;
   52759    case 9: return 3;
   52760    case 8: return 3;
   52761    case 7:
   52762       if (devinfo->is_haswell) {
   52763          return 3;
   52764       } else {
   52765          return 3;
   52766       }
   52767    case 6: return 0;
   52768    case 5: return 0;
   52769    case 4:
   52770       if (devinfo->is_g4x) {
   52771          return 0;
   52772       } else {
   52773          return 0;
   52774       }
   52775    default:
   52776       unreachable("Invalid hardware generation");
   52777    }
   52778 }
   52779 
   52780 
   52781 
   52782 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_start  24
   52783 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_start  24
   52784 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_start  24
   52785 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_start  24
   52786 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_start  24
   52787 
   52788 static inline uint32_t ATTRIBUTE_PURE
   52789 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   52790 {
   52791    switch (devinfo->gen) {
   52792    case 10: return 24;
   52793    case 9: return 24;
   52794    case 8: return 24;
   52795    case 7:
   52796       if (devinfo->is_haswell) {
   52797          return 24;
   52798       } else {
   52799          return 24;
   52800       }
   52801    case 6: return 0;
   52802    case 5: return 0;
   52803    case 4:
   52804       if (devinfo->is_g4x) {
   52805          return 0;
   52806       } else {
   52807          return 0;
   52808       }
   52809    default:
   52810       unreachable("Invalid hardware generation");
   52811    }
   52812 }
   52813 
   52814 
   52815 
   52816 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS::3D Command Sub Opcode */
   52817 
   52818 
   52819 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_bits  8
   52820 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_bits  8
   52821 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_bits  8
   52822 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_bits  8
   52823 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_bits  8
   52824 
   52825 static inline uint32_t ATTRIBUTE_PURE
   52826 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   52827 {
   52828    switch (devinfo->gen) {
   52829    case 10: return 8;
   52830    case 9: return 8;
   52831    case 8: return 8;
   52832    case 7:
   52833       if (devinfo->is_haswell) {
   52834          return 8;
   52835       } else {
   52836          return 8;
   52837       }
   52838    case 6: return 0;
   52839    case 5: return 0;
   52840    case 4:
   52841       if (devinfo->is_g4x) {
   52842          return 0;
   52843       } else {
   52844          return 0;
   52845       }
   52846    default:
   52847       unreachable("Invalid hardware generation");
   52848    }
   52849 }
   52850 
   52851 
   52852 
   52853 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_start  16
   52854 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_start  16
   52855 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_start  16
   52856 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_start  16
   52857 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_start  16
   52858 
   52859 static inline uint32_t ATTRIBUTE_PURE
   52860 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   52861 {
   52862    switch (devinfo->gen) {
   52863    case 10: return 16;
   52864    case 9: return 16;
   52865    case 8: return 16;
   52866    case 7:
   52867       if (devinfo->is_haswell) {
   52868          return 16;
   52869       } else {
   52870          return 16;
   52871       }
   52872    case 6: return 0;
   52873    case 5: return 0;
   52874    case 4:
   52875       if (devinfo->is_g4x) {
   52876          return 0;
   52877       } else {
   52878          return 0;
   52879       }
   52880    default:
   52881       unreachable("Invalid hardware generation");
   52882    }
   52883 }
   52884 
   52885 
   52886 
   52887 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS::Command SubType */
   52888 
   52889 
   52890 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_bits  2
   52891 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_bits  2
   52892 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_bits  2
   52893 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_bits  2
   52894 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_bits  2
   52895 
   52896 static inline uint32_t ATTRIBUTE_PURE
   52897 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_bits(const struct gen_device_info *devinfo)
   52898 {
   52899    switch (devinfo->gen) {
   52900    case 10: return 2;
   52901    case 9: return 2;
   52902    case 8: return 2;
   52903    case 7:
   52904       if (devinfo->is_haswell) {
   52905          return 2;
   52906       } else {
   52907          return 2;
   52908       }
   52909    case 6: return 0;
   52910    case 5: return 0;
   52911    case 4:
   52912       if (devinfo->is_g4x) {
   52913          return 0;
   52914       } else {
   52915          return 0;
   52916       }
   52917    default:
   52918       unreachable("Invalid hardware generation");
   52919    }
   52920 }
   52921 
   52922 
   52923 
   52924 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_start  27
   52925 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_start  27
   52926 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_start  27
   52927 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_start  27
   52928 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_start  27
   52929 
   52930 static inline uint32_t ATTRIBUTE_PURE
   52931 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandSubType_start(const struct gen_device_info *devinfo)
   52932 {
   52933    switch (devinfo->gen) {
   52934    case 10: return 27;
   52935    case 9: return 27;
   52936    case 8: return 27;
   52937    case 7:
   52938       if (devinfo->is_haswell) {
   52939          return 27;
   52940       } else {
   52941          return 27;
   52942       }
   52943    case 6: return 0;
   52944    case 5: return 0;
   52945    case 4:
   52946       if (devinfo->is_g4x) {
   52947          return 0;
   52948       } else {
   52949          return 0;
   52950       }
   52951    default:
   52952       unreachable("Invalid hardware generation");
   52953    }
   52954 }
   52955 
   52956 
   52957 
   52958 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS::Command Type */
   52959 
   52960 
   52961 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_bits  3
   52962 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_bits  3
   52963 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_bits  3
   52964 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_bits  3
   52965 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_bits  3
   52966 
   52967 static inline uint32_t ATTRIBUTE_PURE
   52968 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_bits(const struct gen_device_info *devinfo)
   52969 {
   52970    switch (devinfo->gen) {
   52971    case 10: return 3;
   52972    case 9: return 3;
   52973    case 8: return 3;
   52974    case 7:
   52975       if (devinfo->is_haswell) {
   52976          return 3;
   52977       } else {
   52978          return 3;
   52979       }
   52980    case 6: return 0;
   52981    case 5: return 0;
   52982    case 4:
   52983       if (devinfo->is_g4x) {
   52984          return 0;
   52985       } else {
   52986          return 0;
   52987       }
   52988    default:
   52989       unreachable("Invalid hardware generation");
   52990    }
   52991 }
   52992 
   52993 
   52994 
   52995 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_start  29
   52996 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_start  29
   52997 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_start  29
   52998 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_start  29
   52999 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_start  29
   53000 
   53001 static inline uint32_t ATTRIBUTE_PURE
   53002 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_CommandType_start(const struct gen_device_info *devinfo)
   53003 {
   53004    switch (devinfo->gen) {
   53005    case 10: return 29;
   53006    case 9: return 29;
   53007    case 8: return 29;
   53008    case 7:
   53009       if (devinfo->is_haswell) {
   53010          return 29;
   53011       } else {
   53012          return 29;
   53013       }
   53014    case 6: return 0;
   53015    case 5: return 0;
   53016    case 4:
   53017       if (devinfo->is_g4x) {
   53018          return 0;
   53019       } else {
   53020          return 0;
   53021       }
   53022    default:
   53023       unreachable("Invalid hardware generation");
   53024    }
   53025 }
   53026 
   53027 
   53028 
   53029 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS::Constant Buffer Offset */
   53030 
   53031 
   53032 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_bits  5
   53033 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_bits  5
   53034 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_bits  5
   53035 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_bits  5
   53036 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_bits  4
   53037 
   53038 static inline uint32_t ATTRIBUTE_PURE
   53039 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_bits(const struct gen_device_info *devinfo)
   53040 {
   53041    switch (devinfo->gen) {
   53042    case 10: return 5;
   53043    case 9: return 5;
   53044    case 8: return 5;
   53045    case 7:
   53046       if (devinfo->is_haswell) {
   53047          return 5;
   53048       } else {
   53049          return 4;
   53050       }
   53051    case 6: return 0;
   53052    case 5: return 0;
   53053    case 4:
   53054       if (devinfo->is_g4x) {
   53055          return 0;
   53056       } else {
   53057          return 0;
   53058       }
   53059    default:
   53060       unreachable("Invalid hardware generation");
   53061    }
   53062 }
   53063 
   53064 
   53065 
   53066 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_start  48
   53067 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_start  48
   53068 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_start  48
   53069 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_start  48
   53070 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_start  48
   53071 
   53072 static inline uint32_t ATTRIBUTE_PURE
   53073 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferOffset_start(const struct gen_device_info *devinfo)
   53074 {
   53075    switch (devinfo->gen) {
   53076    case 10: return 48;
   53077    case 9: return 48;
   53078    case 8: return 48;
   53079    case 7:
   53080       if (devinfo->is_haswell) {
   53081          return 48;
   53082       } else {
   53083          return 48;
   53084       }
   53085    case 6: return 0;
   53086    case 5: return 0;
   53087    case 4:
   53088       if (devinfo->is_g4x) {
   53089          return 0;
   53090       } else {
   53091          return 0;
   53092       }
   53093    default:
   53094       unreachable("Invalid hardware generation");
   53095    }
   53096 }
   53097 
   53098 
   53099 
   53100 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS::Constant Buffer Size */
   53101 
   53102 
   53103 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_bits  6
   53104 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_bits  6
   53105 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_bits  6
   53106 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_bits  6
   53107 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_bits  5
   53108 
   53109 static inline uint32_t ATTRIBUTE_PURE
   53110 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_bits(const struct gen_device_info *devinfo)
   53111 {
   53112    switch (devinfo->gen) {
   53113    case 10: return 6;
   53114    case 9: return 6;
   53115    case 8: return 6;
   53116    case 7:
   53117       if (devinfo->is_haswell) {
   53118          return 6;
   53119       } else {
   53120          return 5;
   53121       }
   53122    case 6: return 0;
   53123    case 5: return 0;
   53124    case 4:
   53125       if (devinfo->is_g4x) {
   53126          return 0;
   53127       } else {
   53128          return 0;
   53129       }
   53130    default:
   53131       unreachable("Invalid hardware generation");
   53132    }
   53133 }
   53134 
   53135 
   53136 
   53137 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_start  32
   53138 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_start  32
   53139 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_start  32
   53140 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_start  32
   53141 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_start  32
   53142 
   53143 static inline uint32_t ATTRIBUTE_PURE
   53144 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_ConstantBufferSize_start(const struct gen_device_info *devinfo)
   53145 {
   53146    switch (devinfo->gen) {
   53147    case 10: return 32;
   53148    case 9: return 32;
   53149    case 8: return 32;
   53150    case 7:
   53151       if (devinfo->is_haswell) {
   53152          return 32;
   53153       } else {
   53154          return 32;
   53155       }
   53156    case 6: return 0;
   53157    case 5: return 0;
   53158    case 4:
   53159       if (devinfo->is_g4x) {
   53160          return 0;
   53161       } else {
   53162          return 0;
   53163       }
   53164    default:
   53165       unreachable("Invalid hardware generation");
   53166    }
   53167 }
   53168 
   53169 
   53170 
   53171 /* 3DSTATE_PUSH_CONSTANT_ALLOC_PS::DWord Length */
   53172 
   53173 
   53174 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_bits  8
   53175 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_bits  8
   53176 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_bits  8
   53177 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_bits  8
   53178 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_bits  8
   53179 
   53180 static inline uint32_t ATTRIBUTE_PURE
   53181 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_bits(const struct gen_device_info *devinfo)
   53182 {
   53183    switch (devinfo->gen) {
   53184    case 10: return 8;
   53185    case 9: return 8;
   53186    case 8: return 8;
   53187    case 7:
   53188       if (devinfo->is_haswell) {
   53189          return 8;
   53190       } else {
   53191          return 8;
   53192       }
   53193    case 6: return 0;
   53194    case 5: return 0;
   53195    case 4:
   53196       if (devinfo->is_g4x) {
   53197          return 0;
   53198       } else {
   53199          return 0;
   53200       }
   53201    default:
   53202       unreachable("Invalid hardware generation");
   53203    }
   53204 }
   53205 
   53206 
   53207 
   53208 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_start  0
   53209 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_start  0
   53210 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_start  0
   53211 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_start  0
   53212 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_start  0
   53213 
   53214 static inline uint32_t ATTRIBUTE_PURE
   53215 _3DSTATE_PUSH_CONSTANT_ALLOC_PS_DWordLength_start(const struct gen_device_info *devinfo)
   53216 {
   53217    switch (devinfo->gen) {
   53218    case 10: return 0;
   53219    case 9: return 0;
   53220    case 8: return 0;
   53221    case 7:
   53222       if (devinfo->is_haswell) {
   53223          return 0;
   53224       } else {
   53225          return 0;
   53226       }
   53227    case 6: return 0;
   53228    case 5: return 0;
   53229    case 4:
   53230       if (devinfo->is_g4x) {
   53231          return 0;
   53232       } else {
   53233          return 0;
   53234       }
   53235    default:
   53236       unreachable("Invalid hardware generation");
   53237    }
   53238 }
   53239 
   53240 
   53241 
   53242 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS */
   53243 
   53244 
   53245 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length  2
   53246 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length  2
   53247 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length  2
   53248 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length  2
   53249 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length  2
   53250 
   53251 static inline uint32_t ATTRIBUTE_PURE
   53252 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_length(const struct gen_device_info *devinfo)
   53253 {
   53254    switch (devinfo->gen) {
   53255    case 10: return 2;
   53256    case 9: return 2;
   53257    case 8: return 2;
   53258    case 7:
   53259       if (devinfo->is_haswell) {
   53260          return 2;
   53261       } else {
   53262          return 2;
   53263       }
   53264    case 6: return 0;
   53265    case 5: return 0;
   53266    case 4:
   53267       if (devinfo->is_g4x) {
   53268          return 0;
   53269       } else {
   53270          return 0;
   53271       }
   53272    default:
   53273       unreachable("Invalid hardware generation");
   53274    }
   53275 }
   53276 
   53277 
   53278 
   53279 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS::3D Command Opcode */
   53280 
   53281 
   53282 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_bits  3
   53283 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_bits  3
   53284 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_bits  3
   53285 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_bits  3
   53286 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_bits  3
   53287 
   53288 static inline uint32_t ATTRIBUTE_PURE
   53289 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   53290 {
   53291    switch (devinfo->gen) {
   53292    case 10: return 3;
   53293    case 9: return 3;
   53294    case 8: return 3;
   53295    case 7:
   53296       if (devinfo->is_haswell) {
   53297          return 3;
   53298       } else {
   53299          return 3;
   53300       }
   53301    case 6: return 0;
   53302    case 5: return 0;
   53303    case 4:
   53304       if (devinfo->is_g4x) {
   53305          return 0;
   53306       } else {
   53307          return 0;
   53308       }
   53309    default:
   53310       unreachable("Invalid hardware generation");
   53311    }
   53312 }
   53313 
   53314 
   53315 
   53316 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_start  24
   53317 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_start  24
   53318 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_start  24
   53319 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_start  24
   53320 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_start  24
   53321 
   53322 static inline uint32_t ATTRIBUTE_PURE
   53323 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   53324 {
   53325    switch (devinfo->gen) {
   53326    case 10: return 24;
   53327    case 9: return 24;
   53328    case 8: return 24;
   53329    case 7:
   53330       if (devinfo->is_haswell) {
   53331          return 24;
   53332       } else {
   53333          return 24;
   53334       }
   53335    case 6: return 0;
   53336    case 5: return 0;
   53337    case 4:
   53338       if (devinfo->is_g4x) {
   53339          return 0;
   53340       } else {
   53341          return 0;
   53342       }
   53343    default:
   53344       unreachable("Invalid hardware generation");
   53345    }
   53346 }
   53347 
   53348 
   53349 
   53350 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS::3D Command Sub Opcode */
   53351 
   53352 
   53353 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_bits  8
   53354 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_bits  8
   53355 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_bits  8
   53356 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_bits  8
   53357 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_bits  8
   53358 
   53359 static inline uint32_t ATTRIBUTE_PURE
   53360 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   53361 {
   53362    switch (devinfo->gen) {
   53363    case 10: return 8;
   53364    case 9: return 8;
   53365    case 8: return 8;
   53366    case 7:
   53367       if (devinfo->is_haswell) {
   53368          return 8;
   53369       } else {
   53370          return 8;
   53371       }
   53372    case 6: return 0;
   53373    case 5: return 0;
   53374    case 4:
   53375       if (devinfo->is_g4x) {
   53376          return 0;
   53377       } else {
   53378          return 0;
   53379       }
   53380    default:
   53381       unreachable("Invalid hardware generation");
   53382    }
   53383 }
   53384 
   53385 
   53386 
   53387 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_start  16
   53388 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_start  16
   53389 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_start  16
   53390 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_start  16
   53391 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_start  16
   53392 
   53393 static inline uint32_t ATTRIBUTE_PURE
   53394 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   53395 {
   53396    switch (devinfo->gen) {
   53397    case 10: return 16;
   53398    case 9: return 16;
   53399    case 8: return 16;
   53400    case 7:
   53401       if (devinfo->is_haswell) {
   53402          return 16;
   53403       } else {
   53404          return 16;
   53405       }
   53406    case 6: return 0;
   53407    case 5: return 0;
   53408    case 4:
   53409       if (devinfo->is_g4x) {
   53410          return 0;
   53411       } else {
   53412          return 0;
   53413       }
   53414    default:
   53415       unreachable("Invalid hardware generation");
   53416    }
   53417 }
   53418 
   53419 
   53420 
   53421 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS::Command SubType */
   53422 
   53423 
   53424 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_bits  2
   53425 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_bits  2
   53426 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_bits  2
   53427 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_bits  2
   53428 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_bits  2
   53429 
   53430 static inline uint32_t ATTRIBUTE_PURE
   53431 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   53432 {
   53433    switch (devinfo->gen) {
   53434    case 10: return 2;
   53435    case 9: return 2;
   53436    case 8: return 2;
   53437    case 7:
   53438       if (devinfo->is_haswell) {
   53439          return 2;
   53440       } else {
   53441          return 2;
   53442       }
   53443    case 6: return 0;
   53444    case 5: return 0;
   53445    case 4:
   53446       if (devinfo->is_g4x) {
   53447          return 0;
   53448       } else {
   53449          return 0;
   53450       }
   53451    default:
   53452       unreachable("Invalid hardware generation");
   53453    }
   53454 }
   53455 
   53456 
   53457 
   53458 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_start  27
   53459 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_start  27
   53460 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_start  27
   53461 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_start  27
   53462 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_start  27
   53463 
   53464 static inline uint32_t ATTRIBUTE_PURE
   53465 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   53466 {
   53467    switch (devinfo->gen) {
   53468    case 10: return 27;
   53469    case 9: return 27;
   53470    case 8: return 27;
   53471    case 7:
   53472       if (devinfo->is_haswell) {
   53473          return 27;
   53474       } else {
   53475          return 27;
   53476       }
   53477    case 6: return 0;
   53478    case 5: return 0;
   53479    case 4:
   53480       if (devinfo->is_g4x) {
   53481          return 0;
   53482       } else {
   53483          return 0;
   53484       }
   53485    default:
   53486       unreachable("Invalid hardware generation");
   53487    }
   53488 }
   53489 
   53490 
   53491 
   53492 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS::Command Type */
   53493 
   53494 
   53495 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_bits  3
   53496 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_bits  3
   53497 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_bits  3
   53498 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_bits  3
   53499 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_bits  3
   53500 
   53501 static inline uint32_t ATTRIBUTE_PURE
   53502 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_bits(const struct gen_device_info *devinfo)
   53503 {
   53504    switch (devinfo->gen) {
   53505    case 10: return 3;
   53506    case 9: return 3;
   53507    case 8: return 3;
   53508    case 7:
   53509       if (devinfo->is_haswell) {
   53510          return 3;
   53511       } else {
   53512          return 3;
   53513       }
   53514    case 6: return 0;
   53515    case 5: return 0;
   53516    case 4:
   53517       if (devinfo->is_g4x) {
   53518          return 0;
   53519       } else {
   53520          return 0;
   53521       }
   53522    default:
   53523       unreachable("Invalid hardware generation");
   53524    }
   53525 }
   53526 
   53527 
   53528 
   53529 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_start  29
   53530 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_start  29
   53531 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_start  29
   53532 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_start  29
   53533 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_start  29
   53534 
   53535 static inline uint32_t ATTRIBUTE_PURE
   53536 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_CommandType_start(const struct gen_device_info *devinfo)
   53537 {
   53538    switch (devinfo->gen) {
   53539    case 10: return 29;
   53540    case 9: return 29;
   53541    case 8: return 29;
   53542    case 7:
   53543       if (devinfo->is_haswell) {
   53544          return 29;
   53545       } else {
   53546          return 29;
   53547       }
   53548    case 6: return 0;
   53549    case 5: return 0;
   53550    case 4:
   53551       if (devinfo->is_g4x) {
   53552          return 0;
   53553       } else {
   53554          return 0;
   53555       }
   53556    default:
   53557       unreachable("Invalid hardware generation");
   53558    }
   53559 }
   53560 
   53561 
   53562 
   53563 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS::Constant Buffer Offset */
   53564 
   53565 
   53566 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_bits  5
   53567 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_bits  5
   53568 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_bits  5
   53569 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_bits  5
   53570 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_bits  4
   53571 
   53572 static inline uint32_t ATTRIBUTE_PURE
   53573 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_bits(const struct gen_device_info *devinfo)
   53574 {
   53575    switch (devinfo->gen) {
   53576    case 10: return 5;
   53577    case 9: return 5;
   53578    case 8: return 5;
   53579    case 7:
   53580       if (devinfo->is_haswell) {
   53581          return 5;
   53582       } else {
   53583          return 4;
   53584       }
   53585    case 6: return 0;
   53586    case 5: return 0;
   53587    case 4:
   53588       if (devinfo->is_g4x) {
   53589          return 0;
   53590       } else {
   53591          return 0;
   53592       }
   53593    default:
   53594       unreachable("Invalid hardware generation");
   53595    }
   53596 }
   53597 
   53598 
   53599 
   53600 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_start  48
   53601 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_start  48
   53602 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_start  48
   53603 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_start  48
   53604 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_start  48
   53605 
   53606 static inline uint32_t ATTRIBUTE_PURE
   53607 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferOffset_start(const struct gen_device_info *devinfo)
   53608 {
   53609    switch (devinfo->gen) {
   53610    case 10: return 48;
   53611    case 9: return 48;
   53612    case 8: return 48;
   53613    case 7:
   53614       if (devinfo->is_haswell) {
   53615          return 48;
   53616       } else {
   53617          return 48;
   53618       }
   53619    case 6: return 0;
   53620    case 5: return 0;
   53621    case 4:
   53622       if (devinfo->is_g4x) {
   53623          return 0;
   53624       } else {
   53625          return 0;
   53626       }
   53627    default:
   53628       unreachable("Invalid hardware generation");
   53629    }
   53630 }
   53631 
   53632 
   53633 
   53634 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS::Constant Buffer Size */
   53635 
   53636 
   53637 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_bits  6
   53638 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_bits  6
   53639 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_bits  6
   53640 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_bits  6
   53641 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_bits  5
   53642 
   53643 static inline uint32_t ATTRIBUTE_PURE
   53644 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_bits(const struct gen_device_info *devinfo)
   53645 {
   53646    switch (devinfo->gen) {
   53647    case 10: return 6;
   53648    case 9: return 6;
   53649    case 8: return 6;
   53650    case 7:
   53651       if (devinfo->is_haswell) {
   53652          return 6;
   53653       } else {
   53654          return 5;
   53655       }
   53656    case 6: return 0;
   53657    case 5: return 0;
   53658    case 4:
   53659       if (devinfo->is_g4x) {
   53660          return 0;
   53661       } else {
   53662          return 0;
   53663       }
   53664    default:
   53665       unreachable("Invalid hardware generation");
   53666    }
   53667 }
   53668 
   53669 
   53670 
   53671 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_start  32
   53672 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_start  32
   53673 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_start  32
   53674 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_start  32
   53675 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_start  32
   53676 
   53677 static inline uint32_t ATTRIBUTE_PURE
   53678 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_ConstantBufferSize_start(const struct gen_device_info *devinfo)
   53679 {
   53680    switch (devinfo->gen) {
   53681    case 10: return 32;
   53682    case 9: return 32;
   53683    case 8: return 32;
   53684    case 7:
   53685       if (devinfo->is_haswell) {
   53686          return 32;
   53687       } else {
   53688          return 32;
   53689       }
   53690    case 6: return 0;
   53691    case 5: return 0;
   53692    case 4:
   53693       if (devinfo->is_g4x) {
   53694          return 0;
   53695       } else {
   53696          return 0;
   53697       }
   53698    default:
   53699       unreachable("Invalid hardware generation");
   53700    }
   53701 }
   53702 
   53703 
   53704 
   53705 /* 3DSTATE_PUSH_CONSTANT_ALLOC_VS::DWord Length */
   53706 
   53707 
   53708 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_bits  8
   53709 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_bits  8
   53710 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_bits  8
   53711 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_bits  8
   53712 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_bits  8
   53713 
   53714 static inline uint32_t ATTRIBUTE_PURE
   53715 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   53716 {
   53717    switch (devinfo->gen) {
   53718    case 10: return 8;
   53719    case 9: return 8;
   53720    case 8: return 8;
   53721    case 7:
   53722       if (devinfo->is_haswell) {
   53723          return 8;
   53724       } else {
   53725          return 8;
   53726       }
   53727    case 6: return 0;
   53728    case 5: return 0;
   53729    case 4:
   53730       if (devinfo->is_g4x) {
   53731          return 0;
   53732       } else {
   53733          return 0;
   53734       }
   53735    default:
   53736       unreachable("Invalid hardware generation");
   53737    }
   53738 }
   53739 
   53740 
   53741 
   53742 #define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_start  0
   53743 #define GEN9_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_start  0
   53744 #define GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_start  0
   53745 #define GEN75_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_start  0
   53746 #define GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_start  0
   53747 
   53748 static inline uint32_t ATTRIBUTE_PURE
   53749 _3DSTATE_PUSH_CONSTANT_ALLOC_VS_DWordLength_start(const struct gen_device_info *devinfo)
   53750 {
   53751    switch (devinfo->gen) {
   53752    case 10: return 0;
   53753    case 9: return 0;
   53754    case 8: return 0;
   53755    case 7:
   53756       if (devinfo->is_haswell) {
   53757          return 0;
   53758       } else {
   53759          return 0;
   53760       }
   53761    case 6: return 0;
   53762    case 5: return 0;
   53763    case 4:
   53764       if (devinfo->is_g4x) {
   53765          return 0;
   53766       } else {
   53767          return 0;
   53768       }
   53769    default:
   53770       unreachable("Invalid hardware generation");
   53771    }
   53772 }
   53773 
   53774 
   53775 
   53776 /* 3DSTATE_RASTER */
   53777 
   53778 
   53779 #define GEN10_3DSTATE_RASTER_length  5
   53780 #define GEN9_3DSTATE_RASTER_length  5
   53781 #define GEN8_3DSTATE_RASTER_length  5
   53782 
   53783 static inline uint32_t ATTRIBUTE_PURE
   53784 _3DSTATE_RASTER_length(const struct gen_device_info *devinfo)
   53785 {
   53786    switch (devinfo->gen) {
   53787    case 10: return 5;
   53788    case 9: return 5;
   53789    case 8: return 5;
   53790    case 7:
   53791       if (devinfo->is_haswell) {
   53792          return 0;
   53793       } else {
   53794          return 0;
   53795       }
   53796    case 6: return 0;
   53797    case 5: return 0;
   53798    case 4:
   53799       if (devinfo->is_g4x) {
   53800          return 0;
   53801       } else {
   53802          return 0;
   53803       }
   53804    default:
   53805       unreachable("Invalid hardware generation");
   53806    }
   53807 }
   53808 
   53809 
   53810 
   53811 /* 3DSTATE_RASTER::3D Command Opcode */
   53812 
   53813 
   53814 #define GEN10_3DSTATE_RASTER_3DCommandOpcode_bits  3
   53815 #define GEN9_3DSTATE_RASTER_3DCommandOpcode_bits  3
   53816 #define GEN8_3DSTATE_RASTER_3DCommandOpcode_bits  3
   53817 
   53818 static inline uint32_t ATTRIBUTE_PURE
   53819 _3DSTATE_RASTER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   53820 {
   53821    switch (devinfo->gen) {
   53822    case 10: return 3;
   53823    case 9: return 3;
   53824    case 8: return 3;
   53825    case 7:
   53826       if (devinfo->is_haswell) {
   53827          return 0;
   53828       } else {
   53829          return 0;
   53830       }
   53831    case 6: return 0;
   53832    case 5: return 0;
   53833    case 4:
   53834       if (devinfo->is_g4x) {
   53835          return 0;
   53836       } else {
   53837          return 0;
   53838       }
   53839    default:
   53840       unreachable("Invalid hardware generation");
   53841    }
   53842 }
   53843 
   53844 
   53845 
   53846 #define GEN10_3DSTATE_RASTER_3DCommandOpcode_start  24
   53847 #define GEN9_3DSTATE_RASTER_3DCommandOpcode_start  24
   53848 #define GEN8_3DSTATE_RASTER_3DCommandOpcode_start  24
   53849 
   53850 static inline uint32_t ATTRIBUTE_PURE
   53851 _3DSTATE_RASTER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   53852 {
   53853    switch (devinfo->gen) {
   53854    case 10: return 24;
   53855    case 9: return 24;
   53856    case 8: return 24;
   53857    case 7:
   53858       if (devinfo->is_haswell) {
   53859          return 0;
   53860       } else {
   53861          return 0;
   53862       }
   53863    case 6: return 0;
   53864    case 5: return 0;
   53865    case 4:
   53866       if (devinfo->is_g4x) {
   53867          return 0;
   53868       } else {
   53869          return 0;
   53870       }
   53871    default:
   53872       unreachable("Invalid hardware generation");
   53873    }
   53874 }
   53875 
   53876 
   53877 
   53878 /* 3DSTATE_RASTER::3D Command Sub Opcode */
   53879 
   53880 
   53881 #define GEN10_3DSTATE_RASTER_3DCommandSubOpcode_bits  8
   53882 #define GEN9_3DSTATE_RASTER_3DCommandSubOpcode_bits  8
   53883 #define GEN8_3DSTATE_RASTER_3DCommandSubOpcode_bits  8
   53884 
   53885 static inline uint32_t ATTRIBUTE_PURE
   53886 _3DSTATE_RASTER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   53887 {
   53888    switch (devinfo->gen) {
   53889    case 10: return 8;
   53890    case 9: return 8;
   53891    case 8: return 8;
   53892    case 7:
   53893       if (devinfo->is_haswell) {
   53894          return 0;
   53895       } else {
   53896          return 0;
   53897       }
   53898    case 6: return 0;
   53899    case 5: return 0;
   53900    case 4:
   53901       if (devinfo->is_g4x) {
   53902          return 0;
   53903       } else {
   53904          return 0;
   53905       }
   53906    default:
   53907       unreachable("Invalid hardware generation");
   53908    }
   53909 }
   53910 
   53911 
   53912 
   53913 #define GEN10_3DSTATE_RASTER_3DCommandSubOpcode_start  16
   53914 #define GEN9_3DSTATE_RASTER_3DCommandSubOpcode_start  16
   53915 #define GEN8_3DSTATE_RASTER_3DCommandSubOpcode_start  16
   53916 
   53917 static inline uint32_t ATTRIBUTE_PURE
   53918 _3DSTATE_RASTER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   53919 {
   53920    switch (devinfo->gen) {
   53921    case 10: return 16;
   53922    case 9: return 16;
   53923    case 8: return 16;
   53924    case 7:
   53925       if (devinfo->is_haswell) {
   53926          return 0;
   53927       } else {
   53928          return 0;
   53929       }
   53930    case 6: return 0;
   53931    case 5: return 0;
   53932    case 4:
   53933       if (devinfo->is_g4x) {
   53934          return 0;
   53935       } else {
   53936          return 0;
   53937       }
   53938    default:
   53939       unreachable("Invalid hardware generation");
   53940    }
   53941 }
   53942 
   53943 
   53944 
   53945 /* 3DSTATE_RASTER::API Mode */
   53946 
   53947 
   53948 #define GEN10_3DSTATE_RASTER_APIMode_bits  2
   53949 #define GEN9_3DSTATE_RASTER_APIMode_bits  2
   53950 #define GEN8_3DSTATE_RASTER_APIMode_bits  2
   53951 
   53952 static inline uint32_t ATTRIBUTE_PURE
   53953 _3DSTATE_RASTER_APIMode_bits(const struct gen_device_info *devinfo)
   53954 {
   53955    switch (devinfo->gen) {
   53956    case 10: return 2;
   53957    case 9: return 2;
   53958    case 8: return 2;
   53959    case 7:
   53960       if (devinfo->is_haswell) {
   53961          return 0;
   53962       } else {
   53963          return 0;
   53964       }
   53965    case 6: return 0;
   53966    case 5: return 0;
   53967    case 4:
   53968       if (devinfo->is_g4x) {
   53969          return 0;
   53970       } else {
   53971          return 0;
   53972       }
   53973    default:
   53974       unreachable("Invalid hardware generation");
   53975    }
   53976 }
   53977 
   53978 
   53979 
   53980 #define GEN10_3DSTATE_RASTER_APIMode_start  54
   53981 #define GEN9_3DSTATE_RASTER_APIMode_start  54
   53982 #define GEN8_3DSTATE_RASTER_APIMode_start  54
   53983 
   53984 static inline uint32_t ATTRIBUTE_PURE
   53985 _3DSTATE_RASTER_APIMode_start(const struct gen_device_info *devinfo)
   53986 {
   53987    switch (devinfo->gen) {
   53988    case 10: return 54;
   53989    case 9: return 54;
   53990    case 8: return 54;
   53991    case 7:
   53992       if (devinfo->is_haswell) {
   53993          return 0;
   53994       } else {
   53995          return 0;
   53996       }
   53997    case 6: return 0;
   53998    case 5: return 0;
   53999    case 4:
   54000       if (devinfo->is_g4x) {
   54001          return 0;
   54002       } else {
   54003          return 0;
   54004       }
   54005    default:
   54006       unreachable("Invalid hardware generation");
   54007    }
   54008 }
   54009 
   54010 
   54011 
   54012 /* 3DSTATE_RASTER::Antialiasing Enable */
   54013 
   54014 
   54015 #define GEN10_3DSTATE_RASTER_AntialiasingEnable_bits  1
   54016 #define GEN9_3DSTATE_RASTER_AntialiasingEnable_bits  1
   54017 #define GEN8_3DSTATE_RASTER_AntialiasingEnable_bits  1
   54018 
   54019 static inline uint32_t ATTRIBUTE_PURE
   54020 _3DSTATE_RASTER_AntialiasingEnable_bits(const struct gen_device_info *devinfo)
   54021 {
   54022    switch (devinfo->gen) {
   54023    case 10: return 1;
   54024    case 9: return 1;
   54025    case 8: return 1;
   54026    case 7:
   54027       if (devinfo->is_haswell) {
   54028          return 0;
   54029       } else {
   54030          return 0;
   54031       }
   54032    case 6: return 0;
   54033    case 5: return 0;
   54034    case 4:
   54035       if (devinfo->is_g4x) {
   54036          return 0;
   54037       } else {
   54038          return 0;
   54039       }
   54040    default:
   54041       unreachable("Invalid hardware generation");
   54042    }
   54043 }
   54044 
   54045 
   54046 
   54047 #define GEN10_3DSTATE_RASTER_AntialiasingEnable_start  34
   54048 #define GEN9_3DSTATE_RASTER_AntialiasingEnable_start  34
   54049 #define GEN8_3DSTATE_RASTER_AntialiasingEnable_start  34
   54050 
   54051 static inline uint32_t ATTRIBUTE_PURE
   54052 _3DSTATE_RASTER_AntialiasingEnable_start(const struct gen_device_info *devinfo)
   54053 {
   54054    switch (devinfo->gen) {
   54055    case 10: return 34;
   54056    case 9: return 34;
   54057    case 8: return 34;
   54058    case 7:
   54059       if (devinfo->is_haswell) {
   54060          return 0;
   54061       } else {
   54062          return 0;
   54063       }
   54064    case 6: return 0;
   54065    case 5: return 0;
   54066    case 4:
   54067       if (devinfo->is_g4x) {
   54068          return 0;
   54069       } else {
   54070          return 0;
   54071       }
   54072    default:
   54073       unreachable("Invalid hardware generation");
   54074    }
   54075 }
   54076 
   54077 
   54078 
   54079 /* 3DSTATE_RASTER::Back Face Fill Mode */
   54080 
   54081 
   54082 #define GEN10_3DSTATE_RASTER_BackFaceFillMode_bits  2
   54083 #define GEN9_3DSTATE_RASTER_BackFaceFillMode_bits  2
   54084 #define GEN8_3DSTATE_RASTER_BackFaceFillMode_bits  2
   54085 
   54086 static inline uint32_t ATTRIBUTE_PURE
   54087 _3DSTATE_RASTER_BackFaceFillMode_bits(const struct gen_device_info *devinfo)
   54088 {
   54089    switch (devinfo->gen) {
   54090    case 10: return 2;
   54091    case 9: return 2;
   54092    case 8: return 2;
   54093    case 7:
   54094       if (devinfo->is_haswell) {
   54095          return 0;
   54096       } else {
   54097          return 0;
   54098       }
   54099    case 6: return 0;
   54100    case 5: return 0;
   54101    case 4:
   54102       if (devinfo->is_g4x) {
   54103          return 0;
   54104       } else {
   54105          return 0;
   54106       }
   54107    default:
   54108       unreachable("Invalid hardware generation");
   54109    }
   54110 }
   54111 
   54112 
   54113 
   54114 #define GEN10_3DSTATE_RASTER_BackFaceFillMode_start  35
   54115 #define GEN9_3DSTATE_RASTER_BackFaceFillMode_start  35
   54116 #define GEN8_3DSTATE_RASTER_BackFaceFillMode_start  35
   54117 
   54118 static inline uint32_t ATTRIBUTE_PURE
   54119 _3DSTATE_RASTER_BackFaceFillMode_start(const struct gen_device_info *devinfo)
   54120 {
   54121    switch (devinfo->gen) {
   54122    case 10: return 35;
   54123    case 9: return 35;
   54124    case 8: return 35;
   54125    case 7:
   54126       if (devinfo->is_haswell) {
   54127          return 0;
   54128       } else {
   54129          return 0;
   54130       }
   54131    case 6: return 0;
   54132    case 5: return 0;
   54133    case 4:
   54134       if (devinfo->is_g4x) {
   54135          return 0;
   54136       } else {
   54137          return 0;
   54138       }
   54139    default:
   54140       unreachable("Invalid hardware generation");
   54141    }
   54142 }
   54143 
   54144 
   54145 
   54146 /* 3DSTATE_RASTER::Command SubType */
   54147 
   54148 
   54149 #define GEN10_3DSTATE_RASTER_CommandSubType_bits  2
   54150 #define GEN9_3DSTATE_RASTER_CommandSubType_bits  2
   54151 #define GEN8_3DSTATE_RASTER_CommandSubType_bits  2
   54152 
   54153 static inline uint32_t ATTRIBUTE_PURE
   54154 _3DSTATE_RASTER_CommandSubType_bits(const struct gen_device_info *devinfo)
   54155 {
   54156    switch (devinfo->gen) {
   54157    case 10: return 2;
   54158    case 9: return 2;
   54159    case 8: return 2;
   54160    case 7:
   54161       if (devinfo->is_haswell) {
   54162          return 0;
   54163       } else {
   54164          return 0;
   54165       }
   54166    case 6: return 0;
   54167    case 5: return 0;
   54168    case 4:
   54169       if (devinfo->is_g4x) {
   54170          return 0;
   54171       } else {
   54172          return 0;
   54173       }
   54174    default:
   54175       unreachable("Invalid hardware generation");
   54176    }
   54177 }
   54178 
   54179 
   54180 
   54181 #define GEN10_3DSTATE_RASTER_CommandSubType_start  27
   54182 #define GEN9_3DSTATE_RASTER_CommandSubType_start  27
   54183 #define GEN8_3DSTATE_RASTER_CommandSubType_start  27
   54184 
   54185 static inline uint32_t ATTRIBUTE_PURE
   54186 _3DSTATE_RASTER_CommandSubType_start(const struct gen_device_info *devinfo)
   54187 {
   54188    switch (devinfo->gen) {
   54189    case 10: return 27;
   54190    case 9: return 27;
   54191    case 8: return 27;
   54192    case 7:
   54193       if (devinfo->is_haswell) {
   54194          return 0;
   54195       } else {
   54196          return 0;
   54197       }
   54198    case 6: return 0;
   54199    case 5: return 0;
   54200    case 4:
   54201       if (devinfo->is_g4x) {
   54202          return 0;
   54203       } else {
   54204          return 0;
   54205       }
   54206    default:
   54207       unreachable("Invalid hardware generation");
   54208    }
   54209 }
   54210 
   54211 
   54212 
   54213 /* 3DSTATE_RASTER::Command Type */
   54214 
   54215 
   54216 #define GEN10_3DSTATE_RASTER_CommandType_bits  3
   54217 #define GEN9_3DSTATE_RASTER_CommandType_bits  3
   54218 #define GEN8_3DSTATE_RASTER_CommandType_bits  3
   54219 
   54220 static inline uint32_t ATTRIBUTE_PURE
   54221 _3DSTATE_RASTER_CommandType_bits(const struct gen_device_info *devinfo)
   54222 {
   54223    switch (devinfo->gen) {
   54224    case 10: return 3;
   54225    case 9: return 3;
   54226    case 8: return 3;
   54227    case 7:
   54228       if (devinfo->is_haswell) {
   54229          return 0;
   54230       } else {
   54231          return 0;
   54232       }
   54233    case 6: return 0;
   54234    case 5: return 0;
   54235    case 4:
   54236       if (devinfo->is_g4x) {
   54237          return 0;
   54238       } else {
   54239          return 0;
   54240       }
   54241    default:
   54242       unreachable("Invalid hardware generation");
   54243    }
   54244 }
   54245 
   54246 
   54247 
   54248 #define GEN10_3DSTATE_RASTER_CommandType_start  29
   54249 #define GEN9_3DSTATE_RASTER_CommandType_start  29
   54250 #define GEN8_3DSTATE_RASTER_CommandType_start  29
   54251 
   54252 static inline uint32_t ATTRIBUTE_PURE
   54253 _3DSTATE_RASTER_CommandType_start(const struct gen_device_info *devinfo)
   54254 {
   54255    switch (devinfo->gen) {
   54256    case 10: return 29;
   54257    case 9: return 29;
   54258    case 8: return 29;
   54259    case 7:
   54260       if (devinfo->is_haswell) {
   54261          return 0;
   54262       } else {
   54263          return 0;
   54264       }
   54265    case 6: return 0;
   54266    case 5: return 0;
   54267    case 4:
   54268       if (devinfo->is_g4x) {
   54269          return 0;
   54270       } else {
   54271          return 0;
   54272       }
   54273    default:
   54274       unreachable("Invalid hardware generation");
   54275    }
   54276 }
   54277 
   54278 
   54279 
   54280 /* 3DSTATE_RASTER::Conservative Rasterization Enable */
   54281 
   54282 
   54283 #define GEN10_3DSTATE_RASTER_ConservativeRasterizationEnable_bits  1
   54284 #define GEN9_3DSTATE_RASTER_ConservativeRasterizationEnable_bits  1
   54285 
   54286 static inline uint32_t ATTRIBUTE_PURE
   54287 _3DSTATE_RASTER_ConservativeRasterizationEnable_bits(const struct gen_device_info *devinfo)
   54288 {
   54289    switch (devinfo->gen) {
   54290    case 10: return 1;
   54291    case 9: return 1;
   54292    case 8: return 0;
   54293    case 7:
   54294       if (devinfo->is_haswell) {
   54295          return 0;
   54296       } else {
   54297          return 0;
   54298       }
   54299    case 6: return 0;
   54300    case 5: return 0;
   54301    case 4:
   54302       if (devinfo->is_g4x) {
   54303          return 0;
   54304       } else {
   54305          return 0;
   54306       }
   54307    default:
   54308       unreachable("Invalid hardware generation");
   54309    }
   54310 }
   54311 
   54312 
   54313 
   54314 #define GEN10_3DSTATE_RASTER_ConservativeRasterizationEnable_start  56
   54315 #define GEN9_3DSTATE_RASTER_ConservativeRasterizationEnable_start  56
   54316 
   54317 static inline uint32_t ATTRIBUTE_PURE
   54318 _3DSTATE_RASTER_ConservativeRasterizationEnable_start(const struct gen_device_info *devinfo)
   54319 {
   54320    switch (devinfo->gen) {
   54321    case 10: return 56;
   54322    case 9: return 56;
   54323    case 8: return 0;
   54324    case 7:
   54325       if (devinfo->is_haswell) {
   54326          return 0;
   54327       } else {
   54328          return 0;
   54329       }
   54330    case 6: return 0;
   54331    case 5: return 0;
   54332    case 4:
   54333       if (devinfo->is_g4x) {
   54334          return 0;
   54335       } else {
   54336          return 0;
   54337       }
   54338    default:
   54339       unreachable("Invalid hardware generation");
   54340    }
   54341 }
   54342 
   54343 
   54344 
   54345 /* 3DSTATE_RASTER::Cull Mode */
   54346 
   54347 
   54348 #define GEN10_3DSTATE_RASTER_CullMode_bits  2
   54349 #define GEN9_3DSTATE_RASTER_CullMode_bits  2
   54350 #define GEN8_3DSTATE_RASTER_CullMode_bits  2
   54351 
   54352 static inline uint32_t ATTRIBUTE_PURE
   54353 _3DSTATE_RASTER_CullMode_bits(const struct gen_device_info *devinfo)
   54354 {
   54355    switch (devinfo->gen) {
   54356    case 10: return 2;
   54357    case 9: return 2;
   54358    case 8: return 2;
   54359    case 7:
   54360       if (devinfo->is_haswell) {
   54361          return 0;
   54362       } else {
   54363          return 0;
   54364       }
   54365    case 6: return 0;
   54366    case 5: return 0;
   54367    case 4:
   54368       if (devinfo->is_g4x) {
   54369          return 0;
   54370       } else {
   54371          return 0;
   54372       }
   54373    default:
   54374       unreachable("Invalid hardware generation");
   54375    }
   54376 }
   54377 
   54378 
   54379 
   54380 #define GEN10_3DSTATE_RASTER_CullMode_start  48
   54381 #define GEN9_3DSTATE_RASTER_CullMode_start  48
   54382 #define GEN8_3DSTATE_RASTER_CullMode_start  48
   54383 
   54384 static inline uint32_t ATTRIBUTE_PURE
   54385 _3DSTATE_RASTER_CullMode_start(const struct gen_device_info *devinfo)
   54386 {
   54387    switch (devinfo->gen) {
   54388    case 10: return 48;
   54389    case 9: return 48;
   54390    case 8: return 48;
   54391    case 7:
   54392       if (devinfo->is_haswell) {
   54393          return 0;
   54394       } else {
   54395          return 0;
   54396       }
   54397    case 6: return 0;
   54398    case 5: return 0;
   54399    case 4:
   54400       if (devinfo->is_g4x) {
   54401          return 0;
   54402       } else {
   54403          return 0;
   54404       }
   54405    default:
   54406       unreachable("Invalid hardware generation");
   54407    }
   54408 }
   54409 
   54410 
   54411 
   54412 /* 3DSTATE_RASTER::DWord Length */
   54413 
   54414 
   54415 #define GEN10_3DSTATE_RASTER_DWordLength_bits  8
   54416 #define GEN9_3DSTATE_RASTER_DWordLength_bits  8
   54417 #define GEN8_3DSTATE_RASTER_DWordLength_bits  8
   54418 
   54419 static inline uint32_t ATTRIBUTE_PURE
   54420 _3DSTATE_RASTER_DWordLength_bits(const struct gen_device_info *devinfo)
   54421 {
   54422    switch (devinfo->gen) {
   54423    case 10: return 8;
   54424    case 9: return 8;
   54425    case 8: return 8;
   54426    case 7:
   54427       if (devinfo->is_haswell) {
   54428          return 0;
   54429       } else {
   54430          return 0;
   54431       }
   54432    case 6: return 0;
   54433    case 5: return 0;
   54434    case 4:
   54435       if (devinfo->is_g4x) {
   54436          return 0;
   54437       } else {
   54438          return 0;
   54439       }
   54440    default:
   54441       unreachable("Invalid hardware generation");
   54442    }
   54443 }
   54444 
   54445 
   54446 
   54447 #define GEN10_3DSTATE_RASTER_DWordLength_start  0
   54448 #define GEN9_3DSTATE_RASTER_DWordLength_start  0
   54449 #define GEN8_3DSTATE_RASTER_DWordLength_start  0
   54450 
   54451 static inline uint32_t ATTRIBUTE_PURE
   54452 _3DSTATE_RASTER_DWordLength_start(const struct gen_device_info *devinfo)
   54453 {
   54454    switch (devinfo->gen) {
   54455    case 10: return 0;
   54456    case 9: return 0;
   54457    case 8: return 0;
   54458    case 7:
   54459       if (devinfo->is_haswell) {
   54460          return 0;
   54461       } else {
   54462          return 0;
   54463       }
   54464    case 6: return 0;
   54465    case 5: return 0;
   54466    case 4:
   54467       if (devinfo->is_g4x) {
   54468          return 0;
   54469       } else {
   54470          return 0;
   54471       }
   54472    default:
   54473       unreachable("Invalid hardware generation");
   54474    }
   54475 }
   54476 
   54477 
   54478 
   54479 /* 3DSTATE_RASTER::DX Multisample Rasterization Enable */
   54480 
   54481 
   54482 #define GEN10_3DSTATE_RASTER_DXMultisampleRasterizationEnable_bits  1
   54483 #define GEN9_3DSTATE_RASTER_DXMultisampleRasterizationEnable_bits  1
   54484 #define GEN8_3DSTATE_RASTER_DXMultisampleRasterizationEnable_bits  1
   54485 
   54486 static inline uint32_t ATTRIBUTE_PURE
   54487 _3DSTATE_RASTER_DXMultisampleRasterizationEnable_bits(const struct gen_device_info *devinfo)
   54488 {
   54489    switch (devinfo->gen) {
   54490    case 10: return 1;
   54491    case 9: return 1;
   54492    case 8: return 1;
   54493    case 7:
   54494       if (devinfo->is_haswell) {
   54495          return 0;
   54496       } else {
   54497          return 0;
   54498       }
   54499    case 6: return 0;
   54500    case 5: return 0;
   54501    case 4:
   54502       if (devinfo->is_g4x) {
   54503          return 0;
   54504       } else {
   54505          return 0;
   54506       }
   54507    default:
   54508       unreachable("Invalid hardware generation");
   54509    }
   54510 }
   54511 
   54512 
   54513 
   54514 #define GEN10_3DSTATE_RASTER_DXMultisampleRasterizationEnable_start  44
   54515 #define GEN9_3DSTATE_RASTER_DXMultisampleRasterizationEnable_start  44
   54516 #define GEN8_3DSTATE_RASTER_DXMultisampleRasterizationEnable_start  44
   54517 
   54518 static inline uint32_t ATTRIBUTE_PURE
   54519 _3DSTATE_RASTER_DXMultisampleRasterizationEnable_start(const struct gen_device_info *devinfo)
   54520 {
   54521    switch (devinfo->gen) {
   54522    case 10: return 44;
   54523    case 9: return 44;
   54524    case 8: return 44;
   54525    case 7:
   54526       if (devinfo->is_haswell) {
   54527          return 0;
   54528       } else {
   54529          return 0;
   54530       }
   54531    case 6: return 0;
   54532    case 5: return 0;
   54533    case 4:
   54534       if (devinfo->is_g4x) {
   54535          return 0;
   54536       } else {
   54537          return 0;
   54538       }
   54539    default:
   54540       unreachable("Invalid hardware generation");
   54541    }
   54542 }
   54543 
   54544 
   54545 
   54546 /* 3DSTATE_RASTER::DX Multisample Rasterization Mode */
   54547 
   54548 
   54549 #define GEN10_3DSTATE_RASTER_DXMultisampleRasterizationMode_bits  2
   54550 #define GEN9_3DSTATE_RASTER_DXMultisampleRasterizationMode_bits  2
   54551 #define GEN8_3DSTATE_RASTER_DXMultisampleRasterizationMode_bits  2
   54552 
   54553 static inline uint32_t ATTRIBUTE_PURE
   54554 _3DSTATE_RASTER_DXMultisampleRasterizationMode_bits(const struct gen_device_info *devinfo)
   54555 {
   54556    switch (devinfo->gen) {
   54557    case 10: return 2;
   54558    case 9: return 2;
   54559    case 8: return 2;
   54560    case 7:
   54561       if (devinfo->is_haswell) {
   54562          return 0;
   54563       } else {
   54564          return 0;
   54565       }
   54566    case 6: return 0;
   54567    case 5: return 0;
   54568    case 4:
   54569       if (devinfo->is_g4x) {
   54570          return 0;
   54571       } else {
   54572          return 0;
   54573       }
   54574    default:
   54575       unreachable("Invalid hardware generation");
   54576    }
   54577 }
   54578 
   54579 
   54580 
   54581 #define GEN10_3DSTATE_RASTER_DXMultisampleRasterizationMode_start  42
   54582 #define GEN9_3DSTATE_RASTER_DXMultisampleRasterizationMode_start  42
   54583 #define GEN8_3DSTATE_RASTER_DXMultisampleRasterizationMode_start  42
   54584 
   54585 static inline uint32_t ATTRIBUTE_PURE
   54586 _3DSTATE_RASTER_DXMultisampleRasterizationMode_start(const struct gen_device_info *devinfo)
   54587 {
   54588    switch (devinfo->gen) {
   54589    case 10: return 42;
   54590    case 9: return 42;
   54591    case 8: return 42;
   54592    case 7:
   54593       if (devinfo->is_haswell) {
   54594          return 0;
   54595       } else {
   54596          return 0;
   54597       }
   54598    case 6: return 0;
   54599    case 5: return 0;
   54600    case 4:
   54601       if (devinfo->is_g4x) {
   54602          return 0;
   54603       } else {
   54604          return 0;
   54605       }
   54606    default:
   54607       unreachable("Invalid hardware generation");
   54608    }
   54609 }
   54610 
   54611 
   54612 
   54613 /* 3DSTATE_RASTER::Force Multisampling */
   54614 
   54615 
   54616 #define GEN10_3DSTATE_RASTER_ForceMultisampling_bits  1
   54617 #define GEN9_3DSTATE_RASTER_ForceMultisampling_bits  1
   54618 #define GEN8_3DSTATE_RASTER_ForceMultisampling_bits  1
   54619 
   54620 static inline uint32_t ATTRIBUTE_PURE
   54621 _3DSTATE_RASTER_ForceMultisampling_bits(const struct gen_device_info *devinfo)
   54622 {
   54623    switch (devinfo->gen) {
   54624    case 10: return 1;
   54625    case 9: return 1;
   54626    case 8: return 1;
   54627    case 7:
   54628       if (devinfo->is_haswell) {
   54629          return 0;
   54630       } else {
   54631          return 0;
   54632       }
   54633    case 6: return 0;
   54634    case 5: return 0;
   54635    case 4:
   54636       if (devinfo->is_g4x) {
   54637          return 0;
   54638       } else {
   54639          return 0;
   54640       }
   54641    default:
   54642       unreachable("Invalid hardware generation");
   54643    }
   54644 }
   54645 
   54646 
   54647 
   54648 #define GEN10_3DSTATE_RASTER_ForceMultisampling_start  46
   54649 #define GEN9_3DSTATE_RASTER_ForceMultisampling_start  46
   54650 #define GEN8_3DSTATE_RASTER_ForceMultisampling_start  46
   54651 
   54652 static inline uint32_t ATTRIBUTE_PURE
   54653 _3DSTATE_RASTER_ForceMultisampling_start(const struct gen_device_info *devinfo)
   54654 {
   54655    switch (devinfo->gen) {
   54656    case 10: return 46;
   54657    case 9: return 46;
   54658    case 8: return 46;
   54659    case 7:
   54660       if (devinfo->is_haswell) {
   54661          return 0;
   54662       } else {
   54663          return 0;
   54664       }
   54665    case 6: return 0;
   54666    case 5: return 0;
   54667    case 4:
   54668       if (devinfo->is_g4x) {
   54669          return 0;
   54670       } else {
   54671          return 0;
   54672       }
   54673    default:
   54674       unreachable("Invalid hardware generation");
   54675    }
   54676 }
   54677 
   54678 
   54679 
   54680 /* 3DSTATE_RASTER::Forced Sample Count */
   54681 
   54682 
   54683 #define GEN10_3DSTATE_RASTER_ForcedSampleCount_bits  3
   54684 #define GEN9_3DSTATE_RASTER_ForcedSampleCount_bits  3
   54685 #define GEN8_3DSTATE_RASTER_ForcedSampleCount_bits  3
   54686 
   54687 static inline uint32_t ATTRIBUTE_PURE
   54688 _3DSTATE_RASTER_ForcedSampleCount_bits(const struct gen_device_info *devinfo)
   54689 {
   54690    switch (devinfo->gen) {
   54691    case 10: return 3;
   54692    case 9: return 3;
   54693    case 8: return 3;
   54694    case 7:
   54695       if (devinfo->is_haswell) {
   54696          return 0;
   54697       } else {
   54698          return 0;
   54699       }
   54700    case 6: return 0;
   54701    case 5: return 0;
   54702    case 4:
   54703       if (devinfo->is_g4x) {
   54704          return 0;
   54705       } else {
   54706          return 0;
   54707       }
   54708    default:
   54709       unreachable("Invalid hardware generation");
   54710    }
   54711 }
   54712 
   54713 
   54714 
   54715 #define GEN10_3DSTATE_RASTER_ForcedSampleCount_start  50
   54716 #define GEN9_3DSTATE_RASTER_ForcedSampleCount_start  50
   54717 #define GEN8_3DSTATE_RASTER_ForcedSampleCount_start  50
   54718 
   54719 static inline uint32_t ATTRIBUTE_PURE
   54720 _3DSTATE_RASTER_ForcedSampleCount_start(const struct gen_device_info *devinfo)
   54721 {
   54722    switch (devinfo->gen) {
   54723    case 10: return 50;
   54724    case 9: return 50;
   54725    case 8: return 50;
   54726    case 7:
   54727       if (devinfo->is_haswell) {
   54728          return 0;
   54729       } else {
   54730          return 0;
   54731       }
   54732    case 6: return 0;
   54733    case 5: return 0;
   54734    case 4:
   54735       if (devinfo->is_g4x) {
   54736          return 0;
   54737       } else {
   54738          return 0;
   54739       }
   54740    default:
   54741       unreachable("Invalid hardware generation");
   54742    }
   54743 }
   54744 
   54745 
   54746 
   54747 /* 3DSTATE_RASTER::Front Face Fill Mode */
   54748 
   54749 
   54750 #define GEN10_3DSTATE_RASTER_FrontFaceFillMode_bits  2
   54751 #define GEN9_3DSTATE_RASTER_FrontFaceFillMode_bits  2
   54752 #define GEN8_3DSTATE_RASTER_FrontFaceFillMode_bits  2
   54753 
   54754 static inline uint32_t ATTRIBUTE_PURE
   54755 _3DSTATE_RASTER_FrontFaceFillMode_bits(const struct gen_device_info *devinfo)
   54756 {
   54757    switch (devinfo->gen) {
   54758    case 10: return 2;
   54759    case 9: return 2;
   54760    case 8: return 2;
   54761    case 7:
   54762       if (devinfo->is_haswell) {
   54763          return 0;
   54764       } else {
   54765          return 0;
   54766       }
   54767    case 6: return 0;
   54768    case 5: return 0;
   54769    case 4:
   54770       if (devinfo->is_g4x) {
   54771          return 0;
   54772       } else {
   54773          return 0;
   54774       }
   54775    default:
   54776       unreachable("Invalid hardware generation");
   54777    }
   54778 }
   54779 
   54780 
   54781 
   54782 #define GEN10_3DSTATE_RASTER_FrontFaceFillMode_start  37
   54783 #define GEN9_3DSTATE_RASTER_FrontFaceFillMode_start  37
   54784 #define GEN8_3DSTATE_RASTER_FrontFaceFillMode_start  37
   54785 
   54786 static inline uint32_t ATTRIBUTE_PURE
   54787 _3DSTATE_RASTER_FrontFaceFillMode_start(const struct gen_device_info *devinfo)
   54788 {
   54789    switch (devinfo->gen) {
   54790    case 10: return 37;
   54791    case 9: return 37;
   54792    case 8: return 37;
   54793    case 7:
   54794       if (devinfo->is_haswell) {
   54795          return 0;
   54796       } else {
   54797          return 0;
   54798       }
   54799    case 6: return 0;
   54800    case 5: return 0;
   54801    case 4:
   54802       if (devinfo->is_g4x) {
   54803          return 0;
   54804       } else {
   54805          return 0;
   54806       }
   54807    default:
   54808       unreachable("Invalid hardware generation");
   54809    }
   54810 }
   54811 
   54812 
   54813 
   54814 /* 3DSTATE_RASTER::Front Winding */
   54815 
   54816 
   54817 #define GEN10_3DSTATE_RASTER_FrontWinding_bits  1
   54818 #define GEN9_3DSTATE_RASTER_FrontWinding_bits  1
   54819 #define GEN8_3DSTATE_RASTER_FrontWinding_bits  1
   54820 
   54821 static inline uint32_t ATTRIBUTE_PURE
   54822 _3DSTATE_RASTER_FrontWinding_bits(const struct gen_device_info *devinfo)
   54823 {
   54824    switch (devinfo->gen) {
   54825    case 10: return 1;
   54826    case 9: return 1;
   54827    case 8: return 1;
   54828    case 7:
   54829       if (devinfo->is_haswell) {
   54830          return 0;
   54831       } else {
   54832          return 0;
   54833       }
   54834    case 6: return 0;
   54835    case 5: return 0;
   54836    case 4:
   54837       if (devinfo->is_g4x) {
   54838          return 0;
   54839       } else {
   54840          return 0;
   54841       }
   54842    default:
   54843       unreachable("Invalid hardware generation");
   54844    }
   54845 }
   54846 
   54847 
   54848 
   54849 #define GEN10_3DSTATE_RASTER_FrontWinding_start  53
   54850 #define GEN9_3DSTATE_RASTER_FrontWinding_start  53
   54851 #define GEN8_3DSTATE_RASTER_FrontWinding_start  53
   54852 
   54853 static inline uint32_t ATTRIBUTE_PURE
   54854 _3DSTATE_RASTER_FrontWinding_start(const struct gen_device_info *devinfo)
   54855 {
   54856    switch (devinfo->gen) {
   54857    case 10: return 53;
   54858    case 9: return 53;
   54859    case 8: return 53;
   54860    case 7:
   54861       if (devinfo->is_haswell) {
   54862          return 0;
   54863       } else {
   54864          return 0;
   54865       }
   54866    case 6: return 0;
   54867    case 5: return 0;
   54868    case 4:
   54869       if (devinfo->is_g4x) {
   54870          return 0;
   54871       } else {
   54872          return 0;
   54873       }
   54874    default:
   54875       unreachable("Invalid hardware generation");
   54876    }
   54877 }
   54878 
   54879 
   54880 
   54881 /* 3DSTATE_RASTER::Global Depth Offset Clamp */
   54882 
   54883 
   54884 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetClamp_bits  32
   54885 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetClamp_bits  32
   54886 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetClamp_bits  32
   54887 
   54888 static inline uint32_t ATTRIBUTE_PURE
   54889 _3DSTATE_RASTER_GlobalDepthOffsetClamp_bits(const struct gen_device_info *devinfo)
   54890 {
   54891    switch (devinfo->gen) {
   54892    case 10: return 32;
   54893    case 9: return 32;
   54894    case 8: return 32;
   54895    case 7:
   54896       if (devinfo->is_haswell) {
   54897          return 0;
   54898       } else {
   54899          return 0;
   54900       }
   54901    case 6: return 0;
   54902    case 5: return 0;
   54903    case 4:
   54904       if (devinfo->is_g4x) {
   54905          return 0;
   54906       } else {
   54907          return 0;
   54908       }
   54909    default:
   54910       unreachable("Invalid hardware generation");
   54911    }
   54912 }
   54913 
   54914 
   54915 
   54916 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetClamp_start  128
   54917 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetClamp_start  128
   54918 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetClamp_start  128
   54919 
   54920 static inline uint32_t ATTRIBUTE_PURE
   54921 _3DSTATE_RASTER_GlobalDepthOffsetClamp_start(const struct gen_device_info *devinfo)
   54922 {
   54923    switch (devinfo->gen) {
   54924    case 10: return 128;
   54925    case 9: return 128;
   54926    case 8: return 128;
   54927    case 7:
   54928       if (devinfo->is_haswell) {
   54929          return 0;
   54930       } else {
   54931          return 0;
   54932       }
   54933    case 6: return 0;
   54934    case 5: return 0;
   54935    case 4:
   54936       if (devinfo->is_g4x) {
   54937          return 0;
   54938       } else {
   54939          return 0;
   54940       }
   54941    default:
   54942       unreachable("Invalid hardware generation");
   54943    }
   54944 }
   54945 
   54946 
   54947 
   54948 /* 3DSTATE_RASTER::Global Depth Offset Constant */
   54949 
   54950 
   54951 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetConstant_bits  32
   54952 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetConstant_bits  32
   54953 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetConstant_bits  32
   54954 
   54955 static inline uint32_t ATTRIBUTE_PURE
   54956 _3DSTATE_RASTER_GlobalDepthOffsetConstant_bits(const struct gen_device_info *devinfo)
   54957 {
   54958    switch (devinfo->gen) {
   54959    case 10: return 32;
   54960    case 9: return 32;
   54961    case 8: return 32;
   54962    case 7:
   54963       if (devinfo->is_haswell) {
   54964          return 0;
   54965       } else {
   54966          return 0;
   54967       }
   54968    case 6: return 0;
   54969    case 5: return 0;
   54970    case 4:
   54971       if (devinfo->is_g4x) {
   54972          return 0;
   54973       } else {
   54974          return 0;
   54975       }
   54976    default:
   54977       unreachable("Invalid hardware generation");
   54978    }
   54979 }
   54980 
   54981 
   54982 
   54983 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetConstant_start  64
   54984 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetConstant_start  64
   54985 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetConstant_start  64
   54986 
   54987 static inline uint32_t ATTRIBUTE_PURE
   54988 _3DSTATE_RASTER_GlobalDepthOffsetConstant_start(const struct gen_device_info *devinfo)
   54989 {
   54990    switch (devinfo->gen) {
   54991    case 10: return 64;
   54992    case 9: return 64;
   54993    case 8: return 64;
   54994    case 7:
   54995       if (devinfo->is_haswell) {
   54996          return 0;
   54997       } else {
   54998          return 0;
   54999       }
   55000    case 6: return 0;
   55001    case 5: return 0;
   55002    case 4:
   55003       if (devinfo->is_g4x) {
   55004          return 0;
   55005       } else {
   55006          return 0;
   55007       }
   55008    default:
   55009       unreachable("Invalid hardware generation");
   55010    }
   55011 }
   55012 
   55013 
   55014 
   55015 /* 3DSTATE_RASTER::Global Depth Offset Enable Point */
   55016 
   55017 
   55018 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_bits  1
   55019 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_bits  1
   55020 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_bits  1
   55021 
   55022 static inline uint32_t ATTRIBUTE_PURE
   55023 _3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_bits(const struct gen_device_info *devinfo)
   55024 {
   55025    switch (devinfo->gen) {
   55026    case 10: return 1;
   55027    case 9: return 1;
   55028    case 8: return 1;
   55029    case 7:
   55030       if (devinfo->is_haswell) {
   55031          return 0;
   55032       } else {
   55033          return 0;
   55034       }
   55035    case 6: return 0;
   55036    case 5: return 0;
   55037    case 4:
   55038       if (devinfo->is_g4x) {
   55039          return 0;
   55040       } else {
   55041          return 0;
   55042       }
   55043    default:
   55044       unreachable("Invalid hardware generation");
   55045    }
   55046 }
   55047 
   55048 
   55049 
   55050 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_start  39
   55051 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_start  39
   55052 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_start  39
   55053 
   55054 static inline uint32_t ATTRIBUTE_PURE
   55055 _3DSTATE_RASTER_GlobalDepthOffsetEnablePoint_start(const struct gen_device_info *devinfo)
   55056 {
   55057    switch (devinfo->gen) {
   55058    case 10: return 39;
   55059    case 9: return 39;
   55060    case 8: return 39;
   55061    case 7:
   55062       if (devinfo->is_haswell) {
   55063          return 0;
   55064       } else {
   55065          return 0;
   55066       }
   55067    case 6: return 0;
   55068    case 5: return 0;
   55069    case 4:
   55070       if (devinfo->is_g4x) {
   55071          return 0;
   55072       } else {
   55073          return 0;
   55074       }
   55075    default:
   55076       unreachable("Invalid hardware generation");
   55077    }
   55078 }
   55079 
   55080 
   55081 
   55082 /* 3DSTATE_RASTER::Global Depth Offset Enable Solid */
   55083 
   55084 
   55085 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_bits  1
   55086 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_bits  1
   55087 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_bits  1
   55088 
   55089 static inline uint32_t ATTRIBUTE_PURE
   55090 _3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_bits(const struct gen_device_info *devinfo)
   55091 {
   55092    switch (devinfo->gen) {
   55093    case 10: return 1;
   55094    case 9: return 1;
   55095    case 8: return 1;
   55096    case 7:
   55097       if (devinfo->is_haswell) {
   55098          return 0;
   55099       } else {
   55100          return 0;
   55101       }
   55102    case 6: return 0;
   55103    case 5: return 0;
   55104    case 4:
   55105       if (devinfo->is_g4x) {
   55106          return 0;
   55107       } else {
   55108          return 0;
   55109       }
   55110    default:
   55111       unreachable("Invalid hardware generation");
   55112    }
   55113 }
   55114 
   55115 
   55116 
   55117 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_start  41
   55118 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_start  41
   55119 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_start  41
   55120 
   55121 static inline uint32_t ATTRIBUTE_PURE
   55122 _3DSTATE_RASTER_GlobalDepthOffsetEnableSolid_start(const struct gen_device_info *devinfo)
   55123 {
   55124    switch (devinfo->gen) {
   55125    case 10: return 41;
   55126    case 9: return 41;
   55127    case 8: return 41;
   55128    case 7:
   55129       if (devinfo->is_haswell) {
   55130          return 0;
   55131       } else {
   55132          return 0;
   55133       }
   55134    case 6: return 0;
   55135    case 5: return 0;
   55136    case 4:
   55137       if (devinfo->is_g4x) {
   55138          return 0;
   55139       } else {
   55140          return 0;
   55141       }
   55142    default:
   55143       unreachable("Invalid hardware generation");
   55144    }
   55145 }
   55146 
   55147 
   55148 
   55149 /* 3DSTATE_RASTER::Global Depth Offset Enable Wireframe */
   55150 
   55151 
   55152 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_bits  1
   55153 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_bits  1
   55154 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_bits  1
   55155 
   55156 static inline uint32_t ATTRIBUTE_PURE
   55157 _3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_bits(const struct gen_device_info *devinfo)
   55158 {
   55159    switch (devinfo->gen) {
   55160    case 10: return 1;
   55161    case 9: return 1;
   55162    case 8: return 1;
   55163    case 7:
   55164       if (devinfo->is_haswell) {
   55165          return 0;
   55166       } else {
   55167          return 0;
   55168       }
   55169    case 6: return 0;
   55170    case 5: return 0;
   55171    case 4:
   55172       if (devinfo->is_g4x) {
   55173          return 0;
   55174       } else {
   55175          return 0;
   55176       }
   55177    default:
   55178       unreachable("Invalid hardware generation");
   55179    }
   55180 }
   55181 
   55182 
   55183 
   55184 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_start  40
   55185 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_start  40
   55186 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_start  40
   55187 
   55188 static inline uint32_t ATTRIBUTE_PURE
   55189 _3DSTATE_RASTER_GlobalDepthOffsetEnableWireframe_start(const struct gen_device_info *devinfo)
   55190 {
   55191    switch (devinfo->gen) {
   55192    case 10: return 40;
   55193    case 9: return 40;
   55194    case 8: return 40;
   55195    case 7:
   55196       if (devinfo->is_haswell) {
   55197          return 0;
   55198       } else {
   55199          return 0;
   55200       }
   55201    case 6: return 0;
   55202    case 5: return 0;
   55203    case 4:
   55204       if (devinfo->is_g4x) {
   55205          return 0;
   55206       } else {
   55207          return 0;
   55208       }
   55209    default:
   55210       unreachable("Invalid hardware generation");
   55211    }
   55212 }
   55213 
   55214 
   55215 
   55216 /* 3DSTATE_RASTER::Global Depth Offset Scale */
   55217 
   55218 
   55219 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetScale_bits  32
   55220 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetScale_bits  32
   55221 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetScale_bits  32
   55222 
   55223 static inline uint32_t ATTRIBUTE_PURE
   55224 _3DSTATE_RASTER_GlobalDepthOffsetScale_bits(const struct gen_device_info *devinfo)
   55225 {
   55226    switch (devinfo->gen) {
   55227    case 10: return 32;
   55228    case 9: return 32;
   55229    case 8: return 32;
   55230    case 7:
   55231       if (devinfo->is_haswell) {
   55232          return 0;
   55233       } else {
   55234          return 0;
   55235       }
   55236    case 6: return 0;
   55237    case 5: return 0;
   55238    case 4:
   55239       if (devinfo->is_g4x) {
   55240          return 0;
   55241       } else {
   55242          return 0;
   55243       }
   55244    default:
   55245       unreachable("Invalid hardware generation");
   55246    }
   55247 }
   55248 
   55249 
   55250 
   55251 #define GEN10_3DSTATE_RASTER_GlobalDepthOffsetScale_start  96
   55252 #define GEN9_3DSTATE_RASTER_GlobalDepthOffsetScale_start  96
   55253 #define GEN8_3DSTATE_RASTER_GlobalDepthOffsetScale_start  96
   55254 
   55255 static inline uint32_t ATTRIBUTE_PURE
   55256 _3DSTATE_RASTER_GlobalDepthOffsetScale_start(const struct gen_device_info *devinfo)
   55257 {
   55258    switch (devinfo->gen) {
   55259    case 10: return 96;
   55260    case 9: return 96;
   55261    case 8: return 96;
   55262    case 7:
   55263       if (devinfo->is_haswell) {
   55264          return 0;
   55265       } else {
   55266          return 0;
   55267       }
   55268    case 6: return 0;
   55269    case 5: return 0;
   55270    case 4:
   55271       if (devinfo->is_g4x) {
   55272          return 0;
   55273       } else {
   55274          return 0;
   55275       }
   55276    default:
   55277       unreachable("Invalid hardware generation");
   55278    }
   55279 }
   55280 
   55281 
   55282 
   55283 /* 3DSTATE_RASTER::Scissor Rectangle Enable */
   55284 
   55285 
   55286 #define GEN10_3DSTATE_RASTER_ScissorRectangleEnable_bits  1
   55287 #define GEN9_3DSTATE_RASTER_ScissorRectangleEnable_bits  1
   55288 #define GEN8_3DSTATE_RASTER_ScissorRectangleEnable_bits  1
   55289 
   55290 static inline uint32_t ATTRIBUTE_PURE
   55291 _3DSTATE_RASTER_ScissorRectangleEnable_bits(const struct gen_device_info *devinfo)
   55292 {
   55293    switch (devinfo->gen) {
   55294    case 10: return 1;
   55295    case 9: return 1;
   55296    case 8: return 1;
   55297    case 7:
   55298       if (devinfo->is_haswell) {
   55299          return 0;
   55300       } else {
   55301          return 0;
   55302       }
   55303    case 6: return 0;
   55304    case 5: return 0;
   55305    case 4:
   55306       if (devinfo->is_g4x) {
   55307          return 0;
   55308       } else {
   55309          return 0;
   55310       }
   55311    default:
   55312       unreachable("Invalid hardware generation");
   55313    }
   55314 }
   55315 
   55316 
   55317 
   55318 #define GEN10_3DSTATE_RASTER_ScissorRectangleEnable_start  33
   55319 #define GEN9_3DSTATE_RASTER_ScissorRectangleEnable_start  33
   55320 #define GEN8_3DSTATE_RASTER_ScissorRectangleEnable_start  33
   55321 
   55322 static inline uint32_t ATTRIBUTE_PURE
   55323 _3DSTATE_RASTER_ScissorRectangleEnable_start(const struct gen_device_info *devinfo)
   55324 {
   55325    switch (devinfo->gen) {
   55326    case 10: return 33;
   55327    case 9: return 33;
   55328    case 8: return 33;
   55329    case 7:
   55330       if (devinfo->is_haswell) {
   55331          return 0;
   55332       } else {
   55333          return 0;
   55334       }
   55335    case 6: return 0;
   55336    case 5: return 0;
   55337    case 4:
   55338       if (devinfo->is_g4x) {
   55339          return 0;
   55340       } else {
   55341          return 0;
   55342       }
   55343    default:
   55344       unreachable("Invalid hardware generation");
   55345    }
   55346 }
   55347 
   55348 
   55349 
   55350 /* 3DSTATE_RASTER::Smooth Point Enable */
   55351 
   55352 
   55353 #define GEN10_3DSTATE_RASTER_SmoothPointEnable_bits  1
   55354 #define GEN9_3DSTATE_RASTER_SmoothPointEnable_bits  1
   55355 #define GEN8_3DSTATE_RASTER_SmoothPointEnable_bits  1
   55356 
   55357 static inline uint32_t ATTRIBUTE_PURE
   55358 _3DSTATE_RASTER_SmoothPointEnable_bits(const struct gen_device_info *devinfo)
   55359 {
   55360    switch (devinfo->gen) {
   55361    case 10: return 1;
   55362    case 9: return 1;
   55363    case 8: return 1;
   55364    case 7:
   55365       if (devinfo->is_haswell) {
   55366          return 0;
   55367       } else {
   55368          return 0;
   55369       }
   55370    case 6: return 0;
   55371    case 5: return 0;
   55372    case 4:
   55373       if (devinfo->is_g4x) {
   55374          return 0;
   55375       } else {
   55376          return 0;
   55377       }
   55378    default:
   55379       unreachable("Invalid hardware generation");
   55380    }
   55381 }
   55382 
   55383 
   55384 
   55385 #define GEN10_3DSTATE_RASTER_SmoothPointEnable_start  45
   55386 #define GEN9_3DSTATE_RASTER_SmoothPointEnable_start  45
   55387 #define GEN8_3DSTATE_RASTER_SmoothPointEnable_start  45
   55388 
   55389 static inline uint32_t ATTRIBUTE_PURE
   55390 _3DSTATE_RASTER_SmoothPointEnable_start(const struct gen_device_info *devinfo)
   55391 {
   55392    switch (devinfo->gen) {
   55393    case 10: return 45;
   55394    case 9: return 45;
   55395    case 8: return 45;
   55396    case 7:
   55397       if (devinfo->is_haswell) {
   55398          return 0;
   55399       } else {
   55400          return 0;
   55401       }
   55402    case 6: return 0;
   55403    case 5: return 0;
   55404    case 4:
   55405       if (devinfo->is_g4x) {
   55406          return 0;
   55407       } else {
   55408          return 0;
   55409       }
   55410    default:
   55411       unreachable("Invalid hardware generation");
   55412    }
   55413 }
   55414 
   55415 
   55416 
   55417 /* 3DSTATE_RASTER::Viewport Z Clip Test Enable */
   55418 
   55419 
   55420 #define GEN8_3DSTATE_RASTER_ViewportZClipTestEnable_bits  1
   55421 
   55422 static inline uint32_t ATTRIBUTE_PURE
   55423 _3DSTATE_RASTER_ViewportZClipTestEnable_bits(const struct gen_device_info *devinfo)
   55424 {
   55425    switch (devinfo->gen) {
   55426    case 10: return 0;
   55427    case 9: return 0;
   55428    case 8: return 1;
   55429    case 7:
   55430       if (devinfo->is_haswell) {
   55431          return 0;
   55432       } else {
   55433          return 0;
   55434       }
   55435    case 6: return 0;
   55436    case 5: return 0;
   55437    case 4:
   55438       if (devinfo->is_g4x) {
   55439          return 0;
   55440       } else {
   55441          return 0;
   55442       }
   55443    default:
   55444       unreachable("Invalid hardware generation");
   55445    }
   55446 }
   55447 
   55448 
   55449 
   55450 #define GEN8_3DSTATE_RASTER_ViewportZClipTestEnable_start  32
   55451 
   55452 static inline uint32_t ATTRIBUTE_PURE
   55453 _3DSTATE_RASTER_ViewportZClipTestEnable_start(const struct gen_device_info *devinfo)
   55454 {
   55455    switch (devinfo->gen) {
   55456    case 10: return 0;
   55457    case 9: return 0;
   55458    case 8: return 32;
   55459    case 7:
   55460       if (devinfo->is_haswell) {
   55461          return 0;
   55462       } else {
   55463          return 0;
   55464       }
   55465    case 6: return 0;
   55466    case 5: return 0;
   55467    case 4:
   55468       if (devinfo->is_g4x) {
   55469          return 0;
   55470       } else {
   55471          return 0;
   55472       }
   55473    default:
   55474       unreachable("Invalid hardware generation");
   55475    }
   55476 }
   55477 
   55478 
   55479 
   55480 /* 3DSTATE_RASTER::Viewport Z Far Clip Test Enable */
   55481 
   55482 
   55483 #define GEN10_3DSTATE_RASTER_ViewportZFarClipTestEnable_bits  1
   55484 #define GEN9_3DSTATE_RASTER_ViewportZFarClipTestEnable_bits  1
   55485 
   55486 static inline uint32_t ATTRIBUTE_PURE
   55487 _3DSTATE_RASTER_ViewportZFarClipTestEnable_bits(const struct gen_device_info *devinfo)
   55488 {
   55489    switch (devinfo->gen) {
   55490    case 10: return 1;
   55491    case 9: return 1;
   55492    case 8: return 0;
   55493    case 7:
   55494       if (devinfo->is_haswell) {
   55495          return 0;
   55496       } else {
   55497          return 0;
   55498       }
   55499    case 6: return 0;
   55500    case 5: return 0;
   55501    case 4:
   55502       if (devinfo->is_g4x) {
   55503          return 0;
   55504       } else {
   55505          return 0;
   55506       }
   55507    default:
   55508       unreachable("Invalid hardware generation");
   55509    }
   55510 }
   55511 
   55512 
   55513 
   55514 #define GEN10_3DSTATE_RASTER_ViewportZFarClipTestEnable_start  58
   55515 #define GEN9_3DSTATE_RASTER_ViewportZFarClipTestEnable_start  58
   55516 
   55517 static inline uint32_t ATTRIBUTE_PURE
   55518 _3DSTATE_RASTER_ViewportZFarClipTestEnable_start(const struct gen_device_info *devinfo)
   55519 {
   55520    switch (devinfo->gen) {
   55521    case 10: return 58;
   55522    case 9: return 58;
   55523    case 8: return 0;
   55524    case 7:
   55525       if (devinfo->is_haswell) {
   55526          return 0;
   55527       } else {
   55528          return 0;
   55529       }
   55530    case 6: return 0;
   55531    case 5: return 0;
   55532    case 4:
   55533       if (devinfo->is_g4x) {
   55534          return 0;
   55535       } else {
   55536          return 0;
   55537       }
   55538    default:
   55539       unreachable("Invalid hardware generation");
   55540    }
   55541 }
   55542 
   55543 
   55544 
   55545 /* 3DSTATE_RASTER::Viewport Z Near Clip Test Enable */
   55546 
   55547 
   55548 #define GEN10_3DSTATE_RASTER_ViewportZNearClipTestEnable_bits  1
   55549 #define GEN9_3DSTATE_RASTER_ViewportZNearClipTestEnable_bits  1
   55550 
   55551 static inline uint32_t ATTRIBUTE_PURE
   55552 _3DSTATE_RASTER_ViewportZNearClipTestEnable_bits(const struct gen_device_info *devinfo)
   55553 {
   55554    switch (devinfo->gen) {
   55555    case 10: return 1;
   55556    case 9: return 1;
   55557    case 8: return 0;
   55558    case 7:
   55559       if (devinfo->is_haswell) {
   55560          return 0;
   55561       } else {
   55562          return 0;
   55563       }
   55564    case 6: return 0;
   55565    case 5: return 0;
   55566    case 4:
   55567       if (devinfo->is_g4x) {
   55568          return 0;
   55569       } else {
   55570          return 0;
   55571       }
   55572    default:
   55573       unreachable("Invalid hardware generation");
   55574    }
   55575 }
   55576 
   55577 
   55578 
   55579 #define GEN10_3DSTATE_RASTER_ViewportZNearClipTestEnable_start  32
   55580 #define GEN9_3DSTATE_RASTER_ViewportZNearClipTestEnable_start  32
   55581 
   55582 static inline uint32_t ATTRIBUTE_PURE
   55583 _3DSTATE_RASTER_ViewportZNearClipTestEnable_start(const struct gen_device_info *devinfo)
   55584 {
   55585    switch (devinfo->gen) {
   55586    case 10: return 32;
   55587    case 9: return 32;
   55588    case 8: return 0;
   55589    case 7:
   55590       if (devinfo->is_haswell) {
   55591          return 0;
   55592       } else {
   55593          return 0;
   55594       }
   55595    case 6: return 0;
   55596    case 5: return 0;
   55597    case 4:
   55598       if (devinfo->is_g4x) {
   55599          return 0;
   55600       } else {
   55601          return 0;
   55602       }
   55603    default:
   55604       unreachable("Invalid hardware generation");
   55605    }
   55606 }
   55607 
   55608 
   55609 
   55610 /* 3DSTATE_RAST_MULTISAMPLE */
   55611 
   55612 
   55613 #define GEN75_3DSTATE_RAST_MULTISAMPLE_length  6
   55614 
   55615 static inline uint32_t ATTRIBUTE_PURE
   55616 _3DSTATE_RAST_MULTISAMPLE_length(const struct gen_device_info *devinfo)
   55617 {
   55618    switch (devinfo->gen) {
   55619    case 10: return 0;
   55620    case 9: return 0;
   55621    case 8: return 0;
   55622    case 7:
   55623       if (devinfo->is_haswell) {
   55624          return 6;
   55625       } else {
   55626          return 0;
   55627       }
   55628    case 6: return 0;
   55629    case 5: return 0;
   55630    case 4:
   55631       if (devinfo->is_g4x) {
   55632          return 0;
   55633       } else {
   55634          return 0;
   55635       }
   55636    default:
   55637       unreachable("Invalid hardware generation");
   55638    }
   55639 }
   55640 
   55641 
   55642 
   55643 /* 3DSTATE_RAST_MULTISAMPLE::3D Command Opcode */
   55644 
   55645 
   55646 #define GEN75_3DSTATE_RAST_MULTISAMPLE_3DCommandOpcode_bits  3
   55647 
   55648 static inline uint32_t ATTRIBUTE_PURE
   55649 _3DSTATE_RAST_MULTISAMPLE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   55650 {
   55651    switch (devinfo->gen) {
   55652    case 10: return 0;
   55653    case 9: return 0;
   55654    case 8: return 0;
   55655    case 7:
   55656       if (devinfo->is_haswell) {
   55657          return 3;
   55658       } else {
   55659          return 0;
   55660       }
   55661    case 6: return 0;
   55662    case 5: return 0;
   55663    case 4:
   55664       if (devinfo->is_g4x) {
   55665          return 0;
   55666       } else {
   55667          return 0;
   55668       }
   55669    default:
   55670       unreachable("Invalid hardware generation");
   55671    }
   55672 }
   55673 
   55674 
   55675 
   55676 #define GEN75_3DSTATE_RAST_MULTISAMPLE_3DCommandOpcode_start  24
   55677 
   55678 static inline uint32_t ATTRIBUTE_PURE
   55679 _3DSTATE_RAST_MULTISAMPLE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   55680 {
   55681    switch (devinfo->gen) {
   55682    case 10: return 0;
   55683    case 9: return 0;
   55684    case 8: return 0;
   55685    case 7:
   55686       if (devinfo->is_haswell) {
   55687          return 24;
   55688       } else {
   55689          return 0;
   55690       }
   55691    case 6: return 0;
   55692    case 5: return 0;
   55693    case 4:
   55694       if (devinfo->is_g4x) {
   55695          return 0;
   55696       } else {
   55697          return 0;
   55698       }
   55699    default:
   55700       unreachable("Invalid hardware generation");
   55701    }
   55702 }
   55703 
   55704 
   55705 
   55706 /* 3DSTATE_RAST_MULTISAMPLE::3D Command Sub Opcode */
   55707 
   55708 
   55709 #define GEN75_3DSTATE_RAST_MULTISAMPLE_3DCommandSubOpcode_bits  8
   55710 
   55711 static inline uint32_t ATTRIBUTE_PURE
   55712 _3DSTATE_RAST_MULTISAMPLE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   55713 {
   55714    switch (devinfo->gen) {
   55715    case 10: return 0;
   55716    case 9: return 0;
   55717    case 8: return 0;
   55718    case 7:
   55719       if (devinfo->is_haswell) {
   55720          return 8;
   55721       } else {
   55722          return 0;
   55723       }
   55724    case 6: return 0;
   55725    case 5: return 0;
   55726    case 4:
   55727       if (devinfo->is_g4x) {
   55728          return 0;
   55729       } else {
   55730          return 0;
   55731       }
   55732    default:
   55733       unreachable("Invalid hardware generation");
   55734    }
   55735 }
   55736 
   55737 
   55738 
   55739 #define GEN75_3DSTATE_RAST_MULTISAMPLE_3DCommandSubOpcode_start  16
   55740 
   55741 static inline uint32_t ATTRIBUTE_PURE
   55742 _3DSTATE_RAST_MULTISAMPLE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   55743 {
   55744    switch (devinfo->gen) {
   55745    case 10: return 0;
   55746    case 9: return 0;
   55747    case 8: return 0;
   55748    case 7:
   55749       if (devinfo->is_haswell) {
   55750          return 16;
   55751       } else {
   55752          return 0;
   55753       }
   55754    case 6: return 0;
   55755    case 5: return 0;
   55756    case 4:
   55757       if (devinfo->is_g4x) {
   55758          return 0;
   55759       } else {
   55760          return 0;
   55761       }
   55762    default:
   55763       unreachable("Invalid hardware generation");
   55764    }
   55765 }
   55766 
   55767 
   55768 
   55769 /* 3DSTATE_RAST_MULTISAMPLE::Command SubType */
   55770 
   55771 
   55772 #define GEN75_3DSTATE_RAST_MULTISAMPLE_CommandSubType_bits  2
   55773 
   55774 static inline uint32_t ATTRIBUTE_PURE
   55775 _3DSTATE_RAST_MULTISAMPLE_CommandSubType_bits(const struct gen_device_info *devinfo)
   55776 {
   55777    switch (devinfo->gen) {
   55778    case 10: return 0;
   55779    case 9: return 0;
   55780    case 8: return 0;
   55781    case 7:
   55782       if (devinfo->is_haswell) {
   55783          return 2;
   55784       } else {
   55785          return 0;
   55786       }
   55787    case 6: return 0;
   55788    case 5: return 0;
   55789    case 4:
   55790       if (devinfo->is_g4x) {
   55791          return 0;
   55792       } else {
   55793          return 0;
   55794       }
   55795    default:
   55796       unreachable("Invalid hardware generation");
   55797    }
   55798 }
   55799 
   55800 
   55801 
   55802 #define GEN75_3DSTATE_RAST_MULTISAMPLE_CommandSubType_start  27
   55803 
   55804 static inline uint32_t ATTRIBUTE_PURE
   55805 _3DSTATE_RAST_MULTISAMPLE_CommandSubType_start(const struct gen_device_info *devinfo)
   55806 {
   55807    switch (devinfo->gen) {
   55808    case 10: return 0;
   55809    case 9: return 0;
   55810    case 8: return 0;
   55811    case 7:
   55812       if (devinfo->is_haswell) {
   55813          return 27;
   55814       } else {
   55815          return 0;
   55816       }
   55817    case 6: return 0;
   55818    case 5: return 0;
   55819    case 4:
   55820       if (devinfo->is_g4x) {
   55821          return 0;
   55822       } else {
   55823          return 0;
   55824       }
   55825    default:
   55826       unreachable("Invalid hardware generation");
   55827    }
   55828 }
   55829 
   55830 
   55831 
   55832 /* 3DSTATE_RAST_MULTISAMPLE::Command Type */
   55833 
   55834 
   55835 #define GEN75_3DSTATE_RAST_MULTISAMPLE_CommandType_bits  3
   55836 
   55837 static inline uint32_t ATTRIBUTE_PURE
   55838 _3DSTATE_RAST_MULTISAMPLE_CommandType_bits(const struct gen_device_info *devinfo)
   55839 {
   55840    switch (devinfo->gen) {
   55841    case 10: return 0;
   55842    case 9: return 0;
   55843    case 8: return 0;
   55844    case 7:
   55845       if (devinfo->is_haswell) {
   55846          return 3;
   55847       } else {
   55848          return 0;
   55849       }
   55850    case 6: return 0;
   55851    case 5: return 0;
   55852    case 4:
   55853       if (devinfo->is_g4x) {
   55854          return 0;
   55855       } else {
   55856          return 0;
   55857       }
   55858    default:
   55859       unreachable("Invalid hardware generation");
   55860    }
   55861 }
   55862 
   55863 
   55864 
   55865 #define GEN75_3DSTATE_RAST_MULTISAMPLE_CommandType_start  29
   55866 
   55867 static inline uint32_t ATTRIBUTE_PURE
   55868 _3DSTATE_RAST_MULTISAMPLE_CommandType_start(const struct gen_device_info *devinfo)
   55869 {
   55870    switch (devinfo->gen) {
   55871    case 10: return 0;
   55872    case 9: return 0;
   55873    case 8: return 0;
   55874    case 7:
   55875       if (devinfo->is_haswell) {
   55876          return 29;
   55877       } else {
   55878          return 0;
   55879       }
   55880    case 6: return 0;
   55881    case 5: return 0;
   55882    case 4:
   55883       if (devinfo->is_g4x) {
   55884          return 0;
   55885       } else {
   55886          return 0;
   55887       }
   55888    default:
   55889       unreachable("Invalid hardware generation");
   55890    }
   55891 }
   55892 
   55893 
   55894 
   55895 /* 3DSTATE_RAST_MULTISAMPLE::DWord Length */
   55896 
   55897 
   55898 #define GEN75_3DSTATE_RAST_MULTISAMPLE_DWordLength_bits  8
   55899 
   55900 static inline uint32_t ATTRIBUTE_PURE
   55901 _3DSTATE_RAST_MULTISAMPLE_DWordLength_bits(const struct gen_device_info *devinfo)
   55902 {
   55903    switch (devinfo->gen) {
   55904    case 10: return 0;
   55905    case 9: return 0;
   55906    case 8: return 0;
   55907    case 7:
   55908       if (devinfo->is_haswell) {
   55909          return 8;
   55910       } else {
   55911          return 0;
   55912       }
   55913    case 6: return 0;
   55914    case 5: return 0;
   55915    case 4:
   55916       if (devinfo->is_g4x) {
   55917          return 0;
   55918       } else {
   55919          return 0;
   55920       }
   55921    default:
   55922       unreachable("Invalid hardware generation");
   55923    }
   55924 }
   55925 
   55926 
   55927 
   55928 #define GEN75_3DSTATE_RAST_MULTISAMPLE_DWordLength_start  0
   55929 
   55930 static inline uint32_t ATTRIBUTE_PURE
   55931 _3DSTATE_RAST_MULTISAMPLE_DWordLength_start(const struct gen_device_info *devinfo)
   55932 {
   55933    switch (devinfo->gen) {
   55934    case 10: return 0;
   55935    case 9: return 0;
   55936    case 8: return 0;
   55937    case 7:
   55938       if (devinfo->is_haswell) {
   55939          return 0;
   55940       } else {
   55941          return 0;
   55942       }
   55943    case 6: return 0;
   55944    case 5: return 0;
   55945    case 4:
   55946       if (devinfo->is_g4x) {
   55947          return 0;
   55948       } else {
   55949          return 0;
   55950       }
   55951    default:
   55952       unreachable("Invalid hardware generation");
   55953    }
   55954 }
   55955 
   55956 
   55957 
   55958 /* 3DSTATE_RAST_MULTISAMPLE::Number of Rasterization Multisamples */
   55959 
   55960 
   55961 #define GEN75_3DSTATE_RAST_MULTISAMPLE_NumberofRasterizationMultisamples_bits  3
   55962 
   55963 static inline uint32_t ATTRIBUTE_PURE
   55964 _3DSTATE_RAST_MULTISAMPLE_NumberofRasterizationMultisamples_bits(const struct gen_device_info *devinfo)
   55965 {
   55966    switch (devinfo->gen) {
   55967    case 10: return 0;
   55968    case 9: return 0;
   55969    case 8: return 0;
   55970    case 7:
   55971       if (devinfo->is_haswell) {
   55972          return 3;
   55973       } else {
   55974          return 0;
   55975       }
   55976    case 6: return 0;
   55977    case 5: return 0;
   55978    case 4:
   55979       if (devinfo->is_g4x) {
   55980          return 0;
   55981       } else {
   55982          return 0;
   55983       }
   55984    default:
   55985       unreachable("Invalid hardware generation");
   55986    }
   55987 }
   55988 
   55989 
   55990 
   55991 #define GEN75_3DSTATE_RAST_MULTISAMPLE_NumberofRasterizationMultisamples_start  33
   55992 
   55993 static inline uint32_t ATTRIBUTE_PURE
   55994 _3DSTATE_RAST_MULTISAMPLE_NumberofRasterizationMultisamples_start(const struct gen_device_info *devinfo)
   55995 {
   55996    switch (devinfo->gen) {
   55997    case 10: return 0;
   55998    case 9: return 0;
   55999    case 8: return 0;
   56000    case 7:
   56001       if (devinfo->is_haswell) {
   56002          return 33;
   56003       } else {
   56004          return 0;
   56005       }
   56006    case 6: return 0;
   56007    case 5: return 0;
   56008    case 4:
   56009       if (devinfo->is_g4x) {
   56010          return 0;
   56011       } else {
   56012          return 0;
   56013       }
   56014    default:
   56015       unreachable("Invalid hardware generation");
   56016    }
   56017 }
   56018 
   56019 
   56020 
   56021 /* 3DSTATE_RAST_MULTISAMPLE::Sample0 X Offset */
   56022 
   56023 
   56024 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample0XOffset_bits  4
   56025 
   56026 static inline uint32_t ATTRIBUTE_PURE
   56027 _3DSTATE_RAST_MULTISAMPLE_Sample0XOffset_bits(const struct gen_device_info *devinfo)
   56028 {
   56029    switch (devinfo->gen) {
   56030    case 10: return 0;
   56031    case 9: return 0;
   56032    case 8: return 0;
   56033    case 7:
   56034       if (devinfo->is_haswell) {
   56035          return 4;
   56036       } else {
   56037          return 0;
   56038       }
   56039    case 6: return 0;
   56040    case 5: return 0;
   56041    case 4:
   56042       if (devinfo->is_g4x) {
   56043          return 0;
   56044       } else {
   56045          return 0;
   56046       }
   56047    default:
   56048       unreachable("Invalid hardware generation");
   56049    }
   56050 }
   56051 
   56052 
   56053 
   56054 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample0XOffset_start  68
   56055 
   56056 static inline uint32_t ATTRIBUTE_PURE
   56057 _3DSTATE_RAST_MULTISAMPLE_Sample0XOffset_start(const struct gen_device_info *devinfo)
   56058 {
   56059    switch (devinfo->gen) {
   56060    case 10: return 0;
   56061    case 9: return 0;
   56062    case 8: return 0;
   56063    case 7:
   56064       if (devinfo->is_haswell) {
   56065          return 68;
   56066       } else {
   56067          return 0;
   56068       }
   56069    case 6: return 0;
   56070    case 5: return 0;
   56071    case 4:
   56072       if (devinfo->is_g4x) {
   56073          return 0;
   56074       } else {
   56075          return 0;
   56076       }
   56077    default:
   56078       unreachable("Invalid hardware generation");
   56079    }
   56080 }
   56081 
   56082 
   56083 
   56084 /* 3DSTATE_RAST_MULTISAMPLE::Sample0 Y Offset */
   56085 
   56086 
   56087 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample0YOffset_bits  4
   56088 
   56089 static inline uint32_t ATTRIBUTE_PURE
   56090 _3DSTATE_RAST_MULTISAMPLE_Sample0YOffset_bits(const struct gen_device_info *devinfo)
   56091 {
   56092    switch (devinfo->gen) {
   56093    case 10: return 0;
   56094    case 9: return 0;
   56095    case 8: return 0;
   56096    case 7:
   56097       if (devinfo->is_haswell) {
   56098          return 4;
   56099       } else {
   56100          return 0;
   56101       }
   56102    case 6: return 0;
   56103    case 5: return 0;
   56104    case 4:
   56105       if (devinfo->is_g4x) {
   56106          return 0;
   56107       } else {
   56108          return 0;
   56109       }
   56110    default:
   56111       unreachable("Invalid hardware generation");
   56112    }
   56113 }
   56114 
   56115 
   56116 
   56117 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample0YOffset_start  64
   56118 
   56119 static inline uint32_t ATTRIBUTE_PURE
   56120 _3DSTATE_RAST_MULTISAMPLE_Sample0YOffset_start(const struct gen_device_info *devinfo)
   56121 {
   56122    switch (devinfo->gen) {
   56123    case 10: return 0;
   56124    case 9: return 0;
   56125    case 8: return 0;
   56126    case 7:
   56127       if (devinfo->is_haswell) {
   56128          return 64;
   56129       } else {
   56130          return 0;
   56131       }
   56132    case 6: return 0;
   56133    case 5: return 0;
   56134    case 4:
   56135       if (devinfo->is_g4x) {
   56136          return 0;
   56137       } else {
   56138          return 0;
   56139       }
   56140    default:
   56141       unreachable("Invalid hardware generation");
   56142    }
   56143 }
   56144 
   56145 
   56146 
   56147 /* 3DSTATE_RAST_MULTISAMPLE::Sample1 X Offset */
   56148 
   56149 
   56150 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample1XOffset_bits  4
   56151 
   56152 static inline uint32_t ATTRIBUTE_PURE
   56153 _3DSTATE_RAST_MULTISAMPLE_Sample1XOffset_bits(const struct gen_device_info *devinfo)
   56154 {
   56155    switch (devinfo->gen) {
   56156    case 10: return 0;
   56157    case 9: return 0;
   56158    case 8: return 0;
   56159    case 7:
   56160       if (devinfo->is_haswell) {
   56161          return 4;
   56162       } else {
   56163          return 0;
   56164       }
   56165    case 6: return 0;
   56166    case 5: return 0;
   56167    case 4:
   56168       if (devinfo->is_g4x) {
   56169          return 0;
   56170       } else {
   56171          return 0;
   56172       }
   56173    default:
   56174       unreachable("Invalid hardware generation");
   56175    }
   56176 }
   56177 
   56178 
   56179 
   56180 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample1XOffset_start  76
   56181 
   56182 static inline uint32_t ATTRIBUTE_PURE
   56183 _3DSTATE_RAST_MULTISAMPLE_Sample1XOffset_start(const struct gen_device_info *devinfo)
   56184 {
   56185    switch (devinfo->gen) {
   56186    case 10: return 0;
   56187    case 9: return 0;
   56188    case 8: return 0;
   56189    case 7:
   56190       if (devinfo->is_haswell) {
   56191          return 76;
   56192       } else {
   56193          return 0;
   56194       }
   56195    case 6: return 0;
   56196    case 5: return 0;
   56197    case 4:
   56198       if (devinfo->is_g4x) {
   56199          return 0;
   56200       } else {
   56201          return 0;
   56202       }
   56203    default:
   56204       unreachable("Invalid hardware generation");
   56205    }
   56206 }
   56207 
   56208 
   56209 
   56210 /* 3DSTATE_RAST_MULTISAMPLE::Sample1 Y Offset */
   56211 
   56212 
   56213 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample1YOffset_bits  4
   56214 
   56215 static inline uint32_t ATTRIBUTE_PURE
   56216 _3DSTATE_RAST_MULTISAMPLE_Sample1YOffset_bits(const struct gen_device_info *devinfo)
   56217 {
   56218    switch (devinfo->gen) {
   56219    case 10: return 0;
   56220    case 9: return 0;
   56221    case 8: return 0;
   56222    case 7:
   56223       if (devinfo->is_haswell) {
   56224          return 4;
   56225       } else {
   56226          return 0;
   56227       }
   56228    case 6: return 0;
   56229    case 5: return 0;
   56230    case 4:
   56231       if (devinfo->is_g4x) {
   56232          return 0;
   56233       } else {
   56234          return 0;
   56235       }
   56236    default:
   56237       unreachable("Invalid hardware generation");
   56238    }
   56239 }
   56240 
   56241 
   56242 
   56243 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample1YOffset_start  72
   56244 
   56245 static inline uint32_t ATTRIBUTE_PURE
   56246 _3DSTATE_RAST_MULTISAMPLE_Sample1YOffset_start(const struct gen_device_info *devinfo)
   56247 {
   56248    switch (devinfo->gen) {
   56249    case 10: return 0;
   56250    case 9: return 0;
   56251    case 8: return 0;
   56252    case 7:
   56253       if (devinfo->is_haswell) {
   56254          return 72;
   56255       } else {
   56256          return 0;
   56257       }
   56258    case 6: return 0;
   56259    case 5: return 0;
   56260    case 4:
   56261       if (devinfo->is_g4x) {
   56262          return 0;
   56263       } else {
   56264          return 0;
   56265       }
   56266    default:
   56267       unreachable("Invalid hardware generation");
   56268    }
   56269 }
   56270 
   56271 
   56272 
   56273 /* 3DSTATE_RAST_MULTISAMPLE::Sample10 X Offset */
   56274 
   56275 
   56276 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample10XOffset_bits  4
   56277 
   56278 static inline uint32_t ATTRIBUTE_PURE
   56279 _3DSTATE_RAST_MULTISAMPLE_Sample10XOffset_bits(const struct gen_device_info *devinfo)
   56280 {
   56281    switch (devinfo->gen) {
   56282    case 10: return 0;
   56283    case 9: return 0;
   56284    case 8: return 0;
   56285    case 7:
   56286       if (devinfo->is_haswell) {
   56287          return 4;
   56288       } else {
   56289          return 0;
   56290       }
   56291    case 6: return 0;
   56292    case 5: return 0;
   56293    case 4:
   56294       if (devinfo->is_g4x) {
   56295          return 0;
   56296       } else {
   56297          return 0;
   56298       }
   56299    default:
   56300       unreachable("Invalid hardware generation");
   56301    }
   56302 }
   56303 
   56304 
   56305 
   56306 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample10XOffset_start  148
   56307 
   56308 static inline uint32_t ATTRIBUTE_PURE
   56309 _3DSTATE_RAST_MULTISAMPLE_Sample10XOffset_start(const struct gen_device_info *devinfo)
   56310 {
   56311    switch (devinfo->gen) {
   56312    case 10: return 0;
   56313    case 9: return 0;
   56314    case 8: return 0;
   56315    case 7:
   56316       if (devinfo->is_haswell) {
   56317          return 148;
   56318       } else {
   56319          return 0;
   56320       }
   56321    case 6: return 0;
   56322    case 5: return 0;
   56323    case 4:
   56324       if (devinfo->is_g4x) {
   56325          return 0;
   56326       } else {
   56327          return 0;
   56328       }
   56329    default:
   56330       unreachable("Invalid hardware generation");
   56331    }
   56332 }
   56333 
   56334 
   56335 
   56336 /* 3DSTATE_RAST_MULTISAMPLE::Sample10 Y Offset */
   56337 
   56338 
   56339 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample10YOffset_bits  4
   56340 
   56341 static inline uint32_t ATTRIBUTE_PURE
   56342 _3DSTATE_RAST_MULTISAMPLE_Sample10YOffset_bits(const struct gen_device_info *devinfo)
   56343 {
   56344    switch (devinfo->gen) {
   56345    case 10: return 0;
   56346    case 9: return 0;
   56347    case 8: return 0;
   56348    case 7:
   56349       if (devinfo->is_haswell) {
   56350          return 4;
   56351       } else {
   56352          return 0;
   56353       }
   56354    case 6: return 0;
   56355    case 5: return 0;
   56356    case 4:
   56357       if (devinfo->is_g4x) {
   56358          return 0;
   56359       } else {
   56360          return 0;
   56361       }
   56362    default:
   56363       unreachable("Invalid hardware generation");
   56364    }
   56365 }
   56366 
   56367 
   56368 
   56369 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample10YOffset_start  144
   56370 
   56371 static inline uint32_t ATTRIBUTE_PURE
   56372 _3DSTATE_RAST_MULTISAMPLE_Sample10YOffset_start(const struct gen_device_info *devinfo)
   56373 {
   56374    switch (devinfo->gen) {
   56375    case 10: return 0;
   56376    case 9: return 0;
   56377    case 8: return 0;
   56378    case 7:
   56379       if (devinfo->is_haswell) {
   56380          return 144;
   56381       } else {
   56382          return 0;
   56383       }
   56384    case 6: return 0;
   56385    case 5: return 0;
   56386    case 4:
   56387       if (devinfo->is_g4x) {
   56388          return 0;
   56389       } else {
   56390          return 0;
   56391       }
   56392    default:
   56393       unreachable("Invalid hardware generation");
   56394    }
   56395 }
   56396 
   56397 
   56398 
   56399 /* 3DSTATE_RAST_MULTISAMPLE::Sample11 X Offset */
   56400 
   56401 
   56402 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample11XOffset_bits  4
   56403 
   56404 static inline uint32_t ATTRIBUTE_PURE
   56405 _3DSTATE_RAST_MULTISAMPLE_Sample11XOffset_bits(const struct gen_device_info *devinfo)
   56406 {
   56407    switch (devinfo->gen) {
   56408    case 10: return 0;
   56409    case 9: return 0;
   56410    case 8: return 0;
   56411    case 7:
   56412       if (devinfo->is_haswell) {
   56413          return 4;
   56414       } else {
   56415          return 0;
   56416       }
   56417    case 6: return 0;
   56418    case 5: return 0;
   56419    case 4:
   56420       if (devinfo->is_g4x) {
   56421          return 0;
   56422       } else {
   56423          return 0;
   56424       }
   56425    default:
   56426       unreachable("Invalid hardware generation");
   56427    }
   56428 }
   56429 
   56430 
   56431 
   56432 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample11XOffset_start  156
   56433 
   56434 static inline uint32_t ATTRIBUTE_PURE
   56435 _3DSTATE_RAST_MULTISAMPLE_Sample11XOffset_start(const struct gen_device_info *devinfo)
   56436 {
   56437    switch (devinfo->gen) {
   56438    case 10: return 0;
   56439    case 9: return 0;
   56440    case 8: return 0;
   56441    case 7:
   56442       if (devinfo->is_haswell) {
   56443          return 156;
   56444       } else {
   56445          return 0;
   56446       }
   56447    case 6: return 0;
   56448    case 5: return 0;
   56449    case 4:
   56450       if (devinfo->is_g4x) {
   56451          return 0;
   56452       } else {
   56453          return 0;
   56454       }
   56455    default:
   56456       unreachable("Invalid hardware generation");
   56457    }
   56458 }
   56459 
   56460 
   56461 
   56462 /* 3DSTATE_RAST_MULTISAMPLE::Sample11 Y Offset */
   56463 
   56464 
   56465 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample11YOffset_bits  4
   56466 
   56467 static inline uint32_t ATTRIBUTE_PURE
   56468 _3DSTATE_RAST_MULTISAMPLE_Sample11YOffset_bits(const struct gen_device_info *devinfo)
   56469 {
   56470    switch (devinfo->gen) {
   56471    case 10: return 0;
   56472    case 9: return 0;
   56473    case 8: return 0;
   56474    case 7:
   56475       if (devinfo->is_haswell) {
   56476          return 4;
   56477       } else {
   56478          return 0;
   56479       }
   56480    case 6: return 0;
   56481    case 5: return 0;
   56482    case 4:
   56483       if (devinfo->is_g4x) {
   56484          return 0;
   56485       } else {
   56486          return 0;
   56487       }
   56488    default:
   56489       unreachable("Invalid hardware generation");
   56490    }
   56491 }
   56492 
   56493 
   56494 
   56495 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample11YOffset_start  152
   56496 
   56497 static inline uint32_t ATTRIBUTE_PURE
   56498 _3DSTATE_RAST_MULTISAMPLE_Sample11YOffset_start(const struct gen_device_info *devinfo)
   56499 {
   56500    switch (devinfo->gen) {
   56501    case 10: return 0;
   56502    case 9: return 0;
   56503    case 8: return 0;
   56504    case 7:
   56505       if (devinfo->is_haswell) {
   56506          return 152;
   56507       } else {
   56508          return 0;
   56509       }
   56510    case 6: return 0;
   56511    case 5: return 0;
   56512    case 4:
   56513       if (devinfo->is_g4x) {
   56514          return 0;
   56515       } else {
   56516          return 0;
   56517       }
   56518    default:
   56519       unreachable("Invalid hardware generation");
   56520    }
   56521 }
   56522 
   56523 
   56524 
   56525 /* 3DSTATE_RAST_MULTISAMPLE::Sample12 X Offset */
   56526 
   56527 
   56528 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample12XOffset_bits  4
   56529 
   56530 static inline uint32_t ATTRIBUTE_PURE
   56531 _3DSTATE_RAST_MULTISAMPLE_Sample12XOffset_bits(const struct gen_device_info *devinfo)
   56532 {
   56533    switch (devinfo->gen) {
   56534    case 10: return 0;
   56535    case 9: return 0;
   56536    case 8: return 0;
   56537    case 7:
   56538       if (devinfo->is_haswell) {
   56539          return 4;
   56540       } else {
   56541          return 0;
   56542       }
   56543    case 6: return 0;
   56544    case 5: return 0;
   56545    case 4:
   56546       if (devinfo->is_g4x) {
   56547          return 0;
   56548       } else {
   56549          return 0;
   56550       }
   56551    default:
   56552       unreachable("Invalid hardware generation");
   56553    }
   56554 }
   56555 
   56556 
   56557 
   56558 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample12XOffset_start  164
   56559 
   56560 static inline uint32_t ATTRIBUTE_PURE
   56561 _3DSTATE_RAST_MULTISAMPLE_Sample12XOffset_start(const struct gen_device_info *devinfo)
   56562 {
   56563    switch (devinfo->gen) {
   56564    case 10: return 0;
   56565    case 9: return 0;
   56566    case 8: return 0;
   56567    case 7:
   56568       if (devinfo->is_haswell) {
   56569          return 164;
   56570       } else {
   56571          return 0;
   56572       }
   56573    case 6: return 0;
   56574    case 5: return 0;
   56575    case 4:
   56576       if (devinfo->is_g4x) {
   56577          return 0;
   56578       } else {
   56579          return 0;
   56580       }
   56581    default:
   56582       unreachable("Invalid hardware generation");
   56583    }
   56584 }
   56585 
   56586 
   56587 
   56588 /* 3DSTATE_RAST_MULTISAMPLE::Sample12 Y Offset */
   56589 
   56590 
   56591 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample12YOffset_bits  4
   56592 
   56593 static inline uint32_t ATTRIBUTE_PURE
   56594 _3DSTATE_RAST_MULTISAMPLE_Sample12YOffset_bits(const struct gen_device_info *devinfo)
   56595 {
   56596    switch (devinfo->gen) {
   56597    case 10: return 0;
   56598    case 9: return 0;
   56599    case 8: return 0;
   56600    case 7:
   56601       if (devinfo->is_haswell) {
   56602          return 4;
   56603       } else {
   56604          return 0;
   56605       }
   56606    case 6: return 0;
   56607    case 5: return 0;
   56608    case 4:
   56609       if (devinfo->is_g4x) {
   56610          return 0;
   56611       } else {
   56612          return 0;
   56613       }
   56614    default:
   56615       unreachable("Invalid hardware generation");
   56616    }
   56617 }
   56618 
   56619 
   56620 
   56621 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample12YOffset_start  160
   56622 
   56623 static inline uint32_t ATTRIBUTE_PURE
   56624 _3DSTATE_RAST_MULTISAMPLE_Sample12YOffset_start(const struct gen_device_info *devinfo)
   56625 {
   56626    switch (devinfo->gen) {
   56627    case 10: return 0;
   56628    case 9: return 0;
   56629    case 8: return 0;
   56630    case 7:
   56631       if (devinfo->is_haswell) {
   56632          return 160;
   56633       } else {
   56634          return 0;
   56635       }
   56636    case 6: return 0;
   56637    case 5: return 0;
   56638    case 4:
   56639       if (devinfo->is_g4x) {
   56640          return 0;
   56641       } else {
   56642          return 0;
   56643       }
   56644    default:
   56645       unreachable("Invalid hardware generation");
   56646    }
   56647 }
   56648 
   56649 
   56650 
   56651 /* 3DSTATE_RAST_MULTISAMPLE::Sample13 X Offset */
   56652 
   56653 
   56654 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample13XOffset_bits  4
   56655 
   56656 static inline uint32_t ATTRIBUTE_PURE
   56657 _3DSTATE_RAST_MULTISAMPLE_Sample13XOffset_bits(const struct gen_device_info *devinfo)
   56658 {
   56659    switch (devinfo->gen) {
   56660    case 10: return 0;
   56661    case 9: return 0;
   56662    case 8: return 0;
   56663    case 7:
   56664       if (devinfo->is_haswell) {
   56665          return 4;
   56666       } else {
   56667          return 0;
   56668       }
   56669    case 6: return 0;
   56670    case 5: return 0;
   56671    case 4:
   56672       if (devinfo->is_g4x) {
   56673          return 0;
   56674       } else {
   56675          return 0;
   56676       }
   56677    default:
   56678       unreachable("Invalid hardware generation");
   56679    }
   56680 }
   56681 
   56682 
   56683 
   56684 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample13XOffset_start  172
   56685 
   56686 static inline uint32_t ATTRIBUTE_PURE
   56687 _3DSTATE_RAST_MULTISAMPLE_Sample13XOffset_start(const struct gen_device_info *devinfo)
   56688 {
   56689    switch (devinfo->gen) {
   56690    case 10: return 0;
   56691    case 9: return 0;
   56692    case 8: return 0;
   56693    case 7:
   56694       if (devinfo->is_haswell) {
   56695          return 172;
   56696       } else {
   56697          return 0;
   56698       }
   56699    case 6: return 0;
   56700    case 5: return 0;
   56701    case 4:
   56702       if (devinfo->is_g4x) {
   56703          return 0;
   56704       } else {
   56705          return 0;
   56706       }
   56707    default:
   56708       unreachable("Invalid hardware generation");
   56709    }
   56710 }
   56711 
   56712 
   56713 
   56714 /* 3DSTATE_RAST_MULTISAMPLE::Sample13 Y Offset */
   56715 
   56716 
   56717 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample13YOffset_bits  4
   56718 
   56719 static inline uint32_t ATTRIBUTE_PURE
   56720 _3DSTATE_RAST_MULTISAMPLE_Sample13YOffset_bits(const struct gen_device_info *devinfo)
   56721 {
   56722    switch (devinfo->gen) {
   56723    case 10: return 0;
   56724    case 9: return 0;
   56725    case 8: return 0;
   56726    case 7:
   56727       if (devinfo->is_haswell) {
   56728          return 4;
   56729       } else {
   56730          return 0;
   56731       }
   56732    case 6: return 0;
   56733    case 5: return 0;
   56734    case 4:
   56735       if (devinfo->is_g4x) {
   56736          return 0;
   56737       } else {
   56738          return 0;
   56739       }
   56740    default:
   56741       unreachable("Invalid hardware generation");
   56742    }
   56743 }
   56744 
   56745 
   56746 
   56747 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample13YOffset_start  168
   56748 
   56749 static inline uint32_t ATTRIBUTE_PURE
   56750 _3DSTATE_RAST_MULTISAMPLE_Sample13YOffset_start(const struct gen_device_info *devinfo)
   56751 {
   56752    switch (devinfo->gen) {
   56753    case 10: return 0;
   56754    case 9: return 0;
   56755    case 8: return 0;
   56756    case 7:
   56757       if (devinfo->is_haswell) {
   56758          return 168;
   56759       } else {
   56760          return 0;
   56761       }
   56762    case 6: return 0;
   56763    case 5: return 0;
   56764    case 4:
   56765       if (devinfo->is_g4x) {
   56766          return 0;
   56767       } else {
   56768          return 0;
   56769       }
   56770    default:
   56771       unreachable("Invalid hardware generation");
   56772    }
   56773 }
   56774 
   56775 
   56776 
   56777 /* 3DSTATE_RAST_MULTISAMPLE::Sample14 X Offset */
   56778 
   56779 
   56780 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample14XOffset_bits  4
   56781 
   56782 static inline uint32_t ATTRIBUTE_PURE
   56783 _3DSTATE_RAST_MULTISAMPLE_Sample14XOffset_bits(const struct gen_device_info *devinfo)
   56784 {
   56785    switch (devinfo->gen) {
   56786    case 10: return 0;
   56787    case 9: return 0;
   56788    case 8: return 0;
   56789    case 7:
   56790       if (devinfo->is_haswell) {
   56791          return 4;
   56792       } else {
   56793          return 0;
   56794       }
   56795    case 6: return 0;
   56796    case 5: return 0;
   56797    case 4:
   56798       if (devinfo->is_g4x) {
   56799          return 0;
   56800       } else {
   56801          return 0;
   56802       }
   56803    default:
   56804       unreachable("Invalid hardware generation");
   56805    }
   56806 }
   56807 
   56808 
   56809 
   56810 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample14XOffset_start  180
   56811 
   56812 static inline uint32_t ATTRIBUTE_PURE
   56813 _3DSTATE_RAST_MULTISAMPLE_Sample14XOffset_start(const struct gen_device_info *devinfo)
   56814 {
   56815    switch (devinfo->gen) {
   56816    case 10: return 0;
   56817    case 9: return 0;
   56818    case 8: return 0;
   56819    case 7:
   56820       if (devinfo->is_haswell) {
   56821          return 180;
   56822       } else {
   56823          return 0;
   56824       }
   56825    case 6: return 0;
   56826    case 5: return 0;
   56827    case 4:
   56828       if (devinfo->is_g4x) {
   56829          return 0;
   56830       } else {
   56831          return 0;
   56832       }
   56833    default:
   56834       unreachable("Invalid hardware generation");
   56835    }
   56836 }
   56837 
   56838 
   56839 
   56840 /* 3DSTATE_RAST_MULTISAMPLE::Sample14 Y Offset */
   56841 
   56842 
   56843 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample14YOffset_bits  4
   56844 
   56845 static inline uint32_t ATTRIBUTE_PURE
   56846 _3DSTATE_RAST_MULTISAMPLE_Sample14YOffset_bits(const struct gen_device_info *devinfo)
   56847 {
   56848    switch (devinfo->gen) {
   56849    case 10: return 0;
   56850    case 9: return 0;
   56851    case 8: return 0;
   56852    case 7:
   56853       if (devinfo->is_haswell) {
   56854          return 4;
   56855       } else {
   56856          return 0;
   56857       }
   56858    case 6: return 0;
   56859    case 5: return 0;
   56860    case 4:
   56861       if (devinfo->is_g4x) {
   56862          return 0;
   56863       } else {
   56864          return 0;
   56865       }
   56866    default:
   56867       unreachable("Invalid hardware generation");
   56868    }
   56869 }
   56870 
   56871 
   56872 
   56873 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample14YOffset_start  176
   56874 
   56875 static inline uint32_t ATTRIBUTE_PURE
   56876 _3DSTATE_RAST_MULTISAMPLE_Sample14YOffset_start(const struct gen_device_info *devinfo)
   56877 {
   56878    switch (devinfo->gen) {
   56879    case 10: return 0;
   56880    case 9: return 0;
   56881    case 8: return 0;
   56882    case 7:
   56883       if (devinfo->is_haswell) {
   56884          return 176;
   56885       } else {
   56886          return 0;
   56887       }
   56888    case 6: return 0;
   56889    case 5: return 0;
   56890    case 4:
   56891       if (devinfo->is_g4x) {
   56892          return 0;
   56893       } else {
   56894          return 0;
   56895       }
   56896    default:
   56897       unreachable("Invalid hardware generation");
   56898    }
   56899 }
   56900 
   56901 
   56902 
   56903 /* 3DSTATE_RAST_MULTISAMPLE::Sample15 X Offset */
   56904 
   56905 
   56906 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample15XOffset_bits  4
   56907 
   56908 static inline uint32_t ATTRIBUTE_PURE
   56909 _3DSTATE_RAST_MULTISAMPLE_Sample15XOffset_bits(const struct gen_device_info *devinfo)
   56910 {
   56911    switch (devinfo->gen) {
   56912    case 10: return 0;
   56913    case 9: return 0;
   56914    case 8: return 0;
   56915    case 7:
   56916       if (devinfo->is_haswell) {
   56917          return 4;
   56918       } else {
   56919          return 0;
   56920       }
   56921    case 6: return 0;
   56922    case 5: return 0;
   56923    case 4:
   56924       if (devinfo->is_g4x) {
   56925          return 0;
   56926       } else {
   56927          return 0;
   56928       }
   56929    default:
   56930       unreachable("Invalid hardware generation");
   56931    }
   56932 }
   56933 
   56934 
   56935 
   56936 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample15XOffset_start  188
   56937 
   56938 static inline uint32_t ATTRIBUTE_PURE
   56939 _3DSTATE_RAST_MULTISAMPLE_Sample15XOffset_start(const struct gen_device_info *devinfo)
   56940 {
   56941    switch (devinfo->gen) {
   56942    case 10: return 0;
   56943    case 9: return 0;
   56944    case 8: return 0;
   56945    case 7:
   56946       if (devinfo->is_haswell) {
   56947          return 188;
   56948       } else {
   56949          return 0;
   56950       }
   56951    case 6: return 0;
   56952    case 5: return 0;
   56953    case 4:
   56954       if (devinfo->is_g4x) {
   56955          return 0;
   56956       } else {
   56957          return 0;
   56958       }
   56959    default:
   56960       unreachable("Invalid hardware generation");
   56961    }
   56962 }
   56963 
   56964 
   56965 
   56966 /* 3DSTATE_RAST_MULTISAMPLE::Sample15 Y Offset */
   56967 
   56968 
   56969 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample15YOffset_bits  4
   56970 
   56971 static inline uint32_t ATTRIBUTE_PURE
   56972 _3DSTATE_RAST_MULTISAMPLE_Sample15YOffset_bits(const struct gen_device_info *devinfo)
   56973 {
   56974    switch (devinfo->gen) {
   56975    case 10: return 0;
   56976    case 9: return 0;
   56977    case 8: return 0;
   56978    case 7:
   56979       if (devinfo->is_haswell) {
   56980          return 4;
   56981       } else {
   56982          return 0;
   56983       }
   56984    case 6: return 0;
   56985    case 5: return 0;
   56986    case 4:
   56987       if (devinfo->is_g4x) {
   56988          return 0;
   56989       } else {
   56990          return 0;
   56991       }
   56992    default:
   56993       unreachable("Invalid hardware generation");
   56994    }
   56995 }
   56996 
   56997 
   56998 
   56999 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample15YOffset_start  184
   57000 
   57001 static inline uint32_t ATTRIBUTE_PURE
   57002 _3DSTATE_RAST_MULTISAMPLE_Sample15YOffset_start(const struct gen_device_info *devinfo)
   57003 {
   57004    switch (devinfo->gen) {
   57005    case 10: return 0;
   57006    case 9: return 0;
   57007    case 8: return 0;
   57008    case 7:
   57009       if (devinfo->is_haswell) {
   57010          return 184;
   57011       } else {
   57012          return 0;
   57013       }
   57014    case 6: return 0;
   57015    case 5: return 0;
   57016    case 4:
   57017       if (devinfo->is_g4x) {
   57018          return 0;
   57019       } else {
   57020          return 0;
   57021       }
   57022    default:
   57023       unreachable("Invalid hardware generation");
   57024    }
   57025 }
   57026 
   57027 
   57028 
   57029 /* 3DSTATE_RAST_MULTISAMPLE::Sample2 X Offset */
   57030 
   57031 
   57032 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample2XOffset_bits  4
   57033 
   57034 static inline uint32_t ATTRIBUTE_PURE
   57035 _3DSTATE_RAST_MULTISAMPLE_Sample2XOffset_bits(const struct gen_device_info *devinfo)
   57036 {
   57037    switch (devinfo->gen) {
   57038    case 10: return 0;
   57039    case 9: return 0;
   57040    case 8: return 0;
   57041    case 7:
   57042       if (devinfo->is_haswell) {
   57043          return 4;
   57044       } else {
   57045          return 0;
   57046       }
   57047    case 6: return 0;
   57048    case 5: return 0;
   57049    case 4:
   57050       if (devinfo->is_g4x) {
   57051          return 0;
   57052       } else {
   57053          return 0;
   57054       }
   57055    default:
   57056       unreachable("Invalid hardware generation");
   57057    }
   57058 }
   57059 
   57060 
   57061 
   57062 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample2XOffset_start  84
   57063 
   57064 static inline uint32_t ATTRIBUTE_PURE
   57065 _3DSTATE_RAST_MULTISAMPLE_Sample2XOffset_start(const struct gen_device_info *devinfo)
   57066 {
   57067    switch (devinfo->gen) {
   57068    case 10: return 0;
   57069    case 9: return 0;
   57070    case 8: return 0;
   57071    case 7:
   57072       if (devinfo->is_haswell) {
   57073          return 84;
   57074       } else {
   57075          return 0;
   57076       }
   57077    case 6: return 0;
   57078    case 5: return 0;
   57079    case 4:
   57080       if (devinfo->is_g4x) {
   57081          return 0;
   57082       } else {
   57083          return 0;
   57084       }
   57085    default:
   57086       unreachable("Invalid hardware generation");
   57087    }
   57088 }
   57089 
   57090 
   57091 
   57092 /* 3DSTATE_RAST_MULTISAMPLE::Sample2 Y Offset */
   57093 
   57094 
   57095 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample2YOffset_bits  4
   57096 
   57097 static inline uint32_t ATTRIBUTE_PURE
   57098 _3DSTATE_RAST_MULTISAMPLE_Sample2YOffset_bits(const struct gen_device_info *devinfo)
   57099 {
   57100    switch (devinfo->gen) {
   57101    case 10: return 0;
   57102    case 9: return 0;
   57103    case 8: return 0;
   57104    case 7:
   57105       if (devinfo->is_haswell) {
   57106          return 4;
   57107       } else {
   57108          return 0;
   57109       }
   57110    case 6: return 0;
   57111    case 5: return 0;
   57112    case 4:
   57113       if (devinfo->is_g4x) {
   57114          return 0;
   57115       } else {
   57116          return 0;
   57117       }
   57118    default:
   57119       unreachable("Invalid hardware generation");
   57120    }
   57121 }
   57122 
   57123 
   57124 
   57125 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample2YOffset_start  80
   57126 
   57127 static inline uint32_t ATTRIBUTE_PURE
   57128 _3DSTATE_RAST_MULTISAMPLE_Sample2YOffset_start(const struct gen_device_info *devinfo)
   57129 {
   57130    switch (devinfo->gen) {
   57131    case 10: return 0;
   57132    case 9: return 0;
   57133    case 8: return 0;
   57134    case 7:
   57135       if (devinfo->is_haswell) {
   57136          return 80;
   57137       } else {
   57138          return 0;
   57139       }
   57140    case 6: return 0;
   57141    case 5: return 0;
   57142    case 4:
   57143       if (devinfo->is_g4x) {
   57144          return 0;
   57145       } else {
   57146          return 0;
   57147       }
   57148    default:
   57149       unreachable("Invalid hardware generation");
   57150    }
   57151 }
   57152 
   57153 
   57154 
   57155 /* 3DSTATE_RAST_MULTISAMPLE::Sample3 X Offset */
   57156 
   57157 
   57158 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample3XOffset_bits  4
   57159 
   57160 static inline uint32_t ATTRIBUTE_PURE
   57161 _3DSTATE_RAST_MULTISAMPLE_Sample3XOffset_bits(const struct gen_device_info *devinfo)
   57162 {
   57163    switch (devinfo->gen) {
   57164    case 10: return 0;
   57165    case 9: return 0;
   57166    case 8: return 0;
   57167    case 7:
   57168       if (devinfo->is_haswell) {
   57169          return 4;
   57170       } else {
   57171          return 0;
   57172       }
   57173    case 6: return 0;
   57174    case 5: return 0;
   57175    case 4:
   57176       if (devinfo->is_g4x) {
   57177          return 0;
   57178       } else {
   57179          return 0;
   57180       }
   57181    default:
   57182       unreachable("Invalid hardware generation");
   57183    }
   57184 }
   57185 
   57186 
   57187 
   57188 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample3XOffset_start  92
   57189 
   57190 static inline uint32_t ATTRIBUTE_PURE
   57191 _3DSTATE_RAST_MULTISAMPLE_Sample3XOffset_start(const struct gen_device_info *devinfo)
   57192 {
   57193    switch (devinfo->gen) {
   57194    case 10: return 0;
   57195    case 9: return 0;
   57196    case 8: return 0;
   57197    case 7:
   57198       if (devinfo->is_haswell) {
   57199          return 92;
   57200       } else {
   57201          return 0;
   57202       }
   57203    case 6: return 0;
   57204    case 5: return 0;
   57205    case 4:
   57206       if (devinfo->is_g4x) {
   57207          return 0;
   57208       } else {
   57209          return 0;
   57210       }
   57211    default:
   57212       unreachable("Invalid hardware generation");
   57213    }
   57214 }
   57215 
   57216 
   57217 
   57218 /* 3DSTATE_RAST_MULTISAMPLE::Sample3 Y Offset */
   57219 
   57220 
   57221 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample3YOffset_bits  4
   57222 
   57223 static inline uint32_t ATTRIBUTE_PURE
   57224 _3DSTATE_RAST_MULTISAMPLE_Sample3YOffset_bits(const struct gen_device_info *devinfo)
   57225 {
   57226    switch (devinfo->gen) {
   57227    case 10: return 0;
   57228    case 9: return 0;
   57229    case 8: return 0;
   57230    case 7:
   57231       if (devinfo->is_haswell) {
   57232          return 4;
   57233       } else {
   57234          return 0;
   57235       }
   57236    case 6: return 0;
   57237    case 5: return 0;
   57238    case 4:
   57239       if (devinfo->is_g4x) {
   57240          return 0;
   57241       } else {
   57242          return 0;
   57243       }
   57244    default:
   57245       unreachable("Invalid hardware generation");
   57246    }
   57247 }
   57248 
   57249 
   57250 
   57251 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample3YOffset_start  88
   57252 
   57253 static inline uint32_t ATTRIBUTE_PURE
   57254 _3DSTATE_RAST_MULTISAMPLE_Sample3YOffset_start(const struct gen_device_info *devinfo)
   57255 {
   57256    switch (devinfo->gen) {
   57257    case 10: return 0;
   57258    case 9: return 0;
   57259    case 8: return 0;
   57260    case 7:
   57261       if (devinfo->is_haswell) {
   57262          return 88;
   57263       } else {
   57264          return 0;
   57265       }
   57266    case 6: return 0;
   57267    case 5: return 0;
   57268    case 4:
   57269       if (devinfo->is_g4x) {
   57270          return 0;
   57271       } else {
   57272          return 0;
   57273       }
   57274    default:
   57275       unreachable("Invalid hardware generation");
   57276    }
   57277 }
   57278 
   57279 
   57280 
   57281 /* 3DSTATE_RAST_MULTISAMPLE::Sample4 X Offset */
   57282 
   57283 
   57284 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample4XOffset_bits  4
   57285 
   57286 static inline uint32_t ATTRIBUTE_PURE
   57287 _3DSTATE_RAST_MULTISAMPLE_Sample4XOffset_bits(const struct gen_device_info *devinfo)
   57288 {
   57289    switch (devinfo->gen) {
   57290    case 10: return 0;
   57291    case 9: return 0;
   57292    case 8: return 0;
   57293    case 7:
   57294       if (devinfo->is_haswell) {
   57295          return 4;
   57296       } else {
   57297          return 0;
   57298       }
   57299    case 6: return 0;
   57300    case 5: return 0;
   57301    case 4:
   57302       if (devinfo->is_g4x) {
   57303          return 0;
   57304       } else {
   57305          return 0;
   57306       }
   57307    default:
   57308       unreachable("Invalid hardware generation");
   57309    }
   57310 }
   57311 
   57312 
   57313 
   57314 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample4XOffset_start  100
   57315 
   57316 static inline uint32_t ATTRIBUTE_PURE
   57317 _3DSTATE_RAST_MULTISAMPLE_Sample4XOffset_start(const struct gen_device_info *devinfo)
   57318 {
   57319    switch (devinfo->gen) {
   57320    case 10: return 0;
   57321    case 9: return 0;
   57322    case 8: return 0;
   57323    case 7:
   57324       if (devinfo->is_haswell) {
   57325          return 100;
   57326       } else {
   57327          return 0;
   57328       }
   57329    case 6: return 0;
   57330    case 5: return 0;
   57331    case 4:
   57332       if (devinfo->is_g4x) {
   57333          return 0;
   57334       } else {
   57335          return 0;
   57336       }
   57337    default:
   57338       unreachable("Invalid hardware generation");
   57339    }
   57340 }
   57341 
   57342 
   57343 
   57344 /* 3DSTATE_RAST_MULTISAMPLE::Sample4 Y Offset */
   57345 
   57346 
   57347 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample4YOffset_bits  4
   57348 
   57349 static inline uint32_t ATTRIBUTE_PURE
   57350 _3DSTATE_RAST_MULTISAMPLE_Sample4YOffset_bits(const struct gen_device_info *devinfo)
   57351 {
   57352    switch (devinfo->gen) {
   57353    case 10: return 0;
   57354    case 9: return 0;
   57355    case 8: return 0;
   57356    case 7:
   57357       if (devinfo->is_haswell) {
   57358          return 4;
   57359       } else {
   57360          return 0;
   57361       }
   57362    case 6: return 0;
   57363    case 5: return 0;
   57364    case 4:
   57365       if (devinfo->is_g4x) {
   57366          return 0;
   57367       } else {
   57368          return 0;
   57369       }
   57370    default:
   57371       unreachable("Invalid hardware generation");
   57372    }
   57373 }
   57374 
   57375 
   57376 
   57377 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample4YOffset_start  96
   57378 
   57379 static inline uint32_t ATTRIBUTE_PURE
   57380 _3DSTATE_RAST_MULTISAMPLE_Sample4YOffset_start(const struct gen_device_info *devinfo)
   57381 {
   57382    switch (devinfo->gen) {
   57383    case 10: return 0;
   57384    case 9: return 0;
   57385    case 8: return 0;
   57386    case 7:
   57387       if (devinfo->is_haswell) {
   57388          return 96;
   57389       } else {
   57390          return 0;
   57391       }
   57392    case 6: return 0;
   57393    case 5: return 0;
   57394    case 4:
   57395       if (devinfo->is_g4x) {
   57396          return 0;
   57397       } else {
   57398          return 0;
   57399       }
   57400    default:
   57401       unreachable("Invalid hardware generation");
   57402    }
   57403 }
   57404 
   57405 
   57406 
   57407 /* 3DSTATE_RAST_MULTISAMPLE::Sample5 X Offset */
   57408 
   57409 
   57410 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample5XOffset_bits  4
   57411 
   57412 static inline uint32_t ATTRIBUTE_PURE
   57413 _3DSTATE_RAST_MULTISAMPLE_Sample5XOffset_bits(const struct gen_device_info *devinfo)
   57414 {
   57415    switch (devinfo->gen) {
   57416    case 10: return 0;
   57417    case 9: return 0;
   57418    case 8: return 0;
   57419    case 7:
   57420       if (devinfo->is_haswell) {
   57421          return 4;
   57422       } else {
   57423          return 0;
   57424       }
   57425    case 6: return 0;
   57426    case 5: return 0;
   57427    case 4:
   57428       if (devinfo->is_g4x) {
   57429          return 0;
   57430       } else {
   57431          return 0;
   57432       }
   57433    default:
   57434       unreachable("Invalid hardware generation");
   57435    }
   57436 }
   57437 
   57438 
   57439 
   57440 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample5XOffset_start  108
   57441 
   57442 static inline uint32_t ATTRIBUTE_PURE
   57443 _3DSTATE_RAST_MULTISAMPLE_Sample5XOffset_start(const struct gen_device_info *devinfo)
   57444 {
   57445    switch (devinfo->gen) {
   57446    case 10: return 0;
   57447    case 9: return 0;
   57448    case 8: return 0;
   57449    case 7:
   57450       if (devinfo->is_haswell) {
   57451          return 108;
   57452       } else {
   57453          return 0;
   57454       }
   57455    case 6: return 0;
   57456    case 5: return 0;
   57457    case 4:
   57458       if (devinfo->is_g4x) {
   57459          return 0;
   57460       } else {
   57461          return 0;
   57462       }
   57463    default:
   57464       unreachable("Invalid hardware generation");
   57465    }
   57466 }
   57467 
   57468 
   57469 
   57470 /* 3DSTATE_RAST_MULTISAMPLE::Sample5 Y Offset */
   57471 
   57472 
   57473 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample5YOffset_bits  4
   57474 
   57475 static inline uint32_t ATTRIBUTE_PURE
   57476 _3DSTATE_RAST_MULTISAMPLE_Sample5YOffset_bits(const struct gen_device_info *devinfo)
   57477 {
   57478    switch (devinfo->gen) {
   57479    case 10: return 0;
   57480    case 9: return 0;
   57481    case 8: return 0;
   57482    case 7:
   57483       if (devinfo->is_haswell) {
   57484          return 4;
   57485       } else {
   57486          return 0;
   57487       }
   57488    case 6: return 0;
   57489    case 5: return 0;
   57490    case 4:
   57491       if (devinfo->is_g4x) {
   57492          return 0;
   57493       } else {
   57494          return 0;
   57495       }
   57496    default:
   57497       unreachable("Invalid hardware generation");
   57498    }
   57499 }
   57500 
   57501 
   57502 
   57503 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample5YOffset_start  104
   57504 
   57505 static inline uint32_t ATTRIBUTE_PURE
   57506 _3DSTATE_RAST_MULTISAMPLE_Sample5YOffset_start(const struct gen_device_info *devinfo)
   57507 {
   57508    switch (devinfo->gen) {
   57509    case 10: return 0;
   57510    case 9: return 0;
   57511    case 8: return 0;
   57512    case 7:
   57513       if (devinfo->is_haswell) {
   57514          return 104;
   57515       } else {
   57516          return 0;
   57517       }
   57518    case 6: return 0;
   57519    case 5: return 0;
   57520    case 4:
   57521       if (devinfo->is_g4x) {
   57522          return 0;
   57523       } else {
   57524          return 0;
   57525       }
   57526    default:
   57527       unreachable("Invalid hardware generation");
   57528    }
   57529 }
   57530 
   57531 
   57532 
   57533 /* 3DSTATE_RAST_MULTISAMPLE::Sample6 X Offset */
   57534 
   57535 
   57536 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample6XOffset_bits  4
   57537 
   57538 static inline uint32_t ATTRIBUTE_PURE
   57539 _3DSTATE_RAST_MULTISAMPLE_Sample6XOffset_bits(const struct gen_device_info *devinfo)
   57540 {
   57541    switch (devinfo->gen) {
   57542    case 10: return 0;
   57543    case 9: return 0;
   57544    case 8: return 0;
   57545    case 7:
   57546       if (devinfo->is_haswell) {
   57547          return 4;
   57548       } else {
   57549          return 0;
   57550       }
   57551    case 6: return 0;
   57552    case 5: return 0;
   57553    case 4:
   57554       if (devinfo->is_g4x) {
   57555          return 0;
   57556       } else {
   57557          return 0;
   57558       }
   57559    default:
   57560       unreachable("Invalid hardware generation");
   57561    }
   57562 }
   57563 
   57564 
   57565 
   57566 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample6XOffset_start  116
   57567 
   57568 static inline uint32_t ATTRIBUTE_PURE
   57569 _3DSTATE_RAST_MULTISAMPLE_Sample6XOffset_start(const struct gen_device_info *devinfo)
   57570 {
   57571    switch (devinfo->gen) {
   57572    case 10: return 0;
   57573    case 9: return 0;
   57574    case 8: return 0;
   57575    case 7:
   57576       if (devinfo->is_haswell) {
   57577          return 116;
   57578       } else {
   57579          return 0;
   57580       }
   57581    case 6: return 0;
   57582    case 5: return 0;
   57583    case 4:
   57584       if (devinfo->is_g4x) {
   57585          return 0;
   57586       } else {
   57587          return 0;
   57588       }
   57589    default:
   57590       unreachable("Invalid hardware generation");
   57591    }
   57592 }
   57593 
   57594 
   57595 
   57596 /* 3DSTATE_RAST_MULTISAMPLE::Sample6 Y Offset */
   57597 
   57598 
   57599 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample6YOffset_bits  4
   57600 
   57601 static inline uint32_t ATTRIBUTE_PURE
   57602 _3DSTATE_RAST_MULTISAMPLE_Sample6YOffset_bits(const struct gen_device_info *devinfo)
   57603 {
   57604    switch (devinfo->gen) {
   57605    case 10: return 0;
   57606    case 9: return 0;
   57607    case 8: return 0;
   57608    case 7:
   57609       if (devinfo->is_haswell) {
   57610          return 4;
   57611       } else {
   57612          return 0;
   57613       }
   57614    case 6: return 0;
   57615    case 5: return 0;
   57616    case 4:
   57617       if (devinfo->is_g4x) {
   57618          return 0;
   57619       } else {
   57620          return 0;
   57621       }
   57622    default:
   57623       unreachable("Invalid hardware generation");
   57624    }
   57625 }
   57626 
   57627 
   57628 
   57629 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample6YOffset_start  112
   57630 
   57631 static inline uint32_t ATTRIBUTE_PURE
   57632 _3DSTATE_RAST_MULTISAMPLE_Sample6YOffset_start(const struct gen_device_info *devinfo)
   57633 {
   57634    switch (devinfo->gen) {
   57635    case 10: return 0;
   57636    case 9: return 0;
   57637    case 8: return 0;
   57638    case 7:
   57639       if (devinfo->is_haswell) {
   57640          return 112;
   57641       } else {
   57642          return 0;
   57643       }
   57644    case 6: return 0;
   57645    case 5: return 0;
   57646    case 4:
   57647       if (devinfo->is_g4x) {
   57648          return 0;
   57649       } else {
   57650          return 0;
   57651       }
   57652    default:
   57653       unreachable("Invalid hardware generation");
   57654    }
   57655 }
   57656 
   57657 
   57658 
   57659 /* 3DSTATE_RAST_MULTISAMPLE::Sample7 X Offset */
   57660 
   57661 
   57662 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample7XOffset_bits  4
   57663 
   57664 static inline uint32_t ATTRIBUTE_PURE
   57665 _3DSTATE_RAST_MULTISAMPLE_Sample7XOffset_bits(const struct gen_device_info *devinfo)
   57666 {
   57667    switch (devinfo->gen) {
   57668    case 10: return 0;
   57669    case 9: return 0;
   57670    case 8: return 0;
   57671    case 7:
   57672       if (devinfo->is_haswell) {
   57673          return 4;
   57674       } else {
   57675          return 0;
   57676       }
   57677    case 6: return 0;
   57678    case 5: return 0;
   57679    case 4:
   57680       if (devinfo->is_g4x) {
   57681          return 0;
   57682       } else {
   57683          return 0;
   57684       }
   57685    default:
   57686       unreachable("Invalid hardware generation");
   57687    }
   57688 }
   57689 
   57690 
   57691 
   57692 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample7XOffset_start  124
   57693 
   57694 static inline uint32_t ATTRIBUTE_PURE
   57695 _3DSTATE_RAST_MULTISAMPLE_Sample7XOffset_start(const struct gen_device_info *devinfo)
   57696 {
   57697    switch (devinfo->gen) {
   57698    case 10: return 0;
   57699    case 9: return 0;
   57700    case 8: return 0;
   57701    case 7:
   57702       if (devinfo->is_haswell) {
   57703          return 124;
   57704       } else {
   57705          return 0;
   57706       }
   57707    case 6: return 0;
   57708    case 5: return 0;
   57709    case 4:
   57710       if (devinfo->is_g4x) {
   57711          return 0;
   57712       } else {
   57713          return 0;
   57714       }
   57715    default:
   57716       unreachable("Invalid hardware generation");
   57717    }
   57718 }
   57719 
   57720 
   57721 
   57722 /* 3DSTATE_RAST_MULTISAMPLE::Sample7 Y Offset */
   57723 
   57724 
   57725 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample7YOffset_bits  4
   57726 
   57727 static inline uint32_t ATTRIBUTE_PURE
   57728 _3DSTATE_RAST_MULTISAMPLE_Sample7YOffset_bits(const struct gen_device_info *devinfo)
   57729 {
   57730    switch (devinfo->gen) {
   57731    case 10: return 0;
   57732    case 9: return 0;
   57733    case 8: return 0;
   57734    case 7:
   57735       if (devinfo->is_haswell) {
   57736          return 4;
   57737       } else {
   57738          return 0;
   57739       }
   57740    case 6: return 0;
   57741    case 5: return 0;
   57742    case 4:
   57743       if (devinfo->is_g4x) {
   57744          return 0;
   57745       } else {
   57746          return 0;
   57747       }
   57748    default:
   57749       unreachable("Invalid hardware generation");
   57750    }
   57751 }
   57752 
   57753 
   57754 
   57755 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample7YOffset_start  120
   57756 
   57757 static inline uint32_t ATTRIBUTE_PURE
   57758 _3DSTATE_RAST_MULTISAMPLE_Sample7YOffset_start(const struct gen_device_info *devinfo)
   57759 {
   57760    switch (devinfo->gen) {
   57761    case 10: return 0;
   57762    case 9: return 0;
   57763    case 8: return 0;
   57764    case 7:
   57765       if (devinfo->is_haswell) {
   57766          return 120;
   57767       } else {
   57768          return 0;
   57769       }
   57770    case 6: return 0;
   57771    case 5: return 0;
   57772    case 4:
   57773       if (devinfo->is_g4x) {
   57774          return 0;
   57775       } else {
   57776          return 0;
   57777       }
   57778    default:
   57779       unreachable("Invalid hardware generation");
   57780    }
   57781 }
   57782 
   57783 
   57784 
   57785 /* 3DSTATE_RAST_MULTISAMPLE::Sample8 X Offset */
   57786 
   57787 
   57788 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample8XOffset_bits  4
   57789 
   57790 static inline uint32_t ATTRIBUTE_PURE
   57791 _3DSTATE_RAST_MULTISAMPLE_Sample8XOffset_bits(const struct gen_device_info *devinfo)
   57792 {
   57793    switch (devinfo->gen) {
   57794    case 10: return 0;
   57795    case 9: return 0;
   57796    case 8: return 0;
   57797    case 7:
   57798       if (devinfo->is_haswell) {
   57799          return 4;
   57800       } else {
   57801          return 0;
   57802       }
   57803    case 6: return 0;
   57804    case 5: return 0;
   57805    case 4:
   57806       if (devinfo->is_g4x) {
   57807          return 0;
   57808       } else {
   57809          return 0;
   57810       }
   57811    default:
   57812       unreachable("Invalid hardware generation");
   57813    }
   57814 }
   57815 
   57816 
   57817 
   57818 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample8XOffset_start  132
   57819 
   57820 static inline uint32_t ATTRIBUTE_PURE
   57821 _3DSTATE_RAST_MULTISAMPLE_Sample8XOffset_start(const struct gen_device_info *devinfo)
   57822 {
   57823    switch (devinfo->gen) {
   57824    case 10: return 0;
   57825    case 9: return 0;
   57826    case 8: return 0;
   57827    case 7:
   57828       if (devinfo->is_haswell) {
   57829          return 132;
   57830       } else {
   57831          return 0;
   57832       }
   57833    case 6: return 0;
   57834    case 5: return 0;
   57835    case 4:
   57836       if (devinfo->is_g4x) {
   57837          return 0;
   57838       } else {
   57839          return 0;
   57840       }
   57841    default:
   57842       unreachable("Invalid hardware generation");
   57843    }
   57844 }
   57845 
   57846 
   57847 
   57848 /* 3DSTATE_RAST_MULTISAMPLE::Sample8 Y Offset */
   57849 
   57850 
   57851 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample8YOffset_bits  4
   57852 
   57853 static inline uint32_t ATTRIBUTE_PURE
   57854 _3DSTATE_RAST_MULTISAMPLE_Sample8YOffset_bits(const struct gen_device_info *devinfo)
   57855 {
   57856    switch (devinfo->gen) {
   57857    case 10: return 0;
   57858    case 9: return 0;
   57859    case 8: return 0;
   57860    case 7:
   57861       if (devinfo->is_haswell) {
   57862          return 4;
   57863       } else {
   57864          return 0;
   57865       }
   57866    case 6: return 0;
   57867    case 5: return 0;
   57868    case 4:
   57869       if (devinfo->is_g4x) {
   57870          return 0;
   57871       } else {
   57872          return 0;
   57873       }
   57874    default:
   57875       unreachable("Invalid hardware generation");
   57876    }
   57877 }
   57878 
   57879 
   57880 
   57881 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample8YOffset_start  128
   57882 
   57883 static inline uint32_t ATTRIBUTE_PURE
   57884 _3DSTATE_RAST_MULTISAMPLE_Sample8YOffset_start(const struct gen_device_info *devinfo)
   57885 {
   57886    switch (devinfo->gen) {
   57887    case 10: return 0;
   57888    case 9: return 0;
   57889    case 8: return 0;
   57890    case 7:
   57891       if (devinfo->is_haswell) {
   57892          return 128;
   57893       } else {
   57894          return 0;
   57895       }
   57896    case 6: return 0;
   57897    case 5: return 0;
   57898    case 4:
   57899       if (devinfo->is_g4x) {
   57900          return 0;
   57901       } else {
   57902          return 0;
   57903       }
   57904    default:
   57905       unreachable("Invalid hardware generation");
   57906    }
   57907 }
   57908 
   57909 
   57910 
   57911 /* 3DSTATE_RAST_MULTISAMPLE::Sample9 X Offset */
   57912 
   57913 
   57914 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample9XOffset_bits  4
   57915 
   57916 static inline uint32_t ATTRIBUTE_PURE
   57917 _3DSTATE_RAST_MULTISAMPLE_Sample9XOffset_bits(const struct gen_device_info *devinfo)
   57918 {
   57919    switch (devinfo->gen) {
   57920    case 10: return 0;
   57921    case 9: return 0;
   57922    case 8: return 0;
   57923    case 7:
   57924       if (devinfo->is_haswell) {
   57925          return 4;
   57926       } else {
   57927          return 0;
   57928       }
   57929    case 6: return 0;
   57930    case 5: return 0;
   57931    case 4:
   57932       if (devinfo->is_g4x) {
   57933          return 0;
   57934       } else {
   57935          return 0;
   57936       }
   57937    default:
   57938       unreachable("Invalid hardware generation");
   57939    }
   57940 }
   57941 
   57942 
   57943 
   57944 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample9XOffset_start  140
   57945 
   57946 static inline uint32_t ATTRIBUTE_PURE
   57947 _3DSTATE_RAST_MULTISAMPLE_Sample9XOffset_start(const struct gen_device_info *devinfo)
   57948 {
   57949    switch (devinfo->gen) {
   57950    case 10: return 0;
   57951    case 9: return 0;
   57952    case 8: return 0;
   57953    case 7:
   57954       if (devinfo->is_haswell) {
   57955          return 140;
   57956       } else {
   57957          return 0;
   57958       }
   57959    case 6: return 0;
   57960    case 5: return 0;
   57961    case 4:
   57962       if (devinfo->is_g4x) {
   57963          return 0;
   57964       } else {
   57965          return 0;
   57966       }
   57967    default:
   57968       unreachable("Invalid hardware generation");
   57969    }
   57970 }
   57971 
   57972 
   57973 
   57974 /* 3DSTATE_RAST_MULTISAMPLE::Sample9 Y Offset */
   57975 
   57976 
   57977 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample9YOffset_bits  4
   57978 
   57979 static inline uint32_t ATTRIBUTE_PURE
   57980 _3DSTATE_RAST_MULTISAMPLE_Sample9YOffset_bits(const struct gen_device_info *devinfo)
   57981 {
   57982    switch (devinfo->gen) {
   57983    case 10: return 0;
   57984    case 9: return 0;
   57985    case 8: return 0;
   57986    case 7:
   57987       if (devinfo->is_haswell) {
   57988          return 4;
   57989       } else {
   57990          return 0;
   57991       }
   57992    case 6: return 0;
   57993    case 5: return 0;
   57994    case 4:
   57995       if (devinfo->is_g4x) {
   57996          return 0;
   57997       } else {
   57998          return 0;
   57999       }
   58000    default:
   58001       unreachable("Invalid hardware generation");
   58002    }
   58003 }
   58004 
   58005 
   58006 
   58007 #define GEN75_3DSTATE_RAST_MULTISAMPLE_Sample9YOffset_start  136
   58008 
   58009 static inline uint32_t ATTRIBUTE_PURE
   58010 _3DSTATE_RAST_MULTISAMPLE_Sample9YOffset_start(const struct gen_device_info *devinfo)
   58011 {
   58012    switch (devinfo->gen) {
   58013    case 10: return 0;
   58014    case 9: return 0;
   58015    case 8: return 0;
   58016    case 7:
   58017       if (devinfo->is_haswell) {
   58018          return 136;
   58019       } else {
   58020          return 0;
   58021       }
   58022    case 6: return 0;
   58023    case 5: return 0;
   58024    case 4:
   58025       if (devinfo->is_g4x) {
   58026          return 0;
   58027       } else {
   58028          return 0;
   58029       }
   58030    default:
   58031       unreachable("Invalid hardware generation");
   58032    }
   58033 }
   58034 
   58035 
   58036 
   58037 /* 3DSTATE_RS_CONSTANT_POINTER */
   58038 
   58039 
   58040 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_length  4
   58041 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_length  4
   58042 
   58043 static inline uint32_t ATTRIBUTE_PURE
   58044 _3DSTATE_RS_CONSTANT_POINTER_length(const struct gen_device_info *devinfo)
   58045 {
   58046    switch (devinfo->gen) {
   58047    case 10: return 4;
   58048    case 9: return 4;
   58049    case 8: return 0;
   58050    case 7:
   58051       if (devinfo->is_haswell) {
   58052          return 0;
   58053       } else {
   58054          return 0;
   58055       }
   58056    case 6: return 0;
   58057    case 5: return 0;
   58058    case 4:
   58059       if (devinfo->is_g4x) {
   58060          return 0;
   58061       } else {
   58062          return 0;
   58063       }
   58064    default:
   58065       unreachable("Invalid hardware generation");
   58066    }
   58067 }
   58068 
   58069 
   58070 
   58071 /* 3DSTATE_RS_CONSTANT_POINTER::3D Command Opcode */
   58072 
   58073 
   58074 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_3DCommandOpcode_bits  3
   58075 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_3DCommandOpcode_bits  3
   58076 
   58077 static inline uint32_t ATTRIBUTE_PURE
   58078 _3DSTATE_RS_CONSTANT_POINTER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   58079 {
   58080    switch (devinfo->gen) {
   58081    case 10: return 3;
   58082    case 9: return 3;
   58083    case 8: return 0;
   58084    case 7:
   58085       if (devinfo->is_haswell) {
   58086          return 0;
   58087       } else {
   58088          return 0;
   58089       }
   58090    case 6: return 0;
   58091    case 5: return 0;
   58092    case 4:
   58093       if (devinfo->is_g4x) {
   58094          return 0;
   58095       } else {
   58096          return 0;
   58097       }
   58098    default:
   58099       unreachable("Invalid hardware generation");
   58100    }
   58101 }
   58102 
   58103 
   58104 
   58105 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_3DCommandOpcode_start  24
   58106 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_3DCommandOpcode_start  24
   58107 
   58108 static inline uint32_t ATTRIBUTE_PURE
   58109 _3DSTATE_RS_CONSTANT_POINTER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   58110 {
   58111    switch (devinfo->gen) {
   58112    case 10: return 24;
   58113    case 9: return 24;
   58114    case 8: return 0;
   58115    case 7:
   58116       if (devinfo->is_haswell) {
   58117          return 0;
   58118       } else {
   58119          return 0;
   58120       }
   58121    case 6: return 0;
   58122    case 5: return 0;
   58123    case 4:
   58124       if (devinfo->is_g4x) {
   58125          return 0;
   58126       } else {
   58127          return 0;
   58128       }
   58129    default:
   58130       unreachable("Invalid hardware generation");
   58131    }
   58132 }
   58133 
   58134 
   58135 
   58136 /* 3DSTATE_RS_CONSTANT_POINTER::3D Command Sub Opcode */
   58137 
   58138 
   58139 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_3DCommandSubOpcode_bits  8
   58140 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_3DCommandSubOpcode_bits  8
   58141 
   58142 static inline uint32_t ATTRIBUTE_PURE
   58143 _3DSTATE_RS_CONSTANT_POINTER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   58144 {
   58145    switch (devinfo->gen) {
   58146    case 10: return 8;
   58147    case 9: return 8;
   58148    case 8: return 0;
   58149    case 7:
   58150       if (devinfo->is_haswell) {
   58151          return 0;
   58152       } else {
   58153          return 0;
   58154       }
   58155    case 6: return 0;
   58156    case 5: return 0;
   58157    case 4:
   58158       if (devinfo->is_g4x) {
   58159          return 0;
   58160       } else {
   58161          return 0;
   58162       }
   58163    default:
   58164       unreachable("Invalid hardware generation");
   58165    }
   58166 }
   58167 
   58168 
   58169 
   58170 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_3DCommandSubOpcode_start  16
   58171 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_3DCommandSubOpcode_start  16
   58172 
   58173 static inline uint32_t ATTRIBUTE_PURE
   58174 _3DSTATE_RS_CONSTANT_POINTER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   58175 {
   58176    switch (devinfo->gen) {
   58177    case 10: return 16;
   58178    case 9: return 16;
   58179    case 8: return 0;
   58180    case 7:
   58181       if (devinfo->is_haswell) {
   58182          return 0;
   58183       } else {
   58184          return 0;
   58185       }
   58186    case 6: return 0;
   58187    case 5: return 0;
   58188    case 4:
   58189       if (devinfo->is_g4x) {
   58190          return 0;
   58191       } else {
   58192          return 0;
   58193       }
   58194    default:
   58195       unreachable("Invalid hardware generation");
   58196    }
   58197 }
   58198 
   58199 
   58200 
   58201 /* 3DSTATE_RS_CONSTANT_POINTER::Command SubType */
   58202 
   58203 
   58204 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_CommandSubType_bits  2
   58205 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_CommandSubType_bits  2
   58206 
   58207 static inline uint32_t ATTRIBUTE_PURE
   58208 _3DSTATE_RS_CONSTANT_POINTER_CommandSubType_bits(const struct gen_device_info *devinfo)
   58209 {
   58210    switch (devinfo->gen) {
   58211    case 10: return 2;
   58212    case 9: return 2;
   58213    case 8: return 0;
   58214    case 7:
   58215       if (devinfo->is_haswell) {
   58216          return 0;
   58217       } else {
   58218          return 0;
   58219       }
   58220    case 6: return 0;
   58221    case 5: return 0;
   58222    case 4:
   58223       if (devinfo->is_g4x) {
   58224          return 0;
   58225       } else {
   58226          return 0;
   58227       }
   58228    default:
   58229       unreachable("Invalid hardware generation");
   58230    }
   58231 }
   58232 
   58233 
   58234 
   58235 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_CommandSubType_start  27
   58236 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_CommandSubType_start  27
   58237 
   58238 static inline uint32_t ATTRIBUTE_PURE
   58239 _3DSTATE_RS_CONSTANT_POINTER_CommandSubType_start(const struct gen_device_info *devinfo)
   58240 {
   58241    switch (devinfo->gen) {
   58242    case 10: return 27;
   58243    case 9: return 27;
   58244    case 8: return 0;
   58245    case 7:
   58246       if (devinfo->is_haswell) {
   58247          return 0;
   58248       } else {
   58249          return 0;
   58250       }
   58251    case 6: return 0;
   58252    case 5: return 0;
   58253    case 4:
   58254       if (devinfo->is_g4x) {
   58255          return 0;
   58256       } else {
   58257          return 0;
   58258       }
   58259    default:
   58260       unreachable("Invalid hardware generation");
   58261    }
   58262 }
   58263 
   58264 
   58265 
   58266 /* 3DSTATE_RS_CONSTANT_POINTER::Command Type */
   58267 
   58268 
   58269 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_CommandType_bits  3
   58270 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_CommandType_bits  3
   58271 
   58272 static inline uint32_t ATTRIBUTE_PURE
   58273 _3DSTATE_RS_CONSTANT_POINTER_CommandType_bits(const struct gen_device_info *devinfo)
   58274 {
   58275    switch (devinfo->gen) {
   58276    case 10: return 3;
   58277    case 9: return 3;
   58278    case 8: return 0;
   58279    case 7:
   58280       if (devinfo->is_haswell) {
   58281          return 0;
   58282       } else {
   58283          return 0;
   58284       }
   58285    case 6: return 0;
   58286    case 5: return 0;
   58287    case 4:
   58288       if (devinfo->is_g4x) {
   58289          return 0;
   58290       } else {
   58291          return 0;
   58292       }
   58293    default:
   58294       unreachable("Invalid hardware generation");
   58295    }
   58296 }
   58297 
   58298 
   58299 
   58300 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_CommandType_start  29
   58301 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_CommandType_start  29
   58302 
   58303 static inline uint32_t ATTRIBUTE_PURE
   58304 _3DSTATE_RS_CONSTANT_POINTER_CommandType_start(const struct gen_device_info *devinfo)
   58305 {
   58306    switch (devinfo->gen) {
   58307    case 10: return 29;
   58308    case 9: return 29;
   58309    case 8: return 0;
   58310    case 7:
   58311       if (devinfo->is_haswell) {
   58312          return 0;
   58313       } else {
   58314          return 0;
   58315       }
   58316    case 6: return 0;
   58317    case 5: return 0;
   58318    case 4:
   58319       if (devinfo->is_g4x) {
   58320          return 0;
   58321       } else {
   58322          return 0;
   58323       }
   58324    default:
   58325       unreachable("Invalid hardware generation");
   58326    }
   58327 }
   58328 
   58329 
   58330 
   58331 /* 3DSTATE_RS_CONSTANT_POINTER::DWord Length */
   58332 
   58333 
   58334 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_DWordLength_bits  8
   58335 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_DWordLength_bits  8
   58336 
   58337 static inline uint32_t ATTRIBUTE_PURE
   58338 _3DSTATE_RS_CONSTANT_POINTER_DWordLength_bits(const struct gen_device_info *devinfo)
   58339 {
   58340    switch (devinfo->gen) {
   58341    case 10: return 8;
   58342    case 9: return 8;
   58343    case 8: return 0;
   58344    case 7:
   58345       if (devinfo->is_haswell) {
   58346          return 0;
   58347       } else {
   58348          return 0;
   58349       }
   58350    case 6: return 0;
   58351    case 5: return 0;
   58352    case 4:
   58353       if (devinfo->is_g4x) {
   58354          return 0;
   58355       } else {
   58356          return 0;
   58357       }
   58358    default:
   58359       unreachable("Invalid hardware generation");
   58360    }
   58361 }
   58362 
   58363 
   58364 
   58365 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_DWordLength_start  0
   58366 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_DWordLength_start  0
   58367 
   58368 static inline uint32_t ATTRIBUTE_PURE
   58369 _3DSTATE_RS_CONSTANT_POINTER_DWordLength_start(const struct gen_device_info *devinfo)
   58370 {
   58371    switch (devinfo->gen) {
   58372    case 10: return 0;
   58373    case 9: return 0;
   58374    case 8: return 0;
   58375    case 7:
   58376       if (devinfo->is_haswell) {
   58377          return 0;
   58378       } else {
   58379          return 0;
   58380       }
   58381    case 6: return 0;
   58382    case 5: return 0;
   58383    case 4:
   58384       if (devinfo->is_g4x) {
   58385          return 0;
   58386       } else {
   58387          return 0;
   58388       }
   58389    default:
   58390       unreachable("Invalid hardware generation");
   58391    }
   58392 }
   58393 
   58394 
   58395 
   58396 /* 3DSTATE_RS_CONSTANT_POINTER::Global Constant Buffer Address */
   58397 
   58398 
   58399 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddress_bits  26
   58400 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddress_bits  26
   58401 
   58402 static inline uint32_t ATTRIBUTE_PURE
   58403 _3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddress_bits(const struct gen_device_info *devinfo)
   58404 {
   58405    switch (devinfo->gen) {
   58406    case 10: return 26;
   58407    case 9: return 26;
   58408    case 8: return 0;
   58409    case 7:
   58410       if (devinfo->is_haswell) {
   58411          return 0;
   58412       } else {
   58413          return 0;
   58414       }
   58415    case 6: return 0;
   58416    case 5: return 0;
   58417    case 4:
   58418       if (devinfo->is_g4x) {
   58419          return 0;
   58420       } else {
   58421          return 0;
   58422       }
   58423    default:
   58424       unreachable("Invalid hardware generation");
   58425    }
   58426 }
   58427 
   58428 
   58429 
   58430 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddress_start  70
   58431 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddress_start  70
   58432 
   58433 static inline uint32_t ATTRIBUTE_PURE
   58434 _3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddress_start(const struct gen_device_info *devinfo)
   58435 {
   58436    switch (devinfo->gen) {
   58437    case 10: return 70;
   58438    case 9: return 70;
   58439    case 8: return 0;
   58440    case 7:
   58441       if (devinfo->is_haswell) {
   58442          return 0;
   58443       } else {
   58444          return 0;
   58445       }
   58446    case 6: return 0;
   58447    case 5: return 0;
   58448    case 4:
   58449       if (devinfo->is_g4x) {
   58450          return 0;
   58451       } else {
   58452          return 0;
   58453       }
   58454    default:
   58455       unreachable("Invalid hardware generation");
   58456    }
   58457 }
   58458 
   58459 
   58460 
   58461 /* 3DSTATE_RS_CONSTANT_POINTER::Global Constant Buffer Address High */
   58462 
   58463 
   58464 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddressHigh_bits  32
   58465 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddressHigh_bits  32
   58466 
   58467 static inline uint32_t ATTRIBUTE_PURE
   58468 _3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddressHigh_bits(const struct gen_device_info *devinfo)
   58469 {
   58470    switch (devinfo->gen) {
   58471    case 10: return 32;
   58472    case 9: return 32;
   58473    case 8: return 0;
   58474    case 7:
   58475       if (devinfo->is_haswell) {
   58476          return 0;
   58477       } else {
   58478          return 0;
   58479       }
   58480    case 6: return 0;
   58481    case 5: return 0;
   58482    case 4:
   58483       if (devinfo->is_g4x) {
   58484          return 0;
   58485       } else {
   58486          return 0;
   58487       }
   58488    default:
   58489       unreachable("Invalid hardware generation");
   58490    }
   58491 }
   58492 
   58493 
   58494 
   58495 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddressHigh_start  96
   58496 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddressHigh_start  96
   58497 
   58498 static inline uint32_t ATTRIBUTE_PURE
   58499 _3DSTATE_RS_CONSTANT_POINTER_GlobalConstantBufferAddressHigh_start(const struct gen_device_info *devinfo)
   58500 {
   58501    switch (devinfo->gen) {
   58502    case 10: return 96;
   58503    case 9: return 96;
   58504    case 8: return 0;
   58505    case 7:
   58506       if (devinfo->is_haswell) {
   58507          return 0;
   58508       } else {
   58509          return 0;
   58510       }
   58511    case 6: return 0;
   58512    case 5: return 0;
   58513    case 4:
   58514       if (devinfo->is_g4x) {
   58515          return 0;
   58516       } else {
   58517          return 0;
   58518       }
   58519    default:
   58520       unreachable("Invalid hardware generation");
   58521    }
   58522 }
   58523 
   58524 
   58525 
   58526 /* 3DSTATE_RS_CONSTANT_POINTER::Operation Load or Store */
   58527 
   58528 
   58529 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_OperationLoadorStore_bits  1
   58530 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_OperationLoadorStore_bits  1
   58531 
   58532 static inline uint32_t ATTRIBUTE_PURE
   58533 _3DSTATE_RS_CONSTANT_POINTER_OperationLoadorStore_bits(const struct gen_device_info *devinfo)
   58534 {
   58535    switch (devinfo->gen) {
   58536    case 10: return 1;
   58537    case 9: return 1;
   58538    case 8: return 0;
   58539    case 7:
   58540       if (devinfo->is_haswell) {
   58541          return 0;
   58542       } else {
   58543          return 0;
   58544       }
   58545    case 6: return 0;
   58546    case 5: return 0;
   58547    case 4:
   58548       if (devinfo->is_g4x) {
   58549          return 0;
   58550       } else {
   58551          return 0;
   58552       }
   58553    default:
   58554       unreachable("Invalid hardware generation");
   58555    }
   58556 }
   58557 
   58558 
   58559 
   58560 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_OperationLoadorStore_start  44
   58561 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_OperationLoadorStore_start  44
   58562 
   58563 static inline uint32_t ATTRIBUTE_PURE
   58564 _3DSTATE_RS_CONSTANT_POINTER_OperationLoadorStore_start(const struct gen_device_info *devinfo)
   58565 {
   58566    switch (devinfo->gen) {
   58567    case 10: return 44;
   58568    case 9: return 44;
   58569    case 8: return 0;
   58570    case 7:
   58571       if (devinfo->is_haswell) {
   58572          return 0;
   58573       } else {
   58574          return 0;
   58575       }
   58576    case 6: return 0;
   58577    case 5: return 0;
   58578    case 4:
   58579       if (devinfo->is_g4x) {
   58580          return 0;
   58581       } else {
   58582          return 0;
   58583       }
   58584    default:
   58585       unreachable("Invalid hardware generation");
   58586    }
   58587 }
   58588 
   58589 
   58590 
   58591 /* 3DSTATE_RS_CONSTANT_POINTER::Shader Select */
   58592 
   58593 
   58594 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_ShaderSelect_bits  3
   58595 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_ShaderSelect_bits  3
   58596 
   58597 static inline uint32_t ATTRIBUTE_PURE
   58598 _3DSTATE_RS_CONSTANT_POINTER_ShaderSelect_bits(const struct gen_device_info *devinfo)
   58599 {
   58600    switch (devinfo->gen) {
   58601    case 10: return 3;
   58602    case 9: return 3;
   58603    case 8: return 0;
   58604    case 7:
   58605       if (devinfo->is_haswell) {
   58606          return 0;
   58607       } else {
   58608          return 0;
   58609       }
   58610    case 6: return 0;
   58611    case 5: return 0;
   58612    case 4:
   58613       if (devinfo->is_g4x) {
   58614          return 0;
   58615       } else {
   58616          return 0;
   58617       }
   58618    default:
   58619       unreachable("Invalid hardware generation");
   58620    }
   58621 }
   58622 
   58623 
   58624 
   58625 #define GEN10_3DSTATE_RS_CONSTANT_POINTER_ShaderSelect_start  60
   58626 #define GEN9_3DSTATE_RS_CONSTANT_POINTER_ShaderSelect_start  60
   58627 
   58628 static inline uint32_t ATTRIBUTE_PURE
   58629 _3DSTATE_RS_CONSTANT_POINTER_ShaderSelect_start(const struct gen_device_info *devinfo)
   58630 {
   58631    switch (devinfo->gen) {
   58632    case 10: return 60;
   58633    case 9: return 60;
   58634    case 8: return 0;
   58635    case 7:
   58636       if (devinfo->is_haswell) {
   58637          return 0;
   58638       } else {
   58639          return 0;
   58640       }
   58641    case 6: return 0;
   58642    case 5: return 0;
   58643    case 4:
   58644       if (devinfo->is_g4x) {
   58645          return 0;
   58646       } else {
   58647          return 0;
   58648       }
   58649    default:
   58650       unreachable("Invalid hardware generation");
   58651    }
   58652 }
   58653 
   58654 
   58655 
   58656 /* 3DSTATE_SAMPLER_PALETTE_LOAD0 */
   58657 
   58658 
   58659 
   58660 
   58661 
   58662 /* 3DSTATE_SAMPLER_PALETTE_LOAD0::3D Command Opcode */
   58663 
   58664 
   58665 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_bits  3
   58666 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_bits  3
   58667 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_bits  3
   58668 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_bits  3
   58669 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_bits  3
   58670 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_bits  3
   58671 
   58672 static inline uint32_t ATTRIBUTE_PURE
   58673 _3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   58674 {
   58675    switch (devinfo->gen) {
   58676    case 10: return 3;
   58677    case 9: return 3;
   58678    case 8: return 3;
   58679    case 7:
   58680       if (devinfo->is_haswell) {
   58681          return 3;
   58682       } else {
   58683          return 3;
   58684       }
   58685    case 6: return 3;
   58686    case 5: return 0;
   58687    case 4:
   58688       if (devinfo->is_g4x) {
   58689          return 0;
   58690       } else {
   58691          return 0;
   58692       }
   58693    default:
   58694       unreachable("Invalid hardware generation");
   58695    }
   58696 }
   58697 
   58698 
   58699 
   58700 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_start  24
   58701 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_start  24
   58702 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_start  24
   58703 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_start  24
   58704 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_start  24
   58705 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_start  24
   58706 
   58707 static inline uint32_t ATTRIBUTE_PURE
   58708 _3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   58709 {
   58710    switch (devinfo->gen) {
   58711    case 10: return 24;
   58712    case 9: return 24;
   58713    case 8: return 24;
   58714    case 7:
   58715       if (devinfo->is_haswell) {
   58716          return 24;
   58717       } else {
   58718          return 24;
   58719       }
   58720    case 6: return 24;
   58721    case 5: return 0;
   58722    case 4:
   58723       if (devinfo->is_g4x) {
   58724          return 0;
   58725       } else {
   58726          return 0;
   58727       }
   58728    default:
   58729       unreachable("Invalid hardware generation");
   58730    }
   58731 }
   58732 
   58733 
   58734 
   58735 /* 3DSTATE_SAMPLER_PALETTE_LOAD0::3D Command Sub Opcode */
   58736 
   58737 
   58738 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_bits  8
   58739 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_bits  8
   58740 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_bits  8
   58741 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_bits  8
   58742 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_bits  8
   58743 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_bits  8
   58744 
   58745 static inline uint32_t ATTRIBUTE_PURE
   58746 _3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   58747 {
   58748    switch (devinfo->gen) {
   58749    case 10: return 8;
   58750    case 9: return 8;
   58751    case 8: return 8;
   58752    case 7:
   58753       if (devinfo->is_haswell) {
   58754          return 8;
   58755       } else {
   58756          return 8;
   58757       }
   58758    case 6: return 8;
   58759    case 5: return 0;
   58760    case 4:
   58761       if (devinfo->is_g4x) {
   58762          return 0;
   58763       } else {
   58764          return 0;
   58765       }
   58766    default:
   58767       unreachable("Invalid hardware generation");
   58768    }
   58769 }
   58770 
   58771 
   58772 
   58773 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_start  16
   58774 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_start  16
   58775 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_start  16
   58776 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_start  16
   58777 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_start  16
   58778 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_start  16
   58779 
   58780 static inline uint32_t ATTRIBUTE_PURE
   58781 _3DSTATE_SAMPLER_PALETTE_LOAD0_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   58782 {
   58783    switch (devinfo->gen) {
   58784    case 10: return 16;
   58785    case 9: return 16;
   58786    case 8: return 16;
   58787    case 7:
   58788       if (devinfo->is_haswell) {
   58789          return 16;
   58790       } else {
   58791          return 16;
   58792       }
   58793    case 6: return 16;
   58794    case 5: return 0;
   58795    case 4:
   58796       if (devinfo->is_g4x) {
   58797          return 0;
   58798       } else {
   58799          return 0;
   58800       }
   58801    default:
   58802       unreachable("Invalid hardware generation");
   58803    }
   58804 }
   58805 
   58806 
   58807 
   58808 /* 3DSTATE_SAMPLER_PALETTE_LOAD0::Command SubType */
   58809 
   58810 
   58811 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_bits  2
   58812 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_bits  2
   58813 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_bits  2
   58814 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_bits  2
   58815 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_bits  2
   58816 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_bits  2
   58817 
   58818 static inline uint32_t ATTRIBUTE_PURE
   58819 _3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_bits(const struct gen_device_info *devinfo)
   58820 {
   58821    switch (devinfo->gen) {
   58822    case 10: return 2;
   58823    case 9: return 2;
   58824    case 8: return 2;
   58825    case 7:
   58826       if (devinfo->is_haswell) {
   58827          return 2;
   58828       } else {
   58829          return 2;
   58830       }
   58831    case 6: return 2;
   58832    case 5: return 0;
   58833    case 4:
   58834       if (devinfo->is_g4x) {
   58835          return 0;
   58836       } else {
   58837          return 0;
   58838       }
   58839    default:
   58840       unreachable("Invalid hardware generation");
   58841    }
   58842 }
   58843 
   58844 
   58845 
   58846 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_start  27
   58847 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_start  27
   58848 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_start  27
   58849 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_start  27
   58850 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_start  27
   58851 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_start  27
   58852 
   58853 static inline uint32_t ATTRIBUTE_PURE
   58854 _3DSTATE_SAMPLER_PALETTE_LOAD0_CommandSubType_start(const struct gen_device_info *devinfo)
   58855 {
   58856    switch (devinfo->gen) {
   58857    case 10: return 27;
   58858    case 9: return 27;
   58859    case 8: return 27;
   58860    case 7:
   58861       if (devinfo->is_haswell) {
   58862          return 27;
   58863       } else {
   58864          return 27;
   58865       }
   58866    case 6: return 27;
   58867    case 5: return 0;
   58868    case 4:
   58869       if (devinfo->is_g4x) {
   58870          return 0;
   58871       } else {
   58872          return 0;
   58873       }
   58874    default:
   58875       unreachable("Invalid hardware generation");
   58876    }
   58877 }
   58878 
   58879 
   58880 
   58881 /* 3DSTATE_SAMPLER_PALETTE_LOAD0::Command Type */
   58882 
   58883 
   58884 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_bits  3
   58885 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_bits  3
   58886 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_bits  3
   58887 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_bits  3
   58888 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_bits  3
   58889 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_bits  3
   58890 
   58891 static inline uint32_t ATTRIBUTE_PURE
   58892 _3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_bits(const struct gen_device_info *devinfo)
   58893 {
   58894    switch (devinfo->gen) {
   58895    case 10: return 3;
   58896    case 9: return 3;
   58897    case 8: return 3;
   58898    case 7:
   58899       if (devinfo->is_haswell) {
   58900          return 3;
   58901       } else {
   58902          return 3;
   58903       }
   58904    case 6: return 3;
   58905    case 5: return 0;
   58906    case 4:
   58907       if (devinfo->is_g4x) {
   58908          return 0;
   58909       } else {
   58910          return 0;
   58911       }
   58912    default:
   58913       unreachable("Invalid hardware generation");
   58914    }
   58915 }
   58916 
   58917 
   58918 
   58919 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_start  29
   58920 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_start  29
   58921 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_start  29
   58922 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_start  29
   58923 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_start  29
   58924 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_start  29
   58925 
   58926 static inline uint32_t ATTRIBUTE_PURE
   58927 _3DSTATE_SAMPLER_PALETTE_LOAD0_CommandType_start(const struct gen_device_info *devinfo)
   58928 {
   58929    switch (devinfo->gen) {
   58930    case 10: return 29;
   58931    case 9: return 29;
   58932    case 8: return 29;
   58933    case 7:
   58934       if (devinfo->is_haswell) {
   58935          return 29;
   58936       } else {
   58937          return 29;
   58938       }
   58939    case 6: return 29;
   58940    case 5: return 0;
   58941    case 4:
   58942       if (devinfo->is_g4x) {
   58943          return 0;
   58944       } else {
   58945          return 0;
   58946       }
   58947    default:
   58948       unreachable("Invalid hardware generation");
   58949    }
   58950 }
   58951 
   58952 
   58953 
   58954 /* 3DSTATE_SAMPLER_PALETTE_LOAD0::DWord Length */
   58955 
   58956 
   58957 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_bits  8
   58958 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_bits  8
   58959 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_bits  8
   58960 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_bits  8
   58961 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_bits  8
   58962 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_bits  8
   58963 
   58964 static inline uint32_t ATTRIBUTE_PURE
   58965 _3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_bits(const struct gen_device_info *devinfo)
   58966 {
   58967    switch (devinfo->gen) {
   58968    case 10: return 8;
   58969    case 9: return 8;
   58970    case 8: return 8;
   58971    case 7:
   58972       if (devinfo->is_haswell) {
   58973          return 8;
   58974       } else {
   58975          return 8;
   58976       }
   58977    case 6: return 8;
   58978    case 5: return 0;
   58979    case 4:
   58980       if (devinfo->is_g4x) {
   58981          return 0;
   58982       } else {
   58983          return 0;
   58984       }
   58985    default:
   58986       unreachable("Invalid hardware generation");
   58987    }
   58988 }
   58989 
   58990 
   58991 
   58992 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_start  0
   58993 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_start  0
   58994 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_start  0
   58995 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_start  0
   58996 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_start  0
   58997 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_start  0
   58998 
   58999 static inline uint32_t ATTRIBUTE_PURE
   59000 _3DSTATE_SAMPLER_PALETTE_LOAD0_DWordLength_start(const struct gen_device_info *devinfo)
   59001 {
   59002    switch (devinfo->gen) {
   59003    case 10: return 0;
   59004    case 9: return 0;
   59005    case 8: return 0;
   59006    case 7:
   59007       if (devinfo->is_haswell) {
   59008          return 0;
   59009       } else {
   59010          return 0;
   59011       }
   59012    case 6: return 0;
   59013    case 5: return 0;
   59014    case 4:
   59015       if (devinfo->is_g4x) {
   59016          return 0;
   59017       } else {
   59018          return 0;
   59019       }
   59020    default:
   59021       unreachable("Invalid hardware generation");
   59022    }
   59023 }
   59024 
   59025 
   59026 
   59027 /* 3DSTATE_SAMPLER_PALETTE_LOAD0::Entry */
   59028 
   59029 
   59030 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_bits  32
   59031 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_bits  32
   59032 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_bits  32
   59033 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_bits  32
   59034 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_bits  32
   59035 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_bits  32
   59036 
   59037 static inline uint32_t ATTRIBUTE_PURE
   59038 _3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_bits(const struct gen_device_info *devinfo)
   59039 {
   59040    switch (devinfo->gen) {
   59041    case 10: return 32;
   59042    case 9: return 32;
   59043    case 8: return 32;
   59044    case 7:
   59045       if (devinfo->is_haswell) {
   59046          return 32;
   59047       } else {
   59048          return 32;
   59049       }
   59050    case 6: return 32;
   59051    case 5: return 0;
   59052    case 4:
   59053       if (devinfo->is_g4x) {
   59054          return 0;
   59055       } else {
   59056          return 0;
   59057       }
   59058    default:
   59059       unreachable("Invalid hardware generation");
   59060    }
   59061 }
   59062 
   59063 
   59064 
   59065 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_start  0
   59066 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_start  0
   59067 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_start  0
   59068 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_start  0
   59069 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_start  0
   59070 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_start  0
   59071 
   59072 static inline uint32_t ATTRIBUTE_PURE
   59073 _3DSTATE_SAMPLER_PALETTE_LOAD0_Entry_start(const struct gen_device_info *devinfo)
   59074 {
   59075    switch (devinfo->gen) {
   59076    case 10: return 0;
   59077    case 9: return 0;
   59078    case 8: return 0;
   59079    case 7:
   59080       if (devinfo->is_haswell) {
   59081          return 0;
   59082       } else {
   59083          return 0;
   59084       }
   59085    case 6: return 0;
   59086    case 5: return 0;
   59087    case 4:
   59088       if (devinfo->is_g4x) {
   59089          return 0;
   59090       } else {
   59091          return 0;
   59092       }
   59093    default:
   59094       unreachable("Invalid hardware generation");
   59095    }
   59096 }
   59097 
   59098 
   59099 
   59100 /* 3DSTATE_SAMPLER_PALETTE_LOAD1 */
   59101 
   59102 
   59103 
   59104 
   59105 
   59106 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::3D Command Opcode */
   59107 
   59108 
   59109 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_bits  3
   59110 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_bits  3
   59111 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_bits  3
   59112 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_bits  3
   59113 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_bits  3
   59114 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_bits  3
   59115 
   59116 static inline uint32_t ATTRIBUTE_PURE
   59117 _3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   59118 {
   59119    switch (devinfo->gen) {
   59120    case 10: return 3;
   59121    case 9: return 3;
   59122    case 8: return 3;
   59123    case 7:
   59124       if (devinfo->is_haswell) {
   59125          return 3;
   59126       } else {
   59127          return 3;
   59128       }
   59129    case 6: return 3;
   59130    case 5: return 0;
   59131    case 4:
   59132       if (devinfo->is_g4x) {
   59133          return 0;
   59134       } else {
   59135          return 0;
   59136       }
   59137    default:
   59138       unreachable("Invalid hardware generation");
   59139    }
   59140 }
   59141 
   59142 
   59143 
   59144 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_start  24
   59145 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_start  24
   59146 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_start  24
   59147 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_start  24
   59148 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_start  24
   59149 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_start  24
   59150 
   59151 static inline uint32_t ATTRIBUTE_PURE
   59152 _3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   59153 {
   59154    switch (devinfo->gen) {
   59155    case 10: return 24;
   59156    case 9: return 24;
   59157    case 8: return 24;
   59158    case 7:
   59159       if (devinfo->is_haswell) {
   59160          return 24;
   59161       } else {
   59162          return 24;
   59163       }
   59164    case 6: return 24;
   59165    case 5: return 0;
   59166    case 4:
   59167       if (devinfo->is_g4x) {
   59168          return 0;
   59169       } else {
   59170          return 0;
   59171       }
   59172    default:
   59173       unreachable("Invalid hardware generation");
   59174    }
   59175 }
   59176 
   59177 
   59178 
   59179 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::3D Command Sub Opcode */
   59180 
   59181 
   59182 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_bits  8
   59183 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_bits  8
   59184 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_bits  8
   59185 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_bits  8
   59186 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_bits  8
   59187 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_bits  8
   59188 
   59189 static inline uint32_t ATTRIBUTE_PURE
   59190 _3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   59191 {
   59192    switch (devinfo->gen) {
   59193    case 10: return 8;
   59194    case 9: return 8;
   59195    case 8: return 8;
   59196    case 7:
   59197       if (devinfo->is_haswell) {
   59198          return 8;
   59199       } else {
   59200          return 8;
   59201       }
   59202    case 6: return 8;
   59203    case 5: return 0;
   59204    case 4:
   59205       if (devinfo->is_g4x) {
   59206          return 0;
   59207       } else {
   59208          return 0;
   59209       }
   59210    default:
   59211       unreachable("Invalid hardware generation");
   59212    }
   59213 }
   59214 
   59215 
   59216 
   59217 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_start  16
   59218 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_start  16
   59219 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_start  16
   59220 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_start  16
   59221 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_start  16
   59222 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_start  16
   59223 
   59224 static inline uint32_t ATTRIBUTE_PURE
   59225 _3DSTATE_SAMPLER_PALETTE_LOAD1_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   59226 {
   59227    switch (devinfo->gen) {
   59228    case 10: return 16;
   59229    case 9: return 16;
   59230    case 8: return 16;
   59231    case 7:
   59232       if (devinfo->is_haswell) {
   59233          return 16;
   59234       } else {
   59235          return 16;
   59236       }
   59237    case 6: return 16;
   59238    case 5: return 0;
   59239    case 4:
   59240       if (devinfo->is_g4x) {
   59241          return 0;
   59242       } else {
   59243          return 0;
   59244       }
   59245    default:
   59246       unreachable("Invalid hardware generation");
   59247    }
   59248 }
   59249 
   59250 
   59251 
   59252 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::Command SubType */
   59253 
   59254 
   59255 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_bits  2
   59256 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_bits  2
   59257 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_bits  2
   59258 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_bits  2
   59259 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_bits  2
   59260 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_bits  2
   59261 
   59262 static inline uint32_t ATTRIBUTE_PURE
   59263 _3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_bits(const struct gen_device_info *devinfo)
   59264 {
   59265    switch (devinfo->gen) {
   59266    case 10: return 2;
   59267    case 9: return 2;
   59268    case 8: return 2;
   59269    case 7:
   59270       if (devinfo->is_haswell) {
   59271          return 2;
   59272       } else {
   59273          return 2;
   59274       }
   59275    case 6: return 2;
   59276    case 5: return 0;
   59277    case 4:
   59278       if (devinfo->is_g4x) {
   59279          return 0;
   59280       } else {
   59281          return 0;
   59282       }
   59283    default:
   59284       unreachable("Invalid hardware generation");
   59285    }
   59286 }
   59287 
   59288 
   59289 
   59290 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_start  27
   59291 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_start  27
   59292 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_start  27
   59293 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_start  27
   59294 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_start  27
   59295 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_start  27
   59296 
   59297 static inline uint32_t ATTRIBUTE_PURE
   59298 _3DSTATE_SAMPLER_PALETTE_LOAD1_CommandSubType_start(const struct gen_device_info *devinfo)
   59299 {
   59300    switch (devinfo->gen) {
   59301    case 10: return 27;
   59302    case 9: return 27;
   59303    case 8: return 27;
   59304    case 7:
   59305       if (devinfo->is_haswell) {
   59306          return 27;
   59307       } else {
   59308          return 27;
   59309       }
   59310    case 6: return 27;
   59311    case 5: return 0;
   59312    case 4:
   59313       if (devinfo->is_g4x) {
   59314          return 0;
   59315       } else {
   59316          return 0;
   59317       }
   59318    default:
   59319       unreachable("Invalid hardware generation");
   59320    }
   59321 }
   59322 
   59323 
   59324 
   59325 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::Command Type */
   59326 
   59327 
   59328 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_bits  3
   59329 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_bits  3
   59330 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_bits  3
   59331 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_bits  3
   59332 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_bits  3
   59333 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_bits  3
   59334 
   59335 static inline uint32_t ATTRIBUTE_PURE
   59336 _3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_bits(const struct gen_device_info *devinfo)
   59337 {
   59338    switch (devinfo->gen) {
   59339    case 10: return 3;
   59340    case 9: return 3;
   59341    case 8: return 3;
   59342    case 7:
   59343       if (devinfo->is_haswell) {
   59344          return 3;
   59345       } else {
   59346          return 3;
   59347       }
   59348    case 6: return 3;
   59349    case 5: return 0;
   59350    case 4:
   59351       if (devinfo->is_g4x) {
   59352          return 0;
   59353       } else {
   59354          return 0;
   59355       }
   59356    default:
   59357       unreachable("Invalid hardware generation");
   59358    }
   59359 }
   59360 
   59361 
   59362 
   59363 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_start  29
   59364 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_start  29
   59365 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_start  29
   59366 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_start  29
   59367 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_start  29
   59368 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_start  29
   59369 
   59370 static inline uint32_t ATTRIBUTE_PURE
   59371 _3DSTATE_SAMPLER_PALETTE_LOAD1_CommandType_start(const struct gen_device_info *devinfo)
   59372 {
   59373    switch (devinfo->gen) {
   59374    case 10: return 29;
   59375    case 9: return 29;
   59376    case 8: return 29;
   59377    case 7:
   59378       if (devinfo->is_haswell) {
   59379          return 29;
   59380       } else {
   59381          return 29;
   59382       }
   59383    case 6: return 29;
   59384    case 5: return 0;
   59385    case 4:
   59386       if (devinfo->is_g4x) {
   59387          return 0;
   59388       } else {
   59389          return 0;
   59390       }
   59391    default:
   59392       unreachable("Invalid hardware generation");
   59393    }
   59394 }
   59395 
   59396 
   59397 
   59398 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::DWord Length */
   59399 
   59400 
   59401 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_bits  8
   59402 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_bits  8
   59403 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_bits  8
   59404 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_bits  8
   59405 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_bits  8
   59406 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_bits  8
   59407 
   59408 static inline uint32_t ATTRIBUTE_PURE
   59409 _3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_bits(const struct gen_device_info *devinfo)
   59410 {
   59411    switch (devinfo->gen) {
   59412    case 10: return 8;
   59413    case 9: return 8;
   59414    case 8: return 8;
   59415    case 7:
   59416       if (devinfo->is_haswell) {
   59417          return 8;
   59418       } else {
   59419          return 8;
   59420       }
   59421    case 6: return 8;
   59422    case 5: return 0;
   59423    case 4:
   59424       if (devinfo->is_g4x) {
   59425          return 0;
   59426       } else {
   59427          return 0;
   59428       }
   59429    default:
   59430       unreachable("Invalid hardware generation");
   59431    }
   59432 }
   59433 
   59434 
   59435 
   59436 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_start  0
   59437 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_start  0
   59438 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_start  0
   59439 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_start  0
   59440 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_start  0
   59441 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_start  0
   59442 
   59443 static inline uint32_t ATTRIBUTE_PURE
   59444 _3DSTATE_SAMPLER_PALETTE_LOAD1_DWordLength_start(const struct gen_device_info *devinfo)
   59445 {
   59446    switch (devinfo->gen) {
   59447    case 10: return 0;
   59448    case 9: return 0;
   59449    case 8: return 0;
   59450    case 7:
   59451       if (devinfo->is_haswell) {
   59452          return 0;
   59453       } else {
   59454          return 0;
   59455       }
   59456    case 6: return 0;
   59457    case 5: return 0;
   59458    case 4:
   59459       if (devinfo->is_g4x) {
   59460          return 0;
   59461       } else {
   59462          return 0;
   59463       }
   59464    default:
   59465       unreachable("Invalid hardware generation");
   59466    }
   59467 }
   59468 
   59469 
   59470 
   59471 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::Palette Alpha[0:N-1] */
   59472 
   59473 
   59474 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_bits  8
   59475 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_bits  8
   59476 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_bits  8
   59477 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_bits  8
   59478 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_bits  8
   59479 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_bits  8
   59480 
   59481 static inline uint32_t ATTRIBUTE_PURE
   59482 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_bits(const struct gen_device_info *devinfo)
   59483 {
   59484    switch (devinfo->gen) {
   59485    case 10: return 8;
   59486    case 9: return 8;
   59487    case 8: return 8;
   59488    case 7:
   59489       if (devinfo->is_haswell) {
   59490          return 8;
   59491       } else {
   59492          return 8;
   59493       }
   59494    case 6: return 8;
   59495    case 5: return 0;
   59496    case 4:
   59497       if (devinfo->is_g4x) {
   59498          return 0;
   59499       } else {
   59500          return 0;
   59501       }
   59502    default:
   59503       unreachable("Invalid hardware generation");
   59504    }
   59505 }
   59506 
   59507 
   59508 
   59509 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_start  24
   59510 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_start  24
   59511 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_start  24
   59512 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_start  24
   59513 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_start  24
   59514 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_start  24
   59515 
   59516 static inline uint32_t ATTRIBUTE_PURE
   59517 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteAlpha0N1_start(const struct gen_device_info *devinfo)
   59518 {
   59519    switch (devinfo->gen) {
   59520    case 10: return 24;
   59521    case 9: return 24;
   59522    case 8: return 24;
   59523    case 7:
   59524       if (devinfo->is_haswell) {
   59525          return 24;
   59526       } else {
   59527          return 24;
   59528       }
   59529    case 6: return 24;
   59530    case 5: return 0;
   59531    case 4:
   59532       if (devinfo->is_g4x) {
   59533          return 0;
   59534       } else {
   59535          return 0;
   59536       }
   59537    default:
   59538       unreachable("Invalid hardware generation");
   59539    }
   59540 }
   59541 
   59542 
   59543 
   59544 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::Palette Blue[0:N-1] */
   59545 
   59546 
   59547 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_bits  8
   59548 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_bits  8
   59549 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_bits  8
   59550 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_bits  8
   59551 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_bits  8
   59552 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_bits  8
   59553 
   59554 static inline uint32_t ATTRIBUTE_PURE
   59555 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_bits(const struct gen_device_info *devinfo)
   59556 {
   59557    switch (devinfo->gen) {
   59558    case 10: return 8;
   59559    case 9: return 8;
   59560    case 8: return 8;
   59561    case 7:
   59562       if (devinfo->is_haswell) {
   59563          return 8;
   59564       } else {
   59565          return 8;
   59566       }
   59567    case 6: return 8;
   59568    case 5: return 0;
   59569    case 4:
   59570       if (devinfo->is_g4x) {
   59571          return 0;
   59572       } else {
   59573          return 0;
   59574       }
   59575    default:
   59576       unreachable("Invalid hardware generation");
   59577    }
   59578 }
   59579 
   59580 
   59581 
   59582 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_start  0
   59583 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_start  0
   59584 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_start  0
   59585 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_start  0
   59586 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_start  0
   59587 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_start  0
   59588 
   59589 static inline uint32_t ATTRIBUTE_PURE
   59590 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteBlue0N1_start(const struct gen_device_info *devinfo)
   59591 {
   59592    switch (devinfo->gen) {
   59593    case 10: return 0;
   59594    case 9: return 0;
   59595    case 8: return 0;
   59596    case 7:
   59597       if (devinfo->is_haswell) {
   59598          return 0;
   59599       } else {
   59600          return 0;
   59601       }
   59602    case 6: return 0;
   59603    case 5: return 0;
   59604    case 4:
   59605       if (devinfo->is_g4x) {
   59606          return 0;
   59607       } else {
   59608          return 0;
   59609       }
   59610    default:
   59611       unreachable("Invalid hardware generation");
   59612    }
   59613 }
   59614 
   59615 
   59616 
   59617 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::Palette Green[0:N-1] */
   59618 
   59619 
   59620 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_bits  8
   59621 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_bits  8
   59622 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_bits  8
   59623 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_bits  8
   59624 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_bits  8
   59625 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_bits  8
   59626 
   59627 static inline uint32_t ATTRIBUTE_PURE
   59628 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_bits(const struct gen_device_info *devinfo)
   59629 {
   59630    switch (devinfo->gen) {
   59631    case 10: return 8;
   59632    case 9: return 8;
   59633    case 8: return 8;
   59634    case 7:
   59635       if (devinfo->is_haswell) {
   59636          return 8;
   59637       } else {
   59638          return 8;
   59639       }
   59640    case 6: return 8;
   59641    case 5: return 0;
   59642    case 4:
   59643       if (devinfo->is_g4x) {
   59644          return 0;
   59645       } else {
   59646          return 0;
   59647       }
   59648    default:
   59649       unreachable("Invalid hardware generation");
   59650    }
   59651 }
   59652 
   59653 
   59654 
   59655 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_start  8
   59656 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_start  8
   59657 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_start  8
   59658 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_start  8
   59659 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_start  8
   59660 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_start  8
   59661 
   59662 static inline uint32_t ATTRIBUTE_PURE
   59663 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteGreen0N1_start(const struct gen_device_info *devinfo)
   59664 {
   59665    switch (devinfo->gen) {
   59666    case 10: return 8;
   59667    case 9: return 8;
   59668    case 8: return 8;
   59669    case 7:
   59670       if (devinfo->is_haswell) {
   59671          return 8;
   59672       } else {
   59673          return 8;
   59674       }
   59675    case 6: return 8;
   59676    case 5: return 0;
   59677    case 4:
   59678       if (devinfo->is_g4x) {
   59679          return 0;
   59680       } else {
   59681          return 0;
   59682       }
   59683    default:
   59684       unreachable("Invalid hardware generation");
   59685    }
   59686 }
   59687 
   59688 
   59689 
   59690 /* 3DSTATE_SAMPLER_PALETTE_LOAD1::Palette Red[0:N-1] */
   59691 
   59692 
   59693 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_bits  8
   59694 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_bits  8
   59695 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_bits  8
   59696 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_bits  8
   59697 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_bits  8
   59698 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_bits  8
   59699 
   59700 static inline uint32_t ATTRIBUTE_PURE
   59701 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_bits(const struct gen_device_info *devinfo)
   59702 {
   59703    switch (devinfo->gen) {
   59704    case 10: return 8;
   59705    case 9: return 8;
   59706    case 8: return 8;
   59707    case 7:
   59708       if (devinfo->is_haswell) {
   59709          return 8;
   59710       } else {
   59711          return 8;
   59712       }
   59713    case 6: return 8;
   59714    case 5: return 0;
   59715    case 4:
   59716       if (devinfo->is_g4x) {
   59717          return 0;
   59718       } else {
   59719          return 0;
   59720       }
   59721    default:
   59722       unreachable("Invalid hardware generation");
   59723    }
   59724 }
   59725 
   59726 
   59727 
   59728 #define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_start  16
   59729 #define GEN9_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_start  16
   59730 #define GEN8_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_start  16
   59731 #define GEN75_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_start  16
   59732 #define GEN7_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_start  16
   59733 #define GEN6_3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_start  16
   59734 
   59735 static inline uint32_t ATTRIBUTE_PURE
   59736 _3DSTATE_SAMPLER_PALETTE_LOAD1_PaletteRed0N1_start(const struct gen_device_info *devinfo)
   59737 {
   59738    switch (devinfo->gen) {
   59739    case 10: return 16;
   59740    case 9: return 16;
   59741    case 8: return 16;
   59742    case 7:
   59743       if (devinfo->is_haswell) {
   59744          return 16;
   59745       } else {
   59746          return 16;
   59747       }
   59748    case 6: return 16;
   59749    case 5: return 0;
   59750    case 4:
   59751       if (devinfo->is_g4x) {
   59752          return 0;
   59753       } else {
   59754          return 0;
   59755       }
   59756    default:
   59757       unreachable("Invalid hardware generation");
   59758    }
   59759 }
   59760 
   59761 
   59762 
   59763 /* 3DSTATE_SAMPLER_STATE_POINTERS */
   59764 
   59765 
   59766 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_length  4
   59767 
   59768 static inline uint32_t ATTRIBUTE_PURE
   59769 _3DSTATE_SAMPLER_STATE_POINTERS_length(const struct gen_device_info *devinfo)
   59770 {
   59771    switch (devinfo->gen) {
   59772    case 10: return 0;
   59773    case 9: return 0;
   59774    case 8: return 0;
   59775    case 7:
   59776       if (devinfo->is_haswell) {
   59777          return 0;
   59778       } else {
   59779          return 0;
   59780       }
   59781    case 6: return 4;
   59782    case 5: return 0;
   59783    case 4:
   59784       if (devinfo->is_g4x) {
   59785          return 0;
   59786       } else {
   59787          return 0;
   59788       }
   59789    default:
   59790       unreachable("Invalid hardware generation");
   59791    }
   59792 }
   59793 
   59794 
   59795 
   59796 /* 3DSTATE_SAMPLER_STATE_POINTERS::3D Command Opcode */
   59797 
   59798 
   59799 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_3DCommandOpcode_bits  3
   59800 
   59801 static inline uint32_t ATTRIBUTE_PURE
   59802 _3DSTATE_SAMPLER_STATE_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   59803 {
   59804    switch (devinfo->gen) {
   59805    case 10: return 0;
   59806    case 9: return 0;
   59807    case 8: return 0;
   59808    case 7:
   59809       if (devinfo->is_haswell) {
   59810          return 0;
   59811       } else {
   59812          return 0;
   59813       }
   59814    case 6: return 3;
   59815    case 5: return 0;
   59816    case 4:
   59817       if (devinfo->is_g4x) {
   59818          return 0;
   59819       } else {
   59820          return 0;
   59821       }
   59822    default:
   59823       unreachable("Invalid hardware generation");
   59824    }
   59825 }
   59826 
   59827 
   59828 
   59829 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_3DCommandOpcode_start  24
   59830 
   59831 static inline uint32_t ATTRIBUTE_PURE
   59832 _3DSTATE_SAMPLER_STATE_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   59833 {
   59834    switch (devinfo->gen) {
   59835    case 10: return 0;
   59836    case 9: return 0;
   59837    case 8: return 0;
   59838    case 7:
   59839       if (devinfo->is_haswell) {
   59840          return 0;
   59841       } else {
   59842          return 0;
   59843       }
   59844    case 6: return 24;
   59845    case 5: return 0;
   59846    case 4:
   59847       if (devinfo->is_g4x) {
   59848          return 0;
   59849       } else {
   59850          return 0;
   59851       }
   59852    default:
   59853       unreachable("Invalid hardware generation");
   59854    }
   59855 }
   59856 
   59857 
   59858 
   59859 /* 3DSTATE_SAMPLER_STATE_POINTERS::3D Command Sub Opcode */
   59860 
   59861 
   59862 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_3DCommandSubOpcode_bits  8
   59863 
   59864 static inline uint32_t ATTRIBUTE_PURE
   59865 _3DSTATE_SAMPLER_STATE_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   59866 {
   59867    switch (devinfo->gen) {
   59868    case 10: return 0;
   59869    case 9: return 0;
   59870    case 8: return 0;
   59871    case 7:
   59872       if (devinfo->is_haswell) {
   59873          return 0;
   59874       } else {
   59875          return 0;
   59876       }
   59877    case 6: return 8;
   59878    case 5: return 0;
   59879    case 4:
   59880       if (devinfo->is_g4x) {
   59881          return 0;
   59882       } else {
   59883          return 0;
   59884       }
   59885    default:
   59886       unreachable("Invalid hardware generation");
   59887    }
   59888 }
   59889 
   59890 
   59891 
   59892 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_3DCommandSubOpcode_start  16
   59893 
   59894 static inline uint32_t ATTRIBUTE_PURE
   59895 _3DSTATE_SAMPLER_STATE_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   59896 {
   59897    switch (devinfo->gen) {
   59898    case 10: return 0;
   59899    case 9: return 0;
   59900    case 8: return 0;
   59901    case 7:
   59902       if (devinfo->is_haswell) {
   59903          return 0;
   59904       } else {
   59905          return 0;
   59906       }
   59907    case 6: return 16;
   59908    case 5: return 0;
   59909    case 4:
   59910       if (devinfo->is_g4x) {
   59911          return 0;
   59912       } else {
   59913          return 0;
   59914       }
   59915    default:
   59916       unreachable("Invalid hardware generation");
   59917    }
   59918 }
   59919 
   59920 
   59921 
   59922 /* 3DSTATE_SAMPLER_STATE_POINTERS::Command SubType */
   59923 
   59924 
   59925 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_CommandSubType_bits  2
   59926 
   59927 static inline uint32_t ATTRIBUTE_PURE
   59928 _3DSTATE_SAMPLER_STATE_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   59929 {
   59930    switch (devinfo->gen) {
   59931    case 10: return 0;
   59932    case 9: return 0;
   59933    case 8: return 0;
   59934    case 7:
   59935       if (devinfo->is_haswell) {
   59936          return 0;
   59937       } else {
   59938          return 0;
   59939       }
   59940    case 6: return 2;
   59941    case 5: return 0;
   59942    case 4:
   59943       if (devinfo->is_g4x) {
   59944          return 0;
   59945       } else {
   59946          return 0;
   59947       }
   59948    default:
   59949       unreachable("Invalid hardware generation");
   59950    }
   59951 }
   59952 
   59953 
   59954 
   59955 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_CommandSubType_start  27
   59956 
   59957 static inline uint32_t ATTRIBUTE_PURE
   59958 _3DSTATE_SAMPLER_STATE_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   59959 {
   59960    switch (devinfo->gen) {
   59961    case 10: return 0;
   59962    case 9: return 0;
   59963    case 8: return 0;
   59964    case 7:
   59965       if (devinfo->is_haswell) {
   59966          return 0;
   59967       } else {
   59968          return 0;
   59969       }
   59970    case 6: return 27;
   59971    case 5: return 0;
   59972    case 4:
   59973       if (devinfo->is_g4x) {
   59974          return 0;
   59975       } else {
   59976          return 0;
   59977       }
   59978    default:
   59979       unreachable("Invalid hardware generation");
   59980    }
   59981 }
   59982 
   59983 
   59984 
   59985 /* 3DSTATE_SAMPLER_STATE_POINTERS::Command Type */
   59986 
   59987 
   59988 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_CommandType_bits  3
   59989 
   59990 static inline uint32_t ATTRIBUTE_PURE
   59991 _3DSTATE_SAMPLER_STATE_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   59992 {
   59993    switch (devinfo->gen) {
   59994    case 10: return 0;
   59995    case 9: return 0;
   59996    case 8: return 0;
   59997    case 7:
   59998       if (devinfo->is_haswell) {
   59999          return 0;
   60000       } else {
   60001          return 0;
   60002       }
   60003    case 6: return 3;
   60004    case 5: return 0;
   60005    case 4:
   60006       if (devinfo->is_g4x) {
   60007          return 0;
   60008       } else {
   60009          return 0;
   60010       }
   60011    default:
   60012       unreachable("Invalid hardware generation");
   60013    }
   60014 }
   60015 
   60016 
   60017 
   60018 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_CommandType_start  29
   60019 
   60020 static inline uint32_t ATTRIBUTE_PURE
   60021 _3DSTATE_SAMPLER_STATE_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   60022 {
   60023    switch (devinfo->gen) {
   60024    case 10: return 0;
   60025    case 9: return 0;
   60026    case 8: return 0;
   60027    case 7:
   60028       if (devinfo->is_haswell) {
   60029          return 0;
   60030       } else {
   60031          return 0;
   60032       }
   60033    case 6: return 29;
   60034    case 5: return 0;
   60035    case 4:
   60036       if (devinfo->is_g4x) {
   60037          return 0;
   60038       } else {
   60039          return 0;
   60040       }
   60041    default:
   60042       unreachable("Invalid hardware generation");
   60043    }
   60044 }
   60045 
   60046 
   60047 
   60048 /* 3DSTATE_SAMPLER_STATE_POINTERS::DWord Length */
   60049 
   60050 
   60051 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_DWordLength_bits  8
   60052 
   60053 static inline uint32_t ATTRIBUTE_PURE
   60054 _3DSTATE_SAMPLER_STATE_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   60055 {
   60056    switch (devinfo->gen) {
   60057    case 10: return 0;
   60058    case 9: return 0;
   60059    case 8: return 0;
   60060    case 7:
   60061       if (devinfo->is_haswell) {
   60062          return 0;
   60063       } else {
   60064          return 0;
   60065       }
   60066    case 6: return 8;
   60067    case 5: return 0;
   60068    case 4:
   60069       if (devinfo->is_g4x) {
   60070          return 0;
   60071       } else {
   60072          return 0;
   60073       }
   60074    default:
   60075       unreachable("Invalid hardware generation");
   60076    }
   60077 }
   60078 
   60079 
   60080 
   60081 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_DWordLength_start  0
   60082 
   60083 static inline uint32_t ATTRIBUTE_PURE
   60084 _3DSTATE_SAMPLER_STATE_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   60085 {
   60086    switch (devinfo->gen) {
   60087    case 10: return 0;
   60088    case 9: return 0;
   60089    case 8: return 0;
   60090    case 7:
   60091       if (devinfo->is_haswell) {
   60092          return 0;
   60093       } else {
   60094          return 0;
   60095       }
   60096    case 6: return 0;
   60097    case 5: return 0;
   60098    case 4:
   60099       if (devinfo->is_g4x) {
   60100          return 0;
   60101       } else {
   60102          return 0;
   60103       }
   60104    default:
   60105       unreachable("Invalid hardware generation");
   60106    }
   60107 }
   60108 
   60109 
   60110 
   60111 /* 3DSTATE_SAMPLER_STATE_POINTERS::GS Sampler State Change */
   60112 
   60113 
   60114 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_GSSamplerStateChange_bits  1
   60115 
   60116 static inline uint32_t ATTRIBUTE_PURE
   60117 _3DSTATE_SAMPLER_STATE_POINTERS_GSSamplerStateChange_bits(const struct gen_device_info *devinfo)
   60118 {
   60119    switch (devinfo->gen) {
   60120    case 10: return 0;
   60121    case 9: return 0;
   60122    case 8: return 0;
   60123    case 7:
   60124       if (devinfo->is_haswell) {
   60125          return 0;
   60126       } else {
   60127          return 0;
   60128       }
   60129    case 6: return 1;
   60130    case 5: return 0;
   60131    case 4:
   60132       if (devinfo->is_g4x) {
   60133          return 0;
   60134       } else {
   60135          return 0;
   60136       }
   60137    default:
   60138       unreachable("Invalid hardware generation");
   60139    }
   60140 }
   60141 
   60142 
   60143 
   60144 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_GSSamplerStateChange_start  9
   60145 
   60146 static inline uint32_t ATTRIBUTE_PURE
   60147 _3DSTATE_SAMPLER_STATE_POINTERS_GSSamplerStateChange_start(const struct gen_device_info *devinfo)
   60148 {
   60149    switch (devinfo->gen) {
   60150    case 10: return 0;
   60151    case 9: return 0;
   60152    case 8: return 0;
   60153    case 7:
   60154       if (devinfo->is_haswell) {
   60155          return 0;
   60156       } else {
   60157          return 0;
   60158       }
   60159    case 6: return 9;
   60160    case 5: return 0;
   60161    case 4:
   60162       if (devinfo->is_g4x) {
   60163          return 0;
   60164       } else {
   60165          return 0;
   60166       }
   60167    default:
   60168       unreachable("Invalid hardware generation");
   60169    }
   60170 }
   60171 
   60172 
   60173 
   60174 /* 3DSTATE_SAMPLER_STATE_POINTERS::PS Sampler State Change */
   60175 
   60176 
   60177 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PSSamplerStateChange_bits  1
   60178 
   60179 static inline uint32_t ATTRIBUTE_PURE
   60180 _3DSTATE_SAMPLER_STATE_POINTERS_PSSamplerStateChange_bits(const struct gen_device_info *devinfo)
   60181 {
   60182    switch (devinfo->gen) {
   60183    case 10: return 0;
   60184    case 9: return 0;
   60185    case 8: return 0;
   60186    case 7:
   60187       if (devinfo->is_haswell) {
   60188          return 0;
   60189       } else {
   60190          return 0;
   60191       }
   60192    case 6: return 1;
   60193    case 5: return 0;
   60194    case 4:
   60195       if (devinfo->is_g4x) {
   60196          return 0;
   60197       } else {
   60198          return 0;
   60199       }
   60200    default:
   60201       unreachable("Invalid hardware generation");
   60202    }
   60203 }
   60204 
   60205 
   60206 
   60207 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PSSamplerStateChange_start  12
   60208 
   60209 static inline uint32_t ATTRIBUTE_PURE
   60210 _3DSTATE_SAMPLER_STATE_POINTERS_PSSamplerStateChange_start(const struct gen_device_info *devinfo)
   60211 {
   60212    switch (devinfo->gen) {
   60213    case 10: return 0;
   60214    case 9: return 0;
   60215    case 8: return 0;
   60216    case 7:
   60217       if (devinfo->is_haswell) {
   60218          return 0;
   60219       } else {
   60220          return 0;
   60221       }
   60222    case 6: return 12;
   60223    case 5: return 0;
   60224    case 4:
   60225       if (devinfo->is_g4x) {
   60226          return 0;
   60227       } else {
   60228          return 0;
   60229       }
   60230    default:
   60231       unreachable("Invalid hardware generation");
   60232    }
   60233 }
   60234 
   60235 
   60236 
   60237 /* 3DSTATE_SAMPLER_STATE_POINTERS::Pointer to GS Sampler State */
   60238 
   60239 
   60240 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PointertoGSSamplerState_bits  27
   60241 
   60242 static inline uint32_t ATTRIBUTE_PURE
   60243 _3DSTATE_SAMPLER_STATE_POINTERS_PointertoGSSamplerState_bits(const struct gen_device_info *devinfo)
   60244 {
   60245    switch (devinfo->gen) {
   60246    case 10: return 0;
   60247    case 9: return 0;
   60248    case 8: return 0;
   60249    case 7:
   60250       if (devinfo->is_haswell) {
   60251          return 0;
   60252       } else {
   60253          return 0;
   60254       }
   60255    case 6: return 27;
   60256    case 5: return 0;
   60257    case 4:
   60258       if (devinfo->is_g4x) {
   60259          return 0;
   60260       } else {
   60261          return 0;
   60262       }
   60263    default:
   60264       unreachable("Invalid hardware generation");
   60265    }
   60266 }
   60267 
   60268 
   60269 
   60270 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PointertoGSSamplerState_start  69
   60271 
   60272 static inline uint32_t ATTRIBUTE_PURE
   60273 _3DSTATE_SAMPLER_STATE_POINTERS_PointertoGSSamplerState_start(const struct gen_device_info *devinfo)
   60274 {
   60275    switch (devinfo->gen) {
   60276    case 10: return 0;
   60277    case 9: return 0;
   60278    case 8: return 0;
   60279    case 7:
   60280       if (devinfo->is_haswell) {
   60281          return 0;
   60282       } else {
   60283          return 0;
   60284       }
   60285    case 6: return 69;
   60286    case 5: return 0;
   60287    case 4:
   60288       if (devinfo->is_g4x) {
   60289          return 0;
   60290       } else {
   60291          return 0;
   60292       }
   60293    default:
   60294       unreachable("Invalid hardware generation");
   60295    }
   60296 }
   60297 
   60298 
   60299 
   60300 /* 3DSTATE_SAMPLER_STATE_POINTERS::Pointer to PS Sampler State */
   60301 
   60302 
   60303 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PointertoPSSamplerState_bits  27
   60304 
   60305 static inline uint32_t ATTRIBUTE_PURE
   60306 _3DSTATE_SAMPLER_STATE_POINTERS_PointertoPSSamplerState_bits(const struct gen_device_info *devinfo)
   60307 {
   60308    switch (devinfo->gen) {
   60309    case 10: return 0;
   60310    case 9: return 0;
   60311    case 8: return 0;
   60312    case 7:
   60313       if (devinfo->is_haswell) {
   60314          return 0;
   60315       } else {
   60316          return 0;
   60317       }
   60318    case 6: return 27;
   60319    case 5: return 0;
   60320    case 4:
   60321       if (devinfo->is_g4x) {
   60322          return 0;
   60323       } else {
   60324          return 0;
   60325       }
   60326    default:
   60327       unreachable("Invalid hardware generation");
   60328    }
   60329 }
   60330 
   60331 
   60332 
   60333 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PointertoPSSamplerState_start  101
   60334 
   60335 static inline uint32_t ATTRIBUTE_PURE
   60336 _3DSTATE_SAMPLER_STATE_POINTERS_PointertoPSSamplerState_start(const struct gen_device_info *devinfo)
   60337 {
   60338    switch (devinfo->gen) {
   60339    case 10: return 0;
   60340    case 9: return 0;
   60341    case 8: return 0;
   60342    case 7:
   60343       if (devinfo->is_haswell) {
   60344          return 0;
   60345       } else {
   60346          return 0;
   60347       }
   60348    case 6: return 101;
   60349    case 5: return 0;
   60350    case 4:
   60351       if (devinfo->is_g4x) {
   60352          return 0;
   60353       } else {
   60354          return 0;
   60355       }
   60356    default:
   60357       unreachable("Invalid hardware generation");
   60358    }
   60359 }
   60360 
   60361 
   60362 
   60363 /* 3DSTATE_SAMPLER_STATE_POINTERS::Pointer to VS Sampler State */
   60364 
   60365 
   60366 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PointertoVSSamplerState_bits  27
   60367 
   60368 static inline uint32_t ATTRIBUTE_PURE
   60369 _3DSTATE_SAMPLER_STATE_POINTERS_PointertoVSSamplerState_bits(const struct gen_device_info *devinfo)
   60370 {
   60371    switch (devinfo->gen) {
   60372    case 10: return 0;
   60373    case 9: return 0;
   60374    case 8: return 0;
   60375    case 7:
   60376       if (devinfo->is_haswell) {
   60377          return 0;
   60378       } else {
   60379          return 0;
   60380       }
   60381    case 6: return 27;
   60382    case 5: return 0;
   60383    case 4:
   60384       if (devinfo->is_g4x) {
   60385          return 0;
   60386       } else {
   60387          return 0;
   60388       }
   60389    default:
   60390       unreachable("Invalid hardware generation");
   60391    }
   60392 }
   60393 
   60394 
   60395 
   60396 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_PointertoVSSamplerState_start  37
   60397 
   60398 static inline uint32_t ATTRIBUTE_PURE
   60399 _3DSTATE_SAMPLER_STATE_POINTERS_PointertoVSSamplerState_start(const struct gen_device_info *devinfo)
   60400 {
   60401    switch (devinfo->gen) {
   60402    case 10: return 0;
   60403    case 9: return 0;
   60404    case 8: return 0;
   60405    case 7:
   60406       if (devinfo->is_haswell) {
   60407          return 0;
   60408       } else {
   60409          return 0;
   60410       }
   60411    case 6: return 37;
   60412    case 5: return 0;
   60413    case 4:
   60414       if (devinfo->is_g4x) {
   60415          return 0;
   60416       } else {
   60417          return 0;
   60418       }
   60419    default:
   60420       unreachable("Invalid hardware generation");
   60421    }
   60422 }
   60423 
   60424 
   60425 
   60426 /* 3DSTATE_SAMPLER_STATE_POINTERS::VS Sampler State Change */
   60427 
   60428 
   60429 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_VSSamplerStateChange_bits  1
   60430 
   60431 static inline uint32_t ATTRIBUTE_PURE
   60432 _3DSTATE_SAMPLER_STATE_POINTERS_VSSamplerStateChange_bits(const struct gen_device_info *devinfo)
   60433 {
   60434    switch (devinfo->gen) {
   60435    case 10: return 0;
   60436    case 9: return 0;
   60437    case 8: return 0;
   60438    case 7:
   60439       if (devinfo->is_haswell) {
   60440          return 0;
   60441       } else {
   60442          return 0;
   60443       }
   60444    case 6: return 1;
   60445    case 5: return 0;
   60446    case 4:
   60447       if (devinfo->is_g4x) {
   60448          return 0;
   60449       } else {
   60450          return 0;
   60451       }
   60452    default:
   60453       unreachable("Invalid hardware generation");
   60454    }
   60455 }
   60456 
   60457 
   60458 
   60459 #define GEN6_3DSTATE_SAMPLER_STATE_POINTERS_VSSamplerStateChange_start  8
   60460 
   60461 static inline uint32_t ATTRIBUTE_PURE
   60462 _3DSTATE_SAMPLER_STATE_POINTERS_VSSamplerStateChange_start(const struct gen_device_info *devinfo)
   60463 {
   60464    switch (devinfo->gen) {
   60465    case 10: return 0;
   60466    case 9: return 0;
   60467    case 8: return 0;
   60468    case 7:
   60469       if (devinfo->is_haswell) {
   60470          return 0;
   60471       } else {
   60472          return 0;
   60473       }
   60474    case 6: return 8;
   60475    case 5: return 0;
   60476    case 4:
   60477       if (devinfo->is_g4x) {
   60478          return 0;
   60479       } else {
   60480          return 0;
   60481       }
   60482    default:
   60483       unreachable("Invalid hardware generation");
   60484    }
   60485 }
   60486 
   60487 
   60488 
   60489 /* 3DSTATE_SAMPLER_STATE_POINTERS_DS */
   60490 
   60491 
   60492 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_length  2
   60493 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_length  2
   60494 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_length  2
   60495 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_length  2
   60496 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_length  2
   60497 
   60498 static inline uint32_t ATTRIBUTE_PURE
   60499 _3DSTATE_SAMPLER_STATE_POINTERS_DS_length(const struct gen_device_info *devinfo)
   60500 {
   60501    switch (devinfo->gen) {
   60502    case 10: return 2;
   60503    case 9: return 2;
   60504    case 8: return 2;
   60505    case 7:
   60506       if (devinfo->is_haswell) {
   60507          return 2;
   60508       } else {
   60509          return 2;
   60510       }
   60511    case 6: return 0;
   60512    case 5: return 0;
   60513    case 4:
   60514       if (devinfo->is_g4x) {
   60515          return 0;
   60516       } else {
   60517          return 0;
   60518       }
   60519    default:
   60520       unreachable("Invalid hardware generation");
   60521    }
   60522 }
   60523 
   60524 
   60525 
   60526 /* 3DSTATE_SAMPLER_STATE_POINTERS_DS::3D Command Opcode */
   60527 
   60528 
   60529 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_bits  3
   60530 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_bits  3
   60531 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_bits  3
   60532 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_bits  3
   60533 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_bits  3
   60534 
   60535 static inline uint32_t ATTRIBUTE_PURE
   60536 _3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   60537 {
   60538    switch (devinfo->gen) {
   60539    case 10: return 3;
   60540    case 9: return 3;
   60541    case 8: return 3;
   60542    case 7:
   60543       if (devinfo->is_haswell) {
   60544          return 3;
   60545       } else {
   60546          return 3;
   60547       }
   60548    case 6: return 0;
   60549    case 5: return 0;
   60550    case 4:
   60551       if (devinfo->is_g4x) {
   60552          return 0;
   60553       } else {
   60554          return 0;
   60555       }
   60556    default:
   60557       unreachable("Invalid hardware generation");
   60558    }
   60559 }
   60560 
   60561 
   60562 
   60563 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_start  24
   60564 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_start  24
   60565 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_start  24
   60566 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_start  24
   60567 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_start  24
   60568 
   60569 static inline uint32_t ATTRIBUTE_PURE
   60570 _3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   60571 {
   60572    switch (devinfo->gen) {
   60573    case 10: return 24;
   60574    case 9: return 24;
   60575    case 8: return 24;
   60576    case 7:
   60577       if (devinfo->is_haswell) {
   60578          return 24;
   60579       } else {
   60580          return 24;
   60581       }
   60582    case 6: return 0;
   60583    case 5: return 0;
   60584    case 4:
   60585       if (devinfo->is_g4x) {
   60586          return 0;
   60587       } else {
   60588          return 0;
   60589       }
   60590    default:
   60591       unreachable("Invalid hardware generation");
   60592    }
   60593 }
   60594 
   60595 
   60596 
   60597 /* 3DSTATE_SAMPLER_STATE_POINTERS_DS::3D Command Sub Opcode */
   60598 
   60599 
   60600 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_bits  8
   60601 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_bits  8
   60602 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_bits  8
   60603 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_bits  8
   60604 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_bits  8
   60605 
   60606 static inline uint32_t ATTRIBUTE_PURE
   60607 _3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   60608 {
   60609    switch (devinfo->gen) {
   60610    case 10: return 8;
   60611    case 9: return 8;
   60612    case 8: return 8;
   60613    case 7:
   60614       if (devinfo->is_haswell) {
   60615          return 8;
   60616       } else {
   60617          return 8;
   60618       }
   60619    case 6: return 0;
   60620    case 5: return 0;
   60621    case 4:
   60622       if (devinfo->is_g4x) {
   60623          return 0;
   60624       } else {
   60625          return 0;
   60626       }
   60627    default:
   60628       unreachable("Invalid hardware generation");
   60629    }
   60630 }
   60631 
   60632 
   60633 
   60634 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_start  16
   60635 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_start  16
   60636 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_start  16
   60637 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_start  16
   60638 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_start  16
   60639 
   60640 static inline uint32_t ATTRIBUTE_PURE
   60641 _3DSTATE_SAMPLER_STATE_POINTERS_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   60642 {
   60643    switch (devinfo->gen) {
   60644    case 10: return 16;
   60645    case 9: return 16;
   60646    case 8: return 16;
   60647    case 7:
   60648       if (devinfo->is_haswell) {
   60649          return 16;
   60650       } else {
   60651          return 16;
   60652       }
   60653    case 6: return 0;
   60654    case 5: return 0;
   60655    case 4:
   60656       if (devinfo->is_g4x) {
   60657          return 0;
   60658       } else {
   60659          return 0;
   60660       }
   60661    default:
   60662       unreachable("Invalid hardware generation");
   60663    }
   60664 }
   60665 
   60666 
   60667 
   60668 /* 3DSTATE_SAMPLER_STATE_POINTERS_DS::Command SubType */
   60669 
   60670 
   60671 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_bits  2
   60672 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_bits  2
   60673 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_bits  2
   60674 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_bits  2
   60675 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_bits  2
   60676 
   60677 static inline uint32_t ATTRIBUTE_PURE
   60678 _3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   60679 {
   60680    switch (devinfo->gen) {
   60681    case 10: return 2;
   60682    case 9: return 2;
   60683    case 8: return 2;
   60684    case 7:
   60685       if (devinfo->is_haswell) {
   60686          return 2;
   60687       } else {
   60688          return 2;
   60689       }
   60690    case 6: return 0;
   60691    case 5: return 0;
   60692    case 4:
   60693       if (devinfo->is_g4x) {
   60694          return 0;
   60695       } else {
   60696          return 0;
   60697       }
   60698    default:
   60699       unreachable("Invalid hardware generation");
   60700    }
   60701 }
   60702 
   60703 
   60704 
   60705 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_start  27
   60706 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_start  27
   60707 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_start  27
   60708 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_start  27
   60709 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_start  27
   60710 
   60711 static inline uint32_t ATTRIBUTE_PURE
   60712 _3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   60713 {
   60714    switch (devinfo->gen) {
   60715    case 10: return 27;
   60716    case 9: return 27;
   60717    case 8: return 27;
   60718    case 7:
   60719       if (devinfo->is_haswell) {
   60720          return 27;
   60721       } else {
   60722          return 27;
   60723       }
   60724    case 6: return 0;
   60725    case 5: return 0;
   60726    case 4:
   60727       if (devinfo->is_g4x) {
   60728          return 0;
   60729       } else {
   60730          return 0;
   60731       }
   60732    default:
   60733       unreachable("Invalid hardware generation");
   60734    }
   60735 }
   60736 
   60737 
   60738 
   60739 /* 3DSTATE_SAMPLER_STATE_POINTERS_DS::Command Type */
   60740 
   60741 
   60742 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_bits  3
   60743 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_bits  3
   60744 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_bits  3
   60745 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_bits  3
   60746 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_bits  3
   60747 
   60748 static inline uint32_t ATTRIBUTE_PURE
   60749 _3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_bits(const struct gen_device_info *devinfo)
   60750 {
   60751    switch (devinfo->gen) {
   60752    case 10: return 3;
   60753    case 9: return 3;
   60754    case 8: return 3;
   60755    case 7:
   60756       if (devinfo->is_haswell) {
   60757          return 3;
   60758       } else {
   60759          return 3;
   60760       }
   60761    case 6: return 0;
   60762    case 5: return 0;
   60763    case 4:
   60764       if (devinfo->is_g4x) {
   60765          return 0;
   60766       } else {
   60767          return 0;
   60768       }
   60769    default:
   60770       unreachable("Invalid hardware generation");
   60771    }
   60772 }
   60773 
   60774 
   60775 
   60776 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_start  29
   60777 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_start  29
   60778 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_start  29
   60779 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_start  29
   60780 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_start  29
   60781 
   60782 static inline uint32_t ATTRIBUTE_PURE
   60783 _3DSTATE_SAMPLER_STATE_POINTERS_DS_CommandType_start(const struct gen_device_info *devinfo)
   60784 {
   60785    switch (devinfo->gen) {
   60786    case 10: return 29;
   60787    case 9: return 29;
   60788    case 8: return 29;
   60789    case 7:
   60790       if (devinfo->is_haswell) {
   60791          return 29;
   60792       } else {
   60793          return 29;
   60794       }
   60795    case 6: return 0;
   60796    case 5: return 0;
   60797    case 4:
   60798       if (devinfo->is_g4x) {
   60799          return 0;
   60800       } else {
   60801          return 0;
   60802       }
   60803    default:
   60804       unreachable("Invalid hardware generation");
   60805    }
   60806 }
   60807 
   60808 
   60809 
   60810 /* 3DSTATE_SAMPLER_STATE_POINTERS_DS::DWord Length */
   60811 
   60812 
   60813 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_bits  8
   60814 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_bits  8
   60815 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_bits  8
   60816 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_bits  8
   60817 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_bits  8
   60818 
   60819 static inline uint32_t ATTRIBUTE_PURE
   60820 _3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   60821 {
   60822    switch (devinfo->gen) {
   60823    case 10: return 8;
   60824    case 9: return 8;
   60825    case 8: return 8;
   60826    case 7:
   60827       if (devinfo->is_haswell) {
   60828          return 8;
   60829       } else {
   60830          return 8;
   60831       }
   60832    case 6: return 0;
   60833    case 5: return 0;
   60834    case 4:
   60835       if (devinfo->is_g4x) {
   60836          return 0;
   60837       } else {
   60838          return 0;
   60839       }
   60840    default:
   60841       unreachable("Invalid hardware generation");
   60842    }
   60843 }
   60844 
   60845 
   60846 
   60847 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_start  0
   60848 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_start  0
   60849 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_start  0
   60850 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_start  0
   60851 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_start  0
   60852 
   60853 static inline uint32_t ATTRIBUTE_PURE
   60854 _3DSTATE_SAMPLER_STATE_POINTERS_DS_DWordLength_start(const struct gen_device_info *devinfo)
   60855 {
   60856    switch (devinfo->gen) {
   60857    case 10: return 0;
   60858    case 9: return 0;
   60859    case 8: return 0;
   60860    case 7:
   60861       if (devinfo->is_haswell) {
   60862          return 0;
   60863       } else {
   60864          return 0;
   60865       }
   60866    case 6: return 0;
   60867    case 5: return 0;
   60868    case 4:
   60869       if (devinfo->is_g4x) {
   60870          return 0;
   60871       } else {
   60872          return 0;
   60873       }
   60874    default:
   60875       unreachable("Invalid hardware generation");
   60876    }
   60877 }
   60878 
   60879 
   60880 
   60881 /* 3DSTATE_SAMPLER_STATE_POINTERS_DS::Pointer to DS Sampler State */
   60882 
   60883 
   60884 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_bits  27
   60885 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_bits  27
   60886 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_bits  27
   60887 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_bits  27
   60888 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_bits  27
   60889 
   60890 static inline uint32_t ATTRIBUTE_PURE
   60891 _3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_bits(const struct gen_device_info *devinfo)
   60892 {
   60893    switch (devinfo->gen) {
   60894    case 10: return 27;
   60895    case 9: return 27;
   60896    case 8: return 27;
   60897    case 7:
   60898       if (devinfo->is_haswell) {
   60899          return 27;
   60900       } else {
   60901          return 27;
   60902       }
   60903    case 6: return 0;
   60904    case 5: return 0;
   60905    case 4:
   60906       if (devinfo->is_g4x) {
   60907          return 0;
   60908       } else {
   60909          return 0;
   60910       }
   60911    default:
   60912       unreachable("Invalid hardware generation");
   60913    }
   60914 }
   60915 
   60916 
   60917 
   60918 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_start  37
   60919 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_start  37
   60920 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_start  37
   60921 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_start  37
   60922 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_start  37
   60923 
   60924 static inline uint32_t ATTRIBUTE_PURE
   60925 _3DSTATE_SAMPLER_STATE_POINTERS_DS_PointertoDSSamplerState_start(const struct gen_device_info *devinfo)
   60926 {
   60927    switch (devinfo->gen) {
   60928    case 10: return 37;
   60929    case 9: return 37;
   60930    case 8: return 37;
   60931    case 7:
   60932       if (devinfo->is_haswell) {
   60933          return 37;
   60934       } else {
   60935          return 37;
   60936       }
   60937    case 6: return 0;
   60938    case 5: return 0;
   60939    case 4:
   60940       if (devinfo->is_g4x) {
   60941          return 0;
   60942       } else {
   60943          return 0;
   60944       }
   60945    default:
   60946       unreachable("Invalid hardware generation");
   60947    }
   60948 }
   60949 
   60950 
   60951 
   60952 /* 3DSTATE_SAMPLER_STATE_POINTERS_GS */
   60953 
   60954 
   60955 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_length  2
   60956 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_length  2
   60957 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_length  2
   60958 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_length  2
   60959 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_length  2
   60960 
   60961 static inline uint32_t ATTRIBUTE_PURE
   60962 _3DSTATE_SAMPLER_STATE_POINTERS_GS_length(const struct gen_device_info *devinfo)
   60963 {
   60964    switch (devinfo->gen) {
   60965    case 10: return 2;
   60966    case 9: return 2;
   60967    case 8: return 2;
   60968    case 7:
   60969       if (devinfo->is_haswell) {
   60970          return 2;
   60971       } else {
   60972          return 2;
   60973       }
   60974    case 6: return 0;
   60975    case 5: return 0;
   60976    case 4:
   60977       if (devinfo->is_g4x) {
   60978          return 0;
   60979       } else {
   60980          return 0;
   60981       }
   60982    default:
   60983       unreachable("Invalid hardware generation");
   60984    }
   60985 }
   60986 
   60987 
   60988 
   60989 /* 3DSTATE_SAMPLER_STATE_POINTERS_GS::3D Command Opcode */
   60990 
   60991 
   60992 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_bits  3
   60993 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_bits  3
   60994 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_bits  3
   60995 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_bits  3
   60996 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_bits  3
   60997 
   60998 static inline uint32_t ATTRIBUTE_PURE
   60999 _3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   61000 {
   61001    switch (devinfo->gen) {
   61002    case 10: return 3;
   61003    case 9: return 3;
   61004    case 8: return 3;
   61005    case 7:
   61006       if (devinfo->is_haswell) {
   61007          return 3;
   61008       } else {
   61009          return 3;
   61010       }
   61011    case 6: return 0;
   61012    case 5: return 0;
   61013    case 4:
   61014       if (devinfo->is_g4x) {
   61015          return 0;
   61016       } else {
   61017          return 0;
   61018       }
   61019    default:
   61020       unreachable("Invalid hardware generation");
   61021    }
   61022 }
   61023 
   61024 
   61025 
   61026 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_start  24
   61027 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_start  24
   61028 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_start  24
   61029 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_start  24
   61030 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_start  24
   61031 
   61032 static inline uint32_t ATTRIBUTE_PURE
   61033 _3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   61034 {
   61035    switch (devinfo->gen) {
   61036    case 10: return 24;
   61037    case 9: return 24;
   61038    case 8: return 24;
   61039    case 7:
   61040       if (devinfo->is_haswell) {
   61041          return 24;
   61042       } else {
   61043          return 24;
   61044       }
   61045    case 6: return 0;
   61046    case 5: return 0;
   61047    case 4:
   61048       if (devinfo->is_g4x) {
   61049          return 0;
   61050       } else {
   61051          return 0;
   61052       }
   61053    default:
   61054       unreachable("Invalid hardware generation");
   61055    }
   61056 }
   61057 
   61058 
   61059 
   61060 /* 3DSTATE_SAMPLER_STATE_POINTERS_GS::3D Command Sub Opcode */
   61061 
   61062 
   61063 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_bits  8
   61064 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_bits  8
   61065 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_bits  8
   61066 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_bits  8
   61067 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_bits  8
   61068 
   61069 static inline uint32_t ATTRIBUTE_PURE
   61070 _3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   61071 {
   61072    switch (devinfo->gen) {
   61073    case 10: return 8;
   61074    case 9: return 8;
   61075    case 8: return 8;
   61076    case 7:
   61077       if (devinfo->is_haswell) {
   61078          return 8;
   61079       } else {
   61080          return 8;
   61081       }
   61082    case 6: return 0;
   61083    case 5: return 0;
   61084    case 4:
   61085       if (devinfo->is_g4x) {
   61086          return 0;
   61087       } else {
   61088          return 0;
   61089       }
   61090    default:
   61091       unreachable("Invalid hardware generation");
   61092    }
   61093 }
   61094 
   61095 
   61096 
   61097 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_start  16
   61098 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_start  16
   61099 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_start  16
   61100 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_start  16
   61101 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_start  16
   61102 
   61103 static inline uint32_t ATTRIBUTE_PURE
   61104 _3DSTATE_SAMPLER_STATE_POINTERS_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   61105 {
   61106    switch (devinfo->gen) {
   61107    case 10: return 16;
   61108    case 9: return 16;
   61109    case 8: return 16;
   61110    case 7:
   61111       if (devinfo->is_haswell) {
   61112          return 16;
   61113       } else {
   61114          return 16;
   61115       }
   61116    case 6: return 0;
   61117    case 5: return 0;
   61118    case 4:
   61119       if (devinfo->is_g4x) {
   61120          return 0;
   61121       } else {
   61122          return 0;
   61123       }
   61124    default:
   61125       unreachable("Invalid hardware generation");
   61126    }
   61127 }
   61128 
   61129 
   61130 
   61131 /* 3DSTATE_SAMPLER_STATE_POINTERS_GS::Command SubType */
   61132 
   61133 
   61134 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_bits  2
   61135 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_bits  2
   61136 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_bits  2
   61137 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_bits  2
   61138 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_bits  2
   61139 
   61140 static inline uint32_t ATTRIBUTE_PURE
   61141 _3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   61142 {
   61143    switch (devinfo->gen) {
   61144    case 10: return 2;
   61145    case 9: return 2;
   61146    case 8: return 2;
   61147    case 7:
   61148       if (devinfo->is_haswell) {
   61149          return 2;
   61150       } else {
   61151          return 2;
   61152       }
   61153    case 6: return 0;
   61154    case 5: return 0;
   61155    case 4:
   61156       if (devinfo->is_g4x) {
   61157          return 0;
   61158       } else {
   61159          return 0;
   61160       }
   61161    default:
   61162       unreachable("Invalid hardware generation");
   61163    }
   61164 }
   61165 
   61166 
   61167 
   61168 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_start  27
   61169 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_start  27
   61170 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_start  27
   61171 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_start  27
   61172 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_start  27
   61173 
   61174 static inline uint32_t ATTRIBUTE_PURE
   61175 _3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   61176 {
   61177    switch (devinfo->gen) {
   61178    case 10: return 27;
   61179    case 9: return 27;
   61180    case 8: return 27;
   61181    case 7:
   61182       if (devinfo->is_haswell) {
   61183          return 27;
   61184       } else {
   61185          return 27;
   61186       }
   61187    case 6: return 0;
   61188    case 5: return 0;
   61189    case 4:
   61190       if (devinfo->is_g4x) {
   61191          return 0;
   61192       } else {
   61193          return 0;
   61194       }
   61195    default:
   61196       unreachable("Invalid hardware generation");
   61197    }
   61198 }
   61199 
   61200 
   61201 
   61202 /* 3DSTATE_SAMPLER_STATE_POINTERS_GS::Command Type */
   61203 
   61204 
   61205 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_bits  3
   61206 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_bits  3
   61207 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_bits  3
   61208 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_bits  3
   61209 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_bits  3
   61210 
   61211 static inline uint32_t ATTRIBUTE_PURE
   61212 _3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_bits(const struct gen_device_info *devinfo)
   61213 {
   61214    switch (devinfo->gen) {
   61215    case 10: return 3;
   61216    case 9: return 3;
   61217    case 8: return 3;
   61218    case 7:
   61219       if (devinfo->is_haswell) {
   61220          return 3;
   61221       } else {
   61222          return 3;
   61223       }
   61224    case 6: return 0;
   61225    case 5: return 0;
   61226    case 4:
   61227       if (devinfo->is_g4x) {
   61228          return 0;
   61229       } else {
   61230          return 0;
   61231       }
   61232    default:
   61233       unreachable("Invalid hardware generation");
   61234    }
   61235 }
   61236 
   61237 
   61238 
   61239 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_start  29
   61240 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_start  29
   61241 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_start  29
   61242 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_start  29
   61243 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_start  29
   61244 
   61245 static inline uint32_t ATTRIBUTE_PURE
   61246 _3DSTATE_SAMPLER_STATE_POINTERS_GS_CommandType_start(const struct gen_device_info *devinfo)
   61247 {
   61248    switch (devinfo->gen) {
   61249    case 10: return 29;
   61250    case 9: return 29;
   61251    case 8: return 29;
   61252    case 7:
   61253       if (devinfo->is_haswell) {
   61254          return 29;
   61255       } else {
   61256          return 29;
   61257       }
   61258    case 6: return 0;
   61259    case 5: return 0;
   61260    case 4:
   61261       if (devinfo->is_g4x) {
   61262          return 0;
   61263       } else {
   61264          return 0;
   61265       }
   61266    default:
   61267       unreachable("Invalid hardware generation");
   61268    }
   61269 }
   61270 
   61271 
   61272 
   61273 /* 3DSTATE_SAMPLER_STATE_POINTERS_GS::DWord Length */
   61274 
   61275 
   61276 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_bits  8
   61277 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_bits  8
   61278 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_bits  8
   61279 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_bits  8
   61280 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_bits  8
   61281 
   61282 static inline uint32_t ATTRIBUTE_PURE
   61283 _3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   61284 {
   61285    switch (devinfo->gen) {
   61286    case 10: return 8;
   61287    case 9: return 8;
   61288    case 8: return 8;
   61289    case 7:
   61290       if (devinfo->is_haswell) {
   61291          return 8;
   61292       } else {
   61293          return 8;
   61294       }
   61295    case 6: return 0;
   61296    case 5: return 0;
   61297    case 4:
   61298       if (devinfo->is_g4x) {
   61299          return 0;
   61300       } else {
   61301          return 0;
   61302       }
   61303    default:
   61304       unreachable("Invalid hardware generation");
   61305    }
   61306 }
   61307 
   61308 
   61309 
   61310 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_start  0
   61311 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_start  0
   61312 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_start  0
   61313 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_start  0
   61314 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_start  0
   61315 
   61316 static inline uint32_t ATTRIBUTE_PURE
   61317 _3DSTATE_SAMPLER_STATE_POINTERS_GS_DWordLength_start(const struct gen_device_info *devinfo)
   61318 {
   61319    switch (devinfo->gen) {
   61320    case 10: return 0;
   61321    case 9: return 0;
   61322    case 8: return 0;
   61323    case 7:
   61324       if (devinfo->is_haswell) {
   61325          return 0;
   61326       } else {
   61327          return 0;
   61328       }
   61329    case 6: return 0;
   61330    case 5: return 0;
   61331    case 4:
   61332       if (devinfo->is_g4x) {
   61333          return 0;
   61334       } else {
   61335          return 0;
   61336       }
   61337    default:
   61338       unreachable("Invalid hardware generation");
   61339    }
   61340 }
   61341 
   61342 
   61343 
   61344 /* 3DSTATE_SAMPLER_STATE_POINTERS_GS::Pointer to GS Sampler State */
   61345 
   61346 
   61347 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_bits  27
   61348 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_bits  27
   61349 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_bits  27
   61350 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_bits  27
   61351 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_bits  27
   61352 
   61353 static inline uint32_t ATTRIBUTE_PURE
   61354 _3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_bits(const struct gen_device_info *devinfo)
   61355 {
   61356    switch (devinfo->gen) {
   61357    case 10: return 27;
   61358    case 9: return 27;
   61359    case 8: return 27;
   61360    case 7:
   61361       if (devinfo->is_haswell) {
   61362          return 27;
   61363       } else {
   61364          return 27;
   61365       }
   61366    case 6: return 0;
   61367    case 5: return 0;
   61368    case 4:
   61369       if (devinfo->is_g4x) {
   61370          return 0;
   61371       } else {
   61372          return 0;
   61373       }
   61374    default:
   61375       unreachable("Invalid hardware generation");
   61376    }
   61377 }
   61378 
   61379 
   61380 
   61381 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_start  37
   61382 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_start  37
   61383 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_start  37
   61384 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_start  37
   61385 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_start  37
   61386 
   61387 static inline uint32_t ATTRIBUTE_PURE
   61388 _3DSTATE_SAMPLER_STATE_POINTERS_GS_PointertoGSSamplerState_start(const struct gen_device_info *devinfo)
   61389 {
   61390    switch (devinfo->gen) {
   61391    case 10: return 37;
   61392    case 9: return 37;
   61393    case 8: return 37;
   61394    case 7:
   61395       if (devinfo->is_haswell) {
   61396          return 37;
   61397       } else {
   61398          return 37;
   61399       }
   61400    case 6: return 0;
   61401    case 5: return 0;
   61402    case 4:
   61403       if (devinfo->is_g4x) {
   61404          return 0;
   61405       } else {
   61406          return 0;
   61407       }
   61408    default:
   61409       unreachable("Invalid hardware generation");
   61410    }
   61411 }
   61412 
   61413 
   61414 
   61415 /* 3DSTATE_SAMPLER_STATE_POINTERS_HS */
   61416 
   61417 
   61418 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_length  2
   61419 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_length  2
   61420 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_length  2
   61421 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_length  2
   61422 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_length  2
   61423 
   61424 static inline uint32_t ATTRIBUTE_PURE
   61425 _3DSTATE_SAMPLER_STATE_POINTERS_HS_length(const struct gen_device_info *devinfo)
   61426 {
   61427    switch (devinfo->gen) {
   61428    case 10: return 2;
   61429    case 9: return 2;
   61430    case 8: return 2;
   61431    case 7:
   61432       if (devinfo->is_haswell) {
   61433          return 2;
   61434       } else {
   61435          return 2;
   61436       }
   61437    case 6: return 0;
   61438    case 5: return 0;
   61439    case 4:
   61440       if (devinfo->is_g4x) {
   61441          return 0;
   61442       } else {
   61443          return 0;
   61444       }
   61445    default:
   61446       unreachable("Invalid hardware generation");
   61447    }
   61448 }
   61449 
   61450 
   61451 
   61452 /* 3DSTATE_SAMPLER_STATE_POINTERS_HS::3D Command Opcode */
   61453 
   61454 
   61455 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_bits  3
   61456 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_bits  3
   61457 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_bits  3
   61458 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_bits  3
   61459 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_bits  3
   61460 
   61461 static inline uint32_t ATTRIBUTE_PURE
   61462 _3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   61463 {
   61464    switch (devinfo->gen) {
   61465    case 10: return 3;
   61466    case 9: return 3;
   61467    case 8: return 3;
   61468    case 7:
   61469       if (devinfo->is_haswell) {
   61470          return 3;
   61471       } else {
   61472          return 3;
   61473       }
   61474    case 6: return 0;
   61475    case 5: return 0;
   61476    case 4:
   61477       if (devinfo->is_g4x) {
   61478          return 0;
   61479       } else {
   61480          return 0;
   61481       }
   61482    default:
   61483       unreachable("Invalid hardware generation");
   61484    }
   61485 }
   61486 
   61487 
   61488 
   61489 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_start  24
   61490 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_start  24
   61491 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_start  24
   61492 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_start  24
   61493 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_start  24
   61494 
   61495 static inline uint32_t ATTRIBUTE_PURE
   61496 _3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   61497 {
   61498    switch (devinfo->gen) {
   61499    case 10: return 24;
   61500    case 9: return 24;
   61501    case 8: return 24;
   61502    case 7:
   61503       if (devinfo->is_haswell) {
   61504          return 24;
   61505       } else {
   61506          return 24;
   61507       }
   61508    case 6: return 0;
   61509    case 5: return 0;
   61510    case 4:
   61511       if (devinfo->is_g4x) {
   61512          return 0;
   61513       } else {
   61514          return 0;
   61515       }
   61516    default:
   61517       unreachable("Invalid hardware generation");
   61518    }
   61519 }
   61520 
   61521 
   61522 
   61523 /* 3DSTATE_SAMPLER_STATE_POINTERS_HS::3D Command Sub Opcode */
   61524 
   61525 
   61526 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_bits  8
   61527 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_bits  8
   61528 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_bits  8
   61529 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_bits  8
   61530 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_bits  8
   61531 
   61532 static inline uint32_t ATTRIBUTE_PURE
   61533 _3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   61534 {
   61535    switch (devinfo->gen) {
   61536    case 10: return 8;
   61537    case 9: return 8;
   61538    case 8: return 8;
   61539    case 7:
   61540       if (devinfo->is_haswell) {
   61541          return 8;
   61542       } else {
   61543          return 8;
   61544       }
   61545    case 6: return 0;
   61546    case 5: return 0;
   61547    case 4:
   61548       if (devinfo->is_g4x) {
   61549          return 0;
   61550       } else {
   61551          return 0;
   61552       }
   61553    default:
   61554       unreachable("Invalid hardware generation");
   61555    }
   61556 }
   61557 
   61558 
   61559 
   61560 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_start  16
   61561 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_start  16
   61562 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_start  16
   61563 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_start  16
   61564 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_start  16
   61565 
   61566 static inline uint32_t ATTRIBUTE_PURE
   61567 _3DSTATE_SAMPLER_STATE_POINTERS_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   61568 {
   61569    switch (devinfo->gen) {
   61570    case 10: return 16;
   61571    case 9: return 16;
   61572    case 8: return 16;
   61573    case 7:
   61574       if (devinfo->is_haswell) {
   61575          return 16;
   61576       } else {
   61577          return 16;
   61578       }
   61579    case 6: return 0;
   61580    case 5: return 0;
   61581    case 4:
   61582       if (devinfo->is_g4x) {
   61583          return 0;
   61584       } else {
   61585          return 0;
   61586       }
   61587    default:
   61588       unreachable("Invalid hardware generation");
   61589    }
   61590 }
   61591 
   61592 
   61593 
   61594 /* 3DSTATE_SAMPLER_STATE_POINTERS_HS::Command SubType */
   61595 
   61596 
   61597 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_bits  2
   61598 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_bits  2
   61599 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_bits  2
   61600 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_bits  2
   61601 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_bits  2
   61602 
   61603 static inline uint32_t ATTRIBUTE_PURE
   61604 _3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   61605 {
   61606    switch (devinfo->gen) {
   61607    case 10: return 2;
   61608    case 9: return 2;
   61609    case 8: return 2;
   61610    case 7:
   61611       if (devinfo->is_haswell) {
   61612          return 2;
   61613       } else {
   61614          return 2;
   61615       }
   61616    case 6: return 0;
   61617    case 5: return 0;
   61618    case 4:
   61619       if (devinfo->is_g4x) {
   61620          return 0;
   61621       } else {
   61622          return 0;
   61623       }
   61624    default:
   61625       unreachable("Invalid hardware generation");
   61626    }
   61627 }
   61628 
   61629 
   61630 
   61631 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_start  27
   61632 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_start  27
   61633 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_start  27
   61634 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_start  27
   61635 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_start  27
   61636 
   61637 static inline uint32_t ATTRIBUTE_PURE
   61638 _3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   61639 {
   61640    switch (devinfo->gen) {
   61641    case 10: return 27;
   61642    case 9: return 27;
   61643    case 8: return 27;
   61644    case 7:
   61645       if (devinfo->is_haswell) {
   61646          return 27;
   61647       } else {
   61648          return 27;
   61649       }
   61650    case 6: return 0;
   61651    case 5: return 0;
   61652    case 4:
   61653       if (devinfo->is_g4x) {
   61654          return 0;
   61655       } else {
   61656          return 0;
   61657       }
   61658    default:
   61659       unreachable("Invalid hardware generation");
   61660    }
   61661 }
   61662 
   61663 
   61664 
   61665 /* 3DSTATE_SAMPLER_STATE_POINTERS_HS::Command Type */
   61666 
   61667 
   61668 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_bits  3
   61669 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_bits  3
   61670 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_bits  3
   61671 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_bits  3
   61672 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_bits  3
   61673 
   61674 static inline uint32_t ATTRIBUTE_PURE
   61675 _3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_bits(const struct gen_device_info *devinfo)
   61676 {
   61677    switch (devinfo->gen) {
   61678    case 10: return 3;
   61679    case 9: return 3;
   61680    case 8: return 3;
   61681    case 7:
   61682       if (devinfo->is_haswell) {
   61683          return 3;
   61684       } else {
   61685          return 3;
   61686       }
   61687    case 6: return 0;
   61688    case 5: return 0;
   61689    case 4:
   61690       if (devinfo->is_g4x) {
   61691          return 0;
   61692       } else {
   61693          return 0;
   61694       }
   61695    default:
   61696       unreachable("Invalid hardware generation");
   61697    }
   61698 }
   61699 
   61700 
   61701 
   61702 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_start  29
   61703 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_start  29
   61704 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_start  29
   61705 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_start  29
   61706 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_start  29
   61707 
   61708 static inline uint32_t ATTRIBUTE_PURE
   61709 _3DSTATE_SAMPLER_STATE_POINTERS_HS_CommandType_start(const struct gen_device_info *devinfo)
   61710 {
   61711    switch (devinfo->gen) {
   61712    case 10: return 29;
   61713    case 9: return 29;
   61714    case 8: return 29;
   61715    case 7:
   61716       if (devinfo->is_haswell) {
   61717          return 29;
   61718       } else {
   61719          return 29;
   61720       }
   61721    case 6: return 0;
   61722    case 5: return 0;
   61723    case 4:
   61724       if (devinfo->is_g4x) {
   61725          return 0;
   61726       } else {
   61727          return 0;
   61728       }
   61729    default:
   61730       unreachable("Invalid hardware generation");
   61731    }
   61732 }
   61733 
   61734 
   61735 
   61736 /* 3DSTATE_SAMPLER_STATE_POINTERS_HS::DWord Length */
   61737 
   61738 
   61739 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_bits  8
   61740 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_bits  8
   61741 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_bits  8
   61742 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_bits  8
   61743 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_bits  8
   61744 
   61745 static inline uint32_t ATTRIBUTE_PURE
   61746 _3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   61747 {
   61748    switch (devinfo->gen) {
   61749    case 10: return 8;
   61750    case 9: return 8;
   61751    case 8: return 8;
   61752    case 7:
   61753       if (devinfo->is_haswell) {
   61754          return 8;
   61755       } else {
   61756          return 8;
   61757       }
   61758    case 6: return 0;
   61759    case 5: return 0;
   61760    case 4:
   61761       if (devinfo->is_g4x) {
   61762          return 0;
   61763       } else {
   61764          return 0;
   61765       }
   61766    default:
   61767       unreachable("Invalid hardware generation");
   61768    }
   61769 }
   61770 
   61771 
   61772 
   61773 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_start  0
   61774 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_start  0
   61775 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_start  0
   61776 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_start  0
   61777 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_start  0
   61778 
   61779 static inline uint32_t ATTRIBUTE_PURE
   61780 _3DSTATE_SAMPLER_STATE_POINTERS_HS_DWordLength_start(const struct gen_device_info *devinfo)
   61781 {
   61782    switch (devinfo->gen) {
   61783    case 10: return 0;
   61784    case 9: return 0;
   61785    case 8: return 0;
   61786    case 7:
   61787       if (devinfo->is_haswell) {
   61788          return 0;
   61789       } else {
   61790          return 0;
   61791       }
   61792    case 6: return 0;
   61793    case 5: return 0;
   61794    case 4:
   61795       if (devinfo->is_g4x) {
   61796          return 0;
   61797       } else {
   61798          return 0;
   61799       }
   61800    default:
   61801       unreachable("Invalid hardware generation");
   61802    }
   61803 }
   61804 
   61805 
   61806 
   61807 /* 3DSTATE_SAMPLER_STATE_POINTERS_HS::Pointer to HS Sampler State */
   61808 
   61809 
   61810 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_bits  27
   61811 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_bits  27
   61812 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_bits  27
   61813 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_bits  27
   61814 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_bits  27
   61815 
   61816 static inline uint32_t ATTRIBUTE_PURE
   61817 _3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_bits(const struct gen_device_info *devinfo)
   61818 {
   61819    switch (devinfo->gen) {
   61820    case 10: return 27;
   61821    case 9: return 27;
   61822    case 8: return 27;
   61823    case 7:
   61824       if (devinfo->is_haswell) {
   61825          return 27;
   61826       } else {
   61827          return 27;
   61828       }
   61829    case 6: return 0;
   61830    case 5: return 0;
   61831    case 4:
   61832       if (devinfo->is_g4x) {
   61833          return 0;
   61834       } else {
   61835          return 0;
   61836       }
   61837    default:
   61838       unreachable("Invalid hardware generation");
   61839    }
   61840 }
   61841 
   61842 
   61843 
   61844 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_start  37
   61845 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_start  37
   61846 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_start  37
   61847 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_start  37
   61848 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_start  37
   61849 
   61850 static inline uint32_t ATTRIBUTE_PURE
   61851 _3DSTATE_SAMPLER_STATE_POINTERS_HS_PointertoHSSamplerState_start(const struct gen_device_info *devinfo)
   61852 {
   61853    switch (devinfo->gen) {
   61854    case 10: return 37;
   61855    case 9: return 37;
   61856    case 8: return 37;
   61857    case 7:
   61858       if (devinfo->is_haswell) {
   61859          return 37;
   61860       } else {
   61861          return 37;
   61862       }
   61863    case 6: return 0;
   61864    case 5: return 0;
   61865    case 4:
   61866       if (devinfo->is_g4x) {
   61867          return 0;
   61868       } else {
   61869          return 0;
   61870       }
   61871    default:
   61872       unreachable("Invalid hardware generation");
   61873    }
   61874 }
   61875 
   61876 
   61877 
   61878 /* 3DSTATE_SAMPLER_STATE_POINTERS_PS */
   61879 
   61880 
   61881 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_length  2
   61882 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_length  2
   61883 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_length  2
   61884 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_length  2
   61885 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_length  2
   61886 
   61887 static inline uint32_t ATTRIBUTE_PURE
   61888 _3DSTATE_SAMPLER_STATE_POINTERS_PS_length(const struct gen_device_info *devinfo)
   61889 {
   61890    switch (devinfo->gen) {
   61891    case 10: return 2;
   61892    case 9: return 2;
   61893    case 8: return 2;
   61894    case 7:
   61895       if (devinfo->is_haswell) {
   61896          return 2;
   61897       } else {
   61898          return 2;
   61899       }
   61900    case 6: return 0;
   61901    case 5: return 0;
   61902    case 4:
   61903       if (devinfo->is_g4x) {
   61904          return 0;
   61905       } else {
   61906          return 0;
   61907       }
   61908    default:
   61909       unreachable("Invalid hardware generation");
   61910    }
   61911 }
   61912 
   61913 
   61914 
   61915 /* 3DSTATE_SAMPLER_STATE_POINTERS_PS::3D Command Opcode */
   61916 
   61917 
   61918 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_bits  3
   61919 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_bits  3
   61920 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_bits  3
   61921 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_bits  3
   61922 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_bits  3
   61923 
   61924 static inline uint32_t ATTRIBUTE_PURE
   61925 _3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   61926 {
   61927    switch (devinfo->gen) {
   61928    case 10: return 3;
   61929    case 9: return 3;
   61930    case 8: return 3;
   61931    case 7:
   61932       if (devinfo->is_haswell) {
   61933          return 3;
   61934       } else {
   61935          return 3;
   61936       }
   61937    case 6: return 0;
   61938    case 5: return 0;
   61939    case 4:
   61940       if (devinfo->is_g4x) {
   61941          return 0;
   61942       } else {
   61943          return 0;
   61944       }
   61945    default:
   61946       unreachable("Invalid hardware generation");
   61947    }
   61948 }
   61949 
   61950 
   61951 
   61952 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_start  24
   61953 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_start  24
   61954 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_start  24
   61955 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_start  24
   61956 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_start  24
   61957 
   61958 static inline uint32_t ATTRIBUTE_PURE
   61959 _3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   61960 {
   61961    switch (devinfo->gen) {
   61962    case 10: return 24;
   61963    case 9: return 24;
   61964    case 8: return 24;
   61965    case 7:
   61966       if (devinfo->is_haswell) {
   61967          return 24;
   61968       } else {
   61969          return 24;
   61970       }
   61971    case 6: return 0;
   61972    case 5: return 0;
   61973    case 4:
   61974       if (devinfo->is_g4x) {
   61975          return 0;
   61976       } else {
   61977          return 0;
   61978       }
   61979    default:
   61980       unreachable("Invalid hardware generation");
   61981    }
   61982 }
   61983 
   61984 
   61985 
   61986 /* 3DSTATE_SAMPLER_STATE_POINTERS_PS::3D Command Sub Opcode */
   61987 
   61988 
   61989 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_bits  8
   61990 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_bits  8
   61991 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_bits  8
   61992 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_bits  8
   61993 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_bits  8
   61994 
   61995 static inline uint32_t ATTRIBUTE_PURE
   61996 _3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   61997 {
   61998    switch (devinfo->gen) {
   61999    case 10: return 8;
   62000    case 9: return 8;
   62001    case 8: return 8;
   62002    case 7:
   62003       if (devinfo->is_haswell) {
   62004          return 8;
   62005       } else {
   62006          return 8;
   62007       }
   62008    case 6: return 0;
   62009    case 5: return 0;
   62010    case 4:
   62011       if (devinfo->is_g4x) {
   62012          return 0;
   62013       } else {
   62014          return 0;
   62015       }
   62016    default:
   62017       unreachable("Invalid hardware generation");
   62018    }
   62019 }
   62020 
   62021 
   62022 
   62023 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_start  16
   62024 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_start  16
   62025 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_start  16
   62026 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_start  16
   62027 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_start  16
   62028 
   62029 static inline uint32_t ATTRIBUTE_PURE
   62030 _3DSTATE_SAMPLER_STATE_POINTERS_PS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   62031 {
   62032    switch (devinfo->gen) {
   62033    case 10: return 16;
   62034    case 9: return 16;
   62035    case 8: return 16;
   62036    case 7:
   62037       if (devinfo->is_haswell) {
   62038          return 16;
   62039       } else {
   62040          return 16;
   62041       }
   62042    case 6: return 0;
   62043    case 5: return 0;
   62044    case 4:
   62045       if (devinfo->is_g4x) {
   62046          return 0;
   62047       } else {
   62048          return 0;
   62049       }
   62050    default:
   62051       unreachable("Invalid hardware generation");
   62052    }
   62053 }
   62054 
   62055 
   62056 
   62057 /* 3DSTATE_SAMPLER_STATE_POINTERS_PS::Command SubType */
   62058 
   62059 
   62060 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_bits  2
   62061 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_bits  2
   62062 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_bits  2
   62063 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_bits  2
   62064 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_bits  2
   62065 
   62066 static inline uint32_t ATTRIBUTE_PURE
   62067 _3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_bits(const struct gen_device_info *devinfo)
   62068 {
   62069    switch (devinfo->gen) {
   62070    case 10: return 2;
   62071    case 9: return 2;
   62072    case 8: return 2;
   62073    case 7:
   62074       if (devinfo->is_haswell) {
   62075          return 2;
   62076       } else {
   62077          return 2;
   62078       }
   62079    case 6: return 0;
   62080    case 5: return 0;
   62081    case 4:
   62082       if (devinfo->is_g4x) {
   62083          return 0;
   62084       } else {
   62085          return 0;
   62086       }
   62087    default:
   62088       unreachable("Invalid hardware generation");
   62089    }
   62090 }
   62091 
   62092 
   62093 
   62094 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_start  27
   62095 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_start  27
   62096 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_start  27
   62097 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_start  27
   62098 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_start  27
   62099 
   62100 static inline uint32_t ATTRIBUTE_PURE
   62101 _3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandSubType_start(const struct gen_device_info *devinfo)
   62102 {
   62103    switch (devinfo->gen) {
   62104    case 10: return 27;
   62105    case 9: return 27;
   62106    case 8: return 27;
   62107    case 7:
   62108       if (devinfo->is_haswell) {
   62109          return 27;
   62110       } else {
   62111          return 27;
   62112       }
   62113    case 6: return 0;
   62114    case 5: return 0;
   62115    case 4:
   62116       if (devinfo->is_g4x) {
   62117          return 0;
   62118       } else {
   62119          return 0;
   62120       }
   62121    default:
   62122       unreachable("Invalid hardware generation");
   62123    }
   62124 }
   62125 
   62126 
   62127 
   62128 /* 3DSTATE_SAMPLER_STATE_POINTERS_PS::Command Type */
   62129 
   62130 
   62131 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_bits  3
   62132 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_bits  3
   62133 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_bits  3
   62134 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_bits  3
   62135 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_bits  3
   62136 
   62137 static inline uint32_t ATTRIBUTE_PURE
   62138 _3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_bits(const struct gen_device_info *devinfo)
   62139 {
   62140    switch (devinfo->gen) {
   62141    case 10: return 3;
   62142    case 9: return 3;
   62143    case 8: return 3;
   62144    case 7:
   62145       if (devinfo->is_haswell) {
   62146          return 3;
   62147       } else {
   62148          return 3;
   62149       }
   62150    case 6: return 0;
   62151    case 5: return 0;
   62152    case 4:
   62153       if (devinfo->is_g4x) {
   62154          return 0;
   62155       } else {
   62156          return 0;
   62157       }
   62158    default:
   62159       unreachable("Invalid hardware generation");
   62160    }
   62161 }
   62162 
   62163 
   62164 
   62165 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_start  29
   62166 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_start  29
   62167 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_start  29
   62168 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_start  29
   62169 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_start  29
   62170 
   62171 static inline uint32_t ATTRIBUTE_PURE
   62172 _3DSTATE_SAMPLER_STATE_POINTERS_PS_CommandType_start(const struct gen_device_info *devinfo)
   62173 {
   62174    switch (devinfo->gen) {
   62175    case 10: return 29;
   62176    case 9: return 29;
   62177    case 8: return 29;
   62178    case 7:
   62179       if (devinfo->is_haswell) {
   62180          return 29;
   62181       } else {
   62182          return 29;
   62183       }
   62184    case 6: return 0;
   62185    case 5: return 0;
   62186    case 4:
   62187       if (devinfo->is_g4x) {
   62188          return 0;
   62189       } else {
   62190          return 0;
   62191       }
   62192    default:
   62193       unreachable("Invalid hardware generation");
   62194    }
   62195 }
   62196 
   62197 
   62198 
   62199 /* 3DSTATE_SAMPLER_STATE_POINTERS_PS::DWord Length */
   62200 
   62201 
   62202 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_bits  8
   62203 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_bits  8
   62204 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_bits  8
   62205 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_bits  8
   62206 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_bits  8
   62207 
   62208 static inline uint32_t ATTRIBUTE_PURE
   62209 _3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_bits(const struct gen_device_info *devinfo)
   62210 {
   62211    switch (devinfo->gen) {
   62212    case 10: return 8;
   62213    case 9: return 8;
   62214    case 8: return 8;
   62215    case 7:
   62216       if (devinfo->is_haswell) {
   62217          return 8;
   62218       } else {
   62219          return 8;
   62220       }
   62221    case 6: return 0;
   62222    case 5: return 0;
   62223    case 4:
   62224       if (devinfo->is_g4x) {
   62225          return 0;
   62226       } else {
   62227          return 0;
   62228       }
   62229    default:
   62230       unreachable("Invalid hardware generation");
   62231    }
   62232 }
   62233 
   62234 
   62235 
   62236 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_start  0
   62237 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_start  0
   62238 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_start  0
   62239 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_start  0
   62240 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_start  0
   62241 
   62242 static inline uint32_t ATTRIBUTE_PURE
   62243 _3DSTATE_SAMPLER_STATE_POINTERS_PS_DWordLength_start(const struct gen_device_info *devinfo)
   62244 {
   62245    switch (devinfo->gen) {
   62246    case 10: return 0;
   62247    case 9: return 0;
   62248    case 8: return 0;
   62249    case 7:
   62250       if (devinfo->is_haswell) {
   62251          return 0;
   62252       } else {
   62253          return 0;
   62254       }
   62255    case 6: return 0;
   62256    case 5: return 0;
   62257    case 4:
   62258       if (devinfo->is_g4x) {
   62259          return 0;
   62260       } else {
   62261          return 0;
   62262       }
   62263    default:
   62264       unreachable("Invalid hardware generation");
   62265    }
   62266 }
   62267 
   62268 
   62269 
   62270 /* 3DSTATE_SAMPLER_STATE_POINTERS_PS::Pointer to PS Sampler State */
   62271 
   62272 
   62273 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_bits  27
   62274 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_bits  27
   62275 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_bits  27
   62276 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_bits  27
   62277 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_bits  27
   62278 
   62279 static inline uint32_t ATTRIBUTE_PURE
   62280 _3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_bits(const struct gen_device_info *devinfo)
   62281 {
   62282    switch (devinfo->gen) {
   62283    case 10: return 27;
   62284    case 9: return 27;
   62285    case 8: return 27;
   62286    case 7:
   62287       if (devinfo->is_haswell) {
   62288          return 27;
   62289       } else {
   62290          return 27;
   62291       }
   62292    case 6: return 0;
   62293    case 5: return 0;
   62294    case 4:
   62295       if (devinfo->is_g4x) {
   62296          return 0;
   62297       } else {
   62298          return 0;
   62299       }
   62300    default:
   62301       unreachable("Invalid hardware generation");
   62302    }
   62303 }
   62304 
   62305 
   62306 
   62307 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_start  37
   62308 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_start  37
   62309 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_start  37
   62310 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_start  37
   62311 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_start  37
   62312 
   62313 static inline uint32_t ATTRIBUTE_PURE
   62314 _3DSTATE_SAMPLER_STATE_POINTERS_PS_PointertoPSSamplerState_start(const struct gen_device_info *devinfo)
   62315 {
   62316    switch (devinfo->gen) {
   62317    case 10: return 37;
   62318    case 9: return 37;
   62319    case 8: return 37;
   62320    case 7:
   62321       if (devinfo->is_haswell) {
   62322          return 37;
   62323       } else {
   62324          return 37;
   62325       }
   62326    case 6: return 0;
   62327    case 5: return 0;
   62328    case 4:
   62329       if (devinfo->is_g4x) {
   62330          return 0;
   62331       } else {
   62332          return 0;
   62333       }
   62334    default:
   62335       unreachable("Invalid hardware generation");
   62336    }
   62337 }
   62338 
   62339 
   62340 
   62341 /* 3DSTATE_SAMPLER_STATE_POINTERS_VS */
   62342 
   62343 
   62344 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_length  2
   62345 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_length  2
   62346 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_length  2
   62347 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_length  2
   62348 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_length  2
   62349 
   62350 static inline uint32_t ATTRIBUTE_PURE
   62351 _3DSTATE_SAMPLER_STATE_POINTERS_VS_length(const struct gen_device_info *devinfo)
   62352 {
   62353    switch (devinfo->gen) {
   62354    case 10: return 2;
   62355    case 9: return 2;
   62356    case 8: return 2;
   62357    case 7:
   62358       if (devinfo->is_haswell) {
   62359          return 2;
   62360       } else {
   62361          return 2;
   62362       }
   62363    case 6: return 0;
   62364    case 5: return 0;
   62365    case 4:
   62366       if (devinfo->is_g4x) {
   62367          return 0;
   62368       } else {
   62369          return 0;
   62370       }
   62371    default:
   62372       unreachable("Invalid hardware generation");
   62373    }
   62374 }
   62375 
   62376 
   62377 
   62378 /* 3DSTATE_SAMPLER_STATE_POINTERS_VS::3D Command Opcode */
   62379 
   62380 
   62381 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_bits  3
   62382 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_bits  3
   62383 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_bits  3
   62384 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_bits  3
   62385 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_bits  3
   62386 
   62387 static inline uint32_t ATTRIBUTE_PURE
   62388 _3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   62389 {
   62390    switch (devinfo->gen) {
   62391    case 10: return 3;
   62392    case 9: return 3;
   62393    case 8: return 3;
   62394    case 7:
   62395       if (devinfo->is_haswell) {
   62396          return 3;
   62397       } else {
   62398          return 3;
   62399       }
   62400    case 6: return 0;
   62401    case 5: return 0;
   62402    case 4:
   62403       if (devinfo->is_g4x) {
   62404          return 0;
   62405       } else {
   62406          return 0;
   62407       }
   62408    default:
   62409       unreachable("Invalid hardware generation");
   62410    }
   62411 }
   62412 
   62413 
   62414 
   62415 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_start  24
   62416 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_start  24
   62417 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_start  24
   62418 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_start  24
   62419 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_start  24
   62420 
   62421 static inline uint32_t ATTRIBUTE_PURE
   62422 _3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   62423 {
   62424    switch (devinfo->gen) {
   62425    case 10: return 24;
   62426    case 9: return 24;
   62427    case 8: return 24;
   62428    case 7:
   62429       if (devinfo->is_haswell) {
   62430          return 24;
   62431       } else {
   62432          return 24;
   62433       }
   62434    case 6: return 0;
   62435    case 5: return 0;
   62436    case 4:
   62437       if (devinfo->is_g4x) {
   62438          return 0;
   62439       } else {
   62440          return 0;
   62441       }
   62442    default:
   62443       unreachable("Invalid hardware generation");
   62444    }
   62445 }
   62446 
   62447 
   62448 
   62449 /* 3DSTATE_SAMPLER_STATE_POINTERS_VS::3D Command Sub Opcode */
   62450 
   62451 
   62452 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_bits  8
   62453 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_bits  8
   62454 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_bits  8
   62455 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_bits  8
   62456 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_bits  8
   62457 
   62458 static inline uint32_t ATTRIBUTE_PURE
   62459 _3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   62460 {
   62461    switch (devinfo->gen) {
   62462    case 10: return 8;
   62463    case 9: return 8;
   62464    case 8: return 8;
   62465    case 7:
   62466       if (devinfo->is_haswell) {
   62467          return 8;
   62468       } else {
   62469          return 8;
   62470       }
   62471    case 6: return 0;
   62472    case 5: return 0;
   62473    case 4:
   62474       if (devinfo->is_g4x) {
   62475          return 0;
   62476       } else {
   62477          return 0;
   62478       }
   62479    default:
   62480       unreachable("Invalid hardware generation");
   62481    }
   62482 }
   62483 
   62484 
   62485 
   62486 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_start  16
   62487 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_start  16
   62488 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_start  16
   62489 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_start  16
   62490 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_start  16
   62491 
   62492 static inline uint32_t ATTRIBUTE_PURE
   62493 _3DSTATE_SAMPLER_STATE_POINTERS_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   62494 {
   62495    switch (devinfo->gen) {
   62496    case 10: return 16;
   62497    case 9: return 16;
   62498    case 8: return 16;
   62499    case 7:
   62500       if (devinfo->is_haswell) {
   62501          return 16;
   62502       } else {
   62503          return 16;
   62504       }
   62505    case 6: return 0;
   62506    case 5: return 0;
   62507    case 4:
   62508       if (devinfo->is_g4x) {
   62509          return 0;
   62510       } else {
   62511          return 0;
   62512       }
   62513    default:
   62514       unreachable("Invalid hardware generation");
   62515    }
   62516 }
   62517 
   62518 
   62519 
   62520 /* 3DSTATE_SAMPLER_STATE_POINTERS_VS::Command SubType */
   62521 
   62522 
   62523 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_bits  2
   62524 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_bits  2
   62525 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_bits  2
   62526 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_bits  2
   62527 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_bits  2
   62528 
   62529 static inline uint32_t ATTRIBUTE_PURE
   62530 _3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   62531 {
   62532    switch (devinfo->gen) {
   62533    case 10: return 2;
   62534    case 9: return 2;
   62535    case 8: return 2;
   62536    case 7:
   62537       if (devinfo->is_haswell) {
   62538          return 2;
   62539       } else {
   62540          return 2;
   62541       }
   62542    case 6: return 0;
   62543    case 5: return 0;
   62544    case 4:
   62545       if (devinfo->is_g4x) {
   62546          return 0;
   62547       } else {
   62548          return 0;
   62549       }
   62550    default:
   62551       unreachable("Invalid hardware generation");
   62552    }
   62553 }
   62554 
   62555 
   62556 
   62557 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_start  27
   62558 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_start  27
   62559 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_start  27
   62560 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_start  27
   62561 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_start  27
   62562 
   62563 static inline uint32_t ATTRIBUTE_PURE
   62564 _3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   62565 {
   62566    switch (devinfo->gen) {
   62567    case 10: return 27;
   62568    case 9: return 27;
   62569    case 8: return 27;
   62570    case 7:
   62571       if (devinfo->is_haswell) {
   62572          return 27;
   62573       } else {
   62574          return 27;
   62575       }
   62576    case 6: return 0;
   62577    case 5: return 0;
   62578    case 4:
   62579       if (devinfo->is_g4x) {
   62580          return 0;
   62581       } else {
   62582          return 0;
   62583       }
   62584    default:
   62585       unreachable("Invalid hardware generation");
   62586    }
   62587 }
   62588 
   62589 
   62590 
   62591 /* 3DSTATE_SAMPLER_STATE_POINTERS_VS::Command Type */
   62592 
   62593 
   62594 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_bits  3
   62595 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_bits  3
   62596 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_bits  3
   62597 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_bits  3
   62598 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_bits  3
   62599 
   62600 static inline uint32_t ATTRIBUTE_PURE
   62601 _3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_bits(const struct gen_device_info *devinfo)
   62602 {
   62603    switch (devinfo->gen) {
   62604    case 10: return 3;
   62605    case 9: return 3;
   62606    case 8: return 3;
   62607    case 7:
   62608       if (devinfo->is_haswell) {
   62609          return 3;
   62610       } else {
   62611          return 3;
   62612       }
   62613    case 6: return 0;
   62614    case 5: return 0;
   62615    case 4:
   62616       if (devinfo->is_g4x) {
   62617          return 0;
   62618       } else {
   62619          return 0;
   62620       }
   62621    default:
   62622       unreachable("Invalid hardware generation");
   62623    }
   62624 }
   62625 
   62626 
   62627 
   62628 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_start  29
   62629 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_start  29
   62630 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_start  29
   62631 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_start  29
   62632 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_start  29
   62633 
   62634 static inline uint32_t ATTRIBUTE_PURE
   62635 _3DSTATE_SAMPLER_STATE_POINTERS_VS_CommandType_start(const struct gen_device_info *devinfo)
   62636 {
   62637    switch (devinfo->gen) {
   62638    case 10: return 29;
   62639    case 9: return 29;
   62640    case 8: return 29;
   62641    case 7:
   62642       if (devinfo->is_haswell) {
   62643          return 29;
   62644       } else {
   62645          return 29;
   62646       }
   62647    case 6: return 0;
   62648    case 5: return 0;
   62649    case 4:
   62650       if (devinfo->is_g4x) {
   62651          return 0;
   62652       } else {
   62653          return 0;
   62654       }
   62655    default:
   62656       unreachable("Invalid hardware generation");
   62657    }
   62658 }
   62659 
   62660 
   62661 
   62662 /* 3DSTATE_SAMPLER_STATE_POINTERS_VS::DWord Length */
   62663 
   62664 
   62665 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_bits  8
   62666 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_bits  8
   62667 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_bits  8
   62668 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_bits  8
   62669 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_bits  8
   62670 
   62671 static inline uint32_t ATTRIBUTE_PURE
   62672 _3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   62673 {
   62674    switch (devinfo->gen) {
   62675    case 10: return 8;
   62676    case 9: return 8;
   62677    case 8: return 8;
   62678    case 7:
   62679       if (devinfo->is_haswell) {
   62680          return 8;
   62681       } else {
   62682          return 8;
   62683       }
   62684    case 6: return 0;
   62685    case 5: return 0;
   62686    case 4:
   62687       if (devinfo->is_g4x) {
   62688          return 0;
   62689       } else {
   62690          return 0;
   62691       }
   62692    default:
   62693       unreachable("Invalid hardware generation");
   62694    }
   62695 }
   62696 
   62697 
   62698 
   62699 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_start  0
   62700 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_start  0
   62701 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_start  0
   62702 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_start  0
   62703 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_start  0
   62704 
   62705 static inline uint32_t ATTRIBUTE_PURE
   62706 _3DSTATE_SAMPLER_STATE_POINTERS_VS_DWordLength_start(const struct gen_device_info *devinfo)
   62707 {
   62708    switch (devinfo->gen) {
   62709    case 10: return 0;
   62710    case 9: return 0;
   62711    case 8: return 0;
   62712    case 7:
   62713       if (devinfo->is_haswell) {
   62714          return 0;
   62715       } else {
   62716          return 0;
   62717       }
   62718    case 6: return 0;
   62719    case 5: return 0;
   62720    case 4:
   62721       if (devinfo->is_g4x) {
   62722          return 0;
   62723       } else {
   62724          return 0;
   62725       }
   62726    default:
   62727       unreachable("Invalid hardware generation");
   62728    }
   62729 }
   62730 
   62731 
   62732 
   62733 /* 3DSTATE_SAMPLER_STATE_POINTERS_VS::Pointer to VS Sampler State */
   62734 
   62735 
   62736 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_bits  27
   62737 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_bits  27
   62738 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_bits  27
   62739 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_bits  27
   62740 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_bits  27
   62741 
   62742 static inline uint32_t ATTRIBUTE_PURE
   62743 _3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_bits(const struct gen_device_info *devinfo)
   62744 {
   62745    switch (devinfo->gen) {
   62746    case 10: return 27;
   62747    case 9: return 27;
   62748    case 8: return 27;
   62749    case 7:
   62750       if (devinfo->is_haswell) {
   62751          return 27;
   62752       } else {
   62753          return 27;
   62754       }
   62755    case 6: return 0;
   62756    case 5: return 0;
   62757    case 4:
   62758       if (devinfo->is_g4x) {
   62759          return 0;
   62760       } else {
   62761          return 0;
   62762       }
   62763    default:
   62764       unreachable("Invalid hardware generation");
   62765    }
   62766 }
   62767 
   62768 
   62769 
   62770 #define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_start  37
   62771 #define GEN9_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_start  37
   62772 #define GEN8_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_start  37
   62773 #define GEN75_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_start  37
   62774 #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_start  37
   62775 
   62776 static inline uint32_t ATTRIBUTE_PURE
   62777 _3DSTATE_SAMPLER_STATE_POINTERS_VS_PointertoVSSamplerState_start(const struct gen_device_info *devinfo)
   62778 {
   62779    switch (devinfo->gen) {
   62780    case 10: return 37;
   62781    case 9: return 37;
   62782    case 8: return 37;
   62783    case 7:
   62784       if (devinfo->is_haswell) {
   62785          return 37;
   62786       } else {
   62787          return 37;
   62788       }
   62789    case 6: return 0;
   62790    case 5: return 0;
   62791    case 4:
   62792       if (devinfo->is_g4x) {
   62793          return 0;
   62794       } else {
   62795          return 0;
   62796       }
   62797    default:
   62798       unreachable("Invalid hardware generation");
   62799    }
   62800 }
   62801 
   62802 
   62803 
   62804 /* 3DSTATE_SAMPLE_MASK */
   62805 
   62806 
   62807 #define GEN10_3DSTATE_SAMPLE_MASK_length  2
   62808 #define GEN9_3DSTATE_SAMPLE_MASK_length  2
   62809 #define GEN8_3DSTATE_SAMPLE_MASK_length  2
   62810 #define GEN75_3DSTATE_SAMPLE_MASK_length  2
   62811 #define GEN7_3DSTATE_SAMPLE_MASK_length  2
   62812 #define GEN6_3DSTATE_SAMPLE_MASK_length  2
   62813 
   62814 static inline uint32_t ATTRIBUTE_PURE
   62815 _3DSTATE_SAMPLE_MASK_length(const struct gen_device_info *devinfo)
   62816 {
   62817    switch (devinfo->gen) {
   62818    case 10: return 2;
   62819    case 9: return 2;
   62820    case 8: return 2;
   62821    case 7:
   62822       if (devinfo->is_haswell) {
   62823          return 2;
   62824       } else {
   62825          return 2;
   62826       }
   62827    case 6: return 2;
   62828    case 5: return 0;
   62829    case 4:
   62830       if (devinfo->is_g4x) {
   62831          return 0;
   62832       } else {
   62833          return 0;
   62834       }
   62835    default:
   62836       unreachable("Invalid hardware generation");
   62837    }
   62838 }
   62839 
   62840 
   62841 
   62842 /* 3DSTATE_SAMPLE_MASK::3D Command Opcode */
   62843 
   62844 
   62845 #define GEN10_3DSTATE_SAMPLE_MASK_3DCommandOpcode_bits  3
   62846 #define GEN9_3DSTATE_SAMPLE_MASK_3DCommandOpcode_bits  3
   62847 #define GEN8_3DSTATE_SAMPLE_MASK_3DCommandOpcode_bits  3
   62848 #define GEN75_3DSTATE_SAMPLE_MASK_3DCommandOpcode_bits  3
   62849 #define GEN7_3DSTATE_SAMPLE_MASK_3DCommandOpcode_bits  3
   62850 #define GEN6_3DSTATE_SAMPLE_MASK_3DCommandOpcode_bits  3
   62851 
   62852 static inline uint32_t ATTRIBUTE_PURE
   62853 _3DSTATE_SAMPLE_MASK_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   62854 {
   62855    switch (devinfo->gen) {
   62856    case 10: return 3;
   62857    case 9: return 3;
   62858    case 8: return 3;
   62859    case 7:
   62860       if (devinfo->is_haswell) {
   62861          return 3;
   62862       } else {
   62863          return 3;
   62864       }
   62865    case 6: return 3;
   62866    case 5: return 0;
   62867    case 4:
   62868       if (devinfo->is_g4x) {
   62869          return 0;
   62870       } else {
   62871          return 0;
   62872       }
   62873    default:
   62874       unreachable("Invalid hardware generation");
   62875    }
   62876 }
   62877 
   62878 
   62879 
   62880 #define GEN10_3DSTATE_SAMPLE_MASK_3DCommandOpcode_start  24
   62881 #define GEN9_3DSTATE_SAMPLE_MASK_3DCommandOpcode_start  24
   62882 #define GEN8_3DSTATE_SAMPLE_MASK_3DCommandOpcode_start  24
   62883 #define GEN75_3DSTATE_SAMPLE_MASK_3DCommandOpcode_start  24
   62884 #define GEN7_3DSTATE_SAMPLE_MASK_3DCommandOpcode_start  24
   62885 #define GEN6_3DSTATE_SAMPLE_MASK_3DCommandOpcode_start  24
   62886 
   62887 static inline uint32_t ATTRIBUTE_PURE
   62888 _3DSTATE_SAMPLE_MASK_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   62889 {
   62890    switch (devinfo->gen) {
   62891    case 10: return 24;
   62892    case 9: return 24;
   62893    case 8: return 24;
   62894    case 7:
   62895       if (devinfo->is_haswell) {
   62896          return 24;
   62897       } else {
   62898          return 24;
   62899       }
   62900    case 6: return 24;
   62901    case 5: return 0;
   62902    case 4:
   62903       if (devinfo->is_g4x) {
   62904          return 0;
   62905       } else {
   62906          return 0;
   62907       }
   62908    default:
   62909       unreachable("Invalid hardware generation");
   62910    }
   62911 }
   62912 
   62913 
   62914 
   62915 /* 3DSTATE_SAMPLE_MASK::3D Command Sub Opcode */
   62916 
   62917 
   62918 #define GEN10_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_bits  8
   62919 #define GEN9_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_bits  8
   62920 #define GEN8_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_bits  8
   62921 #define GEN75_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_bits  8
   62922 #define GEN7_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_bits  8
   62923 #define GEN6_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_bits  8
   62924 
   62925 static inline uint32_t ATTRIBUTE_PURE
   62926 _3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   62927 {
   62928    switch (devinfo->gen) {
   62929    case 10: return 8;
   62930    case 9: return 8;
   62931    case 8: return 8;
   62932    case 7:
   62933       if (devinfo->is_haswell) {
   62934          return 8;
   62935       } else {
   62936          return 8;
   62937       }
   62938    case 6: return 8;
   62939    case 5: return 0;
   62940    case 4:
   62941       if (devinfo->is_g4x) {
   62942          return 0;
   62943       } else {
   62944          return 0;
   62945       }
   62946    default:
   62947       unreachable("Invalid hardware generation");
   62948    }
   62949 }
   62950 
   62951 
   62952 
   62953 #define GEN10_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_start  16
   62954 #define GEN9_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_start  16
   62955 #define GEN8_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_start  16
   62956 #define GEN75_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_start  16
   62957 #define GEN7_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_start  16
   62958 #define GEN6_3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_start  16
   62959 
   62960 static inline uint32_t ATTRIBUTE_PURE
   62961 _3DSTATE_SAMPLE_MASK_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   62962 {
   62963    switch (devinfo->gen) {
   62964    case 10: return 16;
   62965    case 9: return 16;
   62966    case 8: return 16;
   62967    case 7:
   62968       if (devinfo->is_haswell) {
   62969          return 16;
   62970       } else {
   62971          return 16;
   62972       }
   62973    case 6: return 16;
   62974    case 5: return 0;
   62975    case 4:
   62976       if (devinfo->is_g4x) {
   62977          return 0;
   62978       } else {
   62979          return 0;
   62980       }
   62981    default:
   62982       unreachable("Invalid hardware generation");
   62983    }
   62984 }
   62985 
   62986 
   62987 
   62988 /* 3DSTATE_SAMPLE_MASK::Command SubType */
   62989 
   62990 
   62991 #define GEN10_3DSTATE_SAMPLE_MASK_CommandSubType_bits  2
   62992 #define GEN9_3DSTATE_SAMPLE_MASK_CommandSubType_bits  2
   62993 #define GEN8_3DSTATE_SAMPLE_MASK_CommandSubType_bits  2
   62994 #define GEN75_3DSTATE_SAMPLE_MASK_CommandSubType_bits  2
   62995 #define GEN7_3DSTATE_SAMPLE_MASK_CommandSubType_bits  2
   62996 #define GEN6_3DSTATE_SAMPLE_MASK_CommandSubType_bits  2
   62997 
   62998 static inline uint32_t ATTRIBUTE_PURE
   62999 _3DSTATE_SAMPLE_MASK_CommandSubType_bits(const struct gen_device_info *devinfo)
   63000 {
   63001    switch (devinfo->gen) {
   63002    case 10: return 2;
   63003    case 9: return 2;
   63004    case 8: return 2;
   63005    case 7:
   63006       if (devinfo->is_haswell) {
   63007          return 2;
   63008       } else {
   63009          return 2;
   63010       }
   63011    case 6: return 2;
   63012    case 5: return 0;
   63013    case 4:
   63014       if (devinfo->is_g4x) {
   63015          return 0;
   63016       } else {
   63017          return 0;
   63018       }
   63019    default:
   63020       unreachable("Invalid hardware generation");
   63021    }
   63022 }
   63023 
   63024 
   63025 
   63026 #define GEN10_3DSTATE_SAMPLE_MASK_CommandSubType_start  27
   63027 #define GEN9_3DSTATE_SAMPLE_MASK_CommandSubType_start  27
   63028 #define GEN8_3DSTATE_SAMPLE_MASK_CommandSubType_start  27
   63029 #define GEN75_3DSTATE_SAMPLE_MASK_CommandSubType_start  27
   63030 #define GEN7_3DSTATE_SAMPLE_MASK_CommandSubType_start  27
   63031 #define GEN6_3DSTATE_SAMPLE_MASK_CommandSubType_start  27
   63032 
   63033 static inline uint32_t ATTRIBUTE_PURE
   63034 _3DSTATE_SAMPLE_MASK_CommandSubType_start(const struct gen_device_info *devinfo)
   63035 {
   63036    switch (devinfo->gen) {
   63037    case 10: return 27;
   63038    case 9: return 27;
   63039    case 8: return 27;
   63040    case 7:
   63041       if (devinfo->is_haswell) {
   63042          return 27;
   63043       } else {
   63044          return 27;
   63045       }
   63046    case 6: return 27;
   63047    case 5: return 0;
   63048    case 4:
   63049       if (devinfo->is_g4x) {
   63050          return 0;
   63051       } else {
   63052          return 0;
   63053       }
   63054    default:
   63055       unreachable("Invalid hardware generation");
   63056    }
   63057 }
   63058 
   63059 
   63060 
   63061 /* 3DSTATE_SAMPLE_MASK::Command Type */
   63062 
   63063 
   63064 #define GEN10_3DSTATE_SAMPLE_MASK_CommandType_bits  3
   63065 #define GEN9_3DSTATE_SAMPLE_MASK_CommandType_bits  3
   63066 #define GEN8_3DSTATE_SAMPLE_MASK_CommandType_bits  3
   63067 #define GEN75_3DSTATE_SAMPLE_MASK_CommandType_bits  3
   63068 #define GEN7_3DSTATE_SAMPLE_MASK_CommandType_bits  3
   63069 #define GEN6_3DSTATE_SAMPLE_MASK_CommandType_bits  3
   63070 
   63071 static inline uint32_t ATTRIBUTE_PURE
   63072 _3DSTATE_SAMPLE_MASK_CommandType_bits(const struct gen_device_info *devinfo)
   63073 {
   63074    switch (devinfo->gen) {
   63075    case 10: return 3;
   63076    case 9: return 3;
   63077    case 8: return 3;
   63078    case 7:
   63079       if (devinfo->is_haswell) {
   63080          return 3;
   63081       } else {
   63082          return 3;
   63083       }
   63084    case 6: return 3;
   63085    case 5: return 0;
   63086    case 4:
   63087       if (devinfo->is_g4x) {
   63088          return 0;
   63089       } else {
   63090          return 0;
   63091       }
   63092    default:
   63093       unreachable("Invalid hardware generation");
   63094    }
   63095 }
   63096 
   63097 
   63098 
   63099 #define GEN10_3DSTATE_SAMPLE_MASK_CommandType_start  29
   63100 #define GEN9_3DSTATE_SAMPLE_MASK_CommandType_start  29
   63101 #define GEN8_3DSTATE_SAMPLE_MASK_CommandType_start  29
   63102 #define GEN75_3DSTATE_SAMPLE_MASK_CommandType_start  29
   63103 #define GEN7_3DSTATE_SAMPLE_MASK_CommandType_start  29
   63104 #define GEN6_3DSTATE_SAMPLE_MASK_CommandType_start  29
   63105 
   63106 static inline uint32_t ATTRIBUTE_PURE
   63107 _3DSTATE_SAMPLE_MASK_CommandType_start(const struct gen_device_info *devinfo)
   63108 {
   63109    switch (devinfo->gen) {
   63110    case 10: return 29;
   63111    case 9: return 29;
   63112    case 8: return 29;
   63113    case 7:
   63114       if (devinfo->is_haswell) {
   63115          return 29;
   63116       } else {
   63117          return 29;
   63118       }
   63119    case 6: return 29;
   63120    case 5: return 0;
   63121    case 4:
   63122       if (devinfo->is_g4x) {
   63123          return 0;
   63124       } else {
   63125          return 0;
   63126       }
   63127    default:
   63128       unreachable("Invalid hardware generation");
   63129    }
   63130 }
   63131 
   63132 
   63133 
   63134 /* 3DSTATE_SAMPLE_MASK::DWord Length */
   63135 
   63136 
   63137 #define GEN10_3DSTATE_SAMPLE_MASK_DWordLength_bits  8
   63138 #define GEN9_3DSTATE_SAMPLE_MASK_DWordLength_bits  8
   63139 #define GEN8_3DSTATE_SAMPLE_MASK_DWordLength_bits  8
   63140 #define GEN75_3DSTATE_SAMPLE_MASK_DWordLength_bits  8
   63141 #define GEN7_3DSTATE_SAMPLE_MASK_DWordLength_bits  8
   63142 #define GEN6_3DSTATE_SAMPLE_MASK_DWordLength_bits  8
   63143 
   63144 static inline uint32_t ATTRIBUTE_PURE
   63145 _3DSTATE_SAMPLE_MASK_DWordLength_bits(const struct gen_device_info *devinfo)
   63146 {
   63147    switch (devinfo->gen) {
   63148    case 10: return 8;
   63149    case 9: return 8;
   63150    case 8: return 8;
   63151    case 7:
   63152       if (devinfo->is_haswell) {
   63153          return 8;
   63154       } else {
   63155          return 8;
   63156       }
   63157    case 6: return 8;
   63158    case 5: return 0;
   63159    case 4:
   63160       if (devinfo->is_g4x) {
   63161          return 0;
   63162       } else {
   63163          return 0;
   63164       }
   63165    default:
   63166       unreachable("Invalid hardware generation");
   63167    }
   63168 }
   63169 
   63170 
   63171 
   63172 #define GEN10_3DSTATE_SAMPLE_MASK_DWordLength_start  0
   63173 #define GEN9_3DSTATE_SAMPLE_MASK_DWordLength_start  0
   63174 #define GEN8_3DSTATE_SAMPLE_MASK_DWordLength_start  0
   63175 #define GEN75_3DSTATE_SAMPLE_MASK_DWordLength_start  0
   63176 #define GEN7_3DSTATE_SAMPLE_MASK_DWordLength_start  0
   63177 #define GEN6_3DSTATE_SAMPLE_MASK_DWordLength_start  0
   63178 
   63179 static inline uint32_t ATTRIBUTE_PURE
   63180 _3DSTATE_SAMPLE_MASK_DWordLength_start(const struct gen_device_info *devinfo)
   63181 {
   63182    switch (devinfo->gen) {
   63183    case 10: return 0;
   63184    case 9: return 0;
   63185    case 8: return 0;
   63186    case 7:
   63187       if (devinfo->is_haswell) {
   63188          return 0;
   63189       } else {
   63190          return 0;
   63191       }
   63192    case 6: return 0;
   63193    case 5: return 0;
   63194    case 4:
   63195       if (devinfo->is_g4x) {
   63196          return 0;
   63197       } else {
   63198          return 0;
   63199       }
   63200    default:
   63201       unreachable("Invalid hardware generation");
   63202    }
   63203 }
   63204 
   63205 
   63206 
   63207 /* 3DSTATE_SAMPLE_MASK::Sample Mask */
   63208 
   63209 
   63210 #define GEN10_3DSTATE_SAMPLE_MASK_SampleMask_bits  16
   63211 #define GEN9_3DSTATE_SAMPLE_MASK_SampleMask_bits  16
   63212 #define GEN8_3DSTATE_SAMPLE_MASK_SampleMask_bits  16
   63213 #define GEN75_3DSTATE_SAMPLE_MASK_SampleMask_bits  8
   63214 #define GEN7_3DSTATE_SAMPLE_MASK_SampleMask_bits  8
   63215 #define GEN6_3DSTATE_SAMPLE_MASK_SampleMask_bits  4
   63216 
   63217 static inline uint32_t ATTRIBUTE_PURE
   63218 _3DSTATE_SAMPLE_MASK_SampleMask_bits(const struct gen_device_info *devinfo)
   63219 {
   63220    switch (devinfo->gen) {
   63221    case 10: return 16;
   63222    case 9: return 16;
   63223    case 8: return 16;
   63224    case 7:
   63225       if (devinfo->is_haswell) {
   63226          return 8;
   63227       } else {
   63228          return 8;
   63229       }
   63230    case 6: return 4;
   63231    case 5: return 0;
   63232    case 4:
   63233       if (devinfo->is_g4x) {
   63234          return 0;
   63235       } else {
   63236          return 0;
   63237       }
   63238    default:
   63239       unreachable("Invalid hardware generation");
   63240    }
   63241 }
   63242 
   63243 
   63244 
   63245 #define GEN10_3DSTATE_SAMPLE_MASK_SampleMask_start  32
   63246 #define GEN9_3DSTATE_SAMPLE_MASK_SampleMask_start  32
   63247 #define GEN8_3DSTATE_SAMPLE_MASK_SampleMask_start  32
   63248 #define GEN75_3DSTATE_SAMPLE_MASK_SampleMask_start  32
   63249 #define GEN7_3DSTATE_SAMPLE_MASK_SampleMask_start  32
   63250 #define GEN6_3DSTATE_SAMPLE_MASK_SampleMask_start  32
   63251 
   63252 static inline uint32_t ATTRIBUTE_PURE
   63253 _3DSTATE_SAMPLE_MASK_SampleMask_start(const struct gen_device_info *devinfo)
   63254 {
   63255    switch (devinfo->gen) {
   63256    case 10: return 32;
   63257    case 9: return 32;
   63258    case 8: return 32;
   63259    case 7:
   63260       if (devinfo->is_haswell) {
   63261          return 32;
   63262       } else {
   63263          return 32;
   63264       }
   63265    case 6: return 32;
   63266    case 5: return 0;
   63267    case 4:
   63268       if (devinfo->is_g4x) {
   63269          return 0;
   63270       } else {
   63271          return 0;
   63272       }
   63273    default:
   63274       unreachable("Invalid hardware generation");
   63275    }
   63276 }
   63277 
   63278 
   63279 
   63280 /* 3DSTATE_SAMPLE_PATTERN */
   63281 
   63282 
   63283 #define GEN10_3DSTATE_SAMPLE_PATTERN_length  9
   63284 #define GEN9_3DSTATE_SAMPLE_PATTERN_length  9
   63285 #define GEN8_3DSTATE_SAMPLE_PATTERN_length  9
   63286 
   63287 static inline uint32_t ATTRIBUTE_PURE
   63288 _3DSTATE_SAMPLE_PATTERN_length(const struct gen_device_info *devinfo)
   63289 {
   63290    switch (devinfo->gen) {
   63291    case 10: return 9;
   63292    case 9: return 9;
   63293    case 8: return 9;
   63294    case 7:
   63295       if (devinfo->is_haswell) {
   63296          return 0;
   63297       } else {
   63298          return 0;
   63299       }
   63300    case 6: return 0;
   63301    case 5: return 0;
   63302    case 4:
   63303       if (devinfo->is_g4x) {
   63304          return 0;
   63305       } else {
   63306          return 0;
   63307       }
   63308    default:
   63309       unreachable("Invalid hardware generation");
   63310    }
   63311 }
   63312 
   63313 
   63314 
   63315 /* 3DSTATE_SAMPLE_PATTERN::16x Sample0 X Offset */
   63316 
   63317 
   63318 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample0XOffset_bits  4
   63319 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample0XOffset_bits  4
   63320 
   63321 static inline uint32_t ATTRIBUTE_PURE
   63322 _3DSTATE_SAMPLE_PATTERN_16xSample0XOffset_bits(const struct gen_device_info *devinfo)
   63323 {
   63324    switch (devinfo->gen) {
   63325    case 10: return 4;
   63326    case 9: return 4;
   63327    case 8: return 0;
   63328    case 7:
   63329       if (devinfo->is_haswell) {
   63330          return 0;
   63331       } else {
   63332          return 0;
   63333       }
   63334    case 6: return 0;
   63335    case 5: return 0;
   63336    case 4:
   63337       if (devinfo->is_g4x) {
   63338          return 0;
   63339       } else {
   63340          return 0;
   63341       }
   63342    default:
   63343       unreachable("Invalid hardware generation");
   63344    }
   63345 }
   63346 
   63347 
   63348 
   63349 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample0XOffset_start  36
   63350 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample0XOffset_start  36
   63351 
   63352 static inline uint32_t ATTRIBUTE_PURE
   63353 _3DSTATE_SAMPLE_PATTERN_16xSample0XOffset_start(const struct gen_device_info *devinfo)
   63354 {
   63355    switch (devinfo->gen) {
   63356    case 10: return 36;
   63357    case 9: return 36;
   63358    case 8: return 0;
   63359    case 7:
   63360       if (devinfo->is_haswell) {
   63361          return 0;
   63362       } else {
   63363          return 0;
   63364       }
   63365    case 6: return 0;
   63366    case 5: return 0;
   63367    case 4:
   63368       if (devinfo->is_g4x) {
   63369          return 0;
   63370       } else {
   63371          return 0;
   63372       }
   63373    default:
   63374       unreachable("Invalid hardware generation");
   63375    }
   63376 }
   63377 
   63378 
   63379 
   63380 /* 3DSTATE_SAMPLE_PATTERN::16x Sample0 Y Offset */
   63381 
   63382 
   63383 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample0YOffset_bits  4
   63384 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample0YOffset_bits  4
   63385 
   63386 static inline uint32_t ATTRIBUTE_PURE
   63387 _3DSTATE_SAMPLE_PATTERN_16xSample0YOffset_bits(const struct gen_device_info *devinfo)
   63388 {
   63389    switch (devinfo->gen) {
   63390    case 10: return 4;
   63391    case 9: return 4;
   63392    case 8: return 0;
   63393    case 7:
   63394       if (devinfo->is_haswell) {
   63395          return 0;
   63396       } else {
   63397          return 0;
   63398       }
   63399    case 6: return 0;
   63400    case 5: return 0;
   63401    case 4:
   63402       if (devinfo->is_g4x) {
   63403          return 0;
   63404       } else {
   63405          return 0;
   63406       }
   63407    default:
   63408       unreachable("Invalid hardware generation");
   63409    }
   63410 }
   63411 
   63412 
   63413 
   63414 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample0YOffset_start  32
   63415 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample0YOffset_start  32
   63416 
   63417 static inline uint32_t ATTRIBUTE_PURE
   63418 _3DSTATE_SAMPLE_PATTERN_16xSample0YOffset_start(const struct gen_device_info *devinfo)
   63419 {
   63420    switch (devinfo->gen) {
   63421    case 10: return 32;
   63422    case 9: return 32;
   63423    case 8: return 0;
   63424    case 7:
   63425       if (devinfo->is_haswell) {
   63426          return 0;
   63427       } else {
   63428          return 0;
   63429       }
   63430    case 6: return 0;
   63431    case 5: return 0;
   63432    case 4:
   63433       if (devinfo->is_g4x) {
   63434          return 0;
   63435       } else {
   63436          return 0;
   63437       }
   63438    default:
   63439       unreachable("Invalid hardware generation");
   63440    }
   63441 }
   63442 
   63443 
   63444 
   63445 /* 3DSTATE_SAMPLE_PATTERN::16x Sample1 X Offset */
   63446 
   63447 
   63448 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample1XOffset_bits  4
   63449 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample1XOffset_bits  4
   63450 
   63451 static inline uint32_t ATTRIBUTE_PURE
   63452 _3DSTATE_SAMPLE_PATTERN_16xSample1XOffset_bits(const struct gen_device_info *devinfo)
   63453 {
   63454    switch (devinfo->gen) {
   63455    case 10: return 4;
   63456    case 9: return 4;
   63457    case 8: return 0;
   63458    case 7:
   63459       if (devinfo->is_haswell) {
   63460          return 0;
   63461       } else {
   63462          return 0;
   63463       }
   63464    case 6: return 0;
   63465    case 5: return 0;
   63466    case 4:
   63467       if (devinfo->is_g4x) {
   63468          return 0;
   63469       } else {
   63470          return 0;
   63471       }
   63472    default:
   63473       unreachable("Invalid hardware generation");
   63474    }
   63475 }
   63476 
   63477 
   63478 
   63479 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample1XOffset_start  44
   63480 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample1XOffset_start  44
   63481 
   63482 static inline uint32_t ATTRIBUTE_PURE
   63483 _3DSTATE_SAMPLE_PATTERN_16xSample1XOffset_start(const struct gen_device_info *devinfo)
   63484 {
   63485    switch (devinfo->gen) {
   63486    case 10: return 44;
   63487    case 9: return 44;
   63488    case 8: return 0;
   63489    case 7:
   63490       if (devinfo->is_haswell) {
   63491          return 0;
   63492       } else {
   63493          return 0;
   63494       }
   63495    case 6: return 0;
   63496    case 5: return 0;
   63497    case 4:
   63498       if (devinfo->is_g4x) {
   63499          return 0;
   63500       } else {
   63501          return 0;
   63502       }
   63503    default:
   63504       unreachable("Invalid hardware generation");
   63505    }
   63506 }
   63507 
   63508 
   63509 
   63510 /* 3DSTATE_SAMPLE_PATTERN::16x Sample1 Y Offset */
   63511 
   63512 
   63513 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample1YOffset_bits  4
   63514 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample1YOffset_bits  4
   63515 
   63516 static inline uint32_t ATTRIBUTE_PURE
   63517 _3DSTATE_SAMPLE_PATTERN_16xSample1YOffset_bits(const struct gen_device_info *devinfo)
   63518 {
   63519    switch (devinfo->gen) {
   63520    case 10: return 4;
   63521    case 9: return 4;
   63522    case 8: return 0;
   63523    case 7:
   63524       if (devinfo->is_haswell) {
   63525          return 0;
   63526       } else {
   63527          return 0;
   63528       }
   63529    case 6: return 0;
   63530    case 5: return 0;
   63531    case 4:
   63532       if (devinfo->is_g4x) {
   63533          return 0;
   63534       } else {
   63535          return 0;
   63536       }
   63537    default:
   63538       unreachable("Invalid hardware generation");
   63539    }
   63540 }
   63541 
   63542 
   63543 
   63544 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample1YOffset_start  40
   63545 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample1YOffset_start  40
   63546 
   63547 static inline uint32_t ATTRIBUTE_PURE
   63548 _3DSTATE_SAMPLE_PATTERN_16xSample1YOffset_start(const struct gen_device_info *devinfo)
   63549 {
   63550    switch (devinfo->gen) {
   63551    case 10: return 40;
   63552    case 9: return 40;
   63553    case 8: return 0;
   63554    case 7:
   63555       if (devinfo->is_haswell) {
   63556          return 0;
   63557       } else {
   63558          return 0;
   63559       }
   63560    case 6: return 0;
   63561    case 5: return 0;
   63562    case 4:
   63563       if (devinfo->is_g4x) {
   63564          return 0;
   63565       } else {
   63566          return 0;
   63567       }
   63568    default:
   63569       unreachable("Invalid hardware generation");
   63570    }
   63571 }
   63572 
   63573 
   63574 
   63575 /* 3DSTATE_SAMPLE_PATTERN::16x Sample10 X Offset */
   63576 
   63577 
   63578 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample10XOffset_bits  4
   63579 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample10XOffset_bits  4
   63580 
   63581 static inline uint32_t ATTRIBUTE_PURE
   63582 _3DSTATE_SAMPLE_PATTERN_16xSample10XOffset_bits(const struct gen_device_info *devinfo)
   63583 {
   63584    switch (devinfo->gen) {
   63585    case 10: return 4;
   63586    case 9: return 4;
   63587    case 8: return 0;
   63588    case 7:
   63589       if (devinfo->is_haswell) {
   63590          return 0;
   63591       } else {
   63592          return 0;
   63593       }
   63594    case 6: return 0;
   63595    case 5: return 0;
   63596    case 4:
   63597       if (devinfo->is_g4x) {
   63598          return 0;
   63599       } else {
   63600          return 0;
   63601       }
   63602    default:
   63603       unreachable("Invalid hardware generation");
   63604    }
   63605 }
   63606 
   63607 
   63608 
   63609 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample10XOffset_start  116
   63610 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample10XOffset_start  116
   63611 
   63612 static inline uint32_t ATTRIBUTE_PURE
   63613 _3DSTATE_SAMPLE_PATTERN_16xSample10XOffset_start(const struct gen_device_info *devinfo)
   63614 {
   63615    switch (devinfo->gen) {
   63616    case 10: return 116;
   63617    case 9: return 116;
   63618    case 8: return 0;
   63619    case 7:
   63620       if (devinfo->is_haswell) {
   63621          return 0;
   63622       } else {
   63623          return 0;
   63624       }
   63625    case 6: return 0;
   63626    case 5: return 0;
   63627    case 4:
   63628       if (devinfo->is_g4x) {
   63629          return 0;
   63630       } else {
   63631          return 0;
   63632       }
   63633    default:
   63634       unreachable("Invalid hardware generation");
   63635    }
   63636 }
   63637 
   63638 
   63639 
   63640 /* 3DSTATE_SAMPLE_PATTERN::16x Sample10 Y Offset */
   63641 
   63642 
   63643 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample10YOffset_bits  4
   63644 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample10YOffset_bits  4
   63645 
   63646 static inline uint32_t ATTRIBUTE_PURE
   63647 _3DSTATE_SAMPLE_PATTERN_16xSample10YOffset_bits(const struct gen_device_info *devinfo)
   63648 {
   63649    switch (devinfo->gen) {
   63650    case 10: return 4;
   63651    case 9: return 4;
   63652    case 8: return 0;
   63653    case 7:
   63654       if (devinfo->is_haswell) {
   63655          return 0;
   63656       } else {
   63657          return 0;
   63658       }
   63659    case 6: return 0;
   63660    case 5: return 0;
   63661    case 4:
   63662       if (devinfo->is_g4x) {
   63663          return 0;
   63664       } else {
   63665          return 0;
   63666       }
   63667    default:
   63668       unreachable("Invalid hardware generation");
   63669    }
   63670 }
   63671 
   63672 
   63673 
   63674 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample10YOffset_start  112
   63675 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample10YOffset_start  112
   63676 
   63677 static inline uint32_t ATTRIBUTE_PURE
   63678 _3DSTATE_SAMPLE_PATTERN_16xSample10YOffset_start(const struct gen_device_info *devinfo)
   63679 {
   63680    switch (devinfo->gen) {
   63681    case 10: return 112;
   63682    case 9: return 112;
   63683    case 8: return 0;
   63684    case 7:
   63685       if (devinfo->is_haswell) {
   63686          return 0;
   63687       } else {
   63688          return 0;
   63689       }
   63690    case 6: return 0;
   63691    case 5: return 0;
   63692    case 4:
   63693       if (devinfo->is_g4x) {
   63694          return 0;
   63695       } else {
   63696          return 0;
   63697       }
   63698    default:
   63699       unreachable("Invalid hardware generation");
   63700    }
   63701 }
   63702 
   63703 
   63704 
   63705 /* 3DSTATE_SAMPLE_PATTERN::16x Sample11 X Offset */
   63706 
   63707 
   63708 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample11XOffset_bits  4
   63709 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample11XOffset_bits  4
   63710 
   63711 static inline uint32_t ATTRIBUTE_PURE
   63712 _3DSTATE_SAMPLE_PATTERN_16xSample11XOffset_bits(const struct gen_device_info *devinfo)
   63713 {
   63714    switch (devinfo->gen) {
   63715    case 10: return 4;
   63716    case 9: return 4;
   63717    case 8: return 0;
   63718    case 7:
   63719       if (devinfo->is_haswell) {
   63720          return 0;
   63721       } else {
   63722          return 0;
   63723       }
   63724    case 6: return 0;
   63725    case 5: return 0;
   63726    case 4:
   63727       if (devinfo->is_g4x) {
   63728          return 0;
   63729       } else {
   63730          return 0;
   63731       }
   63732    default:
   63733       unreachable("Invalid hardware generation");
   63734    }
   63735 }
   63736 
   63737 
   63738 
   63739 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample11XOffset_start  124
   63740 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample11XOffset_start  124
   63741 
   63742 static inline uint32_t ATTRIBUTE_PURE
   63743 _3DSTATE_SAMPLE_PATTERN_16xSample11XOffset_start(const struct gen_device_info *devinfo)
   63744 {
   63745    switch (devinfo->gen) {
   63746    case 10: return 124;
   63747    case 9: return 124;
   63748    case 8: return 0;
   63749    case 7:
   63750       if (devinfo->is_haswell) {
   63751          return 0;
   63752       } else {
   63753          return 0;
   63754       }
   63755    case 6: return 0;
   63756    case 5: return 0;
   63757    case 4:
   63758       if (devinfo->is_g4x) {
   63759          return 0;
   63760       } else {
   63761          return 0;
   63762       }
   63763    default:
   63764       unreachable("Invalid hardware generation");
   63765    }
   63766 }
   63767 
   63768 
   63769 
   63770 /* 3DSTATE_SAMPLE_PATTERN::16x Sample11 Y Offset */
   63771 
   63772 
   63773 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample11YOffset_bits  4
   63774 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample11YOffset_bits  4
   63775 
   63776 static inline uint32_t ATTRIBUTE_PURE
   63777 _3DSTATE_SAMPLE_PATTERN_16xSample11YOffset_bits(const struct gen_device_info *devinfo)
   63778 {
   63779    switch (devinfo->gen) {
   63780    case 10: return 4;
   63781    case 9: return 4;
   63782    case 8: return 0;
   63783    case 7:
   63784       if (devinfo->is_haswell) {
   63785          return 0;
   63786       } else {
   63787          return 0;
   63788       }
   63789    case 6: return 0;
   63790    case 5: return 0;
   63791    case 4:
   63792       if (devinfo->is_g4x) {
   63793          return 0;
   63794       } else {
   63795          return 0;
   63796       }
   63797    default:
   63798       unreachable("Invalid hardware generation");
   63799    }
   63800 }
   63801 
   63802 
   63803 
   63804 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample11YOffset_start  120
   63805 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample11YOffset_start  120
   63806 
   63807 static inline uint32_t ATTRIBUTE_PURE
   63808 _3DSTATE_SAMPLE_PATTERN_16xSample11YOffset_start(const struct gen_device_info *devinfo)
   63809 {
   63810    switch (devinfo->gen) {
   63811    case 10: return 120;
   63812    case 9: return 120;
   63813    case 8: return 0;
   63814    case 7:
   63815       if (devinfo->is_haswell) {
   63816          return 0;
   63817       } else {
   63818          return 0;
   63819       }
   63820    case 6: return 0;
   63821    case 5: return 0;
   63822    case 4:
   63823       if (devinfo->is_g4x) {
   63824          return 0;
   63825       } else {
   63826          return 0;
   63827       }
   63828    default:
   63829       unreachable("Invalid hardware generation");
   63830    }
   63831 }
   63832 
   63833 
   63834 
   63835 /* 3DSTATE_SAMPLE_PATTERN::16x Sample12 X Offset */
   63836 
   63837 
   63838 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample12XOffset_bits  4
   63839 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample12XOffset_bits  4
   63840 
   63841 static inline uint32_t ATTRIBUTE_PURE
   63842 _3DSTATE_SAMPLE_PATTERN_16xSample12XOffset_bits(const struct gen_device_info *devinfo)
   63843 {
   63844    switch (devinfo->gen) {
   63845    case 10: return 4;
   63846    case 9: return 4;
   63847    case 8: return 0;
   63848    case 7:
   63849       if (devinfo->is_haswell) {
   63850          return 0;
   63851       } else {
   63852          return 0;
   63853       }
   63854    case 6: return 0;
   63855    case 5: return 0;
   63856    case 4:
   63857       if (devinfo->is_g4x) {
   63858          return 0;
   63859       } else {
   63860          return 0;
   63861       }
   63862    default:
   63863       unreachable("Invalid hardware generation");
   63864    }
   63865 }
   63866 
   63867 
   63868 
   63869 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample12XOffset_start  132
   63870 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample12XOffset_start  132
   63871 
   63872 static inline uint32_t ATTRIBUTE_PURE
   63873 _3DSTATE_SAMPLE_PATTERN_16xSample12XOffset_start(const struct gen_device_info *devinfo)
   63874 {
   63875    switch (devinfo->gen) {
   63876    case 10: return 132;
   63877    case 9: return 132;
   63878    case 8: return 0;
   63879    case 7:
   63880       if (devinfo->is_haswell) {
   63881          return 0;
   63882       } else {
   63883          return 0;
   63884       }
   63885    case 6: return 0;
   63886    case 5: return 0;
   63887    case 4:
   63888       if (devinfo->is_g4x) {
   63889          return 0;
   63890       } else {
   63891          return 0;
   63892       }
   63893    default:
   63894       unreachable("Invalid hardware generation");
   63895    }
   63896 }
   63897 
   63898 
   63899 
   63900 /* 3DSTATE_SAMPLE_PATTERN::16x Sample12 Y Offset */
   63901 
   63902 
   63903 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample12YOffset_bits  4
   63904 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample12YOffset_bits  4
   63905 
   63906 static inline uint32_t ATTRIBUTE_PURE
   63907 _3DSTATE_SAMPLE_PATTERN_16xSample12YOffset_bits(const struct gen_device_info *devinfo)
   63908 {
   63909    switch (devinfo->gen) {
   63910    case 10: return 4;
   63911    case 9: return 4;
   63912    case 8: return 0;
   63913    case 7:
   63914       if (devinfo->is_haswell) {
   63915          return 0;
   63916       } else {
   63917          return 0;
   63918       }
   63919    case 6: return 0;
   63920    case 5: return 0;
   63921    case 4:
   63922       if (devinfo->is_g4x) {
   63923          return 0;
   63924       } else {
   63925          return 0;
   63926       }
   63927    default:
   63928       unreachable("Invalid hardware generation");
   63929    }
   63930 }
   63931 
   63932 
   63933 
   63934 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample12YOffset_start  128
   63935 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample12YOffset_start  128
   63936 
   63937 static inline uint32_t ATTRIBUTE_PURE
   63938 _3DSTATE_SAMPLE_PATTERN_16xSample12YOffset_start(const struct gen_device_info *devinfo)
   63939 {
   63940    switch (devinfo->gen) {
   63941    case 10: return 128;
   63942    case 9: return 128;
   63943    case 8: return 0;
   63944    case 7:
   63945       if (devinfo->is_haswell) {
   63946          return 0;
   63947       } else {
   63948          return 0;
   63949       }
   63950    case 6: return 0;
   63951    case 5: return 0;
   63952    case 4:
   63953       if (devinfo->is_g4x) {
   63954          return 0;
   63955       } else {
   63956          return 0;
   63957       }
   63958    default:
   63959       unreachable("Invalid hardware generation");
   63960    }
   63961 }
   63962 
   63963 
   63964 
   63965 /* 3DSTATE_SAMPLE_PATTERN::16x Sample13 X Offset */
   63966 
   63967 
   63968 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample13XOffset_bits  4
   63969 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample13XOffset_bits  4
   63970 
   63971 static inline uint32_t ATTRIBUTE_PURE
   63972 _3DSTATE_SAMPLE_PATTERN_16xSample13XOffset_bits(const struct gen_device_info *devinfo)
   63973 {
   63974    switch (devinfo->gen) {
   63975    case 10: return 4;
   63976    case 9: return 4;
   63977    case 8: return 0;
   63978    case 7:
   63979       if (devinfo->is_haswell) {
   63980          return 0;
   63981       } else {
   63982          return 0;
   63983       }
   63984    case 6: return 0;
   63985    case 5: return 0;
   63986    case 4:
   63987       if (devinfo->is_g4x) {
   63988          return 0;
   63989       } else {
   63990          return 0;
   63991       }
   63992    default:
   63993       unreachable("Invalid hardware generation");
   63994    }
   63995 }
   63996 
   63997 
   63998 
   63999 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample13XOffset_start  140
   64000 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample13XOffset_start  140
   64001 
   64002 static inline uint32_t ATTRIBUTE_PURE
   64003 _3DSTATE_SAMPLE_PATTERN_16xSample13XOffset_start(const struct gen_device_info *devinfo)
   64004 {
   64005    switch (devinfo->gen) {
   64006    case 10: return 140;
   64007    case 9: return 140;
   64008    case 8: return 0;
   64009    case 7:
   64010       if (devinfo->is_haswell) {
   64011          return 0;
   64012       } else {
   64013          return 0;
   64014       }
   64015    case 6: return 0;
   64016    case 5: return 0;
   64017    case 4:
   64018       if (devinfo->is_g4x) {
   64019          return 0;
   64020       } else {
   64021          return 0;
   64022       }
   64023    default:
   64024       unreachable("Invalid hardware generation");
   64025    }
   64026 }
   64027 
   64028 
   64029 
   64030 /* 3DSTATE_SAMPLE_PATTERN::16x Sample13 Y Offset */
   64031 
   64032 
   64033 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample13YOffset_bits  4
   64034 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample13YOffset_bits  4
   64035 
   64036 static inline uint32_t ATTRIBUTE_PURE
   64037 _3DSTATE_SAMPLE_PATTERN_16xSample13YOffset_bits(const struct gen_device_info *devinfo)
   64038 {
   64039    switch (devinfo->gen) {
   64040    case 10: return 4;
   64041    case 9: return 4;
   64042    case 8: return 0;
   64043    case 7:
   64044       if (devinfo->is_haswell) {
   64045          return 0;
   64046       } else {
   64047          return 0;
   64048       }
   64049    case 6: return 0;
   64050    case 5: return 0;
   64051    case 4:
   64052       if (devinfo->is_g4x) {
   64053          return 0;
   64054       } else {
   64055          return 0;
   64056       }
   64057    default:
   64058       unreachable("Invalid hardware generation");
   64059    }
   64060 }
   64061 
   64062 
   64063 
   64064 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample13YOffset_start  136
   64065 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample13YOffset_start  136
   64066 
   64067 static inline uint32_t ATTRIBUTE_PURE
   64068 _3DSTATE_SAMPLE_PATTERN_16xSample13YOffset_start(const struct gen_device_info *devinfo)
   64069 {
   64070    switch (devinfo->gen) {
   64071    case 10: return 136;
   64072    case 9: return 136;
   64073    case 8: return 0;
   64074    case 7:
   64075       if (devinfo->is_haswell) {
   64076          return 0;
   64077       } else {
   64078          return 0;
   64079       }
   64080    case 6: return 0;
   64081    case 5: return 0;
   64082    case 4:
   64083       if (devinfo->is_g4x) {
   64084          return 0;
   64085       } else {
   64086          return 0;
   64087       }
   64088    default:
   64089       unreachable("Invalid hardware generation");
   64090    }
   64091 }
   64092 
   64093 
   64094 
   64095 /* 3DSTATE_SAMPLE_PATTERN::16x Sample14 X Offset */
   64096 
   64097 
   64098 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample14XOffset_bits  4
   64099 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample14XOffset_bits  4
   64100 
   64101 static inline uint32_t ATTRIBUTE_PURE
   64102 _3DSTATE_SAMPLE_PATTERN_16xSample14XOffset_bits(const struct gen_device_info *devinfo)
   64103 {
   64104    switch (devinfo->gen) {
   64105    case 10: return 4;
   64106    case 9: return 4;
   64107    case 8: return 0;
   64108    case 7:
   64109       if (devinfo->is_haswell) {
   64110          return 0;
   64111       } else {
   64112          return 0;
   64113       }
   64114    case 6: return 0;
   64115    case 5: return 0;
   64116    case 4:
   64117       if (devinfo->is_g4x) {
   64118          return 0;
   64119       } else {
   64120          return 0;
   64121       }
   64122    default:
   64123       unreachable("Invalid hardware generation");
   64124    }
   64125 }
   64126 
   64127 
   64128 
   64129 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample14XOffset_start  148
   64130 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample14XOffset_start  148
   64131 
   64132 static inline uint32_t ATTRIBUTE_PURE
   64133 _3DSTATE_SAMPLE_PATTERN_16xSample14XOffset_start(const struct gen_device_info *devinfo)
   64134 {
   64135    switch (devinfo->gen) {
   64136    case 10: return 148;
   64137    case 9: return 148;
   64138    case 8: return 0;
   64139    case 7:
   64140       if (devinfo->is_haswell) {
   64141          return 0;
   64142       } else {
   64143          return 0;
   64144       }
   64145    case 6: return 0;
   64146    case 5: return 0;
   64147    case 4:
   64148       if (devinfo->is_g4x) {
   64149          return 0;
   64150       } else {
   64151          return 0;
   64152       }
   64153    default:
   64154       unreachable("Invalid hardware generation");
   64155    }
   64156 }
   64157 
   64158 
   64159 
   64160 /* 3DSTATE_SAMPLE_PATTERN::16x Sample14 Y Offset */
   64161 
   64162 
   64163 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample14YOffset_bits  4
   64164 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample14YOffset_bits  4
   64165 
   64166 static inline uint32_t ATTRIBUTE_PURE
   64167 _3DSTATE_SAMPLE_PATTERN_16xSample14YOffset_bits(const struct gen_device_info *devinfo)
   64168 {
   64169    switch (devinfo->gen) {
   64170    case 10: return 4;
   64171    case 9: return 4;
   64172    case 8: return 0;
   64173    case 7:
   64174       if (devinfo->is_haswell) {
   64175          return 0;
   64176       } else {
   64177          return 0;
   64178       }
   64179    case 6: return 0;
   64180    case 5: return 0;
   64181    case 4:
   64182       if (devinfo->is_g4x) {
   64183          return 0;
   64184       } else {
   64185          return 0;
   64186       }
   64187    default:
   64188       unreachable("Invalid hardware generation");
   64189    }
   64190 }
   64191 
   64192 
   64193 
   64194 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample14YOffset_start  144
   64195 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample14YOffset_start  144
   64196 
   64197 static inline uint32_t ATTRIBUTE_PURE
   64198 _3DSTATE_SAMPLE_PATTERN_16xSample14YOffset_start(const struct gen_device_info *devinfo)
   64199 {
   64200    switch (devinfo->gen) {
   64201    case 10: return 144;
   64202    case 9: return 144;
   64203    case 8: return 0;
   64204    case 7:
   64205       if (devinfo->is_haswell) {
   64206          return 0;
   64207       } else {
   64208          return 0;
   64209       }
   64210    case 6: return 0;
   64211    case 5: return 0;
   64212    case 4:
   64213       if (devinfo->is_g4x) {
   64214          return 0;
   64215       } else {
   64216          return 0;
   64217       }
   64218    default:
   64219       unreachable("Invalid hardware generation");
   64220    }
   64221 }
   64222 
   64223 
   64224 
   64225 /* 3DSTATE_SAMPLE_PATTERN::16x Sample15 X Offset */
   64226 
   64227 
   64228 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample15XOffset_bits  4
   64229 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample15XOffset_bits  4
   64230 
   64231 static inline uint32_t ATTRIBUTE_PURE
   64232 _3DSTATE_SAMPLE_PATTERN_16xSample15XOffset_bits(const struct gen_device_info *devinfo)
   64233 {
   64234    switch (devinfo->gen) {
   64235    case 10: return 4;
   64236    case 9: return 4;
   64237    case 8: return 0;
   64238    case 7:
   64239       if (devinfo->is_haswell) {
   64240          return 0;
   64241       } else {
   64242          return 0;
   64243       }
   64244    case 6: return 0;
   64245    case 5: return 0;
   64246    case 4:
   64247       if (devinfo->is_g4x) {
   64248          return 0;
   64249       } else {
   64250          return 0;
   64251       }
   64252    default:
   64253       unreachable("Invalid hardware generation");
   64254    }
   64255 }
   64256 
   64257 
   64258 
   64259 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample15XOffset_start  156
   64260 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample15XOffset_start  156
   64261 
   64262 static inline uint32_t ATTRIBUTE_PURE
   64263 _3DSTATE_SAMPLE_PATTERN_16xSample15XOffset_start(const struct gen_device_info *devinfo)
   64264 {
   64265    switch (devinfo->gen) {
   64266    case 10: return 156;
   64267    case 9: return 156;
   64268    case 8: return 0;
   64269    case 7:
   64270       if (devinfo->is_haswell) {
   64271          return 0;
   64272       } else {
   64273          return 0;
   64274       }
   64275    case 6: return 0;
   64276    case 5: return 0;
   64277    case 4:
   64278       if (devinfo->is_g4x) {
   64279          return 0;
   64280       } else {
   64281          return 0;
   64282       }
   64283    default:
   64284       unreachable("Invalid hardware generation");
   64285    }
   64286 }
   64287 
   64288 
   64289 
   64290 /* 3DSTATE_SAMPLE_PATTERN::16x Sample15 Y Offset */
   64291 
   64292 
   64293 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample15YOffset_bits  4
   64294 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample15YOffset_bits  4
   64295 
   64296 static inline uint32_t ATTRIBUTE_PURE
   64297 _3DSTATE_SAMPLE_PATTERN_16xSample15YOffset_bits(const struct gen_device_info *devinfo)
   64298 {
   64299    switch (devinfo->gen) {
   64300    case 10: return 4;
   64301    case 9: return 4;
   64302    case 8: return 0;
   64303    case 7:
   64304       if (devinfo->is_haswell) {
   64305          return 0;
   64306       } else {
   64307          return 0;
   64308       }
   64309    case 6: return 0;
   64310    case 5: return 0;
   64311    case 4:
   64312       if (devinfo->is_g4x) {
   64313          return 0;
   64314       } else {
   64315          return 0;
   64316       }
   64317    default:
   64318       unreachable("Invalid hardware generation");
   64319    }
   64320 }
   64321 
   64322 
   64323 
   64324 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample15YOffset_start  152
   64325 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample15YOffset_start  152
   64326 
   64327 static inline uint32_t ATTRIBUTE_PURE
   64328 _3DSTATE_SAMPLE_PATTERN_16xSample15YOffset_start(const struct gen_device_info *devinfo)
   64329 {
   64330    switch (devinfo->gen) {
   64331    case 10: return 152;
   64332    case 9: return 152;
   64333    case 8: return 0;
   64334    case 7:
   64335       if (devinfo->is_haswell) {
   64336          return 0;
   64337       } else {
   64338          return 0;
   64339       }
   64340    case 6: return 0;
   64341    case 5: return 0;
   64342    case 4:
   64343       if (devinfo->is_g4x) {
   64344          return 0;
   64345       } else {
   64346          return 0;
   64347       }
   64348    default:
   64349       unreachable("Invalid hardware generation");
   64350    }
   64351 }
   64352 
   64353 
   64354 
   64355 /* 3DSTATE_SAMPLE_PATTERN::16x Sample2 X Offset */
   64356 
   64357 
   64358 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample2XOffset_bits  4
   64359 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample2XOffset_bits  4
   64360 
   64361 static inline uint32_t ATTRIBUTE_PURE
   64362 _3DSTATE_SAMPLE_PATTERN_16xSample2XOffset_bits(const struct gen_device_info *devinfo)
   64363 {
   64364    switch (devinfo->gen) {
   64365    case 10: return 4;
   64366    case 9: return 4;
   64367    case 8: return 0;
   64368    case 7:
   64369       if (devinfo->is_haswell) {
   64370          return 0;
   64371       } else {
   64372          return 0;
   64373       }
   64374    case 6: return 0;
   64375    case 5: return 0;
   64376    case 4:
   64377       if (devinfo->is_g4x) {
   64378          return 0;
   64379       } else {
   64380          return 0;
   64381       }
   64382    default:
   64383       unreachable("Invalid hardware generation");
   64384    }
   64385 }
   64386 
   64387 
   64388 
   64389 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample2XOffset_start  52
   64390 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample2XOffset_start  52
   64391 
   64392 static inline uint32_t ATTRIBUTE_PURE
   64393 _3DSTATE_SAMPLE_PATTERN_16xSample2XOffset_start(const struct gen_device_info *devinfo)
   64394 {
   64395    switch (devinfo->gen) {
   64396    case 10: return 52;
   64397    case 9: return 52;
   64398    case 8: return 0;
   64399    case 7:
   64400       if (devinfo->is_haswell) {
   64401          return 0;
   64402       } else {
   64403          return 0;
   64404       }
   64405    case 6: return 0;
   64406    case 5: return 0;
   64407    case 4:
   64408       if (devinfo->is_g4x) {
   64409          return 0;
   64410       } else {
   64411          return 0;
   64412       }
   64413    default:
   64414       unreachable("Invalid hardware generation");
   64415    }
   64416 }
   64417 
   64418 
   64419 
   64420 /* 3DSTATE_SAMPLE_PATTERN::16x Sample2 Y Offset */
   64421 
   64422 
   64423 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample2YOffset_bits  4
   64424 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample2YOffset_bits  4
   64425 
   64426 static inline uint32_t ATTRIBUTE_PURE
   64427 _3DSTATE_SAMPLE_PATTERN_16xSample2YOffset_bits(const struct gen_device_info *devinfo)
   64428 {
   64429    switch (devinfo->gen) {
   64430    case 10: return 4;
   64431    case 9: return 4;
   64432    case 8: return 0;
   64433    case 7:
   64434       if (devinfo->is_haswell) {
   64435          return 0;
   64436       } else {
   64437          return 0;
   64438       }
   64439    case 6: return 0;
   64440    case 5: return 0;
   64441    case 4:
   64442       if (devinfo->is_g4x) {
   64443          return 0;
   64444       } else {
   64445          return 0;
   64446       }
   64447    default:
   64448       unreachable("Invalid hardware generation");
   64449    }
   64450 }
   64451 
   64452 
   64453 
   64454 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample2YOffset_start  48
   64455 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample2YOffset_start  48
   64456 
   64457 static inline uint32_t ATTRIBUTE_PURE
   64458 _3DSTATE_SAMPLE_PATTERN_16xSample2YOffset_start(const struct gen_device_info *devinfo)
   64459 {
   64460    switch (devinfo->gen) {
   64461    case 10: return 48;
   64462    case 9: return 48;
   64463    case 8: return 0;
   64464    case 7:
   64465       if (devinfo->is_haswell) {
   64466          return 0;
   64467       } else {
   64468          return 0;
   64469       }
   64470    case 6: return 0;
   64471    case 5: return 0;
   64472    case 4:
   64473       if (devinfo->is_g4x) {
   64474          return 0;
   64475       } else {
   64476          return 0;
   64477       }
   64478    default:
   64479       unreachable("Invalid hardware generation");
   64480    }
   64481 }
   64482 
   64483 
   64484 
   64485 /* 3DSTATE_SAMPLE_PATTERN::16x Sample3 X Offset */
   64486 
   64487 
   64488 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample3XOffset_bits  4
   64489 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample3XOffset_bits  4
   64490 
   64491 static inline uint32_t ATTRIBUTE_PURE
   64492 _3DSTATE_SAMPLE_PATTERN_16xSample3XOffset_bits(const struct gen_device_info *devinfo)
   64493 {
   64494    switch (devinfo->gen) {
   64495    case 10: return 4;
   64496    case 9: return 4;
   64497    case 8: return 0;
   64498    case 7:
   64499       if (devinfo->is_haswell) {
   64500          return 0;
   64501       } else {
   64502          return 0;
   64503       }
   64504    case 6: return 0;
   64505    case 5: return 0;
   64506    case 4:
   64507       if (devinfo->is_g4x) {
   64508          return 0;
   64509       } else {
   64510          return 0;
   64511       }
   64512    default:
   64513       unreachable("Invalid hardware generation");
   64514    }
   64515 }
   64516 
   64517 
   64518 
   64519 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample3XOffset_start  60
   64520 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample3XOffset_start  60
   64521 
   64522 static inline uint32_t ATTRIBUTE_PURE
   64523 _3DSTATE_SAMPLE_PATTERN_16xSample3XOffset_start(const struct gen_device_info *devinfo)
   64524 {
   64525    switch (devinfo->gen) {
   64526    case 10: return 60;
   64527    case 9: return 60;
   64528    case 8: return 0;
   64529    case 7:
   64530       if (devinfo->is_haswell) {
   64531          return 0;
   64532       } else {
   64533          return 0;
   64534       }
   64535    case 6: return 0;
   64536    case 5: return 0;
   64537    case 4:
   64538       if (devinfo->is_g4x) {
   64539          return 0;
   64540       } else {
   64541          return 0;
   64542       }
   64543    default:
   64544       unreachable("Invalid hardware generation");
   64545    }
   64546 }
   64547 
   64548 
   64549 
   64550 /* 3DSTATE_SAMPLE_PATTERN::16x Sample3 Y Offset */
   64551 
   64552 
   64553 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample3YOffset_bits  4
   64554 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample3YOffset_bits  4
   64555 
   64556 static inline uint32_t ATTRIBUTE_PURE
   64557 _3DSTATE_SAMPLE_PATTERN_16xSample3YOffset_bits(const struct gen_device_info *devinfo)
   64558 {
   64559    switch (devinfo->gen) {
   64560    case 10: return 4;
   64561    case 9: return 4;
   64562    case 8: return 0;
   64563    case 7:
   64564       if (devinfo->is_haswell) {
   64565          return 0;
   64566       } else {
   64567          return 0;
   64568       }
   64569    case 6: return 0;
   64570    case 5: return 0;
   64571    case 4:
   64572       if (devinfo->is_g4x) {
   64573          return 0;
   64574       } else {
   64575          return 0;
   64576       }
   64577    default:
   64578       unreachable("Invalid hardware generation");
   64579    }
   64580 }
   64581 
   64582 
   64583 
   64584 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample3YOffset_start  56
   64585 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample3YOffset_start  56
   64586 
   64587 static inline uint32_t ATTRIBUTE_PURE
   64588 _3DSTATE_SAMPLE_PATTERN_16xSample3YOffset_start(const struct gen_device_info *devinfo)
   64589 {
   64590    switch (devinfo->gen) {
   64591    case 10: return 56;
   64592    case 9: return 56;
   64593    case 8: return 0;
   64594    case 7:
   64595       if (devinfo->is_haswell) {
   64596          return 0;
   64597       } else {
   64598          return 0;
   64599       }
   64600    case 6: return 0;
   64601    case 5: return 0;
   64602    case 4:
   64603       if (devinfo->is_g4x) {
   64604          return 0;
   64605       } else {
   64606          return 0;
   64607       }
   64608    default:
   64609       unreachable("Invalid hardware generation");
   64610    }
   64611 }
   64612 
   64613 
   64614 
   64615 /* 3DSTATE_SAMPLE_PATTERN::16x Sample4 X Offset */
   64616 
   64617 
   64618 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample4XOffset_bits  4
   64619 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample4XOffset_bits  4
   64620 
   64621 static inline uint32_t ATTRIBUTE_PURE
   64622 _3DSTATE_SAMPLE_PATTERN_16xSample4XOffset_bits(const struct gen_device_info *devinfo)
   64623 {
   64624    switch (devinfo->gen) {
   64625    case 10: return 4;
   64626    case 9: return 4;
   64627    case 8: return 0;
   64628    case 7:
   64629       if (devinfo->is_haswell) {
   64630          return 0;
   64631       } else {
   64632          return 0;
   64633       }
   64634    case 6: return 0;
   64635    case 5: return 0;
   64636    case 4:
   64637       if (devinfo->is_g4x) {
   64638          return 0;
   64639       } else {
   64640          return 0;
   64641       }
   64642    default:
   64643       unreachable("Invalid hardware generation");
   64644    }
   64645 }
   64646 
   64647 
   64648 
   64649 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample4XOffset_start  68
   64650 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample4XOffset_start  68
   64651 
   64652 static inline uint32_t ATTRIBUTE_PURE
   64653 _3DSTATE_SAMPLE_PATTERN_16xSample4XOffset_start(const struct gen_device_info *devinfo)
   64654 {
   64655    switch (devinfo->gen) {
   64656    case 10: return 68;
   64657    case 9: return 68;
   64658    case 8: return 0;
   64659    case 7:
   64660       if (devinfo->is_haswell) {
   64661          return 0;
   64662       } else {
   64663          return 0;
   64664       }
   64665    case 6: return 0;
   64666    case 5: return 0;
   64667    case 4:
   64668       if (devinfo->is_g4x) {
   64669          return 0;
   64670       } else {
   64671          return 0;
   64672       }
   64673    default:
   64674       unreachable("Invalid hardware generation");
   64675    }
   64676 }
   64677 
   64678 
   64679 
   64680 /* 3DSTATE_SAMPLE_PATTERN::16x Sample4 Y Offset */
   64681 
   64682 
   64683 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample4YOffset_bits  4
   64684 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample4YOffset_bits  4
   64685 
   64686 static inline uint32_t ATTRIBUTE_PURE
   64687 _3DSTATE_SAMPLE_PATTERN_16xSample4YOffset_bits(const struct gen_device_info *devinfo)
   64688 {
   64689    switch (devinfo->gen) {
   64690    case 10: return 4;
   64691    case 9: return 4;
   64692    case 8: return 0;
   64693    case 7:
   64694       if (devinfo->is_haswell) {
   64695          return 0;
   64696       } else {
   64697          return 0;
   64698       }
   64699    case 6: return 0;
   64700    case 5: return 0;
   64701    case 4:
   64702       if (devinfo->is_g4x) {
   64703          return 0;
   64704       } else {
   64705          return 0;
   64706       }
   64707    default:
   64708       unreachable("Invalid hardware generation");
   64709    }
   64710 }
   64711 
   64712 
   64713 
   64714 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample4YOffset_start  64
   64715 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample4YOffset_start  64
   64716 
   64717 static inline uint32_t ATTRIBUTE_PURE
   64718 _3DSTATE_SAMPLE_PATTERN_16xSample4YOffset_start(const struct gen_device_info *devinfo)
   64719 {
   64720    switch (devinfo->gen) {
   64721    case 10: return 64;
   64722    case 9: return 64;
   64723    case 8: return 0;
   64724    case 7:
   64725       if (devinfo->is_haswell) {
   64726          return 0;
   64727       } else {
   64728          return 0;
   64729       }
   64730    case 6: return 0;
   64731    case 5: return 0;
   64732    case 4:
   64733       if (devinfo->is_g4x) {
   64734          return 0;
   64735       } else {
   64736          return 0;
   64737       }
   64738    default:
   64739       unreachable("Invalid hardware generation");
   64740    }
   64741 }
   64742 
   64743 
   64744 
   64745 /* 3DSTATE_SAMPLE_PATTERN::16x Sample5 X Offset */
   64746 
   64747 
   64748 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample5XOffset_bits  4
   64749 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample5XOffset_bits  4
   64750 
   64751 static inline uint32_t ATTRIBUTE_PURE
   64752 _3DSTATE_SAMPLE_PATTERN_16xSample5XOffset_bits(const struct gen_device_info *devinfo)
   64753 {
   64754    switch (devinfo->gen) {
   64755    case 10: return 4;
   64756    case 9: return 4;
   64757    case 8: return 0;
   64758    case 7:
   64759       if (devinfo->is_haswell) {
   64760          return 0;
   64761       } else {
   64762          return 0;
   64763       }
   64764    case 6: return 0;
   64765    case 5: return 0;
   64766    case 4:
   64767       if (devinfo->is_g4x) {
   64768          return 0;
   64769       } else {
   64770          return 0;
   64771       }
   64772    default:
   64773       unreachable("Invalid hardware generation");
   64774    }
   64775 }
   64776 
   64777 
   64778 
   64779 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample5XOffset_start  76
   64780 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample5XOffset_start  76
   64781 
   64782 static inline uint32_t ATTRIBUTE_PURE
   64783 _3DSTATE_SAMPLE_PATTERN_16xSample5XOffset_start(const struct gen_device_info *devinfo)
   64784 {
   64785    switch (devinfo->gen) {
   64786    case 10: return 76;
   64787    case 9: return 76;
   64788    case 8: return 0;
   64789    case 7:
   64790       if (devinfo->is_haswell) {
   64791          return 0;
   64792       } else {
   64793          return 0;
   64794       }
   64795    case 6: return 0;
   64796    case 5: return 0;
   64797    case 4:
   64798       if (devinfo->is_g4x) {
   64799          return 0;
   64800       } else {
   64801          return 0;
   64802       }
   64803    default:
   64804       unreachable("Invalid hardware generation");
   64805    }
   64806 }
   64807 
   64808 
   64809 
   64810 /* 3DSTATE_SAMPLE_PATTERN::16x Sample5 Y Offset */
   64811 
   64812 
   64813 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample5YOffset_bits  4
   64814 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample5YOffset_bits  4
   64815 
   64816 static inline uint32_t ATTRIBUTE_PURE
   64817 _3DSTATE_SAMPLE_PATTERN_16xSample5YOffset_bits(const struct gen_device_info *devinfo)
   64818 {
   64819    switch (devinfo->gen) {
   64820    case 10: return 4;
   64821    case 9: return 4;
   64822    case 8: return 0;
   64823    case 7:
   64824       if (devinfo->is_haswell) {
   64825          return 0;
   64826       } else {
   64827          return 0;
   64828       }
   64829    case 6: return 0;
   64830    case 5: return 0;
   64831    case 4:
   64832       if (devinfo->is_g4x) {
   64833          return 0;
   64834       } else {
   64835          return 0;
   64836       }
   64837    default:
   64838       unreachable("Invalid hardware generation");
   64839    }
   64840 }
   64841 
   64842 
   64843 
   64844 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample5YOffset_start  72
   64845 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample5YOffset_start  72
   64846 
   64847 static inline uint32_t ATTRIBUTE_PURE
   64848 _3DSTATE_SAMPLE_PATTERN_16xSample5YOffset_start(const struct gen_device_info *devinfo)
   64849 {
   64850    switch (devinfo->gen) {
   64851    case 10: return 72;
   64852    case 9: return 72;
   64853    case 8: return 0;
   64854    case 7:
   64855       if (devinfo->is_haswell) {
   64856          return 0;
   64857       } else {
   64858          return 0;
   64859       }
   64860    case 6: return 0;
   64861    case 5: return 0;
   64862    case 4:
   64863       if (devinfo->is_g4x) {
   64864          return 0;
   64865       } else {
   64866          return 0;
   64867       }
   64868    default:
   64869       unreachable("Invalid hardware generation");
   64870    }
   64871 }
   64872 
   64873 
   64874 
   64875 /* 3DSTATE_SAMPLE_PATTERN::16x Sample6 X Offset */
   64876 
   64877 
   64878 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample6XOffset_bits  4
   64879 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample6XOffset_bits  4
   64880 
   64881 static inline uint32_t ATTRIBUTE_PURE
   64882 _3DSTATE_SAMPLE_PATTERN_16xSample6XOffset_bits(const struct gen_device_info *devinfo)
   64883 {
   64884    switch (devinfo->gen) {
   64885    case 10: return 4;
   64886    case 9: return 4;
   64887    case 8: return 0;
   64888    case 7:
   64889       if (devinfo->is_haswell) {
   64890          return 0;
   64891       } else {
   64892          return 0;
   64893       }
   64894    case 6: return 0;
   64895    case 5: return 0;
   64896    case 4:
   64897       if (devinfo->is_g4x) {
   64898          return 0;
   64899       } else {
   64900          return 0;
   64901       }
   64902    default:
   64903       unreachable("Invalid hardware generation");
   64904    }
   64905 }
   64906 
   64907 
   64908 
   64909 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample6XOffset_start  84
   64910 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample6XOffset_start  84
   64911 
   64912 static inline uint32_t ATTRIBUTE_PURE
   64913 _3DSTATE_SAMPLE_PATTERN_16xSample6XOffset_start(const struct gen_device_info *devinfo)
   64914 {
   64915    switch (devinfo->gen) {
   64916    case 10: return 84;
   64917    case 9: return 84;
   64918    case 8: return 0;
   64919    case 7:
   64920       if (devinfo->is_haswell) {
   64921          return 0;
   64922       } else {
   64923          return 0;
   64924       }
   64925    case 6: return 0;
   64926    case 5: return 0;
   64927    case 4:
   64928       if (devinfo->is_g4x) {
   64929          return 0;
   64930       } else {
   64931          return 0;
   64932       }
   64933    default:
   64934       unreachable("Invalid hardware generation");
   64935    }
   64936 }
   64937 
   64938 
   64939 
   64940 /* 3DSTATE_SAMPLE_PATTERN::16x Sample6 Y Offset */
   64941 
   64942 
   64943 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample6YOffset_bits  4
   64944 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample6YOffset_bits  4
   64945 
   64946 static inline uint32_t ATTRIBUTE_PURE
   64947 _3DSTATE_SAMPLE_PATTERN_16xSample6YOffset_bits(const struct gen_device_info *devinfo)
   64948 {
   64949    switch (devinfo->gen) {
   64950    case 10: return 4;
   64951    case 9: return 4;
   64952    case 8: return 0;
   64953    case 7:
   64954       if (devinfo->is_haswell) {
   64955          return 0;
   64956       } else {
   64957          return 0;
   64958       }
   64959    case 6: return 0;
   64960    case 5: return 0;
   64961    case 4:
   64962       if (devinfo->is_g4x) {
   64963          return 0;
   64964       } else {
   64965          return 0;
   64966       }
   64967    default:
   64968       unreachable("Invalid hardware generation");
   64969    }
   64970 }
   64971 
   64972 
   64973 
   64974 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample6YOffset_start  80
   64975 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample6YOffset_start  80
   64976 
   64977 static inline uint32_t ATTRIBUTE_PURE
   64978 _3DSTATE_SAMPLE_PATTERN_16xSample6YOffset_start(const struct gen_device_info *devinfo)
   64979 {
   64980    switch (devinfo->gen) {
   64981    case 10: return 80;
   64982    case 9: return 80;
   64983    case 8: return 0;
   64984    case 7:
   64985       if (devinfo->is_haswell) {
   64986          return 0;
   64987       } else {
   64988          return 0;
   64989       }
   64990    case 6: return 0;
   64991    case 5: return 0;
   64992    case 4:
   64993       if (devinfo->is_g4x) {
   64994          return 0;
   64995       } else {
   64996          return 0;
   64997       }
   64998    default:
   64999       unreachable("Invalid hardware generation");
   65000    }
   65001 }
   65002 
   65003 
   65004 
   65005 /* 3DSTATE_SAMPLE_PATTERN::16x Sample7 X Offset */
   65006 
   65007 
   65008 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample7XOffset_bits  4
   65009 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample7XOffset_bits  4
   65010 
   65011 static inline uint32_t ATTRIBUTE_PURE
   65012 _3DSTATE_SAMPLE_PATTERN_16xSample7XOffset_bits(const struct gen_device_info *devinfo)
   65013 {
   65014    switch (devinfo->gen) {
   65015    case 10: return 4;
   65016    case 9: return 4;
   65017    case 8: return 0;
   65018    case 7:
   65019       if (devinfo->is_haswell) {
   65020          return 0;
   65021       } else {
   65022          return 0;
   65023       }
   65024    case 6: return 0;
   65025    case 5: return 0;
   65026    case 4:
   65027       if (devinfo->is_g4x) {
   65028          return 0;
   65029       } else {
   65030          return 0;
   65031       }
   65032    default:
   65033       unreachable("Invalid hardware generation");
   65034    }
   65035 }
   65036 
   65037 
   65038 
   65039 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample7XOffset_start  92
   65040 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample7XOffset_start  92
   65041 
   65042 static inline uint32_t ATTRIBUTE_PURE
   65043 _3DSTATE_SAMPLE_PATTERN_16xSample7XOffset_start(const struct gen_device_info *devinfo)
   65044 {
   65045    switch (devinfo->gen) {
   65046    case 10: return 92;
   65047    case 9: return 92;
   65048    case 8: return 0;
   65049    case 7:
   65050       if (devinfo->is_haswell) {
   65051          return 0;
   65052       } else {
   65053          return 0;
   65054       }
   65055    case 6: return 0;
   65056    case 5: return 0;
   65057    case 4:
   65058       if (devinfo->is_g4x) {
   65059          return 0;
   65060       } else {
   65061          return 0;
   65062       }
   65063    default:
   65064       unreachable("Invalid hardware generation");
   65065    }
   65066 }
   65067 
   65068 
   65069 
   65070 /* 3DSTATE_SAMPLE_PATTERN::16x Sample7 Y Offset */
   65071 
   65072 
   65073 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample7YOffset_bits  4
   65074 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample7YOffset_bits  4
   65075 
   65076 static inline uint32_t ATTRIBUTE_PURE
   65077 _3DSTATE_SAMPLE_PATTERN_16xSample7YOffset_bits(const struct gen_device_info *devinfo)
   65078 {
   65079    switch (devinfo->gen) {
   65080    case 10: return 4;
   65081    case 9: return 4;
   65082    case 8: return 0;
   65083    case 7:
   65084       if (devinfo->is_haswell) {
   65085          return 0;
   65086       } else {
   65087          return 0;
   65088       }
   65089    case 6: return 0;
   65090    case 5: return 0;
   65091    case 4:
   65092       if (devinfo->is_g4x) {
   65093          return 0;
   65094       } else {
   65095          return 0;
   65096       }
   65097    default:
   65098       unreachable("Invalid hardware generation");
   65099    }
   65100 }
   65101 
   65102 
   65103 
   65104 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample7YOffset_start  88
   65105 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample7YOffset_start  88
   65106 
   65107 static inline uint32_t ATTRIBUTE_PURE
   65108 _3DSTATE_SAMPLE_PATTERN_16xSample7YOffset_start(const struct gen_device_info *devinfo)
   65109 {
   65110    switch (devinfo->gen) {
   65111    case 10: return 88;
   65112    case 9: return 88;
   65113    case 8: return 0;
   65114    case 7:
   65115       if (devinfo->is_haswell) {
   65116          return 0;
   65117       } else {
   65118          return 0;
   65119       }
   65120    case 6: return 0;
   65121    case 5: return 0;
   65122    case 4:
   65123       if (devinfo->is_g4x) {
   65124          return 0;
   65125       } else {
   65126          return 0;
   65127       }
   65128    default:
   65129       unreachable("Invalid hardware generation");
   65130    }
   65131 }
   65132 
   65133 
   65134 
   65135 /* 3DSTATE_SAMPLE_PATTERN::16x Sample8 X Offset */
   65136 
   65137 
   65138 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample8XOffset_bits  4
   65139 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample8XOffset_bits  4
   65140 
   65141 static inline uint32_t ATTRIBUTE_PURE
   65142 _3DSTATE_SAMPLE_PATTERN_16xSample8XOffset_bits(const struct gen_device_info *devinfo)
   65143 {
   65144    switch (devinfo->gen) {
   65145    case 10: return 4;
   65146    case 9: return 4;
   65147    case 8: return 0;
   65148    case 7:
   65149       if (devinfo->is_haswell) {
   65150          return 0;
   65151       } else {
   65152          return 0;
   65153       }
   65154    case 6: return 0;
   65155    case 5: return 0;
   65156    case 4:
   65157       if (devinfo->is_g4x) {
   65158          return 0;
   65159       } else {
   65160          return 0;
   65161       }
   65162    default:
   65163       unreachable("Invalid hardware generation");
   65164    }
   65165 }
   65166 
   65167 
   65168 
   65169 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample8XOffset_start  100
   65170 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample8XOffset_start  100
   65171 
   65172 static inline uint32_t ATTRIBUTE_PURE
   65173 _3DSTATE_SAMPLE_PATTERN_16xSample8XOffset_start(const struct gen_device_info *devinfo)
   65174 {
   65175    switch (devinfo->gen) {
   65176    case 10: return 100;
   65177    case 9: return 100;
   65178    case 8: return 0;
   65179    case 7:
   65180       if (devinfo->is_haswell) {
   65181          return 0;
   65182       } else {
   65183          return 0;
   65184       }
   65185    case 6: return 0;
   65186    case 5: return 0;
   65187    case 4:
   65188       if (devinfo->is_g4x) {
   65189          return 0;
   65190       } else {
   65191          return 0;
   65192       }
   65193    default:
   65194       unreachable("Invalid hardware generation");
   65195    }
   65196 }
   65197 
   65198 
   65199 
   65200 /* 3DSTATE_SAMPLE_PATTERN::16x Sample8 Y Offset */
   65201 
   65202 
   65203 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample8YOffset_bits  4
   65204 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample8YOffset_bits  4
   65205 
   65206 static inline uint32_t ATTRIBUTE_PURE
   65207 _3DSTATE_SAMPLE_PATTERN_16xSample8YOffset_bits(const struct gen_device_info *devinfo)
   65208 {
   65209    switch (devinfo->gen) {
   65210    case 10: return 4;
   65211    case 9: return 4;
   65212    case 8: return 0;
   65213    case 7:
   65214       if (devinfo->is_haswell) {
   65215          return 0;
   65216       } else {
   65217          return 0;
   65218       }
   65219    case 6: return 0;
   65220    case 5: return 0;
   65221    case 4:
   65222       if (devinfo->is_g4x) {
   65223          return 0;
   65224       } else {
   65225          return 0;
   65226       }
   65227    default:
   65228       unreachable("Invalid hardware generation");
   65229    }
   65230 }
   65231 
   65232 
   65233 
   65234 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample8YOffset_start  96
   65235 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample8YOffset_start  96
   65236 
   65237 static inline uint32_t ATTRIBUTE_PURE
   65238 _3DSTATE_SAMPLE_PATTERN_16xSample8YOffset_start(const struct gen_device_info *devinfo)
   65239 {
   65240    switch (devinfo->gen) {
   65241    case 10: return 96;
   65242    case 9: return 96;
   65243    case 8: return 0;
   65244    case 7:
   65245       if (devinfo->is_haswell) {
   65246          return 0;
   65247       } else {
   65248          return 0;
   65249       }
   65250    case 6: return 0;
   65251    case 5: return 0;
   65252    case 4:
   65253       if (devinfo->is_g4x) {
   65254          return 0;
   65255       } else {
   65256          return 0;
   65257       }
   65258    default:
   65259       unreachable("Invalid hardware generation");
   65260    }
   65261 }
   65262 
   65263 
   65264 
   65265 /* 3DSTATE_SAMPLE_PATTERN::16x Sample9 X Offset */
   65266 
   65267 
   65268 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample9XOffset_bits  4
   65269 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample9XOffset_bits  4
   65270 
   65271 static inline uint32_t ATTRIBUTE_PURE
   65272 _3DSTATE_SAMPLE_PATTERN_16xSample9XOffset_bits(const struct gen_device_info *devinfo)
   65273 {
   65274    switch (devinfo->gen) {
   65275    case 10: return 4;
   65276    case 9: return 4;
   65277    case 8: return 0;
   65278    case 7:
   65279       if (devinfo->is_haswell) {
   65280          return 0;
   65281       } else {
   65282          return 0;
   65283       }
   65284    case 6: return 0;
   65285    case 5: return 0;
   65286    case 4:
   65287       if (devinfo->is_g4x) {
   65288          return 0;
   65289       } else {
   65290          return 0;
   65291       }
   65292    default:
   65293       unreachable("Invalid hardware generation");
   65294    }
   65295 }
   65296 
   65297 
   65298 
   65299 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample9XOffset_start  108
   65300 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample9XOffset_start  108
   65301 
   65302 static inline uint32_t ATTRIBUTE_PURE
   65303 _3DSTATE_SAMPLE_PATTERN_16xSample9XOffset_start(const struct gen_device_info *devinfo)
   65304 {
   65305    switch (devinfo->gen) {
   65306    case 10: return 108;
   65307    case 9: return 108;
   65308    case 8: return 0;
   65309    case 7:
   65310       if (devinfo->is_haswell) {
   65311          return 0;
   65312       } else {
   65313          return 0;
   65314       }
   65315    case 6: return 0;
   65316    case 5: return 0;
   65317    case 4:
   65318       if (devinfo->is_g4x) {
   65319          return 0;
   65320       } else {
   65321          return 0;
   65322       }
   65323    default:
   65324       unreachable("Invalid hardware generation");
   65325    }
   65326 }
   65327 
   65328 
   65329 
   65330 /* 3DSTATE_SAMPLE_PATTERN::16x Sample9 Y Offset */
   65331 
   65332 
   65333 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample9YOffset_bits  4
   65334 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample9YOffset_bits  4
   65335 
   65336 static inline uint32_t ATTRIBUTE_PURE
   65337 _3DSTATE_SAMPLE_PATTERN_16xSample9YOffset_bits(const struct gen_device_info *devinfo)
   65338 {
   65339    switch (devinfo->gen) {
   65340    case 10: return 4;
   65341    case 9: return 4;
   65342    case 8: return 0;
   65343    case 7:
   65344       if (devinfo->is_haswell) {
   65345          return 0;
   65346       } else {
   65347          return 0;
   65348       }
   65349    case 6: return 0;
   65350    case 5: return 0;
   65351    case 4:
   65352       if (devinfo->is_g4x) {
   65353          return 0;
   65354       } else {
   65355          return 0;
   65356       }
   65357    default:
   65358       unreachable("Invalid hardware generation");
   65359    }
   65360 }
   65361 
   65362 
   65363 
   65364 #define GEN10_3DSTATE_SAMPLE_PATTERN_16xSample9YOffset_start  104
   65365 #define GEN9_3DSTATE_SAMPLE_PATTERN_16xSample9YOffset_start  104
   65366 
   65367 static inline uint32_t ATTRIBUTE_PURE
   65368 _3DSTATE_SAMPLE_PATTERN_16xSample9YOffset_start(const struct gen_device_info *devinfo)
   65369 {
   65370    switch (devinfo->gen) {
   65371    case 10: return 104;
   65372    case 9: return 104;
   65373    case 8: return 0;
   65374    case 7:
   65375       if (devinfo->is_haswell) {
   65376          return 0;
   65377       } else {
   65378          return 0;
   65379       }
   65380    case 6: return 0;
   65381    case 5: return 0;
   65382    case 4:
   65383       if (devinfo->is_g4x) {
   65384          return 0;
   65385       } else {
   65386          return 0;
   65387       }
   65388    default:
   65389       unreachable("Invalid hardware generation");
   65390    }
   65391 }
   65392 
   65393 
   65394 
   65395 /* 3DSTATE_SAMPLE_PATTERN::1x Sample0 X Offset */
   65396 
   65397 
   65398 #define GEN10_3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_bits  4
   65399 #define GEN9_3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_bits  4
   65400 #define GEN8_3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_bits  4
   65401 
   65402 static inline uint32_t ATTRIBUTE_PURE
   65403 _3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_bits(const struct gen_device_info *devinfo)
   65404 {
   65405    switch (devinfo->gen) {
   65406    case 10: return 4;
   65407    case 9: return 4;
   65408    case 8: return 4;
   65409    case 7:
   65410       if (devinfo->is_haswell) {
   65411          return 0;
   65412       } else {
   65413          return 0;
   65414       }
   65415    case 6: return 0;
   65416    case 5: return 0;
   65417    case 4:
   65418       if (devinfo->is_g4x) {
   65419          return 0;
   65420       } else {
   65421          return 0;
   65422       }
   65423    default:
   65424       unreachable("Invalid hardware generation");
   65425    }
   65426 }
   65427 
   65428 
   65429 
   65430 #define GEN10_3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_start  276
   65431 #define GEN9_3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_start  276
   65432 #define GEN8_3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_start  276
   65433 
   65434 static inline uint32_t ATTRIBUTE_PURE
   65435 _3DSTATE_SAMPLE_PATTERN_1xSample0XOffset_start(const struct gen_device_info *devinfo)
   65436 {
   65437    switch (devinfo->gen) {
   65438    case 10: return 276;
   65439    case 9: return 276;
   65440    case 8: return 276;
   65441    case 7:
   65442       if (devinfo->is_haswell) {
   65443          return 0;
   65444       } else {
   65445          return 0;
   65446       }
   65447    case 6: return 0;
   65448    case 5: return 0;
   65449    case 4:
   65450       if (devinfo->is_g4x) {
   65451          return 0;
   65452       } else {
   65453          return 0;
   65454       }
   65455    default:
   65456       unreachable("Invalid hardware generation");
   65457    }
   65458 }
   65459 
   65460 
   65461 
   65462 /* 3DSTATE_SAMPLE_PATTERN::1x Sample0 Y Offset */
   65463 
   65464 
   65465 #define GEN10_3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_bits  4
   65466 #define GEN9_3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_bits  4
   65467 #define GEN8_3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_bits  4
   65468 
   65469 static inline uint32_t ATTRIBUTE_PURE
   65470 _3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_bits(const struct gen_device_info *devinfo)
   65471 {
   65472    switch (devinfo->gen) {
   65473    case 10: return 4;
   65474    case 9: return 4;
   65475    case 8: return 4;
   65476    case 7:
   65477       if (devinfo->is_haswell) {
   65478          return 0;
   65479       } else {
   65480          return 0;
   65481       }
   65482    case 6: return 0;
   65483    case 5: return 0;
   65484    case 4:
   65485       if (devinfo->is_g4x) {
   65486          return 0;
   65487       } else {
   65488          return 0;
   65489       }
   65490    default:
   65491       unreachable("Invalid hardware generation");
   65492    }
   65493 }
   65494 
   65495 
   65496 
   65497 #define GEN10_3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_start  272
   65498 #define GEN9_3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_start  272
   65499 #define GEN8_3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_start  272
   65500 
   65501 static inline uint32_t ATTRIBUTE_PURE
   65502 _3DSTATE_SAMPLE_PATTERN_1xSample0YOffset_start(const struct gen_device_info *devinfo)
   65503 {
   65504    switch (devinfo->gen) {
   65505    case 10: return 272;
   65506    case 9: return 272;
   65507    case 8: return 272;
   65508    case 7:
   65509       if (devinfo->is_haswell) {
   65510          return 0;
   65511       } else {
   65512          return 0;
   65513       }
   65514    case 6: return 0;
   65515    case 5: return 0;
   65516    case 4:
   65517       if (devinfo->is_g4x) {
   65518          return 0;
   65519       } else {
   65520          return 0;
   65521       }
   65522    default:
   65523       unreachable("Invalid hardware generation");
   65524    }
   65525 }
   65526 
   65527 
   65528 
   65529 /* 3DSTATE_SAMPLE_PATTERN::2x Sample0 X Offset */
   65530 
   65531 
   65532 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_bits  4
   65533 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_bits  4
   65534 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_bits  4
   65535 
   65536 static inline uint32_t ATTRIBUTE_PURE
   65537 _3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_bits(const struct gen_device_info *devinfo)
   65538 {
   65539    switch (devinfo->gen) {
   65540    case 10: return 4;
   65541    case 9: return 4;
   65542    case 8: return 4;
   65543    case 7:
   65544       if (devinfo->is_haswell) {
   65545          return 0;
   65546       } else {
   65547          return 0;
   65548       }
   65549    case 6: return 0;
   65550    case 5: return 0;
   65551    case 4:
   65552       if (devinfo->is_g4x) {
   65553          return 0;
   65554       } else {
   65555          return 0;
   65556       }
   65557    default:
   65558       unreachable("Invalid hardware generation");
   65559    }
   65560 }
   65561 
   65562 
   65563 
   65564 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_start  260
   65565 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_start  260
   65566 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_start  260
   65567 
   65568 static inline uint32_t ATTRIBUTE_PURE
   65569 _3DSTATE_SAMPLE_PATTERN_2xSample0XOffset_start(const struct gen_device_info *devinfo)
   65570 {
   65571    switch (devinfo->gen) {
   65572    case 10: return 260;
   65573    case 9: return 260;
   65574    case 8: return 260;
   65575    case 7:
   65576       if (devinfo->is_haswell) {
   65577          return 0;
   65578       } else {
   65579          return 0;
   65580       }
   65581    case 6: return 0;
   65582    case 5: return 0;
   65583    case 4:
   65584       if (devinfo->is_g4x) {
   65585          return 0;
   65586       } else {
   65587          return 0;
   65588       }
   65589    default:
   65590       unreachable("Invalid hardware generation");
   65591    }
   65592 }
   65593 
   65594 
   65595 
   65596 /* 3DSTATE_SAMPLE_PATTERN::2x Sample0 Y Offset */
   65597 
   65598 
   65599 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_bits  4
   65600 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_bits  4
   65601 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_bits  4
   65602 
   65603 static inline uint32_t ATTRIBUTE_PURE
   65604 _3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_bits(const struct gen_device_info *devinfo)
   65605 {
   65606    switch (devinfo->gen) {
   65607    case 10: return 4;
   65608    case 9: return 4;
   65609    case 8: return 4;
   65610    case 7:
   65611       if (devinfo->is_haswell) {
   65612          return 0;
   65613       } else {
   65614          return 0;
   65615       }
   65616    case 6: return 0;
   65617    case 5: return 0;
   65618    case 4:
   65619       if (devinfo->is_g4x) {
   65620          return 0;
   65621       } else {
   65622          return 0;
   65623       }
   65624    default:
   65625       unreachable("Invalid hardware generation");
   65626    }
   65627 }
   65628 
   65629 
   65630 
   65631 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_start  256
   65632 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_start  256
   65633 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_start  256
   65634 
   65635 static inline uint32_t ATTRIBUTE_PURE
   65636 _3DSTATE_SAMPLE_PATTERN_2xSample0YOffset_start(const struct gen_device_info *devinfo)
   65637 {
   65638    switch (devinfo->gen) {
   65639    case 10: return 256;
   65640    case 9: return 256;
   65641    case 8: return 256;
   65642    case 7:
   65643       if (devinfo->is_haswell) {
   65644          return 0;
   65645       } else {
   65646          return 0;
   65647       }
   65648    case 6: return 0;
   65649    case 5: return 0;
   65650    case 4:
   65651       if (devinfo->is_g4x) {
   65652          return 0;
   65653       } else {
   65654          return 0;
   65655       }
   65656    default:
   65657       unreachable("Invalid hardware generation");
   65658    }
   65659 }
   65660 
   65661 
   65662 
   65663 /* 3DSTATE_SAMPLE_PATTERN::2x Sample1 X Offset */
   65664 
   65665 
   65666 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_bits  4
   65667 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_bits  4
   65668 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_bits  4
   65669 
   65670 static inline uint32_t ATTRIBUTE_PURE
   65671 _3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_bits(const struct gen_device_info *devinfo)
   65672 {
   65673    switch (devinfo->gen) {
   65674    case 10: return 4;
   65675    case 9: return 4;
   65676    case 8: return 4;
   65677    case 7:
   65678       if (devinfo->is_haswell) {
   65679          return 0;
   65680       } else {
   65681          return 0;
   65682       }
   65683    case 6: return 0;
   65684    case 5: return 0;
   65685    case 4:
   65686       if (devinfo->is_g4x) {
   65687          return 0;
   65688       } else {
   65689          return 0;
   65690       }
   65691    default:
   65692       unreachable("Invalid hardware generation");
   65693    }
   65694 }
   65695 
   65696 
   65697 
   65698 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_start  268
   65699 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_start  268
   65700 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_start  268
   65701 
   65702 static inline uint32_t ATTRIBUTE_PURE
   65703 _3DSTATE_SAMPLE_PATTERN_2xSample1XOffset_start(const struct gen_device_info *devinfo)
   65704 {
   65705    switch (devinfo->gen) {
   65706    case 10: return 268;
   65707    case 9: return 268;
   65708    case 8: return 268;
   65709    case 7:
   65710       if (devinfo->is_haswell) {
   65711          return 0;
   65712       } else {
   65713          return 0;
   65714       }
   65715    case 6: return 0;
   65716    case 5: return 0;
   65717    case 4:
   65718       if (devinfo->is_g4x) {
   65719          return 0;
   65720       } else {
   65721          return 0;
   65722       }
   65723    default:
   65724       unreachable("Invalid hardware generation");
   65725    }
   65726 }
   65727 
   65728 
   65729 
   65730 /* 3DSTATE_SAMPLE_PATTERN::2x Sample1 Y Offset */
   65731 
   65732 
   65733 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_bits  4
   65734 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_bits  4
   65735 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_bits  4
   65736 
   65737 static inline uint32_t ATTRIBUTE_PURE
   65738 _3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_bits(const struct gen_device_info *devinfo)
   65739 {
   65740    switch (devinfo->gen) {
   65741    case 10: return 4;
   65742    case 9: return 4;
   65743    case 8: return 4;
   65744    case 7:
   65745       if (devinfo->is_haswell) {
   65746          return 0;
   65747       } else {
   65748          return 0;
   65749       }
   65750    case 6: return 0;
   65751    case 5: return 0;
   65752    case 4:
   65753       if (devinfo->is_g4x) {
   65754          return 0;
   65755       } else {
   65756          return 0;
   65757       }
   65758    default:
   65759       unreachable("Invalid hardware generation");
   65760    }
   65761 }
   65762 
   65763 
   65764 
   65765 #define GEN10_3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_start  264
   65766 #define GEN9_3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_start  264
   65767 #define GEN8_3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_start  264
   65768 
   65769 static inline uint32_t ATTRIBUTE_PURE
   65770 _3DSTATE_SAMPLE_PATTERN_2xSample1YOffset_start(const struct gen_device_info *devinfo)
   65771 {
   65772    switch (devinfo->gen) {
   65773    case 10: return 264;
   65774    case 9: return 264;
   65775    case 8: return 264;
   65776    case 7:
   65777       if (devinfo->is_haswell) {
   65778          return 0;
   65779       } else {
   65780          return 0;
   65781       }
   65782    case 6: return 0;
   65783    case 5: return 0;
   65784    case 4:
   65785       if (devinfo->is_g4x) {
   65786          return 0;
   65787       } else {
   65788          return 0;
   65789       }
   65790    default:
   65791       unreachable("Invalid hardware generation");
   65792    }
   65793 }
   65794 
   65795 
   65796 
   65797 /* 3DSTATE_SAMPLE_PATTERN::3D Command Opcode */
   65798 
   65799 
   65800 #define GEN10_3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_bits  3
   65801 #define GEN9_3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_bits  3
   65802 #define GEN8_3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_bits  3
   65803 
   65804 static inline uint32_t ATTRIBUTE_PURE
   65805 _3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   65806 {
   65807    switch (devinfo->gen) {
   65808    case 10: return 3;
   65809    case 9: return 3;
   65810    case 8: return 3;
   65811    case 7:
   65812       if (devinfo->is_haswell) {
   65813          return 0;
   65814       } else {
   65815          return 0;
   65816       }
   65817    case 6: return 0;
   65818    case 5: return 0;
   65819    case 4:
   65820       if (devinfo->is_g4x) {
   65821          return 0;
   65822       } else {
   65823          return 0;
   65824       }
   65825    default:
   65826       unreachable("Invalid hardware generation");
   65827    }
   65828 }
   65829 
   65830 
   65831 
   65832 #define GEN10_3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_start  24
   65833 #define GEN9_3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_start  24
   65834 #define GEN8_3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_start  24
   65835 
   65836 static inline uint32_t ATTRIBUTE_PURE
   65837 _3DSTATE_SAMPLE_PATTERN_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   65838 {
   65839    switch (devinfo->gen) {
   65840    case 10: return 24;
   65841    case 9: return 24;
   65842    case 8: return 24;
   65843    case 7:
   65844       if (devinfo->is_haswell) {
   65845          return 0;
   65846       } else {
   65847          return 0;
   65848       }
   65849    case 6: return 0;
   65850    case 5: return 0;
   65851    case 4:
   65852       if (devinfo->is_g4x) {
   65853          return 0;
   65854       } else {
   65855          return 0;
   65856       }
   65857    default:
   65858       unreachable("Invalid hardware generation");
   65859    }
   65860 }
   65861 
   65862 
   65863 
   65864 /* 3DSTATE_SAMPLE_PATTERN::3D Command Sub Opcode */
   65865 
   65866 
   65867 #define GEN10_3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_bits  8
   65868 #define GEN9_3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_bits  8
   65869 #define GEN8_3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_bits  8
   65870 
   65871 static inline uint32_t ATTRIBUTE_PURE
   65872 _3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   65873 {
   65874    switch (devinfo->gen) {
   65875    case 10: return 8;
   65876    case 9: return 8;
   65877    case 8: return 8;
   65878    case 7:
   65879       if (devinfo->is_haswell) {
   65880          return 0;
   65881       } else {
   65882          return 0;
   65883       }
   65884    case 6: return 0;
   65885    case 5: return 0;
   65886    case 4:
   65887       if (devinfo->is_g4x) {
   65888          return 0;
   65889       } else {
   65890          return 0;
   65891       }
   65892    default:
   65893       unreachable("Invalid hardware generation");
   65894    }
   65895 }
   65896 
   65897 
   65898 
   65899 #define GEN10_3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_start  16
   65900 #define GEN9_3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_start  16
   65901 #define GEN8_3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_start  16
   65902 
   65903 static inline uint32_t ATTRIBUTE_PURE
   65904 _3DSTATE_SAMPLE_PATTERN_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   65905 {
   65906    switch (devinfo->gen) {
   65907    case 10: return 16;
   65908    case 9: return 16;
   65909    case 8: return 16;
   65910    case 7:
   65911       if (devinfo->is_haswell) {
   65912          return 0;
   65913       } else {
   65914          return 0;
   65915       }
   65916    case 6: return 0;
   65917    case 5: return 0;
   65918    case 4:
   65919       if (devinfo->is_g4x) {
   65920          return 0;
   65921       } else {
   65922          return 0;
   65923       }
   65924    default:
   65925       unreachable("Invalid hardware generation");
   65926    }
   65927 }
   65928 
   65929 
   65930 
   65931 /* 3DSTATE_SAMPLE_PATTERN::4x Sample0 X Offset */
   65932 
   65933 
   65934 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_bits  4
   65935 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_bits  4
   65936 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_bits  4
   65937 
   65938 static inline uint32_t ATTRIBUTE_PURE
   65939 _3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_bits(const struct gen_device_info *devinfo)
   65940 {
   65941    switch (devinfo->gen) {
   65942    case 10: return 4;
   65943    case 9: return 4;
   65944    case 8: return 4;
   65945    case 7:
   65946       if (devinfo->is_haswell) {
   65947          return 0;
   65948       } else {
   65949          return 0;
   65950       }
   65951    case 6: return 0;
   65952    case 5: return 0;
   65953    case 4:
   65954       if (devinfo->is_g4x) {
   65955          return 0;
   65956       } else {
   65957          return 0;
   65958       }
   65959    default:
   65960       unreachable("Invalid hardware generation");
   65961    }
   65962 }
   65963 
   65964 
   65965 
   65966 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_start  228
   65967 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_start  228
   65968 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_start  228
   65969 
   65970 static inline uint32_t ATTRIBUTE_PURE
   65971 _3DSTATE_SAMPLE_PATTERN_4xSample0XOffset_start(const struct gen_device_info *devinfo)
   65972 {
   65973    switch (devinfo->gen) {
   65974    case 10: return 228;
   65975    case 9: return 228;
   65976    case 8: return 228;
   65977    case 7:
   65978       if (devinfo->is_haswell) {
   65979          return 0;
   65980       } else {
   65981          return 0;
   65982       }
   65983    case 6: return 0;
   65984    case 5: return 0;
   65985    case 4:
   65986       if (devinfo->is_g4x) {
   65987          return 0;
   65988       } else {
   65989          return 0;
   65990       }
   65991    default:
   65992       unreachable("Invalid hardware generation");
   65993    }
   65994 }
   65995 
   65996 
   65997 
   65998 /* 3DSTATE_SAMPLE_PATTERN::4x Sample0 Y Offset */
   65999 
   66000 
   66001 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_bits  4
   66002 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_bits  4
   66003 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_bits  4
   66004 
   66005 static inline uint32_t ATTRIBUTE_PURE
   66006 _3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_bits(const struct gen_device_info *devinfo)
   66007 {
   66008    switch (devinfo->gen) {
   66009    case 10: return 4;
   66010    case 9: return 4;
   66011    case 8: return 4;
   66012    case 7:
   66013       if (devinfo->is_haswell) {
   66014          return 0;
   66015       } else {
   66016          return 0;
   66017       }
   66018    case 6: return 0;
   66019    case 5: return 0;
   66020    case 4:
   66021       if (devinfo->is_g4x) {
   66022          return 0;
   66023       } else {
   66024          return 0;
   66025       }
   66026    default:
   66027       unreachable("Invalid hardware generation");
   66028    }
   66029 }
   66030 
   66031 
   66032 
   66033 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_start  224
   66034 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_start  224
   66035 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_start  224
   66036 
   66037 static inline uint32_t ATTRIBUTE_PURE
   66038 _3DSTATE_SAMPLE_PATTERN_4xSample0YOffset_start(const struct gen_device_info *devinfo)
   66039 {
   66040    switch (devinfo->gen) {
   66041    case 10: return 224;
   66042    case 9: return 224;
   66043    case 8: return 224;
   66044    case 7:
   66045       if (devinfo->is_haswell) {
   66046          return 0;
   66047       } else {
   66048          return 0;
   66049       }
   66050    case 6: return 0;
   66051    case 5: return 0;
   66052    case 4:
   66053       if (devinfo->is_g4x) {
   66054          return 0;
   66055       } else {
   66056          return 0;
   66057       }
   66058    default:
   66059       unreachable("Invalid hardware generation");
   66060    }
   66061 }
   66062 
   66063 
   66064 
   66065 /* 3DSTATE_SAMPLE_PATTERN::4x Sample1 X Offset */
   66066 
   66067 
   66068 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_bits  4
   66069 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_bits  4
   66070 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_bits  4
   66071 
   66072 static inline uint32_t ATTRIBUTE_PURE
   66073 _3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_bits(const struct gen_device_info *devinfo)
   66074 {
   66075    switch (devinfo->gen) {
   66076    case 10: return 4;
   66077    case 9: return 4;
   66078    case 8: return 4;
   66079    case 7:
   66080       if (devinfo->is_haswell) {
   66081          return 0;
   66082       } else {
   66083          return 0;
   66084       }
   66085    case 6: return 0;
   66086    case 5: return 0;
   66087    case 4:
   66088       if (devinfo->is_g4x) {
   66089          return 0;
   66090       } else {
   66091          return 0;
   66092       }
   66093    default:
   66094       unreachable("Invalid hardware generation");
   66095    }
   66096 }
   66097 
   66098 
   66099 
   66100 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_start  236
   66101 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_start  236
   66102 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_start  236
   66103 
   66104 static inline uint32_t ATTRIBUTE_PURE
   66105 _3DSTATE_SAMPLE_PATTERN_4xSample1XOffset_start(const struct gen_device_info *devinfo)
   66106 {
   66107    switch (devinfo->gen) {
   66108    case 10: return 236;
   66109    case 9: return 236;
   66110    case 8: return 236;
   66111    case 7:
   66112       if (devinfo->is_haswell) {
   66113          return 0;
   66114       } else {
   66115          return 0;
   66116       }
   66117    case 6: return 0;
   66118    case 5: return 0;
   66119    case 4:
   66120       if (devinfo->is_g4x) {
   66121          return 0;
   66122       } else {
   66123          return 0;
   66124       }
   66125    default:
   66126       unreachable("Invalid hardware generation");
   66127    }
   66128 }
   66129 
   66130 
   66131 
   66132 /* 3DSTATE_SAMPLE_PATTERN::4x Sample1 Y Offset */
   66133 
   66134 
   66135 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_bits  4
   66136 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_bits  4
   66137 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_bits  4
   66138 
   66139 static inline uint32_t ATTRIBUTE_PURE
   66140 _3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_bits(const struct gen_device_info *devinfo)
   66141 {
   66142    switch (devinfo->gen) {
   66143    case 10: return 4;
   66144    case 9: return 4;
   66145    case 8: return 4;
   66146    case 7:
   66147       if (devinfo->is_haswell) {
   66148          return 0;
   66149       } else {
   66150          return 0;
   66151       }
   66152    case 6: return 0;
   66153    case 5: return 0;
   66154    case 4:
   66155       if (devinfo->is_g4x) {
   66156          return 0;
   66157       } else {
   66158          return 0;
   66159       }
   66160    default:
   66161       unreachable("Invalid hardware generation");
   66162    }
   66163 }
   66164 
   66165 
   66166 
   66167 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_start  232
   66168 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_start  232
   66169 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_start  232
   66170 
   66171 static inline uint32_t ATTRIBUTE_PURE
   66172 _3DSTATE_SAMPLE_PATTERN_4xSample1YOffset_start(const struct gen_device_info *devinfo)
   66173 {
   66174    switch (devinfo->gen) {
   66175    case 10: return 232;
   66176    case 9: return 232;
   66177    case 8: return 232;
   66178    case 7:
   66179       if (devinfo->is_haswell) {
   66180          return 0;
   66181       } else {
   66182          return 0;
   66183       }
   66184    case 6: return 0;
   66185    case 5: return 0;
   66186    case 4:
   66187       if (devinfo->is_g4x) {
   66188          return 0;
   66189       } else {
   66190          return 0;
   66191       }
   66192    default:
   66193       unreachable("Invalid hardware generation");
   66194    }
   66195 }
   66196 
   66197 
   66198 
   66199 /* 3DSTATE_SAMPLE_PATTERN::4x Sample2 X Offset */
   66200 
   66201 
   66202 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_bits  4
   66203 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_bits  4
   66204 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_bits  4
   66205 
   66206 static inline uint32_t ATTRIBUTE_PURE
   66207 _3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_bits(const struct gen_device_info *devinfo)
   66208 {
   66209    switch (devinfo->gen) {
   66210    case 10: return 4;
   66211    case 9: return 4;
   66212    case 8: return 4;
   66213    case 7:
   66214       if (devinfo->is_haswell) {
   66215          return 0;
   66216       } else {
   66217          return 0;
   66218       }
   66219    case 6: return 0;
   66220    case 5: return 0;
   66221    case 4:
   66222       if (devinfo->is_g4x) {
   66223          return 0;
   66224       } else {
   66225          return 0;
   66226       }
   66227    default:
   66228       unreachable("Invalid hardware generation");
   66229    }
   66230 }
   66231 
   66232 
   66233 
   66234 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_start  244
   66235 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_start  244
   66236 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_start  244
   66237 
   66238 static inline uint32_t ATTRIBUTE_PURE
   66239 _3DSTATE_SAMPLE_PATTERN_4xSample2XOffset_start(const struct gen_device_info *devinfo)
   66240 {
   66241    switch (devinfo->gen) {
   66242    case 10: return 244;
   66243    case 9: return 244;
   66244    case 8: return 244;
   66245    case 7:
   66246       if (devinfo->is_haswell) {
   66247          return 0;
   66248       } else {
   66249          return 0;
   66250       }
   66251    case 6: return 0;
   66252    case 5: return 0;
   66253    case 4:
   66254       if (devinfo->is_g4x) {
   66255          return 0;
   66256       } else {
   66257          return 0;
   66258       }
   66259    default:
   66260       unreachable("Invalid hardware generation");
   66261    }
   66262 }
   66263 
   66264 
   66265 
   66266 /* 3DSTATE_SAMPLE_PATTERN::4x Sample2 Y Offset */
   66267 
   66268 
   66269 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_bits  4
   66270 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_bits  4
   66271 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_bits  4
   66272 
   66273 static inline uint32_t ATTRIBUTE_PURE
   66274 _3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_bits(const struct gen_device_info *devinfo)
   66275 {
   66276    switch (devinfo->gen) {
   66277    case 10: return 4;
   66278    case 9: return 4;
   66279    case 8: return 4;
   66280    case 7:
   66281       if (devinfo->is_haswell) {
   66282          return 0;
   66283       } else {
   66284          return 0;
   66285       }
   66286    case 6: return 0;
   66287    case 5: return 0;
   66288    case 4:
   66289       if (devinfo->is_g4x) {
   66290          return 0;
   66291       } else {
   66292          return 0;
   66293       }
   66294    default:
   66295       unreachable("Invalid hardware generation");
   66296    }
   66297 }
   66298 
   66299 
   66300 
   66301 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_start  240
   66302 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_start  240
   66303 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_start  240
   66304 
   66305 static inline uint32_t ATTRIBUTE_PURE
   66306 _3DSTATE_SAMPLE_PATTERN_4xSample2YOffset_start(const struct gen_device_info *devinfo)
   66307 {
   66308    switch (devinfo->gen) {
   66309    case 10: return 240;
   66310    case 9: return 240;
   66311    case 8: return 240;
   66312    case 7:
   66313       if (devinfo->is_haswell) {
   66314          return 0;
   66315       } else {
   66316          return 0;
   66317       }
   66318    case 6: return 0;
   66319    case 5: return 0;
   66320    case 4:
   66321       if (devinfo->is_g4x) {
   66322          return 0;
   66323       } else {
   66324          return 0;
   66325       }
   66326    default:
   66327       unreachable("Invalid hardware generation");
   66328    }
   66329 }
   66330 
   66331 
   66332 
   66333 /* 3DSTATE_SAMPLE_PATTERN::4x Sample3 X Offset */
   66334 
   66335 
   66336 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_bits  4
   66337 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_bits  4
   66338 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_bits  4
   66339 
   66340 static inline uint32_t ATTRIBUTE_PURE
   66341 _3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_bits(const struct gen_device_info *devinfo)
   66342 {
   66343    switch (devinfo->gen) {
   66344    case 10: return 4;
   66345    case 9: return 4;
   66346    case 8: return 4;
   66347    case 7:
   66348       if (devinfo->is_haswell) {
   66349          return 0;
   66350       } else {
   66351          return 0;
   66352       }
   66353    case 6: return 0;
   66354    case 5: return 0;
   66355    case 4:
   66356       if (devinfo->is_g4x) {
   66357          return 0;
   66358       } else {
   66359          return 0;
   66360       }
   66361    default:
   66362       unreachable("Invalid hardware generation");
   66363    }
   66364 }
   66365 
   66366 
   66367 
   66368 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_start  252
   66369 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_start  252
   66370 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_start  252
   66371 
   66372 static inline uint32_t ATTRIBUTE_PURE
   66373 _3DSTATE_SAMPLE_PATTERN_4xSample3XOffset_start(const struct gen_device_info *devinfo)
   66374 {
   66375    switch (devinfo->gen) {
   66376    case 10: return 252;
   66377    case 9: return 252;
   66378    case 8: return 252;
   66379    case 7:
   66380       if (devinfo->is_haswell) {
   66381          return 0;
   66382       } else {
   66383          return 0;
   66384       }
   66385    case 6: return 0;
   66386    case 5: return 0;
   66387    case 4:
   66388       if (devinfo->is_g4x) {
   66389          return 0;
   66390       } else {
   66391          return 0;
   66392       }
   66393    default:
   66394       unreachable("Invalid hardware generation");
   66395    }
   66396 }
   66397 
   66398 
   66399 
   66400 /* 3DSTATE_SAMPLE_PATTERN::4x Sample3 Y Offset */
   66401 
   66402 
   66403 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_bits  4
   66404 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_bits  4
   66405 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_bits  4
   66406 
   66407 static inline uint32_t ATTRIBUTE_PURE
   66408 _3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_bits(const struct gen_device_info *devinfo)
   66409 {
   66410    switch (devinfo->gen) {
   66411    case 10: return 4;
   66412    case 9: return 4;
   66413    case 8: return 4;
   66414    case 7:
   66415       if (devinfo->is_haswell) {
   66416          return 0;
   66417       } else {
   66418          return 0;
   66419       }
   66420    case 6: return 0;
   66421    case 5: return 0;
   66422    case 4:
   66423       if (devinfo->is_g4x) {
   66424          return 0;
   66425       } else {
   66426          return 0;
   66427       }
   66428    default:
   66429       unreachable("Invalid hardware generation");
   66430    }
   66431 }
   66432 
   66433 
   66434 
   66435 #define GEN10_3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_start  248
   66436 #define GEN9_3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_start  248
   66437 #define GEN8_3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_start  248
   66438 
   66439 static inline uint32_t ATTRIBUTE_PURE
   66440 _3DSTATE_SAMPLE_PATTERN_4xSample3YOffset_start(const struct gen_device_info *devinfo)
   66441 {
   66442    switch (devinfo->gen) {
   66443    case 10: return 248;
   66444    case 9: return 248;
   66445    case 8: return 248;
   66446    case 7:
   66447       if (devinfo->is_haswell) {
   66448          return 0;
   66449       } else {
   66450          return 0;
   66451       }
   66452    case 6: return 0;
   66453    case 5: return 0;
   66454    case 4:
   66455       if (devinfo->is_g4x) {
   66456          return 0;
   66457       } else {
   66458          return 0;
   66459       }
   66460    default:
   66461       unreachable("Invalid hardware generation");
   66462    }
   66463 }
   66464 
   66465 
   66466 
   66467 /* 3DSTATE_SAMPLE_PATTERN::8x Sample0 X Offset */
   66468 
   66469 
   66470 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_bits  4
   66471 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_bits  4
   66472 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_bits  4
   66473 
   66474 static inline uint32_t ATTRIBUTE_PURE
   66475 _3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_bits(const struct gen_device_info *devinfo)
   66476 {
   66477    switch (devinfo->gen) {
   66478    case 10: return 4;
   66479    case 9: return 4;
   66480    case 8: return 4;
   66481    case 7:
   66482       if (devinfo->is_haswell) {
   66483          return 0;
   66484       } else {
   66485          return 0;
   66486       }
   66487    case 6: return 0;
   66488    case 5: return 0;
   66489    case 4:
   66490       if (devinfo->is_g4x) {
   66491          return 0;
   66492       } else {
   66493          return 0;
   66494       }
   66495    default:
   66496       unreachable("Invalid hardware generation");
   66497    }
   66498 }
   66499 
   66500 
   66501 
   66502 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_start  196
   66503 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_start  196
   66504 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_start  196
   66505 
   66506 static inline uint32_t ATTRIBUTE_PURE
   66507 _3DSTATE_SAMPLE_PATTERN_8xSample0XOffset_start(const struct gen_device_info *devinfo)
   66508 {
   66509    switch (devinfo->gen) {
   66510    case 10: return 196;
   66511    case 9: return 196;
   66512    case 8: return 196;
   66513    case 7:
   66514       if (devinfo->is_haswell) {
   66515          return 0;
   66516       } else {
   66517          return 0;
   66518       }
   66519    case 6: return 0;
   66520    case 5: return 0;
   66521    case 4:
   66522       if (devinfo->is_g4x) {
   66523          return 0;
   66524       } else {
   66525          return 0;
   66526       }
   66527    default:
   66528       unreachable("Invalid hardware generation");
   66529    }
   66530 }
   66531 
   66532 
   66533 
   66534 /* 3DSTATE_SAMPLE_PATTERN::8x Sample0 Y Offset */
   66535 
   66536 
   66537 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_bits  4
   66538 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_bits  4
   66539 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_bits  4
   66540 
   66541 static inline uint32_t ATTRIBUTE_PURE
   66542 _3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_bits(const struct gen_device_info *devinfo)
   66543 {
   66544    switch (devinfo->gen) {
   66545    case 10: return 4;
   66546    case 9: return 4;
   66547    case 8: return 4;
   66548    case 7:
   66549       if (devinfo->is_haswell) {
   66550          return 0;
   66551       } else {
   66552          return 0;
   66553       }
   66554    case 6: return 0;
   66555    case 5: return 0;
   66556    case 4:
   66557       if (devinfo->is_g4x) {
   66558          return 0;
   66559       } else {
   66560          return 0;
   66561       }
   66562    default:
   66563       unreachable("Invalid hardware generation");
   66564    }
   66565 }
   66566 
   66567 
   66568 
   66569 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_start  192
   66570 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_start  192
   66571 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_start  192
   66572 
   66573 static inline uint32_t ATTRIBUTE_PURE
   66574 _3DSTATE_SAMPLE_PATTERN_8xSample0YOffset_start(const struct gen_device_info *devinfo)
   66575 {
   66576    switch (devinfo->gen) {
   66577    case 10: return 192;
   66578    case 9: return 192;
   66579    case 8: return 192;
   66580    case 7:
   66581       if (devinfo->is_haswell) {
   66582          return 0;
   66583       } else {
   66584          return 0;
   66585       }
   66586    case 6: return 0;
   66587    case 5: return 0;
   66588    case 4:
   66589       if (devinfo->is_g4x) {
   66590          return 0;
   66591       } else {
   66592          return 0;
   66593       }
   66594    default:
   66595       unreachable("Invalid hardware generation");
   66596    }
   66597 }
   66598 
   66599 
   66600 
   66601 /* 3DSTATE_SAMPLE_PATTERN::8x Sample1 X Offset */
   66602 
   66603 
   66604 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_bits  4
   66605 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_bits  4
   66606 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_bits  4
   66607 
   66608 static inline uint32_t ATTRIBUTE_PURE
   66609 _3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_bits(const struct gen_device_info *devinfo)
   66610 {
   66611    switch (devinfo->gen) {
   66612    case 10: return 4;
   66613    case 9: return 4;
   66614    case 8: return 4;
   66615    case 7:
   66616       if (devinfo->is_haswell) {
   66617          return 0;
   66618       } else {
   66619          return 0;
   66620       }
   66621    case 6: return 0;
   66622    case 5: return 0;
   66623    case 4:
   66624       if (devinfo->is_g4x) {
   66625          return 0;
   66626       } else {
   66627          return 0;
   66628       }
   66629    default:
   66630       unreachable("Invalid hardware generation");
   66631    }
   66632 }
   66633 
   66634 
   66635 
   66636 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_start  204
   66637 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_start  204
   66638 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_start  204
   66639 
   66640 static inline uint32_t ATTRIBUTE_PURE
   66641 _3DSTATE_SAMPLE_PATTERN_8xSample1XOffset_start(const struct gen_device_info *devinfo)
   66642 {
   66643    switch (devinfo->gen) {
   66644    case 10: return 204;
   66645    case 9: return 204;
   66646    case 8: return 204;
   66647    case 7:
   66648       if (devinfo->is_haswell) {
   66649          return 0;
   66650       } else {
   66651          return 0;
   66652       }
   66653    case 6: return 0;
   66654    case 5: return 0;
   66655    case 4:
   66656       if (devinfo->is_g4x) {
   66657          return 0;
   66658       } else {
   66659          return 0;
   66660       }
   66661    default:
   66662       unreachable("Invalid hardware generation");
   66663    }
   66664 }
   66665 
   66666 
   66667 
   66668 /* 3DSTATE_SAMPLE_PATTERN::8x Sample1 Y Offset */
   66669 
   66670 
   66671 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_bits  4
   66672 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_bits  4
   66673 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_bits  4
   66674 
   66675 static inline uint32_t ATTRIBUTE_PURE
   66676 _3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_bits(const struct gen_device_info *devinfo)
   66677 {
   66678    switch (devinfo->gen) {
   66679    case 10: return 4;
   66680    case 9: return 4;
   66681    case 8: return 4;
   66682    case 7:
   66683       if (devinfo->is_haswell) {
   66684          return 0;
   66685       } else {
   66686          return 0;
   66687       }
   66688    case 6: return 0;
   66689    case 5: return 0;
   66690    case 4:
   66691       if (devinfo->is_g4x) {
   66692          return 0;
   66693       } else {
   66694          return 0;
   66695       }
   66696    default:
   66697       unreachable("Invalid hardware generation");
   66698    }
   66699 }
   66700 
   66701 
   66702 
   66703 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_start  200
   66704 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_start  200
   66705 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_start  200
   66706 
   66707 static inline uint32_t ATTRIBUTE_PURE
   66708 _3DSTATE_SAMPLE_PATTERN_8xSample1YOffset_start(const struct gen_device_info *devinfo)
   66709 {
   66710    switch (devinfo->gen) {
   66711    case 10: return 200;
   66712    case 9: return 200;
   66713    case 8: return 200;
   66714    case 7:
   66715       if (devinfo->is_haswell) {
   66716          return 0;
   66717       } else {
   66718          return 0;
   66719       }
   66720    case 6: return 0;
   66721    case 5: return 0;
   66722    case 4:
   66723       if (devinfo->is_g4x) {
   66724          return 0;
   66725       } else {
   66726          return 0;
   66727       }
   66728    default:
   66729       unreachable("Invalid hardware generation");
   66730    }
   66731 }
   66732 
   66733 
   66734 
   66735 /* 3DSTATE_SAMPLE_PATTERN::8x Sample2 X Offset */
   66736 
   66737 
   66738 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_bits  4
   66739 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_bits  4
   66740 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_bits  4
   66741 
   66742 static inline uint32_t ATTRIBUTE_PURE
   66743 _3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_bits(const struct gen_device_info *devinfo)
   66744 {
   66745    switch (devinfo->gen) {
   66746    case 10: return 4;
   66747    case 9: return 4;
   66748    case 8: return 4;
   66749    case 7:
   66750       if (devinfo->is_haswell) {
   66751          return 0;
   66752       } else {
   66753          return 0;
   66754       }
   66755    case 6: return 0;
   66756    case 5: return 0;
   66757    case 4:
   66758       if (devinfo->is_g4x) {
   66759          return 0;
   66760       } else {
   66761          return 0;
   66762       }
   66763    default:
   66764       unreachable("Invalid hardware generation");
   66765    }
   66766 }
   66767 
   66768 
   66769 
   66770 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_start  212
   66771 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_start  212
   66772 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_start  212
   66773 
   66774 static inline uint32_t ATTRIBUTE_PURE
   66775 _3DSTATE_SAMPLE_PATTERN_8xSample2XOffset_start(const struct gen_device_info *devinfo)
   66776 {
   66777    switch (devinfo->gen) {
   66778    case 10: return 212;
   66779    case 9: return 212;
   66780    case 8: return 212;
   66781    case 7:
   66782       if (devinfo->is_haswell) {
   66783          return 0;
   66784       } else {
   66785          return 0;
   66786       }
   66787    case 6: return 0;
   66788    case 5: return 0;
   66789    case 4:
   66790       if (devinfo->is_g4x) {
   66791          return 0;
   66792       } else {
   66793          return 0;
   66794       }
   66795    default:
   66796       unreachable("Invalid hardware generation");
   66797    }
   66798 }
   66799 
   66800 
   66801 
   66802 /* 3DSTATE_SAMPLE_PATTERN::8x Sample2 Y Offset */
   66803 
   66804 
   66805 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_bits  4
   66806 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_bits  4
   66807 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_bits  4
   66808 
   66809 static inline uint32_t ATTRIBUTE_PURE
   66810 _3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_bits(const struct gen_device_info *devinfo)
   66811 {
   66812    switch (devinfo->gen) {
   66813    case 10: return 4;
   66814    case 9: return 4;
   66815    case 8: return 4;
   66816    case 7:
   66817       if (devinfo->is_haswell) {
   66818          return 0;
   66819       } else {
   66820          return 0;
   66821       }
   66822    case 6: return 0;
   66823    case 5: return 0;
   66824    case 4:
   66825       if (devinfo->is_g4x) {
   66826          return 0;
   66827       } else {
   66828          return 0;
   66829       }
   66830    default:
   66831       unreachable("Invalid hardware generation");
   66832    }
   66833 }
   66834 
   66835 
   66836 
   66837 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_start  208
   66838 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_start  208
   66839 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_start  208
   66840 
   66841 static inline uint32_t ATTRIBUTE_PURE
   66842 _3DSTATE_SAMPLE_PATTERN_8xSample2YOffset_start(const struct gen_device_info *devinfo)
   66843 {
   66844    switch (devinfo->gen) {
   66845    case 10: return 208;
   66846    case 9: return 208;
   66847    case 8: return 208;
   66848    case 7:
   66849       if (devinfo->is_haswell) {
   66850          return 0;
   66851       } else {
   66852          return 0;
   66853       }
   66854    case 6: return 0;
   66855    case 5: return 0;
   66856    case 4:
   66857       if (devinfo->is_g4x) {
   66858          return 0;
   66859       } else {
   66860          return 0;
   66861       }
   66862    default:
   66863       unreachable("Invalid hardware generation");
   66864    }
   66865 }
   66866 
   66867 
   66868 
   66869 /* 3DSTATE_SAMPLE_PATTERN::8x Sample3 X Offset */
   66870 
   66871 
   66872 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_bits  4
   66873 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_bits  4
   66874 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_bits  4
   66875 
   66876 static inline uint32_t ATTRIBUTE_PURE
   66877 _3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_bits(const struct gen_device_info *devinfo)
   66878 {
   66879    switch (devinfo->gen) {
   66880    case 10: return 4;
   66881    case 9: return 4;
   66882    case 8: return 4;
   66883    case 7:
   66884       if (devinfo->is_haswell) {
   66885          return 0;
   66886       } else {
   66887          return 0;
   66888       }
   66889    case 6: return 0;
   66890    case 5: return 0;
   66891    case 4:
   66892       if (devinfo->is_g4x) {
   66893          return 0;
   66894       } else {
   66895          return 0;
   66896       }
   66897    default:
   66898       unreachable("Invalid hardware generation");
   66899    }
   66900 }
   66901 
   66902 
   66903 
   66904 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_start  220
   66905 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_start  220
   66906 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_start  220
   66907 
   66908 static inline uint32_t ATTRIBUTE_PURE
   66909 _3DSTATE_SAMPLE_PATTERN_8xSample3XOffset_start(const struct gen_device_info *devinfo)
   66910 {
   66911    switch (devinfo->gen) {
   66912    case 10: return 220;
   66913    case 9: return 220;
   66914    case 8: return 220;
   66915    case 7:
   66916       if (devinfo->is_haswell) {
   66917          return 0;
   66918       } else {
   66919          return 0;
   66920       }
   66921    case 6: return 0;
   66922    case 5: return 0;
   66923    case 4:
   66924       if (devinfo->is_g4x) {
   66925          return 0;
   66926       } else {
   66927          return 0;
   66928       }
   66929    default:
   66930       unreachable("Invalid hardware generation");
   66931    }
   66932 }
   66933 
   66934 
   66935 
   66936 /* 3DSTATE_SAMPLE_PATTERN::8x Sample3 Y Offset */
   66937 
   66938 
   66939 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_bits  4
   66940 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_bits  4
   66941 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_bits  4
   66942 
   66943 static inline uint32_t ATTRIBUTE_PURE
   66944 _3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_bits(const struct gen_device_info *devinfo)
   66945 {
   66946    switch (devinfo->gen) {
   66947    case 10: return 4;
   66948    case 9: return 4;
   66949    case 8: return 4;
   66950    case 7:
   66951       if (devinfo->is_haswell) {
   66952          return 0;
   66953       } else {
   66954          return 0;
   66955       }
   66956    case 6: return 0;
   66957    case 5: return 0;
   66958    case 4:
   66959       if (devinfo->is_g4x) {
   66960          return 0;
   66961       } else {
   66962          return 0;
   66963       }
   66964    default:
   66965       unreachable("Invalid hardware generation");
   66966    }
   66967 }
   66968 
   66969 
   66970 
   66971 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_start  216
   66972 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_start  216
   66973 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_start  216
   66974 
   66975 static inline uint32_t ATTRIBUTE_PURE
   66976 _3DSTATE_SAMPLE_PATTERN_8xSample3YOffset_start(const struct gen_device_info *devinfo)
   66977 {
   66978    switch (devinfo->gen) {
   66979    case 10: return 216;
   66980    case 9: return 216;
   66981    case 8: return 216;
   66982    case 7:
   66983       if (devinfo->is_haswell) {
   66984          return 0;
   66985       } else {
   66986          return 0;
   66987       }
   66988    case 6: return 0;
   66989    case 5: return 0;
   66990    case 4:
   66991       if (devinfo->is_g4x) {
   66992          return 0;
   66993       } else {
   66994          return 0;
   66995       }
   66996    default:
   66997       unreachable("Invalid hardware generation");
   66998    }
   66999 }
   67000 
   67001 
   67002 
   67003 /* 3DSTATE_SAMPLE_PATTERN::8x Sample4 X Offset */
   67004 
   67005 
   67006 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_bits  4
   67007 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_bits  4
   67008 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_bits  4
   67009 
   67010 static inline uint32_t ATTRIBUTE_PURE
   67011 _3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_bits(const struct gen_device_info *devinfo)
   67012 {
   67013    switch (devinfo->gen) {
   67014    case 10: return 4;
   67015    case 9: return 4;
   67016    case 8: return 4;
   67017    case 7:
   67018       if (devinfo->is_haswell) {
   67019          return 0;
   67020       } else {
   67021          return 0;
   67022       }
   67023    case 6: return 0;
   67024    case 5: return 0;
   67025    case 4:
   67026       if (devinfo->is_g4x) {
   67027          return 0;
   67028       } else {
   67029          return 0;
   67030       }
   67031    default:
   67032       unreachable("Invalid hardware generation");
   67033    }
   67034 }
   67035 
   67036 
   67037 
   67038 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_start  164
   67039 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_start  164
   67040 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_start  164
   67041 
   67042 static inline uint32_t ATTRIBUTE_PURE
   67043 _3DSTATE_SAMPLE_PATTERN_8xSample4XOffset_start(const struct gen_device_info *devinfo)
   67044 {
   67045    switch (devinfo->gen) {
   67046    case 10: return 164;
   67047    case 9: return 164;
   67048    case 8: return 164;
   67049    case 7:
   67050       if (devinfo->is_haswell) {
   67051          return 0;
   67052       } else {
   67053          return 0;
   67054       }
   67055    case 6: return 0;
   67056    case 5: return 0;
   67057    case 4:
   67058       if (devinfo->is_g4x) {
   67059          return 0;
   67060       } else {
   67061          return 0;
   67062       }
   67063    default:
   67064       unreachable("Invalid hardware generation");
   67065    }
   67066 }
   67067 
   67068 
   67069 
   67070 /* 3DSTATE_SAMPLE_PATTERN::8x Sample4 Y Offset */
   67071 
   67072 
   67073 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_bits  4
   67074 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_bits  4
   67075 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_bits  4
   67076 
   67077 static inline uint32_t ATTRIBUTE_PURE
   67078 _3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_bits(const struct gen_device_info *devinfo)
   67079 {
   67080    switch (devinfo->gen) {
   67081    case 10: return 4;
   67082    case 9: return 4;
   67083    case 8: return 4;
   67084    case 7:
   67085       if (devinfo->is_haswell) {
   67086          return 0;
   67087       } else {
   67088          return 0;
   67089       }
   67090    case 6: return 0;
   67091    case 5: return 0;
   67092    case 4:
   67093       if (devinfo->is_g4x) {
   67094          return 0;
   67095       } else {
   67096          return 0;
   67097       }
   67098    default:
   67099       unreachable("Invalid hardware generation");
   67100    }
   67101 }
   67102 
   67103 
   67104 
   67105 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_start  160
   67106 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_start  160
   67107 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_start  160
   67108 
   67109 static inline uint32_t ATTRIBUTE_PURE
   67110 _3DSTATE_SAMPLE_PATTERN_8xSample4YOffset_start(const struct gen_device_info *devinfo)
   67111 {
   67112    switch (devinfo->gen) {
   67113    case 10: return 160;
   67114    case 9: return 160;
   67115    case 8: return 160;
   67116    case 7:
   67117       if (devinfo->is_haswell) {
   67118          return 0;
   67119       } else {
   67120          return 0;
   67121       }
   67122    case 6: return 0;
   67123    case 5: return 0;
   67124    case 4:
   67125       if (devinfo->is_g4x) {
   67126          return 0;
   67127       } else {
   67128          return 0;
   67129       }
   67130    default:
   67131       unreachable("Invalid hardware generation");
   67132    }
   67133 }
   67134 
   67135 
   67136 
   67137 /* 3DSTATE_SAMPLE_PATTERN::8x Sample5 X Offset */
   67138 
   67139 
   67140 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_bits  4
   67141 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_bits  4
   67142 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_bits  4
   67143 
   67144 static inline uint32_t ATTRIBUTE_PURE
   67145 _3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_bits(const struct gen_device_info *devinfo)
   67146 {
   67147    switch (devinfo->gen) {
   67148    case 10: return 4;
   67149    case 9: return 4;
   67150    case 8: return 4;
   67151    case 7:
   67152       if (devinfo->is_haswell) {
   67153          return 0;
   67154       } else {
   67155          return 0;
   67156       }
   67157    case 6: return 0;
   67158    case 5: return 0;
   67159    case 4:
   67160       if (devinfo->is_g4x) {
   67161          return 0;
   67162       } else {
   67163          return 0;
   67164       }
   67165    default:
   67166       unreachable("Invalid hardware generation");
   67167    }
   67168 }
   67169 
   67170 
   67171 
   67172 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_start  172
   67173 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_start  172
   67174 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_start  172
   67175 
   67176 static inline uint32_t ATTRIBUTE_PURE
   67177 _3DSTATE_SAMPLE_PATTERN_8xSample5XOffset_start(const struct gen_device_info *devinfo)
   67178 {
   67179    switch (devinfo->gen) {
   67180    case 10: return 172;
   67181    case 9: return 172;
   67182    case 8: return 172;
   67183    case 7:
   67184       if (devinfo->is_haswell) {
   67185          return 0;
   67186       } else {
   67187          return 0;
   67188       }
   67189    case 6: return 0;
   67190    case 5: return 0;
   67191    case 4:
   67192       if (devinfo->is_g4x) {
   67193          return 0;
   67194       } else {
   67195          return 0;
   67196       }
   67197    default:
   67198       unreachable("Invalid hardware generation");
   67199    }
   67200 }
   67201 
   67202 
   67203 
   67204 /* 3DSTATE_SAMPLE_PATTERN::8x Sample5 Y Offset */
   67205 
   67206 
   67207 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_bits  4
   67208 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_bits  4
   67209 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_bits  4
   67210 
   67211 static inline uint32_t ATTRIBUTE_PURE
   67212 _3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_bits(const struct gen_device_info *devinfo)
   67213 {
   67214    switch (devinfo->gen) {
   67215    case 10: return 4;
   67216    case 9: return 4;
   67217    case 8: return 4;
   67218    case 7:
   67219       if (devinfo->is_haswell) {
   67220          return 0;
   67221       } else {
   67222          return 0;
   67223       }
   67224    case 6: return 0;
   67225    case 5: return 0;
   67226    case 4:
   67227       if (devinfo->is_g4x) {
   67228          return 0;
   67229       } else {
   67230          return 0;
   67231       }
   67232    default:
   67233       unreachable("Invalid hardware generation");
   67234    }
   67235 }
   67236 
   67237 
   67238 
   67239 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_start  168
   67240 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_start  168
   67241 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_start  168
   67242 
   67243 static inline uint32_t ATTRIBUTE_PURE
   67244 _3DSTATE_SAMPLE_PATTERN_8xSample5YOffset_start(const struct gen_device_info *devinfo)
   67245 {
   67246    switch (devinfo->gen) {
   67247    case 10: return 168;
   67248    case 9: return 168;
   67249    case 8: return 168;
   67250    case 7:
   67251       if (devinfo->is_haswell) {
   67252          return 0;
   67253       } else {
   67254          return 0;
   67255       }
   67256    case 6: return 0;
   67257    case 5: return 0;
   67258    case 4:
   67259       if (devinfo->is_g4x) {
   67260          return 0;
   67261       } else {
   67262          return 0;
   67263       }
   67264    default:
   67265       unreachable("Invalid hardware generation");
   67266    }
   67267 }
   67268 
   67269 
   67270 
   67271 /* 3DSTATE_SAMPLE_PATTERN::8x Sample6 X Offset */
   67272 
   67273 
   67274 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_bits  4
   67275 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_bits  4
   67276 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_bits  4
   67277 
   67278 static inline uint32_t ATTRIBUTE_PURE
   67279 _3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_bits(const struct gen_device_info *devinfo)
   67280 {
   67281    switch (devinfo->gen) {
   67282    case 10: return 4;
   67283    case 9: return 4;
   67284    case 8: return 4;
   67285    case 7:
   67286       if (devinfo->is_haswell) {
   67287          return 0;
   67288       } else {
   67289          return 0;
   67290       }
   67291    case 6: return 0;
   67292    case 5: return 0;
   67293    case 4:
   67294       if (devinfo->is_g4x) {
   67295          return 0;
   67296       } else {
   67297          return 0;
   67298       }
   67299    default:
   67300       unreachable("Invalid hardware generation");
   67301    }
   67302 }
   67303 
   67304 
   67305 
   67306 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_start  180
   67307 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_start  180
   67308 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_start  180
   67309 
   67310 static inline uint32_t ATTRIBUTE_PURE
   67311 _3DSTATE_SAMPLE_PATTERN_8xSample6XOffset_start(const struct gen_device_info *devinfo)
   67312 {
   67313    switch (devinfo->gen) {
   67314    case 10: return 180;
   67315    case 9: return 180;
   67316    case 8: return 180;
   67317    case 7:
   67318       if (devinfo->is_haswell) {
   67319          return 0;
   67320       } else {
   67321          return 0;
   67322       }
   67323    case 6: return 0;
   67324    case 5: return 0;
   67325    case 4:
   67326       if (devinfo->is_g4x) {
   67327          return 0;
   67328       } else {
   67329          return 0;
   67330       }
   67331    default:
   67332       unreachable("Invalid hardware generation");
   67333    }
   67334 }
   67335 
   67336 
   67337 
   67338 /* 3DSTATE_SAMPLE_PATTERN::8x Sample6 Y Offset */
   67339 
   67340 
   67341 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_bits  4
   67342 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_bits  4
   67343 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_bits  4
   67344 
   67345 static inline uint32_t ATTRIBUTE_PURE
   67346 _3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_bits(const struct gen_device_info *devinfo)
   67347 {
   67348    switch (devinfo->gen) {
   67349    case 10: return 4;
   67350    case 9: return 4;
   67351    case 8: return 4;
   67352    case 7:
   67353       if (devinfo->is_haswell) {
   67354          return 0;
   67355       } else {
   67356          return 0;
   67357       }
   67358    case 6: return 0;
   67359    case 5: return 0;
   67360    case 4:
   67361       if (devinfo->is_g4x) {
   67362          return 0;
   67363       } else {
   67364          return 0;
   67365       }
   67366    default:
   67367       unreachable("Invalid hardware generation");
   67368    }
   67369 }
   67370 
   67371 
   67372 
   67373 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_start  176
   67374 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_start  176
   67375 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_start  176
   67376 
   67377 static inline uint32_t ATTRIBUTE_PURE
   67378 _3DSTATE_SAMPLE_PATTERN_8xSample6YOffset_start(const struct gen_device_info *devinfo)
   67379 {
   67380    switch (devinfo->gen) {
   67381    case 10: return 176;
   67382    case 9: return 176;
   67383    case 8: return 176;
   67384    case 7:
   67385       if (devinfo->is_haswell) {
   67386          return 0;
   67387       } else {
   67388          return 0;
   67389       }
   67390    case 6: return 0;
   67391    case 5: return 0;
   67392    case 4:
   67393       if (devinfo->is_g4x) {
   67394          return 0;
   67395       } else {
   67396          return 0;
   67397       }
   67398    default:
   67399       unreachable("Invalid hardware generation");
   67400    }
   67401 }
   67402 
   67403 
   67404 
   67405 /* 3DSTATE_SAMPLE_PATTERN::8x Sample7 X Offset */
   67406 
   67407 
   67408 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_bits  4
   67409 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_bits  4
   67410 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_bits  4
   67411 
   67412 static inline uint32_t ATTRIBUTE_PURE
   67413 _3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_bits(const struct gen_device_info *devinfo)
   67414 {
   67415    switch (devinfo->gen) {
   67416    case 10: return 4;
   67417    case 9: return 4;
   67418    case 8: return 4;
   67419    case 7:
   67420       if (devinfo->is_haswell) {
   67421          return 0;
   67422       } else {
   67423          return 0;
   67424       }
   67425    case 6: return 0;
   67426    case 5: return 0;
   67427    case 4:
   67428       if (devinfo->is_g4x) {
   67429          return 0;
   67430       } else {
   67431          return 0;
   67432       }
   67433    default:
   67434       unreachable("Invalid hardware generation");
   67435    }
   67436 }
   67437 
   67438 
   67439 
   67440 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_start  188
   67441 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_start  188
   67442 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_start  188
   67443 
   67444 static inline uint32_t ATTRIBUTE_PURE
   67445 _3DSTATE_SAMPLE_PATTERN_8xSample7XOffset_start(const struct gen_device_info *devinfo)
   67446 {
   67447    switch (devinfo->gen) {
   67448    case 10: return 188;
   67449    case 9: return 188;
   67450    case 8: return 188;
   67451    case 7:
   67452       if (devinfo->is_haswell) {
   67453          return 0;
   67454       } else {
   67455          return 0;
   67456       }
   67457    case 6: return 0;
   67458    case 5: return 0;
   67459    case 4:
   67460       if (devinfo->is_g4x) {
   67461          return 0;
   67462       } else {
   67463          return 0;
   67464       }
   67465    default:
   67466       unreachable("Invalid hardware generation");
   67467    }
   67468 }
   67469 
   67470 
   67471 
   67472 /* 3DSTATE_SAMPLE_PATTERN::8x Sample7 Y Offset */
   67473 
   67474 
   67475 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_bits  4
   67476 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_bits  4
   67477 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_bits  4
   67478 
   67479 static inline uint32_t ATTRIBUTE_PURE
   67480 _3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_bits(const struct gen_device_info *devinfo)
   67481 {
   67482    switch (devinfo->gen) {
   67483    case 10: return 4;
   67484    case 9: return 4;
   67485    case 8: return 4;
   67486    case 7:
   67487       if (devinfo->is_haswell) {
   67488          return 0;
   67489       } else {
   67490          return 0;
   67491       }
   67492    case 6: return 0;
   67493    case 5: return 0;
   67494    case 4:
   67495       if (devinfo->is_g4x) {
   67496          return 0;
   67497       } else {
   67498          return 0;
   67499       }
   67500    default:
   67501       unreachable("Invalid hardware generation");
   67502    }
   67503 }
   67504 
   67505 
   67506 
   67507 #define GEN10_3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_start  184
   67508 #define GEN9_3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_start  184
   67509 #define GEN8_3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_start  184
   67510 
   67511 static inline uint32_t ATTRIBUTE_PURE
   67512 _3DSTATE_SAMPLE_PATTERN_8xSample7YOffset_start(const struct gen_device_info *devinfo)
   67513 {
   67514    switch (devinfo->gen) {
   67515    case 10: return 184;
   67516    case 9: return 184;
   67517    case 8: return 184;
   67518    case 7:
   67519       if (devinfo->is_haswell) {
   67520          return 0;
   67521       } else {
   67522          return 0;
   67523       }
   67524    case 6: return 0;
   67525    case 5: return 0;
   67526    case 4:
   67527       if (devinfo->is_g4x) {
   67528          return 0;
   67529       } else {
   67530          return 0;
   67531       }
   67532    default:
   67533       unreachable("Invalid hardware generation");
   67534    }
   67535 }
   67536 
   67537 
   67538 
   67539 /* 3DSTATE_SAMPLE_PATTERN::Command SubType */
   67540 
   67541 
   67542 #define GEN10_3DSTATE_SAMPLE_PATTERN_CommandSubType_bits  2
   67543 #define GEN9_3DSTATE_SAMPLE_PATTERN_CommandSubType_bits  2
   67544 #define GEN8_3DSTATE_SAMPLE_PATTERN_CommandSubType_bits  2
   67545 
   67546 static inline uint32_t ATTRIBUTE_PURE
   67547 _3DSTATE_SAMPLE_PATTERN_CommandSubType_bits(const struct gen_device_info *devinfo)
   67548 {
   67549    switch (devinfo->gen) {
   67550    case 10: return 2;
   67551    case 9: return 2;
   67552    case 8: return 2;
   67553    case 7:
   67554       if (devinfo->is_haswell) {
   67555          return 0;
   67556       } else {
   67557          return 0;
   67558       }
   67559    case 6: return 0;
   67560    case 5: return 0;
   67561    case 4:
   67562       if (devinfo->is_g4x) {
   67563          return 0;
   67564       } else {
   67565          return 0;
   67566       }
   67567    default:
   67568       unreachable("Invalid hardware generation");
   67569    }
   67570 }
   67571 
   67572 
   67573 
   67574 #define GEN10_3DSTATE_SAMPLE_PATTERN_CommandSubType_start  27
   67575 #define GEN9_3DSTATE_SAMPLE_PATTERN_CommandSubType_start  27
   67576 #define GEN8_3DSTATE_SAMPLE_PATTERN_CommandSubType_start  27
   67577 
   67578 static inline uint32_t ATTRIBUTE_PURE
   67579 _3DSTATE_SAMPLE_PATTERN_CommandSubType_start(const struct gen_device_info *devinfo)
   67580 {
   67581    switch (devinfo->gen) {
   67582    case 10: return 27;
   67583    case 9: return 27;
   67584    case 8: return 27;
   67585    case 7:
   67586       if (devinfo->is_haswell) {
   67587          return 0;
   67588       } else {
   67589          return 0;
   67590       }
   67591    case 6: return 0;
   67592    case 5: return 0;
   67593    case 4:
   67594       if (devinfo->is_g4x) {
   67595          return 0;
   67596       } else {
   67597          return 0;
   67598       }
   67599    default:
   67600       unreachable("Invalid hardware generation");
   67601    }
   67602 }
   67603 
   67604 
   67605 
   67606 /* 3DSTATE_SAMPLE_PATTERN::Command Type */
   67607 
   67608 
   67609 #define GEN10_3DSTATE_SAMPLE_PATTERN_CommandType_bits  3
   67610 #define GEN9_3DSTATE_SAMPLE_PATTERN_CommandType_bits  3
   67611 #define GEN8_3DSTATE_SAMPLE_PATTERN_CommandType_bits  3
   67612 
   67613 static inline uint32_t ATTRIBUTE_PURE
   67614 _3DSTATE_SAMPLE_PATTERN_CommandType_bits(const struct gen_device_info *devinfo)
   67615 {
   67616    switch (devinfo->gen) {
   67617    case 10: return 3;
   67618    case 9: return 3;
   67619    case 8: return 3;
   67620    case 7:
   67621       if (devinfo->is_haswell) {
   67622          return 0;
   67623       } else {
   67624          return 0;
   67625       }
   67626    case 6: return 0;
   67627    case 5: return 0;
   67628    case 4:
   67629       if (devinfo->is_g4x) {
   67630          return 0;
   67631       } else {
   67632          return 0;
   67633       }
   67634    default:
   67635       unreachable("Invalid hardware generation");
   67636    }
   67637 }
   67638 
   67639 
   67640 
   67641 #define GEN10_3DSTATE_SAMPLE_PATTERN_CommandType_start  29
   67642 #define GEN9_3DSTATE_SAMPLE_PATTERN_CommandType_start  29
   67643 #define GEN8_3DSTATE_SAMPLE_PATTERN_CommandType_start  29
   67644 
   67645 static inline uint32_t ATTRIBUTE_PURE
   67646 _3DSTATE_SAMPLE_PATTERN_CommandType_start(const struct gen_device_info *devinfo)
   67647 {
   67648    switch (devinfo->gen) {
   67649    case 10: return 29;
   67650    case 9: return 29;
   67651    case 8: return 29;
   67652    case 7:
   67653       if (devinfo->is_haswell) {
   67654          return 0;
   67655       } else {
   67656          return 0;
   67657       }
   67658    case 6: return 0;
   67659    case 5: return 0;
   67660    case 4:
   67661       if (devinfo->is_g4x) {
   67662          return 0;
   67663       } else {
   67664          return 0;
   67665       }
   67666    default:
   67667       unreachable("Invalid hardware generation");
   67668    }
   67669 }
   67670 
   67671 
   67672 
   67673 /* 3DSTATE_SAMPLE_PATTERN::DWord Length */
   67674 
   67675 
   67676 #define GEN10_3DSTATE_SAMPLE_PATTERN_DWordLength_bits  8
   67677 #define GEN9_3DSTATE_SAMPLE_PATTERN_DWordLength_bits  8
   67678 #define GEN8_3DSTATE_SAMPLE_PATTERN_DWordLength_bits  8
   67679 
   67680 static inline uint32_t ATTRIBUTE_PURE
   67681 _3DSTATE_SAMPLE_PATTERN_DWordLength_bits(const struct gen_device_info *devinfo)
   67682 {
   67683    switch (devinfo->gen) {
   67684    case 10: return 8;
   67685    case 9: return 8;
   67686    case 8: return 8;
   67687    case 7:
   67688       if (devinfo->is_haswell) {
   67689          return 0;
   67690       } else {
   67691          return 0;
   67692       }
   67693    case 6: return 0;
   67694    case 5: return 0;
   67695    case 4:
   67696       if (devinfo->is_g4x) {
   67697          return 0;
   67698       } else {
   67699          return 0;
   67700       }
   67701    default:
   67702       unreachable("Invalid hardware generation");
   67703    }
   67704 }
   67705 
   67706 
   67707 
   67708 #define GEN10_3DSTATE_SAMPLE_PATTERN_DWordLength_start  0
   67709 #define GEN9_3DSTATE_SAMPLE_PATTERN_DWordLength_start  0
   67710 #define GEN8_3DSTATE_SAMPLE_PATTERN_DWordLength_start  0
   67711 
   67712 static inline uint32_t ATTRIBUTE_PURE
   67713 _3DSTATE_SAMPLE_PATTERN_DWordLength_start(const struct gen_device_info *devinfo)
   67714 {
   67715    switch (devinfo->gen) {
   67716    case 10: return 0;
   67717    case 9: return 0;
   67718    case 8: return 0;
   67719    case 7:
   67720       if (devinfo->is_haswell) {
   67721          return 0;
   67722       } else {
   67723          return 0;
   67724       }
   67725    case 6: return 0;
   67726    case 5: return 0;
   67727    case 4:
   67728       if (devinfo->is_g4x) {
   67729          return 0;
   67730       } else {
   67731          return 0;
   67732       }
   67733    default:
   67734       unreachable("Invalid hardware generation");
   67735    }
   67736 }
   67737 
   67738 
   67739 
   67740 /* 3DSTATE_SBE */
   67741 
   67742 
   67743 #define GEN10_3DSTATE_SBE_length  6
   67744 #define GEN9_3DSTATE_SBE_length  6
   67745 #define GEN8_3DSTATE_SBE_length  4
   67746 #define GEN75_3DSTATE_SBE_length  14
   67747 #define GEN7_3DSTATE_SBE_length  14
   67748 
   67749 static inline uint32_t ATTRIBUTE_PURE
   67750 _3DSTATE_SBE_length(const struct gen_device_info *devinfo)
   67751 {
   67752    switch (devinfo->gen) {
   67753    case 10: return 6;
   67754    case 9: return 6;
   67755    case 8: return 4;
   67756    case 7:
   67757       if (devinfo->is_haswell) {
   67758          return 14;
   67759       } else {
   67760          return 14;
   67761       }
   67762    case 6: return 0;
   67763    case 5: return 0;
   67764    case 4:
   67765       if (devinfo->is_g4x) {
   67766          return 0;
   67767       } else {
   67768          return 0;
   67769       }
   67770    default:
   67771       unreachable("Invalid hardware generation");
   67772    }
   67773 }
   67774 
   67775 
   67776 
   67777 /* 3DSTATE_SBE::3D Command Opcode */
   67778 
   67779 
   67780 #define GEN10_3DSTATE_SBE_3DCommandOpcode_bits  3
   67781 #define GEN9_3DSTATE_SBE_3DCommandOpcode_bits  3
   67782 #define GEN8_3DSTATE_SBE_3DCommandOpcode_bits  3
   67783 #define GEN75_3DSTATE_SBE_3DCommandOpcode_bits  3
   67784 #define GEN7_3DSTATE_SBE_3DCommandOpcode_bits  3
   67785 
   67786 static inline uint32_t ATTRIBUTE_PURE
   67787 _3DSTATE_SBE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   67788 {
   67789    switch (devinfo->gen) {
   67790    case 10: return 3;
   67791    case 9: return 3;
   67792    case 8: return 3;
   67793    case 7:
   67794       if (devinfo->is_haswell) {
   67795          return 3;
   67796       } else {
   67797          return 3;
   67798       }
   67799    case 6: return 0;
   67800    case 5: return 0;
   67801    case 4:
   67802       if (devinfo->is_g4x) {
   67803          return 0;
   67804       } else {
   67805          return 0;
   67806       }
   67807    default:
   67808       unreachable("Invalid hardware generation");
   67809    }
   67810 }
   67811 
   67812 
   67813 
   67814 #define GEN10_3DSTATE_SBE_3DCommandOpcode_start  24
   67815 #define GEN9_3DSTATE_SBE_3DCommandOpcode_start  24
   67816 #define GEN8_3DSTATE_SBE_3DCommandOpcode_start  24
   67817 #define GEN75_3DSTATE_SBE_3DCommandOpcode_start  24
   67818 #define GEN7_3DSTATE_SBE_3DCommandOpcode_start  24
   67819 
   67820 static inline uint32_t ATTRIBUTE_PURE
   67821 _3DSTATE_SBE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   67822 {
   67823    switch (devinfo->gen) {
   67824    case 10: return 24;
   67825    case 9: return 24;
   67826    case 8: return 24;
   67827    case 7:
   67828       if (devinfo->is_haswell) {
   67829          return 24;
   67830       } else {
   67831          return 24;
   67832       }
   67833    case 6: return 0;
   67834    case 5: return 0;
   67835    case 4:
   67836       if (devinfo->is_g4x) {
   67837          return 0;
   67838       } else {
   67839          return 0;
   67840       }
   67841    default:
   67842       unreachable("Invalid hardware generation");
   67843    }
   67844 }
   67845 
   67846 
   67847 
   67848 /* 3DSTATE_SBE::3D Command Sub Opcode */
   67849 
   67850 
   67851 #define GEN10_3DSTATE_SBE_3DCommandSubOpcode_bits  8
   67852 #define GEN9_3DSTATE_SBE_3DCommandSubOpcode_bits  8
   67853 #define GEN8_3DSTATE_SBE_3DCommandSubOpcode_bits  8
   67854 #define GEN75_3DSTATE_SBE_3DCommandSubOpcode_bits  8
   67855 #define GEN7_3DSTATE_SBE_3DCommandSubOpcode_bits  8
   67856 
   67857 static inline uint32_t ATTRIBUTE_PURE
   67858 _3DSTATE_SBE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   67859 {
   67860    switch (devinfo->gen) {
   67861    case 10: return 8;
   67862    case 9: return 8;
   67863    case 8: return 8;
   67864    case 7:
   67865       if (devinfo->is_haswell) {
   67866          return 8;
   67867       } else {
   67868          return 8;
   67869       }
   67870    case 6: return 0;
   67871    case 5: return 0;
   67872    case 4:
   67873       if (devinfo->is_g4x) {
   67874          return 0;
   67875       } else {
   67876          return 0;
   67877       }
   67878    default:
   67879       unreachable("Invalid hardware generation");
   67880    }
   67881 }
   67882 
   67883 
   67884 
   67885 #define GEN10_3DSTATE_SBE_3DCommandSubOpcode_start  16
   67886 #define GEN9_3DSTATE_SBE_3DCommandSubOpcode_start  16
   67887 #define GEN8_3DSTATE_SBE_3DCommandSubOpcode_start  16
   67888 #define GEN75_3DSTATE_SBE_3DCommandSubOpcode_start  16
   67889 #define GEN7_3DSTATE_SBE_3DCommandSubOpcode_start  16
   67890 
   67891 static inline uint32_t ATTRIBUTE_PURE
   67892 _3DSTATE_SBE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   67893 {
   67894    switch (devinfo->gen) {
   67895    case 10: return 16;
   67896    case 9: return 16;
   67897    case 8: return 16;
   67898    case 7:
   67899       if (devinfo->is_haswell) {
   67900          return 16;
   67901       } else {
   67902          return 16;
   67903       }
   67904    case 6: return 0;
   67905    case 5: return 0;
   67906    case 4:
   67907       if (devinfo->is_g4x) {
   67908          return 0;
   67909       } else {
   67910          return 0;
   67911       }
   67912    default:
   67913       unreachable("Invalid hardware generation");
   67914    }
   67915 }
   67916 
   67917 
   67918 
   67919 /* 3DSTATE_SBE::Attribute */
   67920 
   67921 
   67922 #define GEN75_3DSTATE_SBE_Attribute_bits  16
   67923 #define GEN7_3DSTATE_SBE_Attribute_bits  16
   67924 
   67925 static inline uint32_t ATTRIBUTE_PURE
   67926 _3DSTATE_SBE_Attribute_bits(const struct gen_device_info *devinfo)
   67927 {
   67928    switch (devinfo->gen) {
   67929    case 10: return 0;
   67930    case 9: return 0;
   67931    case 8: return 0;
   67932    case 7:
   67933       if (devinfo->is_haswell) {
   67934          return 16;
   67935       } else {
   67936          return 16;
   67937       }
   67938    case 6: return 0;
   67939    case 5: return 0;
   67940    case 4:
   67941       if (devinfo->is_g4x) {
   67942          return 0;
   67943       } else {
   67944          return 0;
   67945       }
   67946    default:
   67947       unreachable("Invalid hardware generation");
   67948    }
   67949 }
   67950 
   67951 
   67952 
   67953 #define GEN75_3DSTATE_SBE_Attribute_start  0
   67954 #define GEN7_3DSTATE_SBE_Attribute_start  0
   67955 
   67956 static inline uint32_t ATTRIBUTE_PURE
   67957 _3DSTATE_SBE_Attribute_start(const struct gen_device_info *devinfo)
   67958 {
   67959    switch (devinfo->gen) {
   67960    case 10: return 0;
   67961    case 9: return 0;
   67962    case 8: return 0;
   67963    case 7:
   67964       if (devinfo->is_haswell) {
   67965          return 0;
   67966       } else {
   67967          return 0;
   67968       }
   67969    case 6: return 0;
   67970    case 5: return 0;
   67971    case 4:
   67972       if (devinfo->is_g4x) {
   67973          return 0;
   67974       } else {
   67975          return 0;
   67976       }
   67977    default:
   67978       unreachable("Invalid hardware generation");
   67979    }
   67980 }
   67981 
   67982 
   67983 
   67984 /* 3DSTATE_SBE::Attribute 0 WrapShortest Enables */
   67985 
   67986 
   67987 #define GEN75_3DSTATE_SBE_Attribute0WrapShortestEnables_bits  4
   67988 #define GEN7_3DSTATE_SBE_Attribute0WrapShortestEnables_bits  4
   67989 
   67990 static inline uint32_t ATTRIBUTE_PURE
   67991 _3DSTATE_SBE_Attribute0WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   67992 {
   67993    switch (devinfo->gen) {
   67994    case 10: return 0;
   67995    case 9: return 0;
   67996    case 8: return 0;
   67997    case 7:
   67998       if (devinfo->is_haswell) {
   67999          return 4;
   68000       } else {
   68001          return 4;
   68002       }
   68003    case 6: return 0;
   68004    case 5: return 0;
   68005    case 4:
   68006       if (devinfo->is_g4x) {
   68007          return 0;
   68008       } else {
   68009          return 0;
   68010       }
   68011    default:
   68012       unreachable("Invalid hardware generation");
   68013    }
   68014 }
   68015 
   68016 
   68017 
   68018 #define GEN75_3DSTATE_SBE_Attribute0WrapShortestEnables_start  384
   68019 #define GEN7_3DSTATE_SBE_Attribute0WrapShortestEnables_start  384
   68020 
   68021 static inline uint32_t ATTRIBUTE_PURE
   68022 _3DSTATE_SBE_Attribute0WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68023 {
   68024    switch (devinfo->gen) {
   68025    case 10: return 0;
   68026    case 9: return 0;
   68027    case 8: return 0;
   68028    case 7:
   68029       if (devinfo->is_haswell) {
   68030          return 384;
   68031       } else {
   68032          return 384;
   68033       }
   68034    case 6: return 0;
   68035    case 5: return 0;
   68036    case 4:
   68037       if (devinfo->is_g4x) {
   68038          return 0;
   68039       } else {
   68040          return 0;
   68041       }
   68042    default:
   68043       unreachable("Invalid hardware generation");
   68044    }
   68045 }
   68046 
   68047 
   68048 
   68049 /* 3DSTATE_SBE::Attribute 1 WrapShortest Enables */
   68050 
   68051 
   68052 #define GEN75_3DSTATE_SBE_Attribute1WrapShortestEnables_bits  4
   68053 #define GEN7_3DSTATE_SBE_Attribute1WrapShortestEnables_bits  4
   68054 
   68055 static inline uint32_t ATTRIBUTE_PURE
   68056 _3DSTATE_SBE_Attribute1WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68057 {
   68058    switch (devinfo->gen) {
   68059    case 10: return 0;
   68060    case 9: return 0;
   68061    case 8: return 0;
   68062    case 7:
   68063       if (devinfo->is_haswell) {
   68064          return 4;
   68065       } else {
   68066          return 4;
   68067       }
   68068    case 6: return 0;
   68069    case 5: return 0;
   68070    case 4:
   68071       if (devinfo->is_g4x) {
   68072          return 0;
   68073       } else {
   68074          return 0;
   68075       }
   68076    default:
   68077       unreachable("Invalid hardware generation");
   68078    }
   68079 }
   68080 
   68081 
   68082 
   68083 #define GEN75_3DSTATE_SBE_Attribute1WrapShortestEnables_start  388
   68084 #define GEN7_3DSTATE_SBE_Attribute1WrapShortestEnables_start  388
   68085 
   68086 static inline uint32_t ATTRIBUTE_PURE
   68087 _3DSTATE_SBE_Attribute1WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68088 {
   68089    switch (devinfo->gen) {
   68090    case 10: return 0;
   68091    case 9: return 0;
   68092    case 8: return 0;
   68093    case 7:
   68094       if (devinfo->is_haswell) {
   68095          return 388;
   68096       } else {
   68097          return 388;
   68098       }
   68099    case 6: return 0;
   68100    case 5: return 0;
   68101    case 4:
   68102       if (devinfo->is_g4x) {
   68103          return 0;
   68104       } else {
   68105          return 0;
   68106       }
   68107    default:
   68108       unreachable("Invalid hardware generation");
   68109    }
   68110 }
   68111 
   68112 
   68113 
   68114 /* 3DSTATE_SBE::Attribute 10 WrapShortest Enables */
   68115 
   68116 
   68117 #define GEN75_3DSTATE_SBE_Attribute10WrapShortestEnables_bits  4
   68118 #define GEN7_3DSTATE_SBE_Attribute10WrapShortestEnables_bits  4
   68119 
   68120 static inline uint32_t ATTRIBUTE_PURE
   68121 _3DSTATE_SBE_Attribute10WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68122 {
   68123    switch (devinfo->gen) {
   68124    case 10: return 0;
   68125    case 9: return 0;
   68126    case 8: return 0;
   68127    case 7:
   68128       if (devinfo->is_haswell) {
   68129          return 4;
   68130       } else {
   68131          return 4;
   68132       }
   68133    case 6: return 0;
   68134    case 5: return 0;
   68135    case 4:
   68136       if (devinfo->is_g4x) {
   68137          return 0;
   68138       } else {
   68139          return 0;
   68140       }
   68141    default:
   68142       unreachable("Invalid hardware generation");
   68143    }
   68144 }
   68145 
   68146 
   68147 
   68148 #define GEN75_3DSTATE_SBE_Attribute10WrapShortestEnables_start  424
   68149 #define GEN7_3DSTATE_SBE_Attribute10WrapShortestEnables_start  424
   68150 
   68151 static inline uint32_t ATTRIBUTE_PURE
   68152 _3DSTATE_SBE_Attribute10WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68153 {
   68154    switch (devinfo->gen) {
   68155    case 10: return 0;
   68156    case 9: return 0;
   68157    case 8: return 0;
   68158    case 7:
   68159       if (devinfo->is_haswell) {
   68160          return 424;
   68161       } else {
   68162          return 424;
   68163       }
   68164    case 6: return 0;
   68165    case 5: return 0;
   68166    case 4:
   68167       if (devinfo->is_g4x) {
   68168          return 0;
   68169       } else {
   68170          return 0;
   68171       }
   68172    default:
   68173       unreachable("Invalid hardware generation");
   68174    }
   68175 }
   68176 
   68177 
   68178 
   68179 /* 3DSTATE_SBE::Attribute 11 WrapShortest Enables */
   68180 
   68181 
   68182 #define GEN75_3DSTATE_SBE_Attribute11WrapShortestEnables_bits  4
   68183 #define GEN7_3DSTATE_SBE_Attribute11WrapShortestEnables_bits  4
   68184 
   68185 static inline uint32_t ATTRIBUTE_PURE
   68186 _3DSTATE_SBE_Attribute11WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68187 {
   68188    switch (devinfo->gen) {
   68189    case 10: return 0;
   68190    case 9: return 0;
   68191    case 8: return 0;
   68192    case 7:
   68193       if (devinfo->is_haswell) {
   68194          return 4;
   68195       } else {
   68196          return 4;
   68197       }
   68198    case 6: return 0;
   68199    case 5: return 0;
   68200    case 4:
   68201       if (devinfo->is_g4x) {
   68202          return 0;
   68203       } else {
   68204          return 0;
   68205       }
   68206    default:
   68207       unreachable("Invalid hardware generation");
   68208    }
   68209 }
   68210 
   68211 
   68212 
   68213 #define GEN75_3DSTATE_SBE_Attribute11WrapShortestEnables_start  428
   68214 #define GEN7_3DSTATE_SBE_Attribute11WrapShortestEnables_start  428
   68215 
   68216 static inline uint32_t ATTRIBUTE_PURE
   68217 _3DSTATE_SBE_Attribute11WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68218 {
   68219    switch (devinfo->gen) {
   68220    case 10: return 0;
   68221    case 9: return 0;
   68222    case 8: return 0;
   68223    case 7:
   68224       if (devinfo->is_haswell) {
   68225          return 428;
   68226       } else {
   68227          return 428;
   68228       }
   68229    case 6: return 0;
   68230    case 5: return 0;
   68231    case 4:
   68232       if (devinfo->is_g4x) {
   68233          return 0;
   68234       } else {
   68235          return 0;
   68236       }
   68237    default:
   68238       unreachable("Invalid hardware generation");
   68239    }
   68240 }
   68241 
   68242 
   68243 
   68244 /* 3DSTATE_SBE::Attribute 12 WrapShortest Enables */
   68245 
   68246 
   68247 #define GEN75_3DSTATE_SBE_Attribute12WrapShortestEnables_bits  4
   68248 #define GEN7_3DSTATE_SBE_Attribute12WrapShortestEnables_bits  4
   68249 
   68250 static inline uint32_t ATTRIBUTE_PURE
   68251 _3DSTATE_SBE_Attribute12WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68252 {
   68253    switch (devinfo->gen) {
   68254    case 10: return 0;
   68255    case 9: return 0;
   68256    case 8: return 0;
   68257    case 7:
   68258       if (devinfo->is_haswell) {
   68259          return 4;
   68260       } else {
   68261          return 4;
   68262       }
   68263    case 6: return 0;
   68264    case 5: return 0;
   68265    case 4:
   68266       if (devinfo->is_g4x) {
   68267          return 0;
   68268       } else {
   68269          return 0;
   68270       }
   68271    default:
   68272       unreachable("Invalid hardware generation");
   68273    }
   68274 }
   68275 
   68276 
   68277 
   68278 #define GEN75_3DSTATE_SBE_Attribute12WrapShortestEnables_start  432
   68279 #define GEN7_3DSTATE_SBE_Attribute12WrapShortestEnables_start  432
   68280 
   68281 static inline uint32_t ATTRIBUTE_PURE
   68282 _3DSTATE_SBE_Attribute12WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68283 {
   68284    switch (devinfo->gen) {
   68285    case 10: return 0;
   68286    case 9: return 0;
   68287    case 8: return 0;
   68288    case 7:
   68289       if (devinfo->is_haswell) {
   68290          return 432;
   68291       } else {
   68292          return 432;
   68293       }
   68294    case 6: return 0;
   68295    case 5: return 0;
   68296    case 4:
   68297       if (devinfo->is_g4x) {
   68298          return 0;
   68299       } else {
   68300          return 0;
   68301       }
   68302    default:
   68303       unreachable("Invalid hardware generation");
   68304    }
   68305 }
   68306 
   68307 
   68308 
   68309 /* 3DSTATE_SBE::Attribute 13 WrapShortest Enables */
   68310 
   68311 
   68312 #define GEN75_3DSTATE_SBE_Attribute13WrapShortestEnables_bits  4
   68313 #define GEN7_3DSTATE_SBE_Attribute13WrapShortestEnables_bits  4
   68314 
   68315 static inline uint32_t ATTRIBUTE_PURE
   68316 _3DSTATE_SBE_Attribute13WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68317 {
   68318    switch (devinfo->gen) {
   68319    case 10: return 0;
   68320    case 9: return 0;
   68321    case 8: return 0;
   68322    case 7:
   68323       if (devinfo->is_haswell) {
   68324          return 4;
   68325       } else {
   68326          return 4;
   68327       }
   68328    case 6: return 0;
   68329    case 5: return 0;
   68330    case 4:
   68331       if (devinfo->is_g4x) {
   68332          return 0;
   68333       } else {
   68334          return 0;
   68335       }
   68336    default:
   68337       unreachable("Invalid hardware generation");
   68338    }
   68339 }
   68340 
   68341 
   68342 
   68343 #define GEN75_3DSTATE_SBE_Attribute13WrapShortestEnables_start  436
   68344 #define GEN7_3DSTATE_SBE_Attribute13WrapShortestEnables_start  436
   68345 
   68346 static inline uint32_t ATTRIBUTE_PURE
   68347 _3DSTATE_SBE_Attribute13WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68348 {
   68349    switch (devinfo->gen) {
   68350    case 10: return 0;
   68351    case 9: return 0;
   68352    case 8: return 0;
   68353    case 7:
   68354       if (devinfo->is_haswell) {
   68355          return 436;
   68356       } else {
   68357          return 436;
   68358       }
   68359    case 6: return 0;
   68360    case 5: return 0;
   68361    case 4:
   68362       if (devinfo->is_g4x) {
   68363          return 0;
   68364       } else {
   68365          return 0;
   68366       }
   68367    default:
   68368       unreachable("Invalid hardware generation");
   68369    }
   68370 }
   68371 
   68372 
   68373 
   68374 /* 3DSTATE_SBE::Attribute 14 WrapShortest Enables */
   68375 
   68376 
   68377 #define GEN75_3DSTATE_SBE_Attribute14WrapShortestEnables_bits  4
   68378 #define GEN7_3DSTATE_SBE_Attribute14WrapShortestEnables_bits  4
   68379 
   68380 static inline uint32_t ATTRIBUTE_PURE
   68381 _3DSTATE_SBE_Attribute14WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68382 {
   68383    switch (devinfo->gen) {
   68384    case 10: return 0;
   68385    case 9: return 0;
   68386    case 8: return 0;
   68387    case 7:
   68388       if (devinfo->is_haswell) {
   68389          return 4;
   68390       } else {
   68391          return 4;
   68392       }
   68393    case 6: return 0;
   68394    case 5: return 0;
   68395    case 4:
   68396       if (devinfo->is_g4x) {
   68397          return 0;
   68398       } else {
   68399          return 0;
   68400       }
   68401    default:
   68402       unreachable("Invalid hardware generation");
   68403    }
   68404 }
   68405 
   68406 
   68407 
   68408 #define GEN75_3DSTATE_SBE_Attribute14WrapShortestEnables_start  440
   68409 #define GEN7_3DSTATE_SBE_Attribute14WrapShortestEnables_start  440
   68410 
   68411 static inline uint32_t ATTRIBUTE_PURE
   68412 _3DSTATE_SBE_Attribute14WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68413 {
   68414    switch (devinfo->gen) {
   68415    case 10: return 0;
   68416    case 9: return 0;
   68417    case 8: return 0;
   68418    case 7:
   68419       if (devinfo->is_haswell) {
   68420          return 440;
   68421       } else {
   68422          return 440;
   68423       }
   68424    case 6: return 0;
   68425    case 5: return 0;
   68426    case 4:
   68427       if (devinfo->is_g4x) {
   68428          return 0;
   68429       } else {
   68430          return 0;
   68431       }
   68432    default:
   68433       unreachable("Invalid hardware generation");
   68434    }
   68435 }
   68436 
   68437 
   68438 
   68439 /* 3DSTATE_SBE::Attribute 15 WrapShortest Enables */
   68440 
   68441 
   68442 #define GEN75_3DSTATE_SBE_Attribute15WrapShortestEnables_bits  4
   68443 #define GEN7_3DSTATE_SBE_Attribute15WrapShortestEnables_bits  4
   68444 
   68445 static inline uint32_t ATTRIBUTE_PURE
   68446 _3DSTATE_SBE_Attribute15WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68447 {
   68448    switch (devinfo->gen) {
   68449    case 10: return 0;
   68450    case 9: return 0;
   68451    case 8: return 0;
   68452    case 7:
   68453       if (devinfo->is_haswell) {
   68454          return 4;
   68455       } else {
   68456          return 4;
   68457       }
   68458    case 6: return 0;
   68459    case 5: return 0;
   68460    case 4:
   68461       if (devinfo->is_g4x) {
   68462          return 0;
   68463       } else {
   68464          return 0;
   68465       }
   68466    default:
   68467       unreachable("Invalid hardware generation");
   68468    }
   68469 }
   68470 
   68471 
   68472 
   68473 #define GEN75_3DSTATE_SBE_Attribute15WrapShortestEnables_start  444
   68474 #define GEN7_3DSTATE_SBE_Attribute15WrapShortestEnables_start  444
   68475 
   68476 static inline uint32_t ATTRIBUTE_PURE
   68477 _3DSTATE_SBE_Attribute15WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68478 {
   68479    switch (devinfo->gen) {
   68480    case 10: return 0;
   68481    case 9: return 0;
   68482    case 8: return 0;
   68483    case 7:
   68484       if (devinfo->is_haswell) {
   68485          return 444;
   68486       } else {
   68487          return 444;
   68488       }
   68489    case 6: return 0;
   68490    case 5: return 0;
   68491    case 4:
   68492       if (devinfo->is_g4x) {
   68493          return 0;
   68494       } else {
   68495          return 0;
   68496       }
   68497    default:
   68498       unreachable("Invalid hardware generation");
   68499    }
   68500 }
   68501 
   68502 
   68503 
   68504 /* 3DSTATE_SBE::Attribute 2 WrapShortest Enables */
   68505 
   68506 
   68507 #define GEN75_3DSTATE_SBE_Attribute2WrapShortestEnables_bits  4
   68508 #define GEN7_3DSTATE_SBE_Attribute2WrapShortestEnables_bits  4
   68509 
   68510 static inline uint32_t ATTRIBUTE_PURE
   68511 _3DSTATE_SBE_Attribute2WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68512 {
   68513    switch (devinfo->gen) {
   68514    case 10: return 0;
   68515    case 9: return 0;
   68516    case 8: return 0;
   68517    case 7:
   68518       if (devinfo->is_haswell) {
   68519          return 4;
   68520       } else {
   68521          return 4;
   68522       }
   68523    case 6: return 0;
   68524    case 5: return 0;
   68525    case 4:
   68526       if (devinfo->is_g4x) {
   68527          return 0;
   68528       } else {
   68529          return 0;
   68530       }
   68531    default:
   68532       unreachable("Invalid hardware generation");
   68533    }
   68534 }
   68535 
   68536 
   68537 
   68538 #define GEN75_3DSTATE_SBE_Attribute2WrapShortestEnables_start  392
   68539 #define GEN7_3DSTATE_SBE_Attribute2WrapShortestEnables_start  392
   68540 
   68541 static inline uint32_t ATTRIBUTE_PURE
   68542 _3DSTATE_SBE_Attribute2WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68543 {
   68544    switch (devinfo->gen) {
   68545    case 10: return 0;
   68546    case 9: return 0;
   68547    case 8: return 0;
   68548    case 7:
   68549       if (devinfo->is_haswell) {
   68550          return 392;
   68551       } else {
   68552          return 392;
   68553       }
   68554    case 6: return 0;
   68555    case 5: return 0;
   68556    case 4:
   68557       if (devinfo->is_g4x) {
   68558          return 0;
   68559       } else {
   68560          return 0;
   68561       }
   68562    default:
   68563       unreachable("Invalid hardware generation");
   68564    }
   68565 }
   68566 
   68567 
   68568 
   68569 /* 3DSTATE_SBE::Attribute 3 WrapShortest Enables */
   68570 
   68571 
   68572 #define GEN75_3DSTATE_SBE_Attribute3WrapShortestEnables_bits  4
   68573 #define GEN7_3DSTATE_SBE_Attribute3WrapShortestEnables_bits  4
   68574 
   68575 static inline uint32_t ATTRIBUTE_PURE
   68576 _3DSTATE_SBE_Attribute3WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68577 {
   68578    switch (devinfo->gen) {
   68579    case 10: return 0;
   68580    case 9: return 0;
   68581    case 8: return 0;
   68582    case 7:
   68583       if (devinfo->is_haswell) {
   68584          return 4;
   68585       } else {
   68586          return 4;
   68587       }
   68588    case 6: return 0;
   68589    case 5: return 0;
   68590    case 4:
   68591       if (devinfo->is_g4x) {
   68592          return 0;
   68593       } else {
   68594          return 0;
   68595       }
   68596    default:
   68597       unreachable("Invalid hardware generation");
   68598    }
   68599 }
   68600 
   68601 
   68602 
   68603 #define GEN75_3DSTATE_SBE_Attribute3WrapShortestEnables_start  396
   68604 #define GEN7_3DSTATE_SBE_Attribute3WrapShortestEnables_start  396
   68605 
   68606 static inline uint32_t ATTRIBUTE_PURE
   68607 _3DSTATE_SBE_Attribute3WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68608 {
   68609    switch (devinfo->gen) {
   68610    case 10: return 0;
   68611    case 9: return 0;
   68612    case 8: return 0;
   68613    case 7:
   68614       if (devinfo->is_haswell) {
   68615          return 396;
   68616       } else {
   68617          return 396;
   68618       }
   68619    case 6: return 0;
   68620    case 5: return 0;
   68621    case 4:
   68622       if (devinfo->is_g4x) {
   68623          return 0;
   68624       } else {
   68625          return 0;
   68626       }
   68627    default:
   68628       unreachable("Invalid hardware generation");
   68629    }
   68630 }
   68631 
   68632 
   68633 
   68634 /* 3DSTATE_SBE::Attribute 4 WrapShortest Enables */
   68635 
   68636 
   68637 #define GEN75_3DSTATE_SBE_Attribute4WrapShortestEnables_bits  4
   68638 #define GEN7_3DSTATE_SBE_Attribute4WrapShortestEnables_bits  4
   68639 
   68640 static inline uint32_t ATTRIBUTE_PURE
   68641 _3DSTATE_SBE_Attribute4WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68642 {
   68643    switch (devinfo->gen) {
   68644    case 10: return 0;
   68645    case 9: return 0;
   68646    case 8: return 0;
   68647    case 7:
   68648       if (devinfo->is_haswell) {
   68649          return 4;
   68650       } else {
   68651          return 4;
   68652       }
   68653    case 6: return 0;
   68654    case 5: return 0;
   68655    case 4:
   68656       if (devinfo->is_g4x) {
   68657          return 0;
   68658       } else {
   68659          return 0;
   68660       }
   68661    default:
   68662       unreachable("Invalid hardware generation");
   68663    }
   68664 }
   68665 
   68666 
   68667 
   68668 #define GEN75_3DSTATE_SBE_Attribute4WrapShortestEnables_start  400
   68669 #define GEN7_3DSTATE_SBE_Attribute4WrapShortestEnables_start  400
   68670 
   68671 static inline uint32_t ATTRIBUTE_PURE
   68672 _3DSTATE_SBE_Attribute4WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68673 {
   68674    switch (devinfo->gen) {
   68675    case 10: return 0;
   68676    case 9: return 0;
   68677    case 8: return 0;
   68678    case 7:
   68679       if (devinfo->is_haswell) {
   68680          return 400;
   68681       } else {
   68682          return 400;
   68683       }
   68684    case 6: return 0;
   68685    case 5: return 0;
   68686    case 4:
   68687       if (devinfo->is_g4x) {
   68688          return 0;
   68689       } else {
   68690          return 0;
   68691       }
   68692    default:
   68693       unreachable("Invalid hardware generation");
   68694    }
   68695 }
   68696 
   68697 
   68698 
   68699 /* 3DSTATE_SBE::Attribute 5 WrapShortest Enables */
   68700 
   68701 
   68702 #define GEN75_3DSTATE_SBE_Attribute5WrapShortestEnables_bits  4
   68703 #define GEN7_3DSTATE_SBE_Attribute5WrapShortestEnables_bits  4
   68704 
   68705 static inline uint32_t ATTRIBUTE_PURE
   68706 _3DSTATE_SBE_Attribute5WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68707 {
   68708    switch (devinfo->gen) {
   68709    case 10: return 0;
   68710    case 9: return 0;
   68711    case 8: return 0;
   68712    case 7:
   68713       if (devinfo->is_haswell) {
   68714          return 4;
   68715       } else {
   68716          return 4;
   68717       }
   68718    case 6: return 0;
   68719    case 5: return 0;
   68720    case 4:
   68721       if (devinfo->is_g4x) {
   68722          return 0;
   68723       } else {
   68724          return 0;
   68725       }
   68726    default:
   68727       unreachable("Invalid hardware generation");
   68728    }
   68729 }
   68730 
   68731 
   68732 
   68733 #define GEN75_3DSTATE_SBE_Attribute5WrapShortestEnables_start  404
   68734 #define GEN7_3DSTATE_SBE_Attribute5WrapShortestEnables_start  404
   68735 
   68736 static inline uint32_t ATTRIBUTE_PURE
   68737 _3DSTATE_SBE_Attribute5WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68738 {
   68739    switch (devinfo->gen) {
   68740    case 10: return 0;
   68741    case 9: return 0;
   68742    case 8: return 0;
   68743    case 7:
   68744       if (devinfo->is_haswell) {
   68745          return 404;
   68746       } else {
   68747          return 404;
   68748       }
   68749    case 6: return 0;
   68750    case 5: return 0;
   68751    case 4:
   68752       if (devinfo->is_g4x) {
   68753          return 0;
   68754       } else {
   68755          return 0;
   68756       }
   68757    default:
   68758       unreachable("Invalid hardware generation");
   68759    }
   68760 }
   68761 
   68762 
   68763 
   68764 /* 3DSTATE_SBE::Attribute 6 WrapShortest Enables */
   68765 
   68766 
   68767 #define GEN75_3DSTATE_SBE_Attribute6WrapShortestEnables_bits  4
   68768 #define GEN7_3DSTATE_SBE_Attribute6WrapShortestEnables_bits  4
   68769 
   68770 static inline uint32_t ATTRIBUTE_PURE
   68771 _3DSTATE_SBE_Attribute6WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68772 {
   68773    switch (devinfo->gen) {
   68774    case 10: return 0;
   68775    case 9: return 0;
   68776    case 8: return 0;
   68777    case 7:
   68778       if (devinfo->is_haswell) {
   68779          return 4;
   68780       } else {
   68781          return 4;
   68782       }
   68783    case 6: return 0;
   68784    case 5: return 0;
   68785    case 4:
   68786       if (devinfo->is_g4x) {
   68787          return 0;
   68788       } else {
   68789          return 0;
   68790       }
   68791    default:
   68792       unreachable("Invalid hardware generation");
   68793    }
   68794 }
   68795 
   68796 
   68797 
   68798 #define GEN75_3DSTATE_SBE_Attribute6WrapShortestEnables_start  408
   68799 #define GEN7_3DSTATE_SBE_Attribute6WrapShortestEnables_start  408
   68800 
   68801 static inline uint32_t ATTRIBUTE_PURE
   68802 _3DSTATE_SBE_Attribute6WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68803 {
   68804    switch (devinfo->gen) {
   68805    case 10: return 0;
   68806    case 9: return 0;
   68807    case 8: return 0;
   68808    case 7:
   68809       if (devinfo->is_haswell) {
   68810          return 408;
   68811       } else {
   68812          return 408;
   68813       }
   68814    case 6: return 0;
   68815    case 5: return 0;
   68816    case 4:
   68817       if (devinfo->is_g4x) {
   68818          return 0;
   68819       } else {
   68820          return 0;
   68821       }
   68822    default:
   68823       unreachable("Invalid hardware generation");
   68824    }
   68825 }
   68826 
   68827 
   68828 
   68829 /* 3DSTATE_SBE::Attribute 7 WrapShortest Enables */
   68830 
   68831 
   68832 #define GEN75_3DSTATE_SBE_Attribute7WrapShortestEnables_bits  4
   68833 #define GEN7_3DSTATE_SBE_Attribute7WrapShortestEnables_bits  4
   68834 
   68835 static inline uint32_t ATTRIBUTE_PURE
   68836 _3DSTATE_SBE_Attribute7WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68837 {
   68838    switch (devinfo->gen) {
   68839    case 10: return 0;
   68840    case 9: return 0;
   68841    case 8: return 0;
   68842    case 7:
   68843       if (devinfo->is_haswell) {
   68844          return 4;
   68845       } else {
   68846          return 4;
   68847       }
   68848    case 6: return 0;
   68849    case 5: return 0;
   68850    case 4:
   68851       if (devinfo->is_g4x) {
   68852          return 0;
   68853       } else {
   68854          return 0;
   68855       }
   68856    default:
   68857       unreachable("Invalid hardware generation");
   68858    }
   68859 }
   68860 
   68861 
   68862 
   68863 #define GEN75_3DSTATE_SBE_Attribute7WrapShortestEnables_start  412
   68864 #define GEN7_3DSTATE_SBE_Attribute7WrapShortestEnables_start  412
   68865 
   68866 static inline uint32_t ATTRIBUTE_PURE
   68867 _3DSTATE_SBE_Attribute7WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68868 {
   68869    switch (devinfo->gen) {
   68870    case 10: return 0;
   68871    case 9: return 0;
   68872    case 8: return 0;
   68873    case 7:
   68874       if (devinfo->is_haswell) {
   68875          return 412;
   68876       } else {
   68877          return 412;
   68878       }
   68879    case 6: return 0;
   68880    case 5: return 0;
   68881    case 4:
   68882       if (devinfo->is_g4x) {
   68883          return 0;
   68884       } else {
   68885          return 0;
   68886       }
   68887    default:
   68888       unreachable("Invalid hardware generation");
   68889    }
   68890 }
   68891 
   68892 
   68893 
   68894 /* 3DSTATE_SBE::Attribute 8 WrapShortest Enables */
   68895 
   68896 
   68897 #define GEN75_3DSTATE_SBE_Attribute8WrapShortestEnables_bits  4
   68898 #define GEN7_3DSTATE_SBE_Attribute8WrapShortestEnables_bits  4
   68899 
   68900 static inline uint32_t ATTRIBUTE_PURE
   68901 _3DSTATE_SBE_Attribute8WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68902 {
   68903    switch (devinfo->gen) {
   68904    case 10: return 0;
   68905    case 9: return 0;
   68906    case 8: return 0;
   68907    case 7:
   68908       if (devinfo->is_haswell) {
   68909          return 4;
   68910       } else {
   68911          return 4;
   68912       }
   68913    case 6: return 0;
   68914    case 5: return 0;
   68915    case 4:
   68916       if (devinfo->is_g4x) {
   68917          return 0;
   68918       } else {
   68919          return 0;
   68920       }
   68921    default:
   68922       unreachable("Invalid hardware generation");
   68923    }
   68924 }
   68925 
   68926 
   68927 
   68928 #define GEN75_3DSTATE_SBE_Attribute8WrapShortestEnables_start  416
   68929 #define GEN7_3DSTATE_SBE_Attribute8WrapShortestEnables_start  416
   68930 
   68931 static inline uint32_t ATTRIBUTE_PURE
   68932 _3DSTATE_SBE_Attribute8WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68933 {
   68934    switch (devinfo->gen) {
   68935    case 10: return 0;
   68936    case 9: return 0;
   68937    case 8: return 0;
   68938    case 7:
   68939       if (devinfo->is_haswell) {
   68940          return 416;
   68941       } else {
   68942          return 416;
   68943       }
   68944    case 6: return 0;
   68945    case 5: return 0;
   68946    case 4:
   68947       if (devinfo->is_g4x) {
   68948          return 0;
   68949       } else {
   68950          return 0;
   68951       }
   68952    default:
   68953       unreachable("Invalid hardware generation");
   68954    }
   68955 }
   68956 
   68957 
   68958 
   68959 /* 3DSTATE_SBE::Attribute 9 WrapShortest Enables */
   68960 
   68961 
   68962 #define GEN75_3DSTATE_SBE_Attribute9WrapShortestEnables_bits  4
   68963 #define GEN7_3DSTATE_SBE_Attribute9WrapShortestEnables_bits  4
   68964 
   68965 static inline uint32_t ATTRIBUTE_PURE
   68966 _3DSTATE_SBE_Attribute9WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   68967 {
   68968    switch (devinfo->gen) {
   68969    case 10: return 0;
   68970    case 9: return 0;
   68971    case 8: return 0;
   68972    case 7:
   68973       if (devinfo->is_haswell) {
   68974          return 4;
   68975       } else {
   68976          return 4;
   68977       }
   68978    case 6: return 0;
   68979    case 5: return 0;
   68980    case 4:
   68981       if (devinfo->is_g4x) {
   68982          return 0;
   68983       } else {
   68984          return 0;
   68985       }
   68986    default:
   68987       unreachable("Invalid hardware generation");
   68988    }
   68989 }
   68990 
   68991 
   68992 
   68993 #define GEN75_3DSTATE_SBE_Attribute9WrapShortestEnables_start  420
   68994 #define GEN7_3DSTATE_SBE_Attribute9WrapShortestEnables_start  420
   68995 
   68996 static inline uint32_t ATTRIBUTE_PURE
   68997 _3DSTATE_SBE_Attribute9WrapShortestEnables_start(const struct gen_device_info *devinfo)
   68998 {
   68999    switch (devinfo->gen) {
   69000    case 10: return 0;
   69001    case 9: return 0;
   69002    case 8: return 0;
   69003    case 7:
   69004       if (devinfo->is_haswell) {
   69005          return 420;
   69006       } else {
   69007          return 420;
   69008       }
   69009    case 6: return 0;
   69010    case 5: return 0;
   69011    case 4:
   69012       if (devinfo->is_g4x) {
   69013          return 0;
   69014       } else {
   69015          return 0;
   69016       }
   69017    default:
   69018       unreachable("Invalid hardware generation");
   69019    }
   69020 }
   69021 
   69022 
   69023 
   69024 /* 3DSTATE_SBE::Attribute Active Component Format */
   69025 
   69026 
   69027 #define GEN10_3DSTATE_SBE_AttributeActiveComponentFormat_bits  2
   69028 #define GEN9_3DSTATE_SBE_AttributeActiveComponentFormat_bits  2
   69029 
   69030 static inline uint32_t ATTRIBUTE_PURE
   69031 _3DSTATE_SBE_AttributeActiveComponentFormat_bits(const struct gen_device_info *devinfo)
   69032 {
   69033    switch (devinfo->gen) {
   69034    case 10: return 2;
   69035    case 9: return 2;
   69036    case 8: return 0;
   69037    case 7:
   69038       if (devinfo->is_haswell) {
   69039          return 0;
   69040       } else {
   69041          return 0;
   69042       }
   69043    case 6: return 0;
   69044    case 5: return 0;
   69045    case 4:
   69046       if (devinfo->is_g4x) {
   69047          return 0;
   69048       } else {
   69049          return 0;
   69050       }
   69051    default:
   69052       unreachable("Invalid hardware generation");
   69053    }
   69054 }
   69055 
   69056 
   69057 
   69058 #define GEN10_3DSTATE_SBE_AttributeActiveComponentFormat_start  0
   69059 #define GEN9_3DSTATE_SBE_AttributeActiveComponentFormat_start  0
   69060 
   69061 static inline uint32_t ATTRIBUTE_PURE
   69062 _3DSTATE_SBE_AttributeActiveComponentFormat_start(const struct gen_device_info *devinfo)
   69063 {
   69064    switch (devinfo->gen) {
   69065    case 10: return 0;
   69066    case 9: return 0;
   69067    case 8: return 0;
   69068    case 7:
   69069       if (devinfo->is_haswell) {
   69070          return 0;
   69071       } else {
   69072          return 0;
   69073       }
   69074    case 6: return 0;
   69075    case 5: return 0;
   69076    case 4:
   69077       if (devinfo->is_g4x) {
   69078          return 0;
   69079       } else {
   69080          return 0;
   69081       }
   69082    default:
   69083       unreachable("Invalid hardware generation");
   69084    }
   69085 }
   69086 
   69087 
   69088 
   69089 /* 3DSTATE_SBE::Attribute Swizzle Control Mode */
   69090 
   69091 
   69092 #define GEN75_3DSTATE_SBE_AttributeSwizzleControlMode_bits  1
   69093 #define GEN7_3DSTATE_SBE_AttributeSwizzleControlMode_bits  1
   69094 
   69095 static inline uint32_t ATTRIBUTE_PURE
   69096 _3DSTATE_SBE_AttributeSwizzleControlMode_bits(const struct gen_device_info *devinfo)
   69097 {
   69098    switch (devinfo->gen) {
   69099    case 10: return 0;
   69100    case 9: return 0;
   69101    case 8: return 0;
   69102    case 7:
   69103       if (devinfo->is_haswell) {
   69104          return 1;
   69105       } else {
   69106          return 1;
   69107       }
   69108    case 6: return 0;
   69109    case 5: return 0;
   69110    case 4:
   69111       if (devinfo->is_g4x) {
   69112          return 0;
   69113       } else {
   69114          return 0;
   69115       }
   69116    default:
   69117       unreachable("Invalid hardware generation");
   69118    }
   69119 }
   69120 
   69121 
   69122 
   69123 #define GEN75_3DSTATE_SBE_AttributeSwizzleControlMode_start  60
   69124 #define GEN7_3DSTATE_SBE_AttributeSwizzleControlMode_start  60
   69125 
   69126 static inline uint32_t ATTRIBUTE_PURE
   69127 _3DSTATE_SBE_AttributeSwizzleControlMode_start(const struct gen_device_info *devinfo)
   69128 {
   69129    switch (devinfo->gen) {
   69130    case 10: return 0;
   69131    case 9: return 0;
   69132    case 8: return 0;
   69133    case 7:
   69134       if (devinfo->is_haswell) {
   69135          return 60;
   69136       } else {
   69137          return 60;
   69138       }
   69139    case 6: return 0;
   69140    case 5: return 0;
   69141    case 4:
   69142       if (devinfo->is_g4x) {
   69143          return 0;
   69144       } else {
   69145          return 0;
   69146       }
   69147    default:
   69148       unreachable("Invalid hardware generation");
   69149    }
   69150 }
   69151 
   69152 
   69153 
   69154 /* 3DSTATE_SBE::Attribute Swizzle Enable */
   69155 
   69156 
   69157 #define GEN10_3DSTATE_SBE_AttributeSwizzleEnable_bits  1
   69158 #define GEN9_3DSTATE_SBE_AttributeSwizzleEnable_bits  1
   69159 #define GEN8_3DSTATE_SBE_AttributeSwizzleEnable_bits  1
   69160 #define GEN75_3DSTATE_SBE_AttributeSwizzleEnable_bits  1
   69161 #define GEN7_3DSTATE_SBE_AttributeSwizzleEnable_bits  1
   69162 
   69163 static inline uint32_t ATTRIBUTE_PURE
   69164 _3DSTATE_SBE_AttributeSwizzleEnable_bits(const struct gen_device_info *devinfo)
   69165 {
   69166    switch (devinfo->gen) {
   69167    case 10: return 1;
   69168    case 9: return 1;
   69169    case 8: return 1;
   69170    case 7:
   69171       if (devinfo->is_haswell) {
   69172          return 1;
   69173       } else {
   69174          return 1;
   69175       }
   69176    case 6: return 0;
   69177    case 5: return 0;
   69178    case 4:
   69179       if (devinfo->is_g4x) {
   69180          return 0;
   69181       } else {
   69182          return 0;
   69183       }
   69184    default:
   69185       unreachable("Invalid hardware generation");
   69186    }
   69187 }
   69188 
   69189 
   69190 
   69191 #define GEN10_3DSTATE_SBE_AttributeSwizzleEnable_start  53
   69192 #define GEN9_3DSTATE_SBE_AttributeSwizzleEnable_start  53
   69193 #define GEN8_3DSTATE_SBE_AttributeSwizzleEnable_start  53
   69194 #define GEN75_3DSTATE_SBE_AttributeSwizzleEnable_start  53
   69195 #define GEN7_3DSTATE_SBE_AttributeSwizzleEnable_start  53
   69196 
   69197 static inline uint32_t ATTRIBUTE_PURE
   69198 _3DSTATE_SBE_AttributeSwizzleEnable_start(const struct gen_device_info *devinfo)
   69199 {
   69200    switch (devinfo->gen) {
   69201    case 10: return 53;
   69202    case 9: return 53;
   69203    case 8: return 53;
   69204    case 7:
   69205       if (devinfo->is_haswell) {
   69206          return 53;
   69207       } else {
   69208          return 53;
   69209       }
   69210    case 6: return 0;
   69211    case 5: return 0;
   69212    case 4:
   69213       if (devinfo->is_g4x) {
   69214          return 0;
   69215       } else {
   69216          return 0;
   69217       }
   69218    default:
   69219       unreachable("Invalid hardware generation");
   69220    }
   69221 }
   69222 
   69223 
   69224 
   69225 /* 3DSTATE_SBE::Command SubType */
   69226 
   69227 
   69228 #define GEN10_3DSTATE_SBE_CommandSubType_bits  2
   69229 #define GEN9_3DSTATE_SBE_CommandSubType_bits  2
   69230 #define GEN8_3DSTATE_SBE_CommandSubType_bits  2
   69231 #define GEN75_3DSTATE_SBE_CommandSubType_bits  2
   69232 #define GEN7_3DSTATE_SBE_CommandSubType_bits  2
   69233 
   69234 static inline uint32_t ATTRIBUTE_PURE
   69235 _3DSTATE_SBE_CommandSubType_bits(const struct gen_device_info *devinfo)
   69236 {
   69237    switch (devinfo->gen) {
   69238    case 10: return 2;
   69239    case 9: return 2;
   69240    case 8: return 2;
   69241    case 7:
   69242       if (devinfo->is_haswell) {
   69243          return 2;
   69244       } else {
   69245          return 2;
   69246       }
   69247    case 6: return 0;
   69248    case 5: return 0;
   69249    case 4:
   69250       if (devinfo->is_g4x) {
   69251          return 0;
   69252       } else {
   69253          return 0;
   69254       }
   69255    default:
   69256       unreachable("Invalid hardware generation");
   69257    }
   69258 }
   69259 
   69260 
   69261 
   69262 #define GEN10_3DSTATE_SBE_CommandSubType_start  27
   69263 #define GEN9_3DSTATE_SBE_CommandSubType_start  27
   69264 #define GEN8_3DSTATE_SBE_CommandSubType_start  27
   69265 #define GEN75_3DSTATE_SBE_CommandSubType_start  27
   69266 #define GEN7_3DSTATE_SBE_CommandSubType_start  27
   69267 
   69268 static inline uint32_t ATTRIBUTE_PURE
   69269 _3DSTATE_SBE_CommandSubType_start(const struct gen_device_info *devinfo)
   69270 {
   69271    switch (devinfo->gen) {
   69272    case 10: return 27;
   69273    case 9: return 27;
   69274    case 8: return 27;
   69275    case 7:
   69276       if (devinfo->is_haswell) {
   69277          return 27;
   69278       } else {
   69279          return 27;
   69280       }
   69281    case 6: return 0;
   69282    case 5: return 0;
   69283    case 4:
   69284       if (devinfo->is_g4x) {
   69285          return 0;
   69286       } else {
   69287          return 0;
   69288       }
   69289    default:
   69290       unreachable("Invalid hardware generation");
   69291    }
   69292 }
   69293 
   69294 
   69295 
   69296 /* 3DSTATE_SBE::Command Type */
   69297 
   69298 
   69299 #define GEN10_3DSTATE_SBE_CommandType_bits  3
   69300 #define GEN9_3DSTATE_SBE_CommandType_bits  3
   69301 #define GEN8_3DSTATE_SBE_CommandType_bits  3
   69302 #define GEN75_3DSTATE_SBE_CommandType_bits  3
   69303 #define GEN7_3DSTATE_SBE_CommandType_bits  3
   69304 
   69305 static inline uint32_t ATTRIBUTE_PURE
   69306 _3DSTATE_SBE_CommandType_bits(const struct gen_device_info *devinfo)
   69307 {
   69308    switch (devinfo->gen) {
   69309    case 10: return 3;
   69310    case 9: return 3;
   69311    case 8: return 3;
   69312    case 7:
   69313       if (devinfo->is_haswell) {
   69314          return 3;
   69315       } else {
   69316          return 3;
   69317       }
   69318    case 6: return 0;
   69319    case 5: return 0;
   69320    case 4:
   69321       if (devinfo->is_g4x) {
   69322          return 0;
   69323       } else {
   69324          return 0;
   69325       }
   69326    default:
   69327       unreachable("Invalid hardware generation");
   69328    }
   69329 }
   69330 
   69331 
   69332 
   69333 #define GEN10_3DSTATE_SBE_CommandType_start  29
   69334 #define GEN9_3DSTATE_SBE_CommandType_start  29
   69335 #define GEN8_3DSTATE_SBE_CommandType_start  29
   69336 #define GEN75_3DSTATE_SBE_CommandType_start  29
   69337 #define GEN7_3DSTATE_SBE_CommandType_start  29
   69338 
   69339 static inline uint32_t ATTRIBUTE_PURE
   69340 _3DSTATE_SBE_CommandType_start(const struct gen_device_info *devinfo)
   69341 {
   69342    switch (devinfo->gen) {
   69343    case 10: return 29;
   69344    case 9: return 29;
   69345    case 8: return 29;
   69346    case 7:
   69347       if (devinfo->is_haswell) {
   69348          return 29;
   69349       } else {
   69350          return 29;
   69351       }
   69352    case 6: return 0;
   69353    case 5: return 0;
   69354    case 4:
   69355       if (devinfo->is_g4x) {
   69356          return 0;
   69357       } else {
   69358          return 0;
   69359       }
   69360    default:
   69361       unreachable("Invalid hardware generation");
   69362    }
   69363 }
   69364 
   69365 
   69366 
   69367 /* 3DSTATE_SBE::Constant Interpolation Enable */
   69368 
   69369 
   69370 #define GEN10_3DSTATE_SBE_ConstantInterpolationEnable_bits  32
   69371 #define GEN9_3DSTATE_SBE_ConstantInterpolationEnable_bits  32
   69372 #define GEN8_3DSTATE_SBE_ConstantInterpolationEnable_bits  32
   69373 #define GEN75_3DSTATE_SBE_ConstantInterpolationEnable_bits  32
   69374 #define GEN7_3DSTATE_SBE_ConstantInterpolationEnable_bits  32
   69375 
   69376 static inline uint32_t ATTRIBUTE_PURE
   69377 _3DSTATE_SBE_ConstantInterpolationEnable_bits(const struct gen_device_info *devinfo)
   69378 {
   69379    switch (devinfo->gen) {
   69380    case 10: return 32;
   69381    case 9: return 32;
   69382    case 8: return 32;
   69383    case 7:
   69384       if (devinfo->is_haswell) {
   69385          return 32;
   69386       } else {
   69387          return 32;
   69388       }
   69389    case 6: return 0;
   69390    case 5: return 0;
   69391    case 4:
   69392       if (devinfo->is_g4x) {
   69393          return 0;
   69394       } else {
   69395          return 0;
   69396       }
   69397    default:
   69398       unreachable("Invalid hardware generation");
   69399    }
   69400 }
   69401 
   69402 
   69403 
   69404 #define GEN10_3DSTATE_SBE_ConstantInterpolationEnable_start  96
   69405 #define GEN9_3DSTATE_SBE_ConstantInterpolationEnable_start  96
   69406 #define GEN8_3DSTATE_SBE_ConstantInterpolationEnable_start  96
   69407 #define GEN75_3DSTATE_SBE_ConstantInterpolationEnable_start  352
   69408 #define GEN7_3DSTATE_SBE_ConstantInterpolationEnable_start  352
   69409 
   69410 static inline uint32_t ATTRIBUTE_PURE
   69411 _3DSTATE_SBE_ConstantInterpolationEnable_start(const struct gen_device_info *devinfo)
   69412 {
   69413    switch (devinfo->gen) {
   69414    case 10: return 96;
   69415    case 9: return 96;
   69416    case 8: return 96;
   69417    case 7:
   69418       if (devinfo->is_haswell) {
   69419          return 352;
   69420       } else {
   69421          return 352;
   69422       }
   69423    case 6: return 0;
   69424    case 5: return 0;
   69425    case 4:
   69426       if (devinfo->is_g4x) {
   69427          return 0;
   69428       } else {
   69429          return 0;
   69430       }
   69431    default:
   69432       unreachable("Invalid hardware generation");
   69433    }
   69434 }
   69435 
   69436 
   69437 
   69438 /* 3DSTATE_SBE::DWord Length */
   69439 
   69440 
   69441 #define GEN10_3DSTATE_SBE_DWordLength_bits  8
   69442 #define GEN9_3DSTATE_SBE_DWordLength_bits  8
   69443 #define GEN8_3DSTATE_SBE_DWordLength_bits  8
   69444 #define GEN75_3DSTATE_SBE_DWordLength_bits  8
   69445 #define GEN7_3DSTATE_SBE_DWordLength_bits  8
   69446 
   69447 static inline uint32_t ATTRIBUTE_PURE
   69448 _3DSTATE_SBE_DWordLength_bits(const struct gen_device_info *devinfo)
   69449 {
   69450    switch (devinfo->gen) {
   69451    case 10: return 8;
   69452    case 9: return 8;
   69453    case 8: return 8;
   69454    case 7:
   69455       if (devinfo->is_haswell) {
   69456          return 8;
   69457       } else {
   69458          return 8;
   69459       }
   69460    case 6: return 0;
   69461    case 5: return 0;
   69462    case 4:
   69463       if (devinfo->is_g4x) {
   69464          return 0;
   69465       } else {
   69466          return 0;
   69467       }
   69468    default:
   69469       unreachable("Invalid hardware generation");
   69470    }
   69471 }
   69472 
   69473 
   69474 
   69475 #define GEN10_3DSTATE_SBE_DWordLength_start  0
   69476 #define GEN9_3DSTATE_SBE_DWordLength_start  0
   69477 #define GEN8_3DSTATE_SBE_DWordLength_start  0
   69478 #define GEN75_3DSTATE_SBE_DWordLength_start  0
   69479 #define GEN7_3DSTATE_SBE_DWordLength_start  0
   69480 
   69481 static inline uint32_t ATTRIBUTE_PURE
   69482 _3DSTATE_SBE_DWordLength_start(const struct gen_device_info *devinfo)
   69483 {
   69484    switch (devinfo->gen) {
   69485    case 10: return 0;
   69486    case 9: return 0;
   69487    case 8: return 0;
   69488    case 7:
   69489       if (devinfo->is_haswell) {
   69490          return 0;
   69491       } else {
   69492          return 0;
   69493       }
   69494    case 6: return 0;
   69495    case 5: return 0;
   69496    case 4:
   69497       if (devinfo->is_g4x) {
   69498          return 0;
   69499       } else {
   69500          return 0;
   69501       }
   69502    default:
   69503       unreachable("Invalid hardware generation");
   69504    }
   69505 }
   69506 
   69507 
   69508 
   69509 /* 3DSTATE_SBE::Force Vertex URB Entry Read Length */
   69510 
   69511 
   69512 #define GEN10_3DSTATE_SBE_ForceVertexURBEntryReadLength_bits  1
   69513 #define GEN9_3DSTATE_SBE_ForceVertexURBEntryReadLength_bits  1
   69514 #define GEN8_3DSTATE_SBE_ForceVertexURBEntryReadLength_bits  1
   69515 
   69516 static inline uint32_t ATTRIBUTE_PURE
   69517 _3DSTATE_SBE_ForceVertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   69518 {
   69519    switch (devinfo->gen) {
   69520    case 10: return 1;
   69521    case 9: return 1;
   69522    case 8: return 1;
   69523    case 7:
   69524       if (devinfo->is_haswell) {
   69525          return 0;
   69526       } else {
   69527          return 0;
   69528       }
   69529    case 6: return 0;
   69530    case 5: return 0;
   69531    case 4:
   69532       if (devinfo->is_g4x) {
   69533          return 0;
   69534       } else {
   69535          return 0;
   69536       }
   69537    default:
   69538       unreachable("Invalid hardware generation");
   69539    }
   69540 }
   69541 
   69542 
   69543 
   69544 #define GEN10_3DSTATE_SBE_ForceVertexURBEntryReadLength_start  61
   69545 #define GEN9_3DSTATE_SBE_ForceVertexURBEntryReadLength_start  61
   69546 #define GEN8_3DSTATE_SBE_ForceVertexURBEntryReadLength_start  61
   69547 
   69548 static inline uint32_t ATTRIBUTE_PURE
   69549 _3DSTATE_SBE_ForceVertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   69550 {
   69551    switch (devinfo->gen) {
   69552    case 10: return 61;
   69553    case 9: return 61;
   69554    case 8: return 61;
   69555    case 7:
   69556       if (devinfo->is_haswell) {
   69557          return 0;
   69558       } else {
   69559          return 0;
   69560       }
   69561    case 6: return 0;
   69562    case 5: return 0;
   69563    case 4:
   69564       if (devinfo->is_g4x) {
   69565          return 0;
   69566       } else {
   69567          return 0;
   69568       }
   69569    default:
   69570       unreachable("Invalid hardware generation");
   69571    }
   69572 }
   69573 
   69574 
   69575 
   69576 /* 3DSTATE_SBE::Force Vertex URB Entry Read Offset */
   69577 
   69578 
   69579 #define GEN10_3DSTATE_SBE_ForceVertexURBEntryReadOffset_bits  1
   69580 #define GEN9_3DSTATE_SBE_ForceVertexURBEntryReadOffset_bits  1
   69581 #define GEN8_3DSTATE_SBE_ForceVertexURBEntryReadOffset_bits  1
   69582 
   69583 static inline uint32_t ATTRIBUTE_PURE
   69584 _3DSTATE_SBE_ForceVertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   69585 {
   69586    switch (devinfo->gen) {
   69587    case 10: return 1;
   69588    case 9: return 1;
   69589    case 8: return 1;
   69590    case 7:
   69591       if (devinfo->is_haswell) {
   69592          return 0;
   69593       } else {
   69594          return 0;
   69595       }
   69596    case 6: return 0;
   69597    case 5: return 0;
   69598    case 4:
   69599       if (devinfo->is_g4x) {
   69600          return 0;
   69601       } else {
   69602          return 0;
   69603       }
   69604    default:
   69605       unreachable("Invalid hardware generation");
   69606    }
   69607 }
   69608 
   69609 
   69610 
   69611 #define GEN10_3DSTATE_SBE_ForceVertexURBEntryReadOffset_start  60
   69612 #define GEN9_3DSTATE_SBE_ForceVertexURBEntryReadOffset_start  60
   69613 #define GEN8_3DSTATE_SBE_ForceVertexURBEntryReadOffset_start  60
   69614 
   69615 static inline uint32_t ATTRIBUTE_PURE
   69616 _3DSTATE_SBE_ForceVertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   69617 {
   69618    switch (devinfo->gen) {
   69619    case 10: return 60;
   69620    case 9: return 60;
   69621    case 8: return 60;
   69622    case 7:
   69623       if (devinfo->is_haswell) {
   69624          return 0;
   69625       } else {
   69626          return 0;
   69627       }
   69628    case 6: return 0;
   69629    case 5: return 0;
   69630    case 4:
   69631       if (devinfo->is_g4x) {
   69632          return 0;
   69633       } else {
   69634          return 0;
   69635       }
   69636    default:
   69637       unreachable("Invalid hardware generation");
   69638    }
   69639 }
   69640 
   69641 
   69642 
   69643 /* 3DSTATE_SBE::Number of SF Output Attributes */
   69644 
   69645 
   69646 #define GEN10_3DSTATE_SBE_NumberofSFOutputAttributes_bits  6
   69647 #define GEN9_3DSTATE_SBE_NumberofSFOutputAttributes_bits  6
   69648 #define GEN8_3DSTATE_SBE_NumberofSFOutputAttributes_bits  6
   69649 #define GEN75_3DSTATE_SBE_NumberofSFOutputAttributes_bits  6
   69650 #define GEN7_3DSTATE_SBE_NumberofSFOutputAttributes_bits  6
   69651 
   69652 static inline uint32_t ATTRIBUTE_PURE
   69653 _3DSTATE_SBE_NumberofSFOutputAttributes_bits(const struct gen_device_info *devinfo)
   69654 {
   69655    switch (devinfo->gen) {
   69656    case 10: return 6;
   69657    case 9: return 6;
   69658    case 8: return 6;
   69659    case 7:
   69660       if (devinfo->is_haswell) {
   69661          return 6;
   69662       } else {
   69663          return 6;
   69664       }
   69665    case 6: return 0;
   69666    case 5: return 0;
   69667    case 4:
   69668       if (devinfo->is_g4x) {
   69669          return 0;
   69670       } else {
   69671          return 0;
   69672       }
   69673    default:
   69674       unreachable("Invalid hardware generation");
   69675    }
   69676 }
   69677 
   69678 
   69679 
   69680 #define GEN10_3DSTATE_SBE_NumberofSFOutputAttributes_start  54
   69681 #define GEN9_3DSTATE_SBE_NumberofSFOutputAttributes_start  54
   69682 #define GEN8_3DSTATE_SBE_NumberofSFOutputAttributes_start  54
   69683 #define GEN75_3DSTATE_SBE_NumberofSFOutputAttributes_start  54
   69684 #define GEN7_3DSTATE_SBE_NumberofSFOutputAttributes_start  54
   69685 
   69686 static inline uint32_t ATTRIBUTE_PURE
   69687 _3DSTATE_SBE_NumberofSFOutputAttributes_start(const struct gen_device_info *devinfo)
   69688 {
   69689    switch (devinfo->gen) {
   69690    case 10: return 54;
   69691    case 9: return 54;
   69692    case 8: return 54;
   69693    case 7:
   69694       if (devinfo->is_haswell) {
   69695          return 54;
   69696       } else {
   69697          return 54;
   69698       }
   69699    case 6: return 0;
   69700    case 5: return 0;
   69701    case 4:
   69702       if (devinfo->is_g4x) {
   69703          return 0;
   69704       } else {
   69705          return 0;
   69706       }
   69707    default:
   69708       unreachable("Invalid hardware generation");
   69709    }
   69710 }
   69711 
   69712 
   69713 
   69714 /* 3DSTATE_SBE::Point Sprite Texture Coordinate Enable */
   69715 
   69716 
   69717 #define GEN10_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_bits  32
   69718 #define GEN9_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_bits  32
   69719 #define GEN8_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_bits  32
   69720 #define GEN75_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_bits  32
   69721 #define GEN7_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_bits  32
   69722 
   69723 static inline uint32_t ATTRIBUTE_PURE
   69724 _3DSTATE_SBE_PointSpriteTextureCoordinateEnable_bits(const struct gen_device_info *devinfo)
   69725 {
   69726    switch (devinfo->gen) {
   69727    case 10: return 32;
   69728    case 9: return 32;
   69729    case 8: return 32;
   69730    case 7:
   69731       if (devinfo->is_haswell) {
   69732          return 32;
   69733       } else {
   69734          return 32;
   69735       }
   69736    case 6: return 0;
   69737    case 5: return 0;
   69738    case 4:
   69739       if (devinfo->is_g4x) {
   69740          return 0;
   69741       } else {
   69742          return 0;
   69743       }
   69744    default:
   69745       unreachable("Invalid hardware generation");
   69746    }
   69747 }
   69748 
   69749 
   69750 
   69751 #define GEN10_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_start  64
   69752 #define GEN9_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_start  64
   69753 #define GEN8_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_start  64
   69754 #define GEN75_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_start  320
   69755 #define GEN7_3DSTATE_SBE_PointSpriteTextureCoordinateEnable_start  320
   69756 
   69757 static inline uint32_t ATTRIBUTE_PURE
   69758 _3DSTATE_SBE_PointSpriteTextureCoordinateEnable_start(const struct gen_device_info *devinfo)
   69759 {
   69760    switch (devinfo->gen) {
   69761    case 10: return 64;
   69762    case 9: return 64;
   69763    case 8: return 64;
   69764    case 7:
   69765       if (devinfo->is_haswell) {
   69766          return 320;
   69767       } else {
   69768          return 320;
   69769       }
   69770    case 6: return 0;
   69771    case 5: return 0;
   69772    case 4:
   69773       if (devinfo->is_g4x) {
   69774          return 0;
   69775       } else {
   69776          return 0;
   69777       }
   69778    default:
   69779       unreachable("Invalid hardware generation");
   69780    }
   69781 }
   69782 
   69783 
   69784 
   69785 /* 3DSTATE_SBE::Point Sprite Texture Coordinate Origin */
   69786 
   69787 
   69788 #define GEN10_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_bits  1
   69789 #define GEN9_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_bits  1
   69790 #define GEN8_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_bits  1
   69791 #define GEN75_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_bits  1
   69792 #define GEN7_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_bits  1
   69793 
   69794 static inline uint32_t ATTRIBUTE_PURE
   69795 _3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_bits(const struct gen_device_info *devinfo)
   69796 {
   69797    switch (devinfo->gen) {
   69798    case 10: return 1;
   69799    case 9: return 1;
   69800    case 8: return 1;
   69801    case 7:
   69802       if (devinfo->is_haswell) {
   69803          return 1;
   69804       } else {
   69805          return 1;
   69806       }
   69807    case 6: return 0;
   69808    case 5: return 0;
   69809    case 4:
   69810       if (devinfo->is_g4x) {
   69811          return 0;
   69812       } else {
   69813          return 0;
   69814       }
   69815    default:
   69816       unreachable("Invalid hardware generation");
   69817    }
   69818 }
   69819 
   69820 
   69821 
   69822 #define GEN10_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_start  52
   69823 #define GEN9_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_start  52
   69824 #define GEN8_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_start  52
   69825 #define GEN75_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_start  52
   69826 #define GEN7_3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_start  52
   69827 
   69828 static inline uint32_t ATTRIBUTE_PURE
   69829 _3DSTATE_SBE_PointSpriteTextureCoordinateOrigin_start(const struct gen_device_info *devinfo)
   69830 {
   69831    switch (devinfo->gen) {
   69832    case 10: return 52;
   69833    case 9: return 52;
   69834    case 8: return 52;
   69835    case 7:
   69836       if (devinfo->is_haswell) {
   69837          return 52;
   69838       } else {
   69839          return 52;
   69840       }
   69841    case 6: return 0;
   69842    case 5: return 0;
   69843    case 4:
   69844       if (devinfo->is_g4x) {
   69845          return 0;
   69846       } else {
   69847          return 0;
   69848       }
   69849    default:
   69850       unreachable("Invalid hardware generation");
   69851    }
   69852 }
   69853 
   69854 
   69855 
   69856 /* 3DSTATE_SBE::Primitive ID Override Attribute Select */
   69857 
   69858 
   69859 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_bits  5
   69860 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_bits  5
   69861 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_bits  5
   69862 
   69863 static inline uint32_t ATTRIBUTE_PURE
   69864 _3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_bits(const struct gen_device_info *devinfo)
   69865 {
   69866    switch (devinfo->gen) {
   69867    case 10: return 5;
   69868    case 9: return 5;
   69869    case 8: return 5;
   69870    case 7:
   69871       if (devinfo->is_haswell) {
   69872          return 0;
   69873       } else {
   69874          return 0;
   69875       }
   69876    case 6: return 0;
   69877    case 5: return 0;
   69878    case 4:
   69879       if (devinfo->is_g4x) {
   69880          return 0;
   69881       } else {
   69882          return 0;
   69883       }
   69884    default:
   69885       unreachable("Invalid hardware generation");
   69886    }
   69887 }
   69888 
   69889 
   69890 
   69891 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_start  32
   69892 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_start  32
   69893 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_start  32
   69894 
   69895 static inline uint32_t ATTRIBUTE_PURE
   69896 _3DSTATE_SBE_PrimitiveIDOverrideAttributeSelect_start(const struct gen_device_info *devinfo)
   69897 {
   69898    switch (devinfo->gen) {
   69899    case 10: return 32;
   69900    case 9: return 32;
   69901    case 8: return 32;
   69902    case 7:
   69903       if (devinfo->is_haswell) {
   69904          return 0;
   69905       } else {
   69906          return 0;
   69907       }
   69908    case 6: return 0;
   69909    case 5: return 0;
   69910    case 4:
   69911       if (devinfo->is_g4x) {
   69912          return 0;
   69913       } else {
   69914          return 0;
   69915       }
   69916    default:
   69917       unreachable("Invalid hardware generation");
   69918    }
   69919 }
   69920 
   69921 
   69922 
   69923 /* 3DSTATE_SBE::Primitive ID Override Component W */
   69924 
   69925 
   69926 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentW_bits  1
   69927 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentW_bits  1
   69928 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentW_bits  1
   69929 
   69930 static inline uint32_t ATTRIBUTE_PURE
   69931 _3DSTATE_SBE_PrimitiveIDOverrideComponentW_bits(const struct gen_device_info *devinfo)
   69932 {
   69933    switch (devinfo->gen) {
   69934    case 10: return 1;
   69935    case 9: return 1;
   69936    case 8: return 1;
   69937    case 7:
   69938       if (devinfo->is_haswell) {
   69939          return 0;
   69940       } else {
   69941          return 0;
   69942       }
   69943    case 6: return 0;
   69944    case 5: return 0;
   69945    case 4:
   69946       if (devinfo->is_g4x) {
   69947          return 0;
   69948       } else {
   69949          return 0;
   69950       }
   69951    default:
   69952       unreachable("Invalid hardware generation");
   69953    }
   69954 }
   69955 
   69956 
   69957 
   69958 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentW_start  51
   69959 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentW_start  51
   69960 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentW_start  51
   69961 
   69962 static inline uint32_t ATTRIBUTE_PURE
   69963 _3DSTATE_SBE_PrimitiveIDOverrideComponentW_start(const struct gen_device_info *devinfo)
   69964 {
   69965    switch (devinfo->gen) {
   69966    case 10: return 51;
   69967    case 9: return 51;
   69968    case 8: return 51;
   69969    case 7:
   69970       if (devinfo->is_haswell) {
   69971          return 0;
   69972       } else {
   69973          return 0;
   69974       }
   69975    case 6: return 0;
   69976    case 5: return 0;
   69977    case 4:
   69978       if (devinfo->is_g4x) {
   69979          return 0;
   69980       } else {
   69981          return 0;
   69982       }
   69983    default:
   69984       unreachable("Invalid hardware generation");
   69985    }
   69986 }
   69987 
   69988 
   69989 
   69990 /* 3DSTATE_SBE::Primitive ID Override Component X */
   69991 
   69992 
   69993 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentX_bits  1
   69994 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentX_bits  1
   69995 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentX_bits  1
   69996 
   69997 static inline uint32_t ATTRIBUTE_PURE
   69998 _3DSTATE_SBE_PrimitiveIDOverrideComponentX_bits(const struct gen_device_info *devinfo)
   69999 {
   70000    switch (devinfo->gen) {
   70001    case 10: return 1;
   70002    case 9: return 1;
   70003    case 8: return 1;
   70004    case 7:
   70005       if (devinfo->is_haswell) {
   70006          return 0;
   70007       } else {
   70008          return 0;
   70009       }
   70010    case 6: return 0;
   70011    case 5: return 0;
   70012    case 4:
   70013       if (devinfo->is_g4x) {
   70014          return 0;
   70015       } else {
   70016          return 0;
   70017       }
   70018    default:
   70019       unreachable("Invalid hardware generation");
   70020    }
   70021 }
   70022 
   70023 
   70024 
   70025 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentX_start  48
   70026 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentX_start  48
   70027 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentX_start  48
   70028 
   70029 static inline uint32_t ATTRIBUTE_PURE
   70030 _3DSTATE_SBE_PrimitiveIDOverrideComponentX_start(const struct gen_device_info *devinfo)
   70031 {
   70032    switch (devinfo->gen) {
   70033    case 10: return 48;
   70034    case 9: return 48;
   70035    case 8: return 48;
   70036    case 7:
   70037       if (devinfo->is_haswell) {
   70038          return 0;
   70039       } else {
   70040          return 0;
   70041       }
   70042    case 6: return 0;
   70043    case 5: return 0;
   70044    case 4:
   70045       if (devinfo->is_g4x) {
   70046          return 0;
   70047       } else {
   70048          return 0;
   70049       }
   70050    default:
   70051       unreachable("Invalid hardware generation");
   70052    }
   70053 }
   70054 
   70055 
   70056 
   70057 /* 3DSTATE_SBE::Primitive ID Override Component Y */
   70058 
   70059 
   70060 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentY_bits  1
   70061 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentY_bits  1
   70062 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentY_bits  1
   70063 
   70064 static inline uint32_t ATTRIBUTE_PURE
   70065 _3DSTATE_SBE_PrimitiveIDOverrideComponentY_bits(const struct gen_device_info *devinfo)
   70066 {
   70067    switch (devinfo->gen) {
   70068    case 10: return 1;
   70069    case 9: return 1;
   70070    case 8: return 1;
   70071    case 7:
   70072       if (devinfo->is_haswell) {
   70073          return 0;
   70074       } else {
   70075          return 0;
   70076       }
   70077    case 6: return 0;
   70078    case 5: return 0;
   70079    case 4:
   70080       if (devinfo->is_g4x) {
   70081          return 0;
   70082       } else {
   70083          return 0;
   70084       }
   70085    default:
   70086       unreachable("Invalid hardware generation");
   70087    }
   70088 }
   70089 
   70090 
   70091 
   70092 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentY_start  49
   70093 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentY_start  49
   70094 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentY_start  49
   70095 
   70096 static inline uint32_t ATTRIBUTE_PURE
   70097 _3DSTATE_SBE_PrimitiveIDOverrideComponentY_start(const struct gen_device_info *devinfo)
   70098 {
   70099    switch (devinfo->gen) {
   70100    case 10: return 49;
   70101    case 9: return 49;
   70102    case 8: return 49;
   70103    case 7:
   70104       if (devinfo->is_haswell) {
   70105          return 0;
   70106       } else {
   70107          return 0;
   70108       }
   70109    case 6: return 0;
   70110    case 5: return 0;
   70111    case 4:
   70112       if (devinfo->is_g4x) {
   70113          return 0;
   70114       } else {
   70115          return 0;
   70116       }
   70117    default:
   70118       unreachable("Invalid hardware generation");
   70119    }
   70120 }
   70121 
   70122 
   70123 
   70124 /* 3DSTATE_SBE::Primitive ID Override Component Z */
   70125 
   70126 
   70127 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentZ_bits  1
   70128 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentZ_bits  1
   70129 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentZ_bits  1
   70130 
   70131 static inline uint32_t ATTRIBUTE_PURE
   70132 _3DSTATE_SBE_PrimitiveIDOverrideComponentZ_bits(const struct gen_device_info *devinfo)
   70133 {
   70134    switch (devinfo->gen) {
   70135    case 10: return 1;
   70136    case 9: return 1;
   70137    case 8: return 1;
   70138    case 7:
   70139       if (devinfo->is_haswell) {
   70140          return 0;
   70141       } else {
   70142          return 0;
   70143       }
   70144    case 6: return 0;
   70145    case 5: return 0;
   70146    case 4:
   70147       if (devinfo->is_g4x) {
   70148          return 0;
   70149       } else {
   70150          return 0;
   70151       }
   70152    default:
   70153       unreachable("Invalid hardware generation");
   70154    }
   70155 }
   70156 
   70157 
   70158 
   70159 #define GEN10_3DSTATE_SBE_PrimitiveIDOverrideComponentZ_start  50
   70160 #define GEN9_3DSTATE_SBE_PrimitiveIDOverrideComponentZ_start  50
   70161 #define GEN8_3DSTATE_SBE_PrimitiveIDOverrideComponentZ_start  50
   70162 
   70163 static inline uint32_t ATTRIBUTE_PURE
   70164 _3DSTATE_SBE_PrimitiveIDOverrideComponentZ_start(const struct gen_device_info *devinfo)
   70165 {
   70166    switch (devinfo->gen) {
   70167    case 10: return 50;
   70168    case 9: return 50;
   70169    case 8: return 50;
   70170    case 7:
   70171       if (devinfo->is_haswell) {
   70172          return 0;
   70173       } else {
   70174          return 0;
   70175       }
   70176    case 6: return 0;
   70177    case 5: return 0;
   70178    case 4:
   70179       if (devinfo->is_g4x) {
   70180          return 0;
   70181       } else {
   70182          return 0;
   70183       }
   70184    default:
   70185       unreachable("Invalid hardware generation");
   70186    }
   70187 }
   70188 
   70189 
   70190 
   70191 /* 3DSTATE_SBE::Vertex URB Entry Read Length */
   70192 
   70193 
   70194 #define GEN10_3DSTATE_SBE_VertexURBEntryReadLength_bits  5
   70195 #define GEN9_3DSTATE_SBE_VertexURBEntryReadLength_bits  5
   70196 #define GEN8_3DSTATE_SBE_VertexURBEntryReadLength_bits  5
   70197 #define GEN75_3DSTATE_SBE_VertexURBEntryReadLength_bits  5
   70198 #define GEN7_3DSTATE_SBE_VertexURBEntryReadLength_bits  5
   70199 
   70200 static inline uint32_t ATTRIBUTE_PURE
   70201 _3DSTATE_SBE_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   70202 {
   70203    switch (devinfo->gen) {
   70204    case 10: return 5;
   70205    case 9: return 5;
   70206    case 8: return 5;
   70207    case 7:
   70208       if (devinfo->is_haswell) {
   70209          return 5;
   70210       } else {
   70211          return 5;
   70212       }
   70213    case 6: return 0;
   70214    case 5: return 0;
   70215    case 4:
   70216       if (devinfo->is_g4x) {
   70217          return 0;
   70218       } else {
   70219          return 0;
   70220       }
   70221    default:
   70222       unreachable("Invalid hardware generation");
   70223    }
   70224 }
   70225 
   70226 
   70227 
   70228 #define GEN10_3DSTATE_SBE_VertexURBEntryReadLength_start  43
   70229 #define GEN9_3DSTATE_SBE_VertexURBEntryReadLength_start  43
   70230 #define GEN8_3DSTATE_SBE_VertexURBEntryReadLength_start  43
   70231 #define GEN75_3DSTATE_SBE_VertexURBEntryReadLength_start  43
   70232 #define GEN7_3DSTATE_SBE_VertexURBEntryReadLength_start  43
   70233 
   70234 static inline uint32_t ATTRIBUTE_PURE
   70235 _3DSTATE_SBE_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   70236 {
   70237    switch (devinfo->gen) {
   70238    case 10: return 43;
   70239    case 9: return 43;
   70240    case 8: return 43;
   70241    case 7:
   70242       if (devinfo->is_haswell) {
   70243          return 43;
   70244       } else {
   70245          return 43;
   70246       }
   70247    case 6: return 0;
   70248    case 5: return 0;
   70249    case 4:
   70250       if (devinfo->is_g4x) {
   70251          return 0;
   70252       } else {
   70253          return 0;
   70254       }
   70255    default:
   70256       unreachable("Invalid hardware generation");
   70257    }
   70258 }
   70259 
   70260 
   70261 
   70262 /* 3DSTATE_SBE::Vertex URB Entry Read Offset */
   70263 
   70264 
   70265 #define GEN10_3DSTATE_SBE_VertexURBEntryReadOffset_bits  6
   70266 #define GEN9_3DSTATE_SBE_VertexURBEntryReadOffset_bits  6
   70267 #define GEN8_3DSTATE_SBE_VertexURBEntryReadOffset_bits  6
   70268 #define GEN75_3DSTATE_SBE_VertexURBEntryReadOffset_bits  6
   70269 #define GEN7_3DSTATE_SBE_VertexURBEntryReadOffset_bits  6
   70270 
   70271 static inline uint32_t ATTRIBUTE_PURE
   70272 _3DSTATE_SBE_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   70273 {
   70274    switch (devinfo->gen) {
   70275    case 10: return 6;
   70276    case 9: return 6;
   70277    case 8: return 6;
   70278    case 7:
   70279       if (devinfo->is_haswell) {
   70280          return 6;
   70281       } else {
   70282          return 6;
   70283       }
   70284    case 6: return 0;
   70285    case 5: return 0;
   70286    case 4:
   70287       if (devinfo->is_g4x) {
   70288          return 0;
   70289       } else {
   70290          return 0;
   70291       }
   70292    default:
   70293       unreachable("Invalid hardware generation");
   70294    }
   70295 }
   70296 
   70297 
   70298 
   70299 #define GEN10_3DSTATE_SBE_VertexURBEntryReadOffset_start  37
   70300 #define GEN9_3DSTATE_SBE_VertexURBEntryReadOffset_start  37
   70301 #define GEN8_3DSTATE_SBE_VertexURBEntryReadOffset_start  37
   70302 #define GEN75_3DSTATE_SBE_VertexURBEntryReadOffset_start  36
   70303 #define GEN7_3DSTATE_SBE_VertexURBEntryReadOffset_start  36
   70304 
   70305 static inline uint32_t ATTRIBUTE_PURE
   70306 _3DSTATE_SBE_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   70307 {
   70308    switch (devinfo->gen) {
   70309    case 10: return 37;
   70310    case 9: return 37;
   70311    case 8: return 37;
   70312    case 7:
   70313       if (devinfo->is_haswell) {
   70314          return 36;
   70315       } else {
   70316          return 36;
   70317       }
   70318    case 6: return 0;
   70319    case 5: return 0;
   70320    case 4:
   70321       if (devinfo->is_g4x) {
   70322          return 0;
   70323       } else {
   70324          return 0;
   70325       }
   70326    default:
   70327       unreachable("Invalid hardware generation");
   70328    }
   70329 }
   70330 
   70331 
   70332 
   70333 /* 3DSTATE_SBE_SWIZ */
   70334 
   70335 
   70336 #define GEN10_3DSTATE_SBE_SWIZ_length  11
   70337 #define GEN9_3DSTATE_SBE_SWIZ_length  11
   70338 #define GEN8_3DSTATE_SBE_SWIZ_length  11
   70339 
   70340 static inline uint32_t ATTRIBUTE_PURE
   70341 _3DSTATE_SBE_SWIZ_length(const struct gen_device_info *devinfo)
   70342 {
   70343    switch (devinfo->gen) {
   70344    case 10: return 11;
   70345    case 9: return 11;
   70346    case 8: return 11;
   70347    case 7:
   70348       if (devinfo->is_haswell) {
   70349          return 0;
   70350       } else {
   70351          return 0;
   70352       }
   70353    case 6: return 0;
   70354    case 5: return 0;
   70355    case 4:
   70356       if (devinfo->is_g4x) {
   70357          return 0;
   70358       } else {
   70359          return 0;
   70360       }
   70361    default:
   70362       unreachable("Invalid hardware generation");
   70363    }
   70364 }
   70365 
   70366 
   70367 
   70368 /* 3DSTATE_SBE_SWIZ::3D Command Opcode */
   70369 
   70370 
   70371 #define GEN10_3DSTATE_SBE_SWIZ_3DCommandOpcode_bits  3
   70372 #define GEN9_3DSTATE_SBE_SWIZ_3DCommandOpcode_bits  3
   70373 #define GEN8_3DSTATE_SBE_SWIZ_3DCommandOpcode_bits  3
   70374 
   70375 static inline uint32_t ATTRIBUTE_PURE
   70376 _3DSTATE_SBE_SWIZ_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   70377 {
   70378    switch (devinfo->gen) {
   70379    case 10: return 3;
   70380    case 9: return 3;
   70381    case 8: return 3;
   70382    case 7:
   70383       if (devinfo->is_haswell) {
   70384          return 0;
   70385       } else {
   70386          return 0;
   70387       }
   70388    case 6: return 0;
   70389    case 5: return 0;
   70390    case 4:
   70391       if (devinfo->is_g4x) {
   70392          return 0;
   70393       } else {
   70394          return 0;
   70395       }
   70396    default:
   70397       unreachable("Invalid hardware generation");
   70398    }
   70399 }
   70400 
   70401 
   70402 
   70403 #define GEN10_3DSTATE_SBE_SWIZ_3DCommandOpcode_start  24
   70404 #define GEN9_3DSTATE_SBE_SWIZ_3DCommandOpcode_start  24
   70405 #define GEN8_3DSTATE_SBE_SWIZ_3DCommandOpcode_start  24
   70406 
   70407 static inline uint32_t ATTRIBUTE_PURE
   70408 _3DSTATE_SBE_SWIZ_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   70409 {
   70410    switch (devinfo->gen) {
   70411    case 10: return 24;
   70412    case 9: return 24;
   70413    case 8: return 24;
   70414    case 7:
   70415       if (devinfo->is_haswell) {
   70416          return 0;
   70417       } else {
   70418          return 0;
   70419       }
   70420    case 6: return 0;
   70421    case 5: return 0;
   70422    case 4:
   70423       if (devinfo->is_g4x) {
   70424          return 0;
   70425       } else {
   70426          return 0;
   70427       }
   70428    default:
   70429       unreachable("Invalid hardware generation");
   70430    }
   70431 }
   70432 
   70433 
   70434 
   70435 /* 3DSTATE_SBE_SWIZ::3D Command Sub Opcode */
   70436 
   70437 
   70438 #define GEN10_3DSTATE_SBE_SWIZ_3DCommandSubOpcode_bits  8
   70439 #define GEN9_3DSTATE_SBE_SWIZ_3DCommandSubOpcode_bits  8
   70440 #define GEN8_3DSTATE_SBE_SWIZ_3DCommandSubOpcode_bits  8
   70441 
   70442 static inline uint32_t ATTRIBUTE_PURE
   70443 _3DSTATE_SBE_SWIZ_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   70444 {
   70445    switch (devinfo->gen) {
   70446    case 10: return 8;
   70447    case 9: return 8;
   70448    case 8: return 8;
   70449    case 7:
   70450       if (devinfo->is_haswell) {
   70451          return 0;
   70452       } else {
   70453          return 0;
   70454       }
   70455    case 6: return 0;
   70456    case 5: return 0;
   70457    case 4:
   70458       if (devinfo->is_g4x) {
   70459          return 0;
   70460       } else {
   70461          return 0;
   70462       }
   70463    default:
   70464       unreachable("Invalid hardware generation");
   70465    }
   70466 }
   70467 
   70468 
   70469 
   70470 #define GEN10_3DSTATE_SBE_SWIZ_3DCommandSubOpcode_start  16
   70471 #define GEN9_3DSTATE_SBE_SWIZ_3DCommandSubOpcode_start  16
   70472 #define GEN8_3DSTATE_SBE_SWIZ_3DCommandSubOpcode_start  16
   70473 
   70474 static inline uint32_t ATTRIBUTE_PURE
   70475 _3DSTATE_SBE_SWIZ_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   70476 {
   70477    switch (devinfo->gen) {
   70478    case 10: return 16;
   70479    case 9: return 16;
   70480    case 8: return 16;
   70481    case 7:
   70482       if (devinfo->is_haswell) {
   70483          return 0;
   70484       } else {
   70485          return 0;
   70486       }
   70487    case 6: return 0;
   70488    case 5: return 0;
   70489    case 4:
   70490       if (devinfo->is_g4x) {
   70491          return 0;
   70492       } else {
   70493          return 0;
   70494       }
   70495    default:
   70496       unreachable("Invalid hardware generation");
   70497    }
   70498 }
   70499 
   70500 
   70501 
   70502 /* 3DSTATE_SBE_SWIZ::Attribute */
   70503 
   70504 
   70505 #define GEN10_3DSTATE_SBE_SWIZ_Attribute_bits  16
   70506 #define GEN9_3DSTATE_SBE_SWIZ_Attribute_bits  16
   70507 #define GEN8_3DSTATE_SBE_SWIZ_Attribute_bits  16
   70508 
   70509 static inline uint32_t ATTRIBUTE_PURE
   70510 _3DSTATE_SBE_SWIZ_Attribute_bits(const struct gen_device_info *devinfo)
   70511 {
   70512    switch (devinfo->gen) {
   70513    case 10: return 16;
   70514    case 9: return 16;
   70515    case 8: return 16;
   70516    case 7:
   70517       if (devinfo->is_haswell) {
   70518          return 0;
   70519       } else {
   70520          return 0;
   70521       }
   70522    case 6: return 0;
   70523    case 5: return 0;
   70524    case 4:
   70525       if (devinfo->is_g4x) {
   70526          return 0;
   70527       } else {
   70528          return 0;
   70529       }
   70530    default:
   70531       unreachable("Invalid hardware generation");
   70532    }
   70533 }
   70534 
   70535 
   70536 
   70537 #define GEN10_3DSTATE_SBE_SWIZ_Attribute_start  0
   70538 #define GEN9_3DSTATE_SBE_SWIZ_Attribute_start  0
   70539 #define GEN8_3DSTATE_SBE_SWIZ_Attribute_start  0
   70540 
   70541 static inline uint32_t ATTRIBUTE_PURE
   70542 _3DSTATE_SBE_SWIZ_Attribute_start(const struct gen_device_info *devinfo)
   70543 {
   70544    switch (devinfo->gen) {
   70545    case 10: return 0;
   70546    case 9: return 0;
   70547    case 8: return 0;
   70548    case 7:
   70549       if (devinfo->is_haswell) {
   70550          return 0;
   70551       } else {
   70552          return 0;
   70553       }
   70554    case 6: return 0;
   70555    case 5: return 0;
   70556    case 4:
   70557       if (devinfo->is_g4x) {
   70558          return 0;
   70559       } else {
   70560          return 0;
   70561       }
   70562    default:
   70563       unreachable("Invalid hardware generation");
   70564    }
   70565 }
   70566 
   70567 
   70568 
   70569 /* 3DSTATE_SBE_SWIZ::Attribute Wrap Shortest Enables */
   70570 
   70571 
   70572 #define GEN10_3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_bits  4
   70573 #define GEN9_3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_bits  4
   70574 #define GEN8_3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_bits  4
   70575 
   70576 static inline uint32_t ATTRIBUTE_PURE
   70577 _3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_bits(const struct gen_device_info *devinfo)
   70578 {
   70579    switch (devinfo->gen) {
   70580    case 10: return 4;
   70581    case 9: return 4;
   70582    case 8: return 4;
   70583    case 7:
   70584       if (devinfo->is_haswell) {
   70585          return 0;
   70586       } else {
   70587          return 0;
   70588       }
   70589    case 6: return 0;
   70590    case 5: return 0;
   70591    case 4:
   70592       if (devinfo->is_g4x) {
   70593          return 0;
   70594       } else {
   70595          return 0;
   70596       }
   70597    default:
   70598       unreachable("Invalid hardware generation");
   70599    }
   70600 }
   70601 
   70602 
   70603 
   70604 #define GEN10_3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_start  0
   70605 #define GEN9_3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_start  0
   70606 #define GEN8_3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_start  0
   70607 
   70608 static inline uint32_t ATTRIBUTE_PURE
   70609 _3DSTATE_SBE_SWIZ_AttributeWrapShortestEnables_start(const struct gen_device_info *devinfo)
   70610 {
   70611    switch (devinfo->gen) {
   70612    case 10: return 0;
   70613    case 9: return 0;
   70614    case 8: return 0;
   70615    case 7:
   70616       if (devinfo->is_haswell) {
   70617          return 0;
   70618       } else {
   70619          return 0;
   70620       }
   70621    case 6: return 0;
   70622    case 5: return 0;
   70623    case 4:
   70624       if (devinfo->is_g4x) {
   70625          return 0;
   70626       } else {
   70627          return 0;
   70628       }
   70629    default:
   70630       unreachable("Invalid hardware generation");
   70631    }
   70632 }
   70633 
   70634 
   70635 
   70636 /* 3DSTATE_SBE_SWIZ::Command SubType */
   70637 
   70638 
   70639 #define GEN10_3DSTATE_SBE_SWIZ_CommandSubType_bits  2
   70640 #define GEN9_3DSTATE_SBE_SWIZ_CommandSubType_bits  2
   70641 #define GEN8_3DSTATE_SBE_SWIZ_CommandSubType_bits  2
   70642 
   70643 static inline uint32_t ATTRIBUTE_PURE
   70644 _3DSTATE_SBE_SWIZ_CommandSubType_bits(const struct gen_device_info *devinfo)
   70645 {
   70646    switch (devinfo->gen) {
   70647    case 10: return 2;
   70648    case 9: return 2;
   70649    case 8: return 2;
   70650    case 7:
   70651       if (devinfo->is_haswell) {
   70652          return 0;
   70653       } else {
   70654          return 0;
   70655       }
   70656    case 6: return 0;
   70657    case 5: return 0;
   70658    case 4:
   70659       if (devinfo->is_g4x) {
   70660          return 0;
   70661       } else {
   70662          return 0;
   70663       }
   70664    default:
   70665       unreachable("Invalid hardware generation");
   70666    }
   70667 }
   70668 
   70669 
   70670 
   70671 #define GEN10_3DSTATE_SBE_SWIZ_CommandSubType_start  27
   70672 #define GEN9_3DSTATE_SBE_SWIZ_CommandSubType_start  27
   70673 #define GEN8_3DSTATE_SBE_SWIZ_CommandSubType_start  27
   70674 
   70675 static inline uint32_t ATTRIBUTE_PURE
   70676 _3DSTATE_SBE_SWIZ_CommandSubType_start(const struct gen_device_info *devinfo)
   70677 {
   70678    switch (devinfo->gen) {
   70679    case 10: return 27;
   70680    case 9: return 27;
   70681    case 8: return 27;
   70682    case 7:
   70683       if (devinfo->is_haswell) {
   70684          return 0;
   70685       } else {
   70686          return 0;
   70687       }
   70688    case 6: return 0;
   70689    case 5: return 0;
   70690    case 4:
   70691       if (devinfo->is_g4x) {
   70692          return 0;
   70693       } else {
   70694          return 0;
   70695       }
   70696    default:
   70697       unreachable("Invalid hardware generation");
   70698    }
   70699 }
   70700 
   70701 
   70702 
   70703 /* 3DSTATE_SBE_SWIZ::Command Type */
   70704 
   70705 
   70706 #define GEN10_3DSTATE_SBE_SWIZ_CommandType_bits  3
   70707 #define GEN9_3DSTATE_SBE_SWIZ_CommandType_bits  3
   70708 #define GEN8_3DSTATE_SBE_SWIZ_CommandType_bits  3
   70709 
   70710 static inline uint32_t ATTRIBUTE_PURE
   70711 _3DSTATE_SBE_SWIZ_CommandType_bits(const struct gen_device_info *devinfo)
   70712 {
   70713    switch (devinfo->gen) {
   70714    case 10: return 3;
   70715    case 9: return 3;
   70716    case 8: return 3;
   70717    case 7:
   70718       if (devinfo->is_haswell) {
   70719          return 0;
   70720       } else {
   70721          return 0;
   70722       }
   70723    case 6: return 0;
   70724    case 5: return 0;
   70725    case 4:
   70726       if (devinfo->is_g4x) {
   70727          return 0;
   70728       } else {
   70729          return 0;
   70730       }
   70731    default:
   70732       unreachable("Invalid hardware generation");
   70733    }
   70734 }
   70735 
   70736 
   70737 
   70738 #define GEN10_3DSTATE_SBE_SWIZ_CommandType_start  29
   70739 #define GEN9_3DSTATE_SBE_SWIZ_CommandType_start  29
   70740 #define GEN8_3DSTATE_SBE_SWIZ_CommandType_start  29
   70741 
   70742 static inline uint32_t ATTRIBUTE_PURE
   70743 _3DSTATE_SBE_SWIZ_CommandType_start(const struct gen_device_info *devinfo)
   70744 {
   70745    switch (devinfo->gen) {
   70746    case 10: return 29;
   70747    case 9: return 29;
   70748    case 8: return 29;
   70749    case 7:
   70750       if (devinfo->is_haswell) {
   70751          return 0;
   70752       } else {
   70753          return 0;
   70754       }
   70755    case 6: return 0;
   70756    case 5: return 0;
   70757    case 4:
   70758       if (devinfo->is_g4x) {
   70759          return 0;
   70760       } else {
   70761          return 0;
   70762       }
   70763    default:
   70764       unreachable("Invalid hardware generation");
   70765    }
   70766 }
   70767 
   70768 
   70769 
   70770 /* 3DSTATE_SBE_SWIZ::DWord Length */
   70771 
   70772 
   70773 #define GEN10_3DSTATE_SBE_SWIZ_DWordLength_bits  8
   70774 #define GEN9_3DSTATE_SBE_SWIZ_DWordLength_bits  8
   70775 #define GEN8_3DSTATE_SBE_SWIZ_DWordLength_bits  8
   70776 
   70777 static inline uint32_t ATTRIBUTE_PURE
   70778 _3DSTATE_SBE_SWIZ_DWordLength_bits(const struct gen_device_info *devinfo)
   70779 {
   70780    switch (devinfo->gen) {
   70781    case 10: return 8;
   70782    case 9: return 8;
   70783    case 8: return 8;
   70784    case 7:
   70785       if (devinfo->is_haswell) {
   70786          return 0;
   70787       } else {
   70788          return 0;
   70789       }
   70790    case 6: return 0;
   70791    case 5: return 0;
   70792    case 4:
   70793       if (devinfo->is_g4x) {
   70794          return 0;
   70795       } else {
   70796          return 0;
   70797       }
   70798    default:
   70799       unreachable("Invalid hardware generation");
   70800    }
   70801 }
   70802 
   70803 
   70804 
   70805 #define GEN10_3DSTATE_SBE_SWIZ_DWordLength_start  0
   70806 #define GEN9_3DSTATE_SBE_SWIZ_DWordLength_start  0
   70807 #define GEN8_3DSTATE_SBE_SWIZ_DWordLength_start  0
   70808 
   70809 static inline uint32_t ATTRIBUTE_PURE
   70810 _3DSTATE_SBE_SWIZ_DWordLength_start(const struct gen_device_info *devinfo)
   70811 {
   70812    switch (devinfo->gen) {
   70813    case 10: return 0;
   70814    case 9: return 0;
   70815    case 8: return 0;
   70816    case 7:
   70817       if (devinfo->is_haswell) {
   70818          return 0;
   70819       } else {
   70820          return 0;
   70821       }
   70822    case 6: return 0;
   70823    case 5: return 0;
   70824    case 4:
   70825       if (devinfo->is_g4x) {
   70826          return 0;
   70827       } else {
   70828          return 0;
   70829       }
   70830    default:
   70831       unreachable("Invalid hardware generation");
   70832    }
   70833 }
   70834 
   70835 
   70836 
   70837 /* 3DSTATE_SCISSOR_STATE_POINTERS */
   70838 
   70839 
   70840 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_length  2
   70841 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_length  2
   70842 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_length  2
   70843 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_length  2
   70844 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_length  2
   70845 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_length  2
   70846 
   70847 static inline uint32_t ATTRIBUTE_PURE
   70848 _3DSTATE_SCISSOR_STATE_POINTERS_length(const struct gen_device_info *devinfo)
   70849 {
   70850    switch (devinfo->gen) {
   70851    case 10: return 2;
   70852    case 9: return 2;
   70853    case 8: return 2;
   70854    case 7:
   70855       if (devinfo->is_haswell) {
   70856          return 2;
   70857       } else {
   70858          return 2;
   70859       }
   70860    case 6: return 2;
   70861    case 5: return 0;
   70862    case 4:
   70863       if (devinfo->is_g4x) {
   70864          return 0;
   70865       } else {
   70866          return 0;
   70867       }
   70868    default:
   70869       unreachable("Invalid hardware generation");
   70870    }
   70871 }
   70872 
   70873 
   70874 
   70875 /* 3DSTATE_SCISSOR_STATE_POINTERS::3D Command Opcode */
   70876 
   70877 
   70878 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_bits  3
   70879 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_bits  3
   70880 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_bits  3
   70881 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_bits  3
   70882 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_bits  3
   70883 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_bits  3
   70884 
   70885 static inline uint32_t ATTRIBUTE_PURE
   70886 _3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   70887 {
   70888    switch (devinfo->gen) {
   70889    case 10: return 3;
   70890    case 9: return 3;
   70891    case 8: return 3;
   70892    case 7:
   70893       if (devinfo->is_haswell) {
   70894          return 3;
   70895       } else {
   70896          return 3;
   70897       }
   70898    case 6: return 3;
   70899    case 5: return 0;
   70900    case 4:
   70901       if (devinfo->is_g4x) {
   70902          return 0;
   70903       } else {
   70904          return 0;
   70905       }
   70906    default:
   70907       unreachable("Invalid hardware generation");
   70908    }
   70909 }
   70910 
   70911 
   70912 
   70913 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_start  24
   70914 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_start  24
   70915 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_start  24
   70916 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_start  24
   70917 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_start  24
   70918 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_start  24
   70919 
   70920 static inline uint32_t ATTRIBUTE_PURE
   70921 _3DSTATE_SCISSOR_STATE_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   70922 {
   70923    switch (devinfo->gen) {
   70924    case 10: return 24;
   70925    case 9: return 24;
   70926    case 8: return 24;
   70927    case 7:
   70928       if (devinfo->is_haswell) {
   70929          return 24;
   70930       } else {
   70931          return 24;
   70932       }
   70933    case 6: return 24;
   70934    case 5: return 0;
   70935    case 4:
   70936       if (devinfo->is_g4x) {
   70937          return 0;
   70938       } else {
   70939          return 0;
   70940       }
   70941    default:
   70942       unreachable("Invalid hardware generation");
   70943    }
   70944 }
   70945 
   70946 
   70947 
   70948 /* 3DSTATE_SCISSOR_STATE_POINTERS::3D Command Sub Opcode */
   70949 
   70950 
   70951 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_bits  8
   70952 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_bits  8
   70953 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_bits  8
   70954 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_bits  8
   70955 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_bits  8
   70956 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_bits  8
   70957 
   70958 static inline uint32_t ATTRIBUTE_PURE
   70959 _3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   70960 {
   70961    switch (devinfo->gen) {
   70962    case 10: return 8;
   70963    case 9: return 8;
   70964    case 8: return 8;
   70965    case 7:
   70966       if (devinfo->is_haswell) {
   70967          return 8;
   70968       } else {
   70969          return 8;
   70970       }
   70971    case 6: return 8;
   70972    case 5: return 0;
   70973    case 4:
   70974       if (devinfo->is_g4x) {
   70975          return 0;
   70976       } else {
   70977          return 0;
   70978       }
   70979    default:
   70980       unreachable("Invalid hardware generation");
   70981    }
   70982 }
   70983 
   70984 
   70985 
   70986 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_start  16
   70987 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_start  16
   70988 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_start  16
   70989 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_start  16
   70990 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_start  16
   70991 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_start  16
   70992 
   70993 static inline uint32_t ATTRIBUTE_PURE
   70994 _3DSTATE_SCISSOR_STATE_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   70995 {
   70996    switch (devinfo->gen) {
   70997    case 10: return 16;
   70998    case 9: return 16;
   70999    case 8: return 16;
   71000    case 7:
   71001       if (devinfo->is_haswell) {
   71002          return 16;
   71003       } else {
   71004          return 16;
   71005       }
   71006    case 6: return 16;
   71007    case 5: return 0;
   71008    case 4:
   71009       if (devinfo->is_g4x) {
   71010          return 0;
   71011       } else {
   71012          return 0;
   71013       }
   71014    default:
   71015       unreachable("Invalid hardware generation");
   71016    }
   71017 }
   71018 
   71019 
   71020 
   71021 /* 3DSTATE_SCISSOR_STATE_POINTERS::Command SubType */
   71022 
   71023 
   71024 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_bits  2
   71025 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_bits  2
   71026 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_bits  2
   71027 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_bits  2
   71028 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_bits  2
   71029 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_bits  2
   71030 
   71031 static inline uint32_t ATTRIBUTE_PURE
   71032 _3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   71033 {
   71034    switch (devinfo->gen) {
   71035    case 10: return 2;
   71036    case 9: return 2;
   71037    case 8: return 2;
   71038    case 7:
   71039       if (devinfo->is_haswell) {
   71040          return 2;
   71041       } else {
   71042          return 2;
   71043       }
   71044    case 6: return 2;
   71045    case 5: return 0;
   71046    case 4:
   71047       if (devinfo->is_g4x) {
   71048          return 0;
   71049       } else {
   71050          return 0;
   71051       }
   71052    default:
   71053       unreachable("Invalid hardware generation");
   71054    }
   71055 }
   71056 
   71057 
   71058 
   71059 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_start  27
   71060 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_start  27
   71061 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_start  27
   71062 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_start  27
   71063 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_start  27
   71064 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_start  27
   71065 
   71066 static inline uint32_t ATTRIBUTE_PURE
   71067 _3DSTATE_SCISSOR_STATE_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   71068 {
   71069    switch (devinfo->gen) {
   71070    case 10: return 27;
   71071    case 9: return 27;
   71072    case 8: return 27;
   71073    case 7:
   71074       if (devinfo->is_haswell) {
   71075          return 27;
   71076       } else {
   71077          return 27;
   71078       }
   71079    case 6: return 27;
   71080    case 5: return 0;
   71081    case 4:
   71082       if (devinfo->is_g4x) {
   71083          return 0;
   71084       } else {
   71085          return 0;
   71086       }
   71087    default:
   71088       unreachable("Invalid hardware generation");
   71089    }
   71090 }
   71091 
   71092 
   71093 
   71094 /* 3DSTATE_SCISSOR_STATE_POINTERS::Command Type */
   71095 
   71096 
   71097 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_bits  3
   71098 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_bits  3
   71099 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_bits  3
   71100 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_bits  3
   71101 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_bits  3
   71102 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_bits  3
   71103 
   71104 static inline uint32_t ATTRIBUTE_PURE
   71105 _3DSTATE_SCISSOR_STATE_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   71106 {
   71107    switch (devinfo->gen) {
   71108    case 10: return 3;
   71109    case 9: return 3;
   71110    case 8: return 3;
   71111    case 7:
   71112       if (devinfo->is_haswell) {
   71113          return 3;
   71114       } else {
   71115          return 3;
   71116       }
   71117    case 6: return 3;
   71118    case 5: return 0;
   71119    case 4:
   71120       if (devinfo->is_g4x) {
   71121          return 0;
   71122       } else {
   71123          return 0;
   71124       }
   71125    default:
   71126       unreachable("Invalid hardware generation");
   71127    }
   71128 }
   71129 
   71130 
   71131 
   71132 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_start  29
   71133 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_start  29
   71134 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_start  29
   71135 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_start  29
   71136 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_start  29
   71137 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_CommandType_start  29
   71138 
   71139 static inline uint32_t ATTRIBUTE_PURE
   71140 _3DSTATE_SCISSOR_STATE_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   71141 {
   71142    switch (devinfo->gen) {
   71143    case 10: return 29;
   71144    case 9: return 29;
   71145    case 8: return 29;
   71146    case 7:
   71147       if (devinfo->is_haswell) {
   71148          return 29;
   71149       } else {
   71150          return 29;
   71151       }
   71152    case 6: return 29;
   71153    case 5: return 0;
   71154    case 4:
   71155       if (devinfo->is_g4x) {
   71156          return 0;
   71157       } else {
   71158          return 0;
   71159       }
   71160    default:
   71161       unreachable("Invalid hardware generation");
   71162    }
   71163 }
   71164 
   71165 
   71166 
   71167 /* 3DSTATE_SCISSOR_STATE_POINTERS::DWord Length */
   71168 
   71169 
   71170 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_bits  8
   71171 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_bits  8
   71172 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_bits  8
   71173 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_bits  8
   71174 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_bits  8
   71175 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_bits  8
   71176 
   71177 static inline uint32_t ATTRIBUTE_PURE
   71178 _3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   71179 {
   71180    switch (devinfo->gen) {
   71181    case 10: return 8;
   71182    case 9: return 8;
   71183    case 8: return 8;
   71184    case 7:
   71185       if (devinfo->is_haswell) {
   71186          return 8;
   71187       } else {
   71188          return 8;
   71189       }
   71190    case 6: return 8;
   71191    case 5: return 0;
   71192    case 4:
   71193       if (devinfo->is_g4x) {
   71194          return 0;
   71195       } else {
   71196          return 0;
   71197       }
   71198    default:
   71199       unreachable("Invalid hardware generation");
   71200    }
   71201 }
   71202 
   71203 
   71204 
   71205 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_start  0
   71206 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_start  0
   71207 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_start  0
   71208 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_start  0
   71209 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_start  0
   71210 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_start  0
   71211 
   71212 static inline uint32_t ATTRIBUTE_PURE
   71213 _3DSTATE_SCISSOR_STATE_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   71214 {
   71215    switch (devinfo->gen) {
   71216    case 10: return 0;
   71217    case 9: return 0;
   71218    case 8: return 0;
   71219    case 7:
   71220       if (devinfo->is_haswell) {
   71221          return 0;
   71222       } else {
   71223          return 0;
   71224       }
   71225    case 6: return 0;
   71226    case 5: return 0;
   71227    case 4:
   71228       if (devinfo->is_g4x) {
   71229          return 0;
   71230       } else {
   71231          return 0;
   71232       }
   71233    default:
   71234       unreachable("Invalid hardware generation");
   71235    }
   71236 }
   71237 
   71238 
   71239 
   71240 /* 3DSTATE_SCISSOR_STATE_POINTERS::Scissor Rect Pointer */
   71241 
   71242 
   71243 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_bits  27
   71244 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_bits  27
   71245 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_bits  27
   71246 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_bits  27
   71247 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_bits  27
   71248 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_bits  27
   71249 
   71250 static inline uint32_t ATTRIBUTE_PURE
   71251 _3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_bits(const struct gen_device_info *devinfo)
   71252 {
   71253    switch (devinfo->gen) {
   71254    case 10: return 27;
   71255    case 9: return 27;
   71256    case 8: return 27;
   71257    case 7:
   71258       if (devinfo->is_haswell) {
   71259          return 27;
   71260       } else {
   71261          return 27;
   71262       }
   71263    case 6: return 27;
   71264    case 5: return 0;
   71265    case 4:
   71266       if (devinfo->is_g4x) {
   71267          return 0;
   71268       } else {
   71269          return 0;
   71270       }
   71271    default:
   71272       unreachable("Invalid hardware generation");
   71273    }
   71274 }
   71275 
   71276 
   71277 
   71278 #define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_start  37
   71279 #define GEN9_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_start  37
   71280 #define GEN8_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_start  37
   71281 #define GEN75_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_start  37
   71282 #define GEN7_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_start  37
   71283 #define GEN6_3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_start  37
   71284 
   71285 static inline uint32_t ATTRIBUTE_PURE
   71286 _3DSTATE_SCISSOR_STATE_POINTERS_ScissorRectPointer_start(const struct gen_device_info *devinfo)
   71287 {
   71288    switch (devinfo->gen) {
   71289    case 10: return 37;
   71290    case 9: return 37;
   71291    case 8: return 37;
   71292    case 7:
   71293       if (devinfo->is_haswell) {
   71294          return 37;
   71295       } else {
   71296          return 37;
   71297       }
   71298    case 6: return 37;
   71299    case 5: return 0;
   71300    case 4:
   71301       if (devinfo->is_g4x) {
   71302          return 0;
   71303       } else {
   71304          return 0;
   71305       }
   71306    default:
   71307       unreachable("Invalid hardware generation");
   71308    }
   71309 }
   71310 
   71311 
   71312 
   71313 /* 3DSTATE_SF */
   71314 
   71315 
   71316 #define GEN10_3DSTATE_SF_length  4
   71317 #define GEN9_3DSTATE_SF_length  4
   71318 #define GEN8_3DSTATE_SF_length  4
   71319 #define GEN75_3DSTATE_SF_length  7
   71320 #define GEN7_3DSTATE_SF_length  7
   71321 #define GEN6_3DSTATE_SF_length  20
   71322 
   71323 static inline uint32_t ATTRIBUTE_PURE
   71324 _3DSTATE_SF_length(const struct gen_device_info *devinfo)
   71325 {
   71326    switch (devinfo->gen) {
   71327    case 10: return 4;
   71328    case 9: return 4;
   71329    case 8: return 4;
   71330    case 7:
   71331       if (devinfo->is_haswell) {
   71332          return 7;
   71333       } else {
   71334          return 7;
   71335       }
   71336    case 6: return 20;
   71337    case 5: return 0;
   71338    case 4:
   71339       if (devinfo->is_g4x) {
   71340          return 0;
   71341       } else {
   71342          return 0;
   71343       }
   71344    default:
   71345       unreachable("Invalid hardware generation");
   71346    }
   71347 }
   71348 
   71349 
   71350 
   71351 /* 3DSTATE_SF::3D Command Opcode */
   71352 
   71353 
   71354 #define GEN10_3DSTATE_SF_3DCommandOpcode_bits  3
   71355 #define GEN9_3DSTATE_SF_3DCommandOpcode_bits  3
   71356 #define GEN8_3DSTATE_SF_3DCommandOpcode_bits  3
   71357 #define GEN75_3DSTATE_SF_3DCommandOpcode_bits  3
   71358 #define GEN7_3DSTATE_SF_3DCommandOpcode_bits  3
   71359 #define GEN6_3DSTATE_SF_3DCommandOpcode_bits  3
   71360 
   71361 static inline uint32_t ATTRIBUTE_PURE
   71362 _3DSTATE_SF_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   71363 {
   71364    switch (devinfo->gen) {
   71365    case 10: return 3;
   71366    case 9: return 3;
   71367    case 8: return 3;
   71368    case 7:
   71369       if (devinfo->is_haswell) {
   71370          return 3;
   71371       } else {
   71372          return 3;
   71373       }
   71374    case 6: return 3;
   71375    case 5: return 0;
   71376    case 4:
   71377       if (devinfo->is_g4x) {
   71378          return 0;
   71379       } else {
   71380          return 0;
   71381       }
   71382    default:
   71383       unreachable("Invalid hardware generation");
   71384    }
   71385 }
   71386 
   71387 
   71388 
   71389 #define GEN10_3DSTATE_SF_3DCommandOpcode_start  24
   71390 #define GEN9_3DSTATE_SF_3DCommandOpcode_start  24
   71391 #define GEN8_3DSTATE_SF_3DCommandOpcode_start  24
   71392 #define GEN75_3DSTATE_SF_3DCommandOpcode_start  24
   71393 #define GEN7_3DSTATE_SF_3DCommandOpcode_start  24
   71394 #define GEN6_3DSTATE_SF_3DCommandOpcode_start  24
   71395 
   71396 static inline uint32_t ATTRIBUTE_PURE
   71397 _3DSTATE_SF_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   71398 {
   71399    switch (devinfo->gen) {
   71400    case 10: return 24;
   71401    case 9: return 24;
   71402    case 8: return 24;
   71403    case 7:
   71404       if (devinfo->is_haswell) {
   71405          return 24;
   71406       } else {
   71407          return 24;
   71408       }
   71409    case 6: return 24;
   71410    case 5: return 0;
   71411    case 4:
   71412       if (devinfo->is_g4x) {
   71413          return 0;
   71414       } else {
   71415          return 0;
   71416       }
   71417    default:
   71418       unreachable("Invalid hardware generation");
   71419    }
   71420 }
   71421 
   71422 
   71423 
   71424 /* 3DSTATE_SF::3D Command Sub Opcode */
   71425 
   71426 
   71427 #define GEN10_3DSTATE_SF_3DCommandSubOpcode_bits  8
   71428 #define GEN9_3DSTATE_SF_3DCommandSubOpcode_bits  8
   71429 #define GEN8_3DSTATE_SF_3DCommandSubOpcode_bits  8
   71430 #define GEN75_3DSTATE_SF_3DCommandSubOpcode_bits  8
   71431 #define GEN7_3DSTATE_SF_3DCommandSubOpcode_bits  8
   71432 #define GEN6_3DSTATE_SF_3DCommandSubOpcode_bits  8
   71433 
   71434 static inline uint32_t ATTRIBUTE_PURE
   71435 _3DSTATE_SF_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   71436 {
   71437    switch (devinfo->gen) {
   71438    case 10: return 8;
   71439    case 9: return 8;
   71440    case 8: return 8;
   71441    case 7:
   71442       if (devinfo->is_haswell) {
   71443          return 8;
   71444       } else {
   71445          return 8;
   71446       }
   71447    case 6: return 8;
   71448    case 5: return 0;
   71449    case 4:
   71450       if (devinfo->is_g4x) {
   71451          return 0;
   71452       } else {
   71453          return 0;
   71454       }
   71455    default:
   71456       unreachable("Invalid hardware generation");
   71457    }
   71458 }
   71459 
   71460 
   71461 
   71462 #define GEN10_3DSTATE_SF_3DCommandSubOpcode_start  16
   71463 #define GEN9_3DSTATE_SF_3DCommandSubOpcode_start  16
   71464 #define GEN8_3DSTATE_SF_3DCommandSubOpcode_start  16
   71465 #define GEN75_3DSTATE_SF_3DCommandSubOpcode_start  16
   71466 #define GEN7_3DSTATE_SF_3DCommandSubOpcode_start  16
   71467 #define GEN6_3DSTATE_SF_3DCommandSubOpcode_start  16
   71468 
   71469 static inline uint32_t ATTRIBUTE_PURE
   71470 _3DSTATE_SF_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   71471 {
   71472    switch (devinfo->gen) {
   71473    case 10: return 16;
   71474    case 9: return 16;
   71475    case 8: return 16;
   71476    case 7:
   71477       if (devinfo->is_haswell) {
   71478          return 16;
   71479       } else {
   71480          return 16;
   71481       }
   71482    case 6: return 16;
   71483    case 5: return 0;
   71484    case 4:
   71485       if (devinfo->is_g4x) {
   71486          return 0;
   71487       } else {
   71488          return 0;
   71489       }
   71490    default:
   71491       unreachable("Invalid hardware generation");
   71492    }
   71493 }
   71494 
   71495 
   71496 
   71497 /* 3DSTATE_SF::AA Line Distance Mode */
   71498 
   71499 
   71500 #define GEN10_3DSTATE_SF_AALineDistanceMode_bits  1
   71501 #define GEN9_3DSTATE_SF_AALineDistanceMode_bits  1
   71502 #define GEN8_3DSTATE_SF_AALineDistanceMode_bits  1
   71503 #define GEN75_3DSTATE_SF_AALineDistanceMode_bits  1
   71504 #define GEN7_3DSTATE_SF_AALineDistanceMode_bits  1
   71505 #define GEN6_3DSTATE_SF_AALineDistanceMode_bits  1
   71506 
   71507 static inline uint32_t ATTRIBUTE_PURE
   71508 _3DSTATE_SF_AALineDistanceMode_bits(const struct gen_device_info *devinfo)
   71509 {
   71510    switch (devinfo->gen) {
   71511    case 10: return 1;
   71512    case 9: return 1;
   71513    case 8: return 1;
   71514    case 7:
   71515       if (devinfo->is_haswell) {
   71516          return 1;
   71517       } else {
   71518          return 1;
   71519       }
   71520    case 6: return 1;
   71521    case 5: return 0;
   71522    case 4:
   71523       if (devinfo->is_g4x) {
   71524          return 0;
   71525       } else {
   71526          return 0;
   71527       }
   71528    default:
   71529       unreachable("Invalid hardware generation");
   71530    }
   71531 }
   71532 
   71533 
   71534 
   71535 #define GEN10_3DSTATE_SF_AALineDistanceMode_start  110
   71536 #define GEN9_3DSTATE_SF_AALineDistanceMode_start  110
   71537 #define GEN8_3DSTATE_SF_AALineDistanceMode_start  110
   71538 #define GEN75_3DSTATE_SF_AALineDistanceMode_start  110
   71539 #define GEN7_3DSTATE_SF_AALineDistanceMode_start  110
   71540 #define GEN6_3DSTATE_SF_AALineDistanceMode_start  142
   71541 
   71542 static inline uint32_t ATTRIBUTE_PURE
   71543 _3DSTATE_SF_AALineDistanceMode_start(const struct gen_device_info *devinfo)
   71544 {
   71545    switch (devinfo->gen) {
   71546    case 10: return 110;
   71547    case 9: return 110;
   71548    case 8: return 110;
   71549    case 7:
   71550       if (devinfo->is_haswell) {
   71551          return 110;
   71552       } else {
   71553          return 110;
   71554       }
   71555    case 6: return 142;
   71556    case 5: return 0;
   71557    case 4:
   71558       if (devinfo->is_g4x) {
   71559          return 0;
   71560       } else {
   71561          return 0;
   71562       }
   71563    default:
   71564       unreachable("Invalid hardware generation");
   71565    }
   71566 }
   71567 
   71568 
   71569 
   71570 /* 3DSTATE_SF::Anti-Aliasing Enable */
   71571 
   71572 
   71573 #define GEN75_3DSTATE_SF_AntiAliasingEnable_bits  1
   71574 #define GEN7_3DSTATE_SF_AntiAliasingEnable_bits  1
   71575 #define GEN6_3DSTATE_SF_AntiAliasingEnable_bits  1
   71576 
   71577 static inline uint32_t ATTRIBUTE_PURE
   71578 _3DSTATE_SF_AntiAliasingEnable_bits(const struct gen_device_info *devinfo)
   71579 {
   71580    switch (devinfo->gen) {
   71581    case 10: return 0;
   71582    case 9: return 0;
   71583    case 8: return 0;
   71584    case 7:
   71585       if (devinfo->is_haswell) {
   71586          return 1;
   71587       } else {
   71588          return 1;
   71589       }
   71590    case 6: return 1;
   71591    case 5: return 0;
   71592    case 4:
   71593       if (devinfo->is_g4x) {
   71594          return 0;
   71595       } else {
   71596          return 0;
   71597       }
   71598    default:
   71599       unreachable("Invalid hardware generation");
   71600    }
   71601 }
   71602 
   71603 
   71604 
   71605 #define GEN75_3DSTATE_SF_AntiAliasingEnable_start  95
   71606 #define GEN7_3DSTATE_SF_AntiAliasingEnable_start  95
   71607 #define GEN6_3DSTATE_SF_AntiAliasingEnable_start  127
   71608 
   71609 static inline uint32_t ATTRIBUTE_PURE
   71610 _3DSTATE_SF_AntiAliasingEnable_start(const struct gen_device_info *devinfo)
   71611 {
   71612    switch (devinfo->gen) {
   71613    case 10: return 0;
   71614    case 9: return 0;
   71615    case 8: return 0;
   71616    case 7:
   71617       if (devinfo->is_haswell) {
   71618          return 95;
   71619       } else {
   71620          return 95;
   71621       }
   71622    case 6: return 127;
   71623    case 5: return 0;
   71624    case 4:
   71625       if (devinfo->is_g4x) {
   71626          return 0;
   71627       } else {
   71628          return 0;
   71629       }
   71630    default:
   71631       unreachable("Invalid hardware generation");
   71632    }
   71633 }
   71634 
   71635 
   71636 
   71637 /* 3DSTATE_SF::Attribute */
   71638 
   71639 
   71640 #define GEN6_3DSTATE_SF_Attribute_bits  16
   71641 
   71642 static inline uint32_t ATTRIBUTE_PURE
   71643 _3DSTATE_SF_Attribute_bits(const struct gen_device_info *devinfo)
   71644 {
   71645    switch (devinfo->gen) {
   71646    case 10: return 0;
   71647    case 9: return 0;
   71648    case 8: return 0;
   71649    case 7:
   71650       if (devinfo->is_haswell) {
   71651          return 0;
   71652       } else {
   71653          return 0;
   71654       }
   71655    case 6: return 16;
   71656    case 5: return 0;
   71657    case 4:
   71658       if (devinfo->is_g4x) {
   71659          return 0;
   71660       } else {
   71661          return 0;
   71662       }
   71663    default:
   71664       unreachable("Invalid hardware generation");
   71665    }
   71666 }
   71667 
   71668 
   71669 
   71670 #define GEN6_3DSTATE_SF_Attribute_start  0
   71671 
   71672 static inline uint32_t ATTRIBUTE_PURE
   71673 _3DSTATE_SF_Attribute_start(const struct gen_device_info *devinfo)
   71674 {
   71675    switch (devinfo->gen) {
   71676    case 10: return 0;
   71677    case 9: return 0;
   71678    case 8: return 0;
   71679    case 7:
   71680       if (devinfo->is_haswell) {
   71681          return 0;
   71682       } else {
   71683          return 0;
   71684       }
   71685    case 6: return 0;
   71686    case 5: return 0;
   71687    case 4:
   71688       if (devinfo->is_g4x) {
   71689          return 0;
   71690       } else {
   71691          return 0;
   71692       }
   71693    default:
   71694       unreachable("Invalid hardware generation");
   71695    }
   71696 }
   71697 
   71698 
   71699 
   71700 /* 3DSTATE_SF::Attribute 0 WrapShortest Enables */
   71701 
   71702 
   71703 #define GEN6_3DSTATE_SF_Attribute0WrapShortestEnables_bits  4
   71704 
   71705 static inline uint32_t ATTRIBUTE_PURE
   71706 _3DSTATE_SF_Attribute0WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   71707 {
   71708    switch (devinfo->gen) {
   71709    case 10: return 0;
   71710    case 9: return 0;
   71711    case 8: return 0;
   71712    case 7:
   71713       if (devinfo->is_haswell) {
   71714          return 0;
   71715       } else {
   71716          return 0;
   71717       }
   71718    case 6: return 4;
   71719    case 5: return 0;
   71720    case 4:
   71721       if (devinfo->is_g4x) {
   71722          return 0;
   71723       } else {
   71724          return 0;
   71725       }
   71726    default:
   71727       unreachable("Invalid hardware generation");
   71728    }
   71729 }
   71730 
   71731 
   71732 
   71733 #define GEN6_3DSTATE_SF_Attribute0WrapShortestEnables_start  576
   71734 
   71735 static inline uint32_t ATTRIBUTE_PURE
   71736 _3DSTATE_SF_Attribute0WrapShortestEnables_start(const struct gen_device_info *devinfo)
   71737 {
   71738    switch (devinfo->gen) {
   71739    case 10: return 0;
   71740    case 9: return 0;
   71741    case 8: return 0;
   71742    case 7:
   71743       if (devinfo->is_haswell) {
   71744          return 0;
   71745       } else {
   71746          return 0;
   71747       }
   71748    case 6: return 576;
   71749    case 5: return 0;
   71750    case 4:
   71751       if (devinfo->is_g4x) {
   71752          return 0;
   71753       } else {
   71754          return 0;
   71755       }
   71756    default:
   71757       unreachable("Invalid hardware generation");
   71758    }
   71759 }
   71760 
   71761 
   71762 
   71763 /* 3DSTATE_SF::Attribute 1 WrapShortest Enables */
   71764 
   71765 
   71766 #define GEN6_3DSTATE_SF_Attribute1WrapShortestEnables_bits  4
   71767 
   71768 static inline uint32_t ATTRIBUTE_PURE
   71769 _3DSTATE_SF_Attribute1WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   71770 {
   71771    switch (devinfo->gen) {
   71772    case 10: return 0;
   71773    case 9: return 0;
   71774    case 8: return 0;
   71775    case 7:
   71776       if (devinfo->is_haswell) {
   71777          return 0;
   71778       } else {
   71779          return 0;
   71780       }
   71781    case 6: return 4;
   71782    case 5: return 0;
   71783    case 4:
   71784       if (devinfo->is_g4x) {
   71785          return 0;
   71786       } else {
   71787          return 0;
   71788       }
   71789    default:
   71790       unreachable("Invalid hardware generation");
   71791    }
   71792 }
   71793 
   71794 
   71795 
   71796 #define GEN6_3DSTATE_SF_Attribute1WrapShortestEnables_start  580
   71797 
   71798 static inline uint32_t ATTRIBUTE_PURE
   71799 _3DSTATE_SF_Attribute1WrapShortestEnables_start(const struct gen_device_info *devinfo)
   71800 {
   71801    switch (devinfo->gen) {
   71802    case 10: return 0;
   71803    case 9: return 0;
   71804    case 8: return 0;
   71805    case 7:
   71806       if (devinfo->is_haswell) {
   71807          return 0;
   71808       } else {
   71809          return 0;
   71810       }
   71811    case 6: return 580;
   71812    case 5: return 0;
   71813    case 4:
   71814       if (devinfo->is_g4x) {
   71815          return 0;
   71816       } else {
   71817          return 0;
   71818       }
   71819    default:
   71820       unreachable("Invalid hardware generation");
   71821    }
   71822 }
   71823 
   71824 
   71825 
   71826 /* 3DSTATE_SF::Attribute 10 WrapShortest Enables */
   71827 
   71828 
   71829 #define GEN6_3DSTATE_SF_Attribute10WrapShortestEnables_bits  4
   71830 
   71831 static inline uint32_t ATTRIBUTE_PURE
   71832 _3DSTATE_SF_Attribute10WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   71833 {
   71834    switch (devinfo->gen) {
   71835    case 10: return 0;
   71836    case 9: return 0;
   71837    case 8: return 0;
   71838    case 7:
   71839       if (devinfo->is_haswell) {
   71840          return 0;
   71841       } else {
   71842          return 0;
   71843       }
   71844    case 6: return 4;
   71845    case 5: return 0;
   71846    case 4:
   71847       if (devinfo->is_g4x) {
   71848          return 0;
   71849       } else {
   71850          return 0;
   71851       }
   71852    default:
   71853       unreachable("Invalid hardware generation");
   71854    }
   71855 }
   71856 
   71857 
   71858 
   71859 #define GEN6_3DSTATE_SF_Attribute10WrapShortestEnables_start  616
   71860 
   71861 static inline uint32_t ATTRIBUTE_PURE
   71862 _3DSTATE_SF_Attribute10WrapShortestEnables_start(const struct gen_device_info *devinfo)
   71863 {
   71864    switch (devinfo->gen) {
   71865    case 10: return 0;
   71866    case 9: return 0;
   71867    case 8: return 0;
   71868    case 7:
   71869       if (devinfo->is_haswell) {
   71870          return 0;
   71871       } else {
   71872          return 0;
   71873       }
   71874    case 6: return 616;
   71875    case 5: return 0;
   71876    case 4:
   71877       if (devinfo->is_g4x) {
   71878          return 0;
   71879       } else {
   71880          return 0;
   71881       }
   71882    default:
   71883       unreachable("Invalid hardware generation");
   71884    }
   71885 }
   71886 
   71887 
   71888 
   71889 /* 3DSTATE_SF::Attribute 11 WrapShortest Enables */
   71890 
   71891 
   71892 #define GEN6_3DSTATE_SF_Attribute11WrapShortestEnables_bits  4
   71893 
   71894 static inline uint32_t ATTRIBUTE_PURE
   71895 _3DSTATE_SF_Attribute11WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   71896 {
   71897    switch (devinfo->gen) {
   71898    case 10: return 0;
   71899    case 9: return 0;
   71900    case 8: return 0;
   71901    case 7:
   71902       if (devinfo->is_haswell) {
   71903          return 0;
   71904       } else {
   71905          return 0;
   71906       }
   71907    case 6: return 4;
   71908    case 5: return 0;
   71909    case 4:
   71910       if (devinfo->is_g4x) {
   71911          return 0;
   71912       } else {
   71913          return 0;
   71914       }
   71915    default:
   71916       unreachable("Invalid hardware generation");
   71917    }
   71918 }
   71919 
   71920 
   71921 
   71922 #define GEN6_3DSTATE_SF_Attribute11WrapShortestEnables_start  620
   71923 
   71924 static inline uint32_t ATTRIBUTE_PURE
   71925 _3DSTATE_SF_Attribute11WrapShortestEnables_start(const struct gen_device_info *devinfo)
   71926 {
   71927    switch (devinfo->gen) {
   71928    case 10: return 0;
   71929    case 9: return 0;
   71930    case 8: return 0;
   71931    case 7:
   71932       if (devinfo->is_haswell) {
   71933          return 0;
   71934       } else {
   71935          return 0;
   71936       }
   71937    case 6: return 620;
   71938    case 5: return 0;
   71939    case 4:
   71940       if (devinfo->is_g4x) {
   71941          return 0;
   71942       } else {
   71943          return 0;
   71944       }
   71945    default:
   71946       unreachable("Invalid hardware generation");
   71947    }
   71948 }
   71949 
   71950 
   71951 
   71952 /* 3DSTATE_SF::Attribute 12 WrapShortest Enables */
   71953 
   71954 
   71955 #define GEN6_3DSTATE_SF_Attribute12WrapShortestEnables_bits  4
   71956 
   71957 static inline uint32_t ATTRIBUTE_PURE
   71958 _3DSTATE_SF_Attribute12WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   71959 {
   71960    switch (devinfo->gen) {
   71961    case 10: return 0;
   71962    case 9: return 0;
   71963    case 8: return 0;
   71964    case 7:
   71965       if (devinfo->is_haswell) {
   71966          return 0;
   71967       } else {
   71968          return 0;
   71969       }
   71970    case 6: return 4;
   71971    case 5: return 0;
   71972    case 4:
   71973       if (devinfo->is_g4x) {
   71974          return 0;
   71975       } else {
   71976          return 0;
   71977       }
   71978    default:
   71979       unreachable("Invalid hardware generation");
   71980    }
   71981 }
   71982 
   71983 
   71984 
   71985 #define GEN6_3DSTATE_SF_Attribute12WrapShortestEnables_start  624
   71986 
   71987 static inline uint32_t ATTRIBUTE_PURE
   71988 _3DSTATE_SF_Attribute12WrapShortestEnables_start(const struct gen_device_info *devinfo)
   71989 {
   71990    switch (devinfo->gen) {
   71991    case 10: return 0;
   71992    case 9: return 0;
   71993    case 8: return 0;
   71994    case 7:
   71995       if (devinfo->is_haswell) {
   71996          return 0;
   71997       } else {
   71998          return 0;
   71999       }
   72000    case 6: return 624;
   72001    case 5: return 0;
   72002    case 4:
   72003       if (devinfo->is_g4x) {
   72004          return 0;
   72005       } else {
   72006          return 0;
   72007       }
   72008    default:
   72009       unreachable("Invalid hardware generation");
   72010    }
   72011 }
   72012 
   72013 
   72014 
   72015 /* 3DSTATE_SF::Attribute 13 WrapShortest Enables */
   72016 
   72017 
   72018 #define GEN6_3DSTATE_SF_Attribute13WrapShortestEnables_bits  4
   72019 
   72020 static inline uint32_t ATTRIBUTE_PURE
   72021 _3DSTATE_SF_Attribute13WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72022 {
   72023    switch (devinfo->gen) {
   72024    case 10: return 0;
   72025    case 9: return 0;
   72026    case 8: return 0;
   72027    case 7:
   72028       if (devinfo->is_haswell) {
   72029          return 0;
   72030       } else {
   72031          return 0;
   72032       }
   72033    case 6: return 4;
   72034    case 5: return 0;
   72035    case 4:
   72036       if (devinfo->is_g4x) {
   72037          return 0;
   72038       } else {
   72039          return 0;
   72040       }
   72041    default:
   72042       unreachable("Invalid hardware generation");
   72043    }
   72044 }
   72045 
   72046 
   72047 
   72048 #define GEN6_3DSTATE_SF_Attribute13WrapShortestEnables_start  628
   72049 
   72050 static inline uint32_t ATTRIBUTE_PURE
   72051 _3DSTATE_SF_Attribute13WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72052 {
   72053    switch (devinfo->gen) {
   72054    case 10: return 0;
   72055    case 9: return 0;
   72056    case 8: return 0;
   72057    case 7:
   72058       if (devinfo->is_haswell) {
   72059          return 0;
   72060       } else {
   72061          return 0;
   72062       }
   72063    case 6: return 628;
   72064    case 5: return 0;
   72065    case 4:
   72066       if (devinfo->is_g4x) {
   72067          return 0;
   72068       } else {
   72069          return 0;
   72070       }
   72071    default:
   72072       unreachable("Invalid hardware generation");
   72073    }
   72074 }
   72075 
   72076 
   72077 
   72078 /* 3DSTATE_SF::Attribute 14 WrapShortest Enables */
   72079 
   72080 
   72081 #define GEN6_3DSTATE_SF_Attribute14WrapShortestEnables_bits  4
   72082 
   72083 static inline uint32_t ATTRIBUTE_PURE
   72084 _3DSTATE_SF_Attribute14WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72085 {
   72086    switch (devinfo->gen) {
   72087    case 10: return 0;
   72088    case 9: return 0;
   72089    case 8: return 0;
   72090    case 7:
   72091       if (devinfo->is_haswell) {
   72092          return 0;
   72093       } else {
   72094          return 0;
   72095       }
   72096    case 6: return 4;
   72097    case 5: return 0;
   72098    case 4:
   72099       if (devinfo->is_g4x) {
   72100          return 0;
   72101       } else {
   72102          return 0;
   72103       }
   72104    default:
   72105       unreachable("Invalid hardware generation");
   72106    }
   72107 }
   72108 
   72109 
   72110 
   72111 #define GEN6_3DSTATE_SF_Attribute14WrapShortestEnables_start  632
   72112 
   72113 static inline uint32_t ATTRIBUTE_PURE
   72114 _3DSTATE_SF_Attribute14WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72115 {
   72116    switch (devinfo->gen) {
   72117    case 10: return 0;
   72118    case 9: return 0;
   72119    case 8: return 0;
   72120    case 7:
   72121       if (devinfo->is_haswell) {
   72122          return 0;
   72123       } else {
   72124          return 0;
   72125       }
   72126    case 6: return 632;
   72127    case 5: return 0;
   72128    case 4:
   72129       if (devinfo->is_g4x) {
   72130          return 0;
   72131       } else {
   72132          return 0;
   72133       }
   72134    default:
   72135       unreachable("Invalid hardware generation");
   72136    }
   72137 }
   72138 
   72139 
   72140 
   72141 /* 3DSTATE_SF::Attribute 15 WrapShortest Enables */
   72142 
   72143 
   72144 #define GEN6_3DSTATE_SF_Attribute15WrapShortestEnables_bits  4
   72145 
   72146 static inline uint32_t ATTRIBUTE_PURE
   72147 _3DSTATE_SF_Attribute15WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72148 {
   72149    switch (devinfo->gen) {
   72150    case 10: return 0;
   72151    case 9: return 0;
   72152    case 8: return 0;
   72153    case 7:
   72154       if (devinfo->is_haswell) {
   72155          return 0;
   72156       } else {
   72157          return 0;
   72158       }
   72159    case 6: return 4;
   72160    case 5: return 0;
   72161    case 4:
   72162       if (devinfo->is_g4x) {
   72163          return 0;
   72164       } else {
   72165          return 0;
   72166       }
   72167    default:
   72168       unreachable("Invalid hardware generation");
   72169    }
   72170 }
   72171 
   72172 
   72173 
   72174 #define GEN6_3DSTATE_SF_Attribute15WrapShortestEnables_start  636
   72175 
   72176 static inline uint32_t ATTRIBUTE_PURE
   72177 _3DSTATE_SF_Attribute15WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72178 {
   72179    switch (devinfo->gen) {
   72180    case 10: return 0;
   72181    case 9: return 0;
   72182    case 8: return 0;
   72183    case 7:
   72184       if (devinfo->is_haswell) {
   72185          return 0;
   72186       } else {
   72187          return 0;
   72188       }
   72189    case 6: return 636;
   72190    case 5: return 0;
   72191    case 4:
   72192       if (devinfo->is_g4x) {
   72193          return 0;
   72194       } else {
   72195          return 0;
   72196       }
   72197    default:
   72198       unreachable("Invalid hardware generation");
   72199    }
   72200 }
   72201 
   72202 
   72203 
   72204 /* 3DSTATE_SF::Attribute 2 WrapShortest Enables */
   72205 
   72206 
   72207 #define GEN6_3DSTATE_SF_Attribute2WrapShortestEnables_bits  4
   72208 
   72209 static inline uint32_t ATTRIBUTE_PURE
   72210 _3DSTATE_SF_Attribute2WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72211 {
   72212    switch (devinfo->gen) {
   72213    case 10: return 0;
   72214    case 9: return 0;
   72215    case 8: return 0;
   72216    case 7:
   72217       if (devinfo->is_haswell) {
   72218          return 0;
   72219       } else {
   72220          return 0;
   72221       }
   72222    case 6: return 4;
   72223    case 5: return 0;
   72224    case 4:
   72225       if (devinfo->is_g4x) {
   72226          return 0;
   72227       } else {
   72228          return 0;
   72229       }
   72230    default:
   72231       unreachable("Invalid hardware generation");
   72232    }
   72233 }
   72234 
   72235 
   72236 
   72237 #define GEN6_3DSTATE_SF_Attribute2WrapShortestEnables_start  584
   72238 
   72239 static inline uint32_t ATTRIBUTE_PURE
   72240 _3DSTATE_SF_Attribute2WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72241 {
   72242    switch (devinfo->gen) {
   72243    case 10: return 0;
   72244    case 9: return 0;
   72245    case 8: return 0;
   72246    case 7:
   72247       if (devinfo->is_haswell) {
   72248          return 0;
   72249       } else {
   72250          return 0;
   72251       }
   72252    case 6: return 584;
   72253    case 5: return 0;
   72254    case 4:
   72255       if (devinfo->is_g4x) {
   72256          return 0;
   72257       } else {
   72258          return 0;
   72259       }
   72260    default:
   72261       unreachable("Invalid hardware generation");
   72262    }
   72263 }
   72264 
   72265 
   72266 
   72267 /* 3DSTATE_SF::Attribute 3 WrapShortest Enables */
   72268 
   72269 
   72270 #define GEN6_3DSTATE_SF_Attribute3WrapShortestEnables_bits  4
   72271 
   72272 static inline uint32_t ATTRIBUTE_PURE
   72273 _3DSTATE_SF_Attribute3WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72274 {
   72275    switch (devinfo->gen) {
   72276    case 10: return 0;
   72277    case 9: return 0;
   72278    case 8: return 0;
   72279    case 7:
   72280       if (devinfo->is_haswell) {
   72281          return 0;
   72282       } else {
   72283          return 0;
   72284       }
   72285    case 6: return 4;
   72286    case 5: return 0;
   72287    case 4:
   72288       if (devinfo->is_g4x) {
   72289          return 0;
   72290       } else {
   72291          return 0;
   72292       }
   72293    default:
   72294       unreachable("Invalid hardware generation");
   72295    }
   72296 }
   72297 
   72298 
   72299 
   72300 #define GEN6_3DSTATE_SF_Attribute3WrapShortestEnables_start  588
   72301 
   72302 static inline uint32_t ATTRIBUTE_PURE
   72303 _3DSTATE_SF_Attribute3WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72304 {
   72305    switch (devinfo->gen) {
   72306    case 10: return 0;
   72307    case 9: return 0;
   72308    case 8: return 0;
   72309    case 7:
   72310       if (devinfo->is_haswell) {
   72311          return 0;
   72312       } else {
   72313          return 0;
   72314       }
   72315    case 6: return 588;
   72316    case 5: return 0;
   72317    case 4:
   72318       if (devinfo->is_g4x) {
   72319          return 0;
   72320       } else {
   72321          return 0;
   72322       }
   72323    default:
   72324       unreachable("Invalid hardware generation");
   72325    }
   72326 }
   72327 
   72328 
   72329 
   72330 /* 3DSTATE_SF::Attribute 4 WrapShortest Enables */
   72331 
   72332 
   72333 #define GEN6_3DSTATE_SF_Attribute4WrapShortestEnables_bits  4
   72334 
   72335 static inline uint32_t ATTRIBUTE_PURE
   72336 _3DSTATE_SF_Attribute4WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72337 {
   72338    switch (devinfo->gen) {
   72339    case 10: return 0;
   72340    case 9: return 0;
   72341    case 8: return 0;
   72342    case 7:
   72343       if (devinfo->is_haswell) {
   72344          return 0;
   72345       } else {
   72346          return 0;
   72347       }
   72348    case 6: return 4;
   72349    case 5: return 0;
   72350    case 4:
   72351       if (devinfo->is_g4x) {
   72352          return 0;
   72353       } else {
   72354          return 0;
   72355       }
   72356    default:
   72357       unreachable("Invalid hardware generation");
   72358    }
   72359 }
   72360 
   72361 
   72362 
   72363 #define GEN6_3DSTATE_SF_Attribute4WrapShortestEnables_start  592
   72364 
   72365 static inline uint32_t ATTRIBUTE_PURE
   72366 _3DSTATE_SF_Attribute4WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72367 {
   72368    switch (devinfo->gen) {
   72369    case 10: return 0;
   72370    case 9: return 0;
   72371    case 8: return 0;
   72372    case 7:
   72373       if (devinfo->is_haswell) {
   72374          return 0;
   72375       } else {
   72376          return 0;
   72377       }
   72378    case 6: return 592;
   72379    case 5: return 0;
   72380    case 4:
   72381       if (devinfo->is_g4x) {
   72382          return 0;
   72383       } else {
   72384          return 0;
   72385       }
   72386    default:
   72387       unreachable("Invalid hardware generation");
   72388    }
   72389 }
   72390 
   72391 
   72392 
   72393 /* 3DSTATE_SF::Attribute 5 WrapShortest Enables */
   72394 
   72395 
   72396 #define GEN6_3DSTATE_SF_Attribute5WrapShortestEnables_bits  4
   72397 
   72398 static inline uint32_t ATTRIBUTE_PURE
   72399 _3DSTATE_SF_Attribute5WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72400 {
   72401    switch (devinfo->gen) {
   72402    case 10: return 0;
   72403    case 9: return 0;
   72404    case 8: return 0;
   72405    case 7:
   72406       if (devinfo->is_haswell) {
   72407          return 0;
   72408       } else {
   72409          return 0;
   72410       }
   72411    case 6: return 4;
   72412    case 5: return 0;
   72413    case 4:
   72414       if (devinfo->is_g4x) {
   72415          return 0;
   72416       } else {
   72417          return 0;
   72418       }
   72419    default:
   72420       unreachable("Invalid hardware generation");
   72421    }
   72422 }
   72423 
   72424 
   72425 
   72426 #define GEN6_3DSTATE_SF_Attribute5WrapShortestEnables_start  596
   72427 
   72428 static inline uint32_t ATTRIBUTE_PURE
   72429 _3DSTATE_SF_Attribute5WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72430 {
   72431    switch (devinfo->gen) {
   72432    case 10: return 0;
   72433    case 9: return 0;
   72434    case 8: return 0;
   72435    case 7:
   72436       if (devinfo->is_haswell) {
   72437          return 0;
   72438       } else {
   72439          return 0;
   72440       }
   72441    case 6: return 596;
   72442    case 5: return 0;
   72443    case 4:
   72444       if (devinfo->is_g4x) {
   72445          return 0;
   72446       } else {
   72447          return 0;
   72448       }
   72449    default:
   72450       unreachable("Invalid hardware generation");
   72451    }
   72452 }
   72453 
   72454 
   72455 
   72456 /* 3DSTATE_SF::Attribute 6 WrapShortest Enables */
   72457 
   72458 
   72459 #define GEN6_3DSTATE_SF_Attribute6WrapShortestEnables_bits  4
   72460 
   72461 static inline uint32_t ATTRIBUTE_PURE
   72462 _3DSTATE_SF_Attribute6WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72463 {
   72464    switch (devinfo->gen) {
   72465    case 10: return 0;
   72466    case 9: return 0;
   72467    case 8: return 0;
   72468    case 7:
   72469       if (devinfo->is_haswell) {
   72470          return 0;
   72471       } else {
   72472          return 0;
   72473       }
   72474    case 6: return 4;
   72475    case 5: return 0;
   72476    case 4:
   72477       if (devinfo->is_g4x) {
   72478          return 0;
   72479       } else {
   72480          return 0;
   72481       }
   72482    default:
   72483       unreachable("Invalid hardware generation");
   72484    }
   72485 }
   72486 
   72487 
   72488 
   72489 #define GEN6_3DSTATE_SF_Attribute6WrapShortestEnables_start  600
   72490 
   72491 static inline uint32_t ATTRIBUTE_PURE
   72492 _3DSTATE_SF_Attribute6WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72493 {
   72494    switch (devinfo->gen) {
   72495    case 10: return 0;
   72496    case 9: return 0;
   72497    case 8: return 0;
   72498    case 7:
   72499       if (devinfo->is_haswell) {
   72500          return 0;
   72501       } else {
   72502          return 0;
   72503       }
   72504    case 6: return 600;
   72505    case 5: return 0;
   72506    case 4:
   72507       if (devinfo->is_g4x) {
   72508          return 0;
   72509       } else {
   72510          return 0;
   72511       }
   72512    default:
   72513       unreachable("Invalid hardware generation");
   72514    }
   72515 }
   72516 
   72517 
   72518 
   72519 /* 3DSTATE_SF::Attribute 7 WrapShortest Enables */
   72520 
   72521 
   72522 #define GEN6_3DSTATE_SF_Attribute7WrapShortestEnables_bits  4
   72523 
   72524 static inline uint32_t ATTRIBUTE_PURE
   72525 _3DSTATE_SF_Attribute7WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72526 {
   72527    switch (devinfo->gen) {
   72528    case 10: return 0;
   72529    case 9: return 0;
   72530    case 8: return 0;
   72531    case 7:
   72532       if (devinfo->is_haswell) {
   72533          return 0;
   72534       } else {
   72535          return 0;
   72536       }
   72537    case 6: return 4;
   72538    case 5: return 0;
   72539    case 4:
   72540       if (devinfo->is_g4x) {
   72541          return 0;
   72542       } else {
   72543          return 0;
   72544       }
   72545    default:
   72546       unreachable("Invalid hardware generation");
   72547    }
   72548 }
   72549 
   72550 
   72551 
   72552 #define GEN6_3DSTATE_SF_Attribute7WrapShortestEnables_start  604
   72553 
   72554 static inline uint32_t ATTRIBUTE_PURE
   72555 _3DSTATE_SF_Attribute7WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72556 {
   72557    switch (devinfo->gen) {
   72558    case 10: return 0;
   72559    case 9: return 0;
   72560    case 8: return 0;
   72561    case 7:
   72562       if (devinfo->is_haswell) {
   72563          return 0;
   72564       } else {
   72565          return 0;
   72566       }
   72567    case 6: return 604;
   72568    case 5: return 0;
   72569    case 4:
   72570       if (devinfo->is_g4x) {
   72571          return 0;
   72572       } else {
   72573          return 0;
   72574       }
   72575    default:
   72576       unreachable("Invalid hardware generation");
   72577    }
   72578 }
   72579 
   72580 
   72581 
   72582 /* 3DSTATE_SF::Attribute 8 WrapShortest Enables */
   72583 
   72584 
   72585 #define GEN6_3DSTATE_SF_Attribute8WrapShortestEnables_bits  4
   72586 
   72587 static inline uint32_t ATTRIBUTE_PURE
   72588 _3DSTATE_SF_Attribute8WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72589 {
   72590    switch (devinfo->gen) {
   72591    case 10: return 0;
   72592    case 9: return 0;
   72593    case 8: return 0;
   72594    case 7:
   72595       if (devinfo->is_haswell) {
   72596          return 0;
   72597       } else {
   72598          return 0;
   72599       }
   72600    case 6: return 4;
   72601    case 5: return 0;
   72602    case 4:
   72603       if (devinfo->is_g4x) {
   72604          return 0;
   72605       } else {
   72606          return 0;
   72607       }
   72608    default:
   72609       unreachable("Invalid hardware generation");
   72610    }
   72611 }
   72612 
   72613 
   72614 
   72615 #define GEN6_3DSTATE_SF_Attribute8WrapShortestEnables_start  608
   72616 
   72617 static inline uint32_t ATTRIBUTE_PURE
   72618 _3DSTATE_SF_Attribute8WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72619 {
   72620    switch (devinfo->gen) {
   72621    case 10: return 0;
   72622    case 9: return 0;
   72623    case 8: return 0;
   72624    case 7:
   72625       if (devinfo->is_haswell) {
   72626          return 0;
   72627       } else {
   72628          return 0;
   72629       }
   72630    case 6: return 608;
   72631    case 5: return 0;
   72632    case 4:
   72633       if (devinfo->is_g4x) {
   72634          return 0;
   72635       } else {
   72636          return 0;
   72637       }
   72638    default:
   72639       unreachable("Invalid hardware generation");
   72640    }
   72641 }
   72642 
   72643 
   72644 
   72645 /* 3DSTATE_SF::Attribute 9 WrapShortest Enables */
   72646 
   72647 
   72648 #define GEN6_3DSTATE_SF_Attribute9WrapShortestEnables_bits  4
   72649 
   72650 static inline uint32_t ATTRIBUTE_PURE
   72651 _3DSTATE_SF_Attribute9WrapShortestEnables_bits(const struct gen_device_info *devinfo)
   72652 {
   72653    switch (devinfo->gen) {
   72654    case 10: return 0;
   72655    case 9: return 0;
   72656    case 8: return 0;
   72657    case 7:
   72658       if (devinfo->is_haswell) {
   72659          return 0;
   72660       } else {
   72661          return 0;
   72662       }
   72663    case 6: return 4;
   72664    case 5: return 0;
   72665    case 4:
   72666       if (devinfo->is_g4x) {
   72667          return 0;
   72668       } else {
   72669          return 0;
   72670       }
   72671    default:
   72672       unreachable("Invalid hardware generation");
   72673    }
   72674 }
   72675 
   72676 
   72677 
   72678 #define GEN6_3DSTATE_SF_Attribute9WrapShortestEnables_start  612
   72679 
   72680 static inline uint32_t ATTRIBUTE_PURE
   72681 _3DSTATE_SF_Attribute9WrapShortestEnables_start(const struct gen_device_info *devinfo)
   72682 {
   72683    switch (devinfo->gen) {
   72684    case 10: return 0;
   72685    case 9: return 0;
   72686    case 8: return 0;
   72687    case 7:
   72688       if (devinfo->is_haswell) {
   72689          return 0;
   72690       } else {
   72691          return 0;
   72692       }
   72693    case 6: return 612;
   72694    case 5: return 0;
   72695    case 4:
   72696       if (devinfo->is_g4x) {
   72697          return 0;
   72698       } else {
   72699          return 0;
   72700       }
   72701    default:
   72702       unreachable("Invalid hardware generation");
   72703    }
   72704 }
   72705 
   72706 
   72707 
   72708 /* 3DSTATE_SF::Attribute Swizzle Enable */
   72709 
   72710 
   72711 #define GEN6_3DSTATE_SF_AttributeSwizzleEnable_bits  1
   72712 
   72713 static inline uint32_t ATTRIBUTE_PURE
   72714 _3DSTATE_SF_AttributeSwizzleEnable_bits(const struct gen_device_info *devinfo)
   72715 {
   72716    switch (devinfo->gen) {
   72717    case 10: return 0;
   72718    case 9: return 0;
   72719    case 8: return 0;
   72720    case 7:
   72721       if (devinfo->is_haswell) {
   72722          return 0;
   72723       } else {
   72724          return 0;
   72725       }
   72726    case 6: return 1;
   72727    case 5: return 0;
   72728    case 4:
   72729       if (devinfo->is_g4x) {
   72730          return 0;
   72731       } else {
   72732          return 0;
   72733       }
   72734    default:
   72735       unreachable("Invalid hardware generation");
   72736    }
   72737 }
   72738 
   72739 
   72740 
   72741 #define GEN6_3DSTATE_SF_AttributeSwizzleEnable_start  53
   72742 
   72743 static inline uint32_t ATTRIBUTE_PURE
   72744 _3DSTATE_SF_AttributeSwizzleEnable_start(const struct gen_device_info *devinfo)
   72745 {
   72746    switch (devinfo->gen) {
   72747    case 10: return 0;
   72748    case 9: return 0;
   72749    case 8: return 0;
   72750    case 7:
   72751       if (devinfo->is_haswell) {
   72752          return 0;
   72753       } else {
   72754          return 0;
   72755       }
   72756    case 6: return 53;
   72757    case 5: return 0;
   72758    case 4:
   72759       if (devinfo->is_g4x) {
   72760          return 0;
   72761       } else {
   72762          return 0;
   72763       }
   72764    default:
   72765       unreachable("Invalid hardware generation");
   72766    }
   72767 }
   72768 
   72769 
   72770 
   72771 /* 3DSTATE_SF::BackFace Fill Mode */
   72772 
   72773 
   72774 #define GEN75_3DSTATE_SF_BackFaceFillMode_bits  2
   72775 #define GEN7_3DSTATE_SF_BackFaceFillMode_bits  2
   72776 #define GEN6_3DSTATE_SF_BackFaceFillMode_bits  2
   72777 
   72778 static inline uint32_t ATTRIBUTE_PURE
   72779 _3DSTATE_SF_BackFaceFillMode_bits(const struct gen_device_info *devinfo)
   72780 {
   72781    switch (devinfo->gen) {
   72782    case 10: return 0;
   72783    case 9: return 0;
   72784    case 8: return 0;
   72785    case 7:
   72786       if (devinfo->is_haswell) {
   72787          return 2;
   72788       } else {
   72789          return 2;
   72790       }
   72791    case 6: return 2;
   72792    case 5: return 0;
   72793    case 4:
   72794       if (devinfo->is_g4x) {
   72795          return 0;
   72796       } else {
   72797          return 0;
   72798       }
   72799    default:
   72800       unreachable("Invalid hardware generation");
   72801    }
   72802 }
   72803 
   72804 
   72805 
   72806 #define GEN75_3DSTATE_SF_BackFaceFillMode_start  35
   72807 #define GEN7_3DSTATE_SF_BackFaceFillMode_start  35
   72808 #define GEN6_3DSTATE_SF_BackFaceFillMode_start  67
   72809 
   72810 static inline uint32_t ATTRIBUTE_PURE
   72811 _3DSTATE_SF_BackFaceFillMode_start(const struct gen_device_info *devinfo)
   72812 {
   72813    switch (devinfo->gen) {
   72814    case 10: return 0;
   72815    case 9: return 0;
   72816    case 8: return 0;
   72817    case 7:
   72818       if (devinfo->is_haswell) {
   72819          return 35;
   72820       } else {
   72821          return 35;
   72822       }
   72823    case 6: return 67;
   72824    case 5: return 0;
   72825    case 4:
   72826       if (devinfo->is_g4x) {
   72827          return 0;
   72828       } else {
   72829          return 0;
   72830       }
   72831    default:
   72832       unreachable("Invalid hardware generation");
   72833    }
   72834 }
   72835 
   72836 
   72837 
   72838 /* 3DSTATE_SF::CHV Line Width */
   72839 
   72840 
   72841 #define GEN8_3DSTATE_SF_CHVLineWidth_bits  18
   72842 
   72843 static inline uint32_t ATTRIBUTE_PURE
   72844 _3DSTATE_SF_CHVLineWidth_bits(const struct gen_device_info *devinfo)
   72845 {
   72846    switch (devinfo->gen) {
   72847    case 10: return 0;
   72848    case 9: return 0;
   72849    case 8: return 18;
   72850    case 7:
   72851       if (devinfo->is_haswell) {
   72852          return 0;
   72853       } else {
   72854          return 0;
   72855       }
   72856    case 6: return 0;
   72857    case 5: return 0;
   72858    case 4:
   72859       if (devinfo->is_g4x) {
   72860          return 0;
   72861       } else {
   72862          return 0;
   72863       }
   72864    default:
   72865       unreachable("Invalid hardware generation");
   72866    }
   72867 }
   72868 
   72869 
   72870 
   72871 #define GEN8_3DSTATE_SF_CHVLineWidth_start  44
   72872 
   72873 static inline uint32_t ATTRIBUTE_PURE
   72874 _3DSTATE_SF_CHVLineWidth_start(const struct gen_device_info *devinfo)
   72875 {
   72876    switch (devinfo->gen) {
   72877    case 10: return 0;
   72878    case 9: return 0;
   72879    case 8: return 44;
   72880    case 7:
   72881       if (devinfo->is_haswell) {
   72882          return 0;
   72883       } else {
   72884          return 0;
   72885       }
   72886    case 6: return 0;
   72887    case 5: return 0;
   72888    case 4:
   72889       if (devinfo->is_g4x) {
   72890          return 0;
   72891       } else {
   72892          return 0;
   72893       }
   72894    default:
   72895       unreachable("Invalid hardware generation");
   72896    }
   72897 }
   72898 
   72899 
   72900 
   72901 /* 3DSTATE_SF::Command SubType */
   72902 
   72903 
   72904 #define GEN10_3DSTATE_SF_CommandSubType_bits  2
   72905 #define GEN9_3DSTATE_SF_CommandSubType_bits  2
   72906 #define GEN8_3DSTATE_SF_CommandSubType_bits  2
   72907 #define GEN75_3DSTATE_SF_CommandSubType_bits  2
   72908 #define GEN7_3DSTATE_SF_CommandSubType_bits  2
   72909 #define GEN6_3DSTATE_SF_CommandSubType_bits  2
   72910 
   72911 static inline uint32_t ATTRIBUTE_PURE
   72912 _3DSTATE_SF_CommandSubType_bits(const struct gen_device_info *devinfo)
   72913 {
   72914    switch (devinfo->gen) {
   72915    case 10: return 2;
   72916    case 9: return 2;
   72917    case 8: return 2;
   72918    case 7:
   72919       if (devinfo->is_haswell) {
   72920          return 2;
   72921       } else {
   72922          return 2;
   72923       }
   72924    case 6: return 2;
   72925    case 5: return 0;
   72926    case 4:
   72927       if (devinfo->is_g4x) {
   72928          return 0;
   72929       } else {
   72930          return 0;
   72931       }
   72932    default:
   72933       unreachable("Invalid hardware generation");
   72934    }
   72935 }
   72936 
   72937 
   72938 
   72939 #define GEN10_3DSTATE_SF_CommandSubType_start  27
   72940 #define GEN9_3DSTATE_SF_CommandSubType_start  27
   72941 #define GEN8_3DSTATE_SF_CommandSubType_start  27
   72942 #define GEN75_3DSTATE_SF_CommandSubType_start  27
   72943 #define GEN7_3DSTATE_SF_CommandSubType_start  27
   72944 #define GEN6_3DSTATE_SF_CommandSubType_start  27
   72945 
   72946 static inline uint32_t ATTRIBUTE_PURE
   72947 _3DSTATE_SF_CommandSubType_start(const struct gen_device_info *devinfo)
   72948 {
   72949    switch (devinfo->gen) {
   72950    case 10: return 27;
   72951    case 9: return 27;
   72952    case 8: return 27;
   72953    case 7:
   72954       if (devinfo->is_haswell) {
   72955          return 27;
   72956       } else {
   72957          return 27;
   72958       }
   72959    case 6: return 27;
   72960    case 5: return 0;
   72961    case 4:
   72962       if (devinfo->is_g4x) {
   72963          return 0;
   72964       } else {
   72965          return 0;
   72966       }
   72967    default:
   72968       unreachable("Invalid hardware generation");
   72969    }
   72970 }
   72971 
   72972 
   72973 
   72974 /* 3DSTATE_SF::Command Type */
   72975 
   72976 
   72977 #define GEN10_3DSTATE_SF_CommandType_bits  3
   72978 #define GEN9_3DSTATE_SF_CommandType_bits  3
   72979 #define GEN8_3DSTATE_SF_CommandType_bits  3
   72980 #define GEN75_3DSTATE_SF_CommandType_bits  3
   72981 #define GEN7_3DSTATE_SF_CommandType_bits  3
   72982 #define GEN6_3DSTATE_SF_CommandType_bits  3
   72983 
   72984 static inline uint32_t ATTRIBUTE_PURE
   72985 _3DSTATE_SF_CommandType_bits(const struct gen_device_info *devinfo)
   72986 {
   72987    switch (devinfo->gen) {
   72988    case 10: return 3;
   72989    case 9: return 3;
   72990    case 8: return 3;
   72991    case 7:
   72992       if (devinfo->is_haswell) {
   72993          return 3;
   72994       } else {
   72995          return 3;
   72996       }
   72997    case 6: return 3;
   72998    case 5: return 0;
   72999    case 4:
   73000       if (devinfo->is_g4x) {
   73001          return 0;
   73002       } else {
   73003          return 0;
   73004       }
   73005    default:
   73006       unreachable("Invalid hardware generation");
   73007    }
   73008 }
   73009 
   73010 
   73011 
   73012 #define GEN10_3DSTATE_SF_CommandType_start  29
   73013 #define GEN9_3DSTATE_SF_CommandType_start  29
   73014 #define GEN8_3DSTATE_SF_CommandType_start  29
   73015 #define GEN75_3DSTATE_SF_CommandType_start  29
   73016 #define GEN7_3DSTATE_SF_CommandType_start  29
   73017 #define GEN6_3DSTATE_SF_CommandType_start  29
   73018 
   73019 static inline uint32_t ATTRIBUTE_PURE
   73020 _3DSTATE_SF_CommandType_start(const struct gen_device_info *devinfo)
   73021 {
   73022    switch (devinfo->gen) {
   73023    case 10: return 29;
   73024    case 9: return 29;
   73025    case 8: return 29;
   73026    case 7:
   73027       if (devinfo->is_haswell) {
   73028          return 29;
   73029       } else {
   73030          return 29;
   73031       }
   73032    case 6: return 29;
   73033    case 5: return 0;
   73034    case 4:
   73035       if (devinfo->is_g4x) {
   73036          return 0;
   73037       } else {
   73038          return 0;
   73039       }
   73040    default:
   73041       unreachable("Invalid hardware generation");
   73042    }
   73043 }
   73044 
   73045 
   73046 
   73047 /* 3DSTATE_SF::Constant Interpolation Enable */
   73048 
   73049 
   73050 #define GEN6_3DSTATE_SF_ConstantInterpolationEnable_bits  32
   73051 
   73052 static inline uint32_t ATTRIBUTE_PURE
   73053 _3DSTATE_SF_ConstantInterpolationEnable_bits(const struct gen_device_info *devinfo)
   73054 {
   73055    switch (devinfo->gen) {
   73056    case 10: return 0;
   73057    case 9: return 0;
   73058    case 8: return 0;
   73059    case 7:
   73060       if (devinfo->is_haswell) {
   73061          return 0;
   73062       } else {
   73063          return 0;
   73064       }
   73065    case 6: return 32;
   73066    case 5: return 0;
   73067    case 4:
   73068       if (devinfo->is_g4x) {
   73069          return 0;
   73070       } else {
   73071          return 0;
   73072       }
   73073    default:
   73074       unreachable("Invalid hardware generation");
   73075    }
   73076 }
   73077 
   73078 
   73079 
   73080 #define GEN6_3DSTATE_SF_ConstantInterpolationEnable_start  544
   73081 
   73082 static inline uint32_t ATTRIBUTE_PURE
   73083 _3DSTATE_SF_ConstantInterpolationEnable_start(const struct gen_device_info *devinfo)
   73084 {
   73085    switch (devinfo->gen) {
   73086    case 10: return 0;
   73087    case 9: return 0;
   73088    case 8: return 0;
   73089    case 7:
   73090       if (devinfo->is_haswell) {
   73091          return 0;
   73092       } else {
   73093          return 0;
   73094       }
   73095    case 6: return 544;
   73096    case 5: return 0;
   73097    case 4:
   73098       if (devinfo->is_g4x) {
   73099          return 0;
   73100       } else {
   73101          return 0;
   73102       }
   73103    default:
   73104       unreachable("Invalid hardware generation");
   73105    }
   73106 }
   73107 
   73108 
   73109 
   73110 /* 3DSTATE_SF::Cull Mode */
   73111 
   73112 
   73113 #define GEN75_3DSTATE_SF_CullMode_bits  2
   73114 #define GEN7_3DSTATE_SF_CullMode_bits  2
   73115 #define GEN6_3DSTATE_SF_CullMode_bits  2
   73116 
   73117 static inline uint32_t ATTRIBUTE_PURE
   73118 _3DSTATE_SF_CullMode_bits(const struct gen_device_info *devinfo)
   73119 {
   73120    switch (devinfo->gen) {
   73121    case 10: return 0;
   73122    case 9: return 0;
   73123    case 8: return 0;
   73124    case 7:
   73125       if (devinfo->is_haswell) {
   73126          return 2;
   73127       } else {
   73128          return 2;
   73129       }
   73130    case 6: return 2;
   73131    case 5: return 0;
   73132    case 4:
   73133       if (devinfo->is_g4x) {
   73134          return 0;
   73135       } else {
   73136          return 0;
   73137       }
   73138    default:
   73139       unreachable("Invalid hardware generation");
   73140    }
   73141 }
   73142 
   73143 
   73144 
   73145 #define GEN75_3DSTATE_SF_CullMode_start  93
   73146 #define GEN7_3DSTATE_SF_CullMode_start  93
   73147 #define GEN6_3DSTATE_SF_CullMode_start  125
   73148 
   73149 static inline uint32_t ATTRIBUTE_PURE
   73150 _3DSTATE_SF_CullMode_start(const struct gen_device_info *devinfo)
   73151 {
   73152    switch (devinfo->gen) {
   73153    case 10: return 0;
   73154    case 9: return 0;
   73155    case 8: return 0;
   73156    case 7:
   73157       if (devinfo->is_haswell) {
   73158          return 93;
   73159       } else {
   73160          return 93;
   73161       }
   73162    case 6: return 125;
   73163    case 5: return 0;
   73164    case 4:
   73165       if (devinfo->is_g4x) {
   73166          return 0;
   73167       } else {
   73168          return 0;
   73169       }
   73170    default:
   73171       unreachable("Invalid hardware generation");
   73172    }
   73173 }
   73174 
   73175 
   73176 
   73177 /* 3DSTATE_SF::DWord Length */
   73178 
   73179 
   73180 #define GEN10_3DSTATE_SF_DWordLength_bits  8
   73181 #define GEN9_3DSTATE_SF_DWordLength_bits  8
   73182 #define GEN8_3DSTATE_SF_DWordLength_bits  8
   73183 #define GEN75_3DSTATE_SF_DWordLength_bits  8
   73184 #define GEN7_3DSTATE_SF_DWordLength_bits  8
   73185 #define GEN6_3DSTATE_SF_DWordLength_bits  8
   73186 
   73187 static inline uint32_t ATTRIBUTE_PURE
   73188 _3DSTATE_SF_DWordLength_bits(const struct gen_device_info *devinfo)
   73189 {
   73190    switch (devinfo->gen) {
   73191    case 10: return 8;
   73192    case 9: return 8;
   73193    case 8: return 8;
   73194    case 7:
   73195       if (devinfo->is_haswell) {
   73196          return 8;
   73197       } else {
   73198          return 8;
   73199       }
   73200    case 6: return 8;
   73201    case 5: return 0;
   73202    case 4:
   73203       if (devinfo->is_g4x) {
   73204          return 0;
   73205       } else {
   73206          return 0;
   73207       }
   73208    default:
   73209       unreachable("Invalid hardware generation");
   73210    }
   73211 }
   73212 
   73213 
   73214 
   73215 #define GEN10_3DSTATE_SF_DWordLength_start  0
   73216 #define GEN9_3DSTATE_SF_DWordLength_start  0
   73217 #define GEN8_3DSTATE_SF_DWordLength_start  0
   73218 #define GEN75_3DSTATE_SF_DWordLength_start  0
   73219 #define GEN7_3DSTATE_SF_DWordLength_start  0
   73220 #define GEN6_3DSTATE_SF_DWordLength_start  0
   73221 
   73222 static inline uint32_t ATTRIBUTE_PURE
   73223 _3DSTATE_SF_DWordLength_start(const struct gen_device_info *devinfo)
   73224 {
   73225    switch (devinfo->gen) {
   73226    case 10: return 0;
   73227    case 9: return 0;
   73228    case 8: return 0;
   73229    case 7:
   73230       if (devinfo->is_haswell) {
   73231          return 0;
   73232       } else {
   73233          return 0;
   73234       }
   73235    case 6: return 0;
   73236    case 5: return 0;
   73237    case 4:
   73238       if (devinfo->is_g4x) {
   73239          return 0;
   73240       } else {
   73241          return 0;
   73242       }
   73243    default:
   73244       unreachable("Invalid hardware generation");
   73245    }
   73246 }
   73247 
   73248 
   73249 
   73250 /* 3DSTATE_SF::Depth Buffer Surface Format */
   73251 
   73252 
   73253 #define GEN75_3DSTATE_SF_DepthBufferSurfaceFormat_bits  3
   73254 #define GEN7_3DSTATE_SF_DepthBufferSurfaceFormat_bits  3
   73255 
   73256 static inline uint32_t ATTRIBUTE_PURE
   73257 _3DSTATE_SF_DepthBufferSurfaceFormat_bits(const struct gen_device_info *devinfo)
   73258 {
   73259    switch (devinfo->gen) {
   73260    case 10: return 0;
   73261    case 9: return 0;
   73262    case 8: return 0;
   73263    case 7:
   73264       if (devinfo->is_haswell) {
   73265          return 3;
   73266       } else {
   73267          return 3;
   73268       }
   73269    case 6: return 0;
   73270    case 5: return 0;
   73271    case 4:
   73272       if (devinfo->is_g4x) {
   73273          return 0;
   73274       } else {
   73275          return 0;
   73276       }
   73277    default:
   73278       unreachable("Invalid hardware generation");
   73279    }
   73280 }
   73281 
   73282 
   73283 
   73284 #define GEN75_3DSTATE_SF_DepthBufferSurfaceFormat_start  44
   73285 #define GEN7_3DSTATE_SF_DepthBufferSurfaceFormat_start  44
   73286 
   73287 static inline uint32_t ATTRIBUTE_PURE
   73288 _3DSTATE_SF_DepthBufferSurfaceFormat_start(const struct gen_device_info *devinfo)
   73289 {
   73290    switch (devinfo->gen) {
   73291    case 10: return 0;
   73292    case 9: return 0;
   73293    case 8: return 0;
   73294    case 7:
   73295       if (devinfo->is_haswell) {
   73296          return 44;
   73297       } else {
   73298          return 44;
   73299       }
   73300    case 6: return 0;
   73301    case 5: return 0;
   73302    case 4:
   73303       if (devinfo->is_g4x) {
   73304          return 0;
   73305       } else {
   73306          return 0;
   73307       }
   73308    default:
   73309       unreachable("Invalid hardware generation");
   73310    }
   73311 }
   73312 
   73313 
   73314 
   73315 /* 3DSTATE_SF::Front Winding */
   73316 
   73317 
   73318 #define GEN75_3DSTATE_SF_FrontWinding_bits  1
   73319 #define GEN7_3DSTATE_SF_FrontWinding_bits  1
   73320 #define GEN6_3DSTATE_SF_FrontWinding_bits  1
   73321 
   73322 static inline uint32_t ATTRIBUTE_PURE
   73323 _3DSTATE_SF_FrontWinding_bits(const struct gen_device_info *devinfo)
   73324 {
   73325    switch (devinfo->gen) {
   73326    case 10: return 0;
   73327    case 9: return 0;
   73328    case 8: return 0;
   73329    case 7:
   73330       if (devinfo->is_haswell) {
   73331          return 1;
   73332       } else {
   73333          return 1;
   73334       }
   73335    case 6: return 1;
   73336    case 5: return 0;
   73337    case 4:
   73338       if (devinfo->is_g4x) {
   73339          return 0;
   73340       } else {
   73341          return 0;
   73342       }
   73343    default:
   73344       unreachable("Invalid hardware generation");
   73345    }
   73346 }
   73347 
   73348 
   73349 
   73350 #define GEN75_3DSTATE_SF_FrontWinding_start  32
   73351 #define GEN7_3DSTATE_SF_FrontWinding_start  32
   73352 #define GEN6_3DSTATE_SF_FrontWinding_start  64
   73353 
   73354 static inline uint32_t ATTRIBUTE_PURE
   73355 _3DSTATE_SF_FrontWinding_start(const struct gen_device_info *devinfo)
   73356 {
   73357    switch (devinfo->gen) {
   73358    case 10: return 0;
   73359    case 9: return 0;
   73360    case 8: return 0;
   73361    case 7:
   73362       if (devinfo->is_haswell) {
   73363          return 32;
   73364       } else {
   73365          return 32;
   73366       }
   73367    case 6: return 64;
   73368    case 5: return 0;
   73369    case 4:
   73370       if (devinfo->is_g4x) {
   73371          return 0;
   73372       } else {
   73373          return 0;
   73374       }
   73375    default:
   73376       unreachable("Invalid hardware generation");
   73377    }
   73378 }
   73379 
   73380 
   73381 
   73382 /* 3DSTATE_SF::FrontFace Fill Mode */
   73383 
   73384 
   73385 #define GEN75_3DSTATE_SF_FrontFaceFillMode_bits  2
   73386 #define GEN7_3DSTATE_SF_FrontFaceFillMode_bits  2
   73387 #define GEN6_3DSTATE_SF_FrontFaceFillMode_bits  2
   73388 
   73389 static inline uint32_t ATTRIBUTE_PURE
   73390 _3DSTATE_SF_FrontFaceFillMode_bits(const struct gen_device_info *devinfo)
   73391 {
   73392    switch (devinfo->gen) {
   73393    case 10: return 0;
   73394    case 9: return 0;
   73395    case 8: return 0;
   73396    case 7:
   73397       if (devinfo->is_haswell) {
   73398          return 2;
   73399       } else {
   73400          return 2;
   73401       }
   73402    case 6: return 2;
   73403    case 5: return 0;
   73404    case 4:
   73405       if (devinfo->is_g4x) {
   73406          return 0;
   73407       } else {
   73408          return 0;
   73409       }
   73410    default:
   73411       unreachable("Invalid hardware generation");
   73412    }
   73413 }
   73414 
   73415 
   73416 
   73417 #define GEN75_3DSTATE_SF_FrontFaceFillMode_start  37
   73418 #define GEN7_3DSTATE_SF_FrontFaceFillMode_start  37
   73419 #define GEN6_3DSTATE_SF_FrontFaceFillMode_start  69
   73420 
   73421 static inline uint32_t ATTRIBUTE_PURE
   73422 _3DSTATE_SF_FrontFaceFillMode_start(const struct gen_device_info *devinfo)
   73423 {
   73424    switch (devinfo->gen) {
   73425    case 10: return 0;
   73426    case 9: return 0;
   73427    case 8: return 0;
   73428    case 7:
   73429       if (devinfo->is_haswell) {
   73430          return 37;
   73431       } else {
   73432          return 37;
   73433       }
   73434    case 6: return 69;
   73435    case 5: return 0;
   73436    case 4:
   73437       if (devinfo->is_g4x) {
   73438          return 0;
   73439       } else {
   73440          return 0;
   73441       }
   73442    default:
   73443       unreachable("Invalid hardware generation");
   73444    }
   73445 }
   73446 
   73447 
   73448 
   73449 /* 3DSTATE_SF::Global Depth Offset Clamp */
   73450 
   73451 
   73452 #define GEN75_3DSTATE_SF_GlobalDepthOffsetClamp_bits  32
   73453 #define GEN7_3DSTATE_SF_GlobalDepthOffsetClamp_bits  32
   73454 #define GEN6_3DSTATE_SF_GlobalDepthOffsetClamp_bits  32
   73455 
   73456 static inline uint32_t ATTRIBUTE_PURE
   73457 _3DSTATE_SF_GlobalDepthOffsetClamp_bits(const struct gen_device_info *devinfo)
   73458 {
   73459    switch (devinfo->gen) {
   73460    case 10: return 0;
   73461    case 9: return 0;
   73462    case 8: return 0;
   73463    case 7:
   73464       if (devinfo->is_haswell) {
   73465          return 32;
   73466       } else {
   73467          return 32;
   73468       }
   73469    case 6: return 32;
   73470    case 5: return 0;
   73471    case 4:
   73472       if (devinfo->is_g4x) {
   73473          return 0;
   73474       } else {
   73475          return 0;
   73476       }
   73477    default:
   73478       unreachable("Invalid hardware generation");
   73479    }
   73480 }
   73481 
   73482 
   73483 
   73484 #define GEN75_3DSTATE_SF_GlobalDepthOffsetClamp_start  192
   73485 #define GEN7_3DSTATE_SF_GlobalDepthOffsetClamp_start  192
   73486 #define GEN6_3DSTATE_SF_GlobalDepthOffsetClamp_start  224
   73487 
   73488 static inline uint32_t ATTRIBUTE_PURE
   73489 _3DSTATE_SF_GlobalDepthOffsetClamp_start(const struct gen_device_info *devinfo)
   73490 {
   73491    switch (devinfo->gen) {
   73492    case 10: return 0;
   73493    case 9: return 0;
   73494    case 8: return 0;
   73495    case 7:
   73496       if (devinfo->is_haswell) {
   73497          return 192;
   73498       } else {
   73499          return 192;
   73500       }
   73501    case 6: return 224;
   73502    case 5: return 0;
   73503    case 4:
   73504       if (devinfo->is_g4x) {
   73505          return 0;
   73506       } else {
   73507          return 0;
   73508       }
   73509    default:
   73510       unreachable("Invalid hardware generation");
   73511    }
   73512 }
   73513 
   73514 
   73515 
   73516 /* 3DSTATE_SF::Global Depth Offset Constant */
   73517 
   73518 
   73519 #define GEN75_3DSTATE_SF_GlobalDepthOffsetConstant_bits  32
   73520 #define GEN7_3DSTATE_SF_GlobalDepthOffsetConstant_bits  32
   73521 #define GEN6_3DSTATE_SF_GlobalDepthOffsetConstant_bits  32
   73522 
   73523 static inline uint32_t ATTRIBUTE_PURE
   73524 _3DSTATE_SF_GlobalDepthOffsetConstant_bits(const struct gen_device_info *devinfo)
   73525 {
   73526    switch (devinfo->gen) {
   73527    case 10: return 0;
   73528    case 9: return 0;
   73529    case 8: return 0;
   73530    case 7:
   73531       if (devinfo->is_haswell) {
   73532          return 32;
   73533       } else {
   73534          return 32;
   73535       }
   73536    case 6: return 32;
   73537    case 5: return 0;
   73538    case 4:
   73539       if (devinfo->is_g4x) {
   73540          return 0;
   73541       } else {
   73542          return 0;
   73543       }
   73544    default:
   73545       unreachable("Invalid hardware generation");
   73546    }
   73547 }
   73548 
   73549 
   73550 
   73551 #define GEN75_3DSTATE_SF_GlobalDepthOffsetConstant_start  128
   73552 #define GEN7_3DSTATE_SF_GlobalDepthOffsetConstant_start  128
   73553 #define GEN6_3DSTATE_SF_GlobalDepthOffsetConstant_start  160
   73554 
   73555 static inline uint32_t ATTRIBUTE_PURE
   73556 _3DSTATE_SF_GlobalDepthOffsetConstant_start(const struct gen_device_info *devinfo)
   73557 {
   73558    switch (devinfo->gen) {
   73559    case 10: return 0;
   73560    case 9: return 0;
   73561    case 8: return 0;
   73562    case 7:
   73563       if (devinfo->is_haswell) {
   73564          return 128;
   73565       } else {
   73566          return 128;
   73567       }
   73568    case 6: return 160;
   73569    case 5: return 0;
   73570    case 4:
   73571       if (devinfo->is_g4x) {
   73572          return 0;
   73573       } else {
   73574          return 0;
   73575       }
   73576    default:
   73577       unreachable("Invalid hardware generation");
   73578    }
   73579 }
   73580 
   73581 
   73582 
   73583 /* 3DSTATE_SF::Global Depth Offset Enable Point */
   73584 
   73585 
   73586 #define GEN75_3DSTATE_SF_GlobalDepthOffsetEnablePoint_bits  1
   73587 #define GEN7_3DSTATE_SF_GlobalDepthOffsetEnablePoint_bits  1
   73588 #define GEN6_3DSTATE_SF_GlobalDepthOffsetEnablePoint_bits  1
   73589 
   73590 static inline uint32_t ATTRIBUTE_PURE
   73591 _3DSTATE_SF_GlobalDepthOffsetEnablePoint_bits(const struct gen_device_info *devinfo)
   73592 {
   73593    switch (devinfo->gen) {
   73594    case 10: return 0;
   73595    case 9: return 0;
   73596    case 8: return 0;
   73597    case 7:
   73598       if (devinfo->is_haswell) {
   73599          return 1;
   73600       } else {
   73601          return 1;
   73602       }
   73603    case 6: return 1;
   73604    case 5: return 0;
   73605    case 4:
   73606       if (devinfo->is_g4x) {
   73607          return 0;
   73608       } else {
   73609          return 0;
   73610       }
   73611    default:
   73612       unreachable("Invalid hardware generation");
   73613    }
   73614 }
   73615 
   73616 
   73617 
   73618 #define GEN75_3DSTATE_SF_GlobalDepthOffsetEnablePoint_start  39
   73619 #define GEN7_3DSTATE_SF_GlobalDepthOffsetEnablePoint_start  39
   73620 #define GEN6_3DSTATE_SF_GlobalDepthOffsetEnablePoint_start  71
   73621 
   73622 static inline uint32_t ATTRIBUTE_PURE
   73623 _3DSTATE_SF_GlobalDepthOffsetEnablePoint_start(const struct gen_device_info *devinfo)
   73624 {
   73625    switch (devinfo->gen) {
   73626    case 10: return 0;
   73627    case 9: return 0;
   73628    case 8: return 0;
   73629    case 7:
   73630       if (devinfo->is_haswell) {
   73631          return 39;
   73632       } else {
   73633          return 39;
   73634       }
   73635    case 6: return 71;
   73636    case 5: return 0;
   73637    case 4:
   73638       if (devinfo->is_g4x) {
   73639          return 0;
   73640       } else {
   73641          return 0;
   73642       }
   73643    default:
   73644       unreachable("Invalid hardware generation");
   73645    }
   73646 }
   73647 
   73648 
   73649 
   73650 /* 3DSTATE_SF::Global Depth Offset Enable Solid */
   73651 
   73652 
   73653 #define GEN75_3DSTATE_SF_GlobalDepthOffsetEnableSolid_bits  1
   73654 #define GEN7_3DSTATE_SF_GlobalDepthOffsetEnableSolid_bits  1
   73655 #define GEN6_3DSTATE_SF_GlobalDepthOffsetEnableSolid_bits  1
   73656 
   73657 static inline uint32_t ATTRIBUTE_PURE
   73658 _3DSTATE_SF_GlobalDepthOffsetEnableSolid_bits(const struct gen_device_info *devinfo)
   73659 {
   73660    switch (devinfo->gen) {
   73661    case 10: return 0;
   73662    case 9: return 0;
   73663    case 8: return 0;
   73664    case 7:
   73665       if (devinfo->is_haswell) {
   73666          return 1;
   73667       } else {
   73668          return 1;
   73669       }
   73670    case 6: return 1;
   73671    case 5: return 0;
   73672    case 4:
   73673       if (devinfo->is_g4x) {
   73674          return 0;
   73675       } else {
   73676          return 0;
   73677       }
   73678    default:
   73679       unreachable("Invalid hardware generation");
   73680    }
   73681 }
   73682 
   73683 
   73684 
   73685 #define GEN75_3DSTATE_SF_GlobalDepthOffsetEnableSolid_start  41
   73686 #define GEN7_3DSTATE_SF_GlobalDepthOffsetEnableSolid_start  41
   73687 #define GEN6_3DSTATE_SF_GlobalDepthOffsetEnableSolid_start  73
   73688 
   73689 static inline uint32_t ATTRIBUTE_PURE
   73690 _3DSTATE_SF_GlobalDepthOffsetEnableSolid_start(const struct gen_device_info *devinfo)
   73691 {
   73692    switch (devinfo->gen) {
   73693    case 10: return 0;
   73694    case 9: return 0;
   73695    case 8: return 0;
   73696    case 7:
   73697       if (devinfo->is_haswell) {
   73698          return 41;
   73699       } else {
   73700          return 41;
   73701       }
   73702    case 6: return 73;
   73703    case 5: return 0;
   73704    case 4:
   73705       if (devinfo->is_g4x) {
   73706          return 0;
   73707       } else {
   73708          return 0;
   73709       }
   73710    default:
   73711       unreachable("Invalid hardware generation");
   73712    }
   73713 }
   73714 
   73715 
   73716 
   73717 /* 3DSTATE_SF::Global Depth Offset Enable Wireframe */
   73718 
   73719 
   73720 #define GEN75_3DSTATE_SF_GlobalDepthOffsetEnableWireframe_bits  1
   73721 #define GEN7_3DSTATE_SF_GlobalDepthOffsetEnableWireframe_bits  1
   73722 #define GEN6_3DSTATE_SF_GlobalDepthOffsetEnableWireframe_bits  1
   73723 
   73724 static inline uint32_t ATTRIBUTE_PURE
   73725 _3DSTATE_SF_GlobalDepthOffsetEnableWireframe_bits(const struct gen_device_info *devinfo)
   73726 {
   73727    switch (devinfo->gen) {
   73728    case 10: return 0;
   73729    case 9: return 0;
   73730    case 8: return 0;
   73731    case 7:
   73732       if (devinfo->is_haswell) {
   73733          return 1;
   73734       } else {
   73735          return 1;
   73736       }
   73737    case 6: return 1;
   73738    case 5: return 0;
   73739    case 4:
   73740       if (devinfo->is_g4x) {
   73741          return 0;
   73742       } else {
   73743          return 0;
   73744       }
   73745    default:
   73746       unreachable("Invalid hardware generation");
   73747    }
   73748 }
   73749 
   73750 
   73751 
   73752 #define GEN75_3DSTATE_SF_GlobalDepthOffsetEnableWireframe_start  40
   73753 #define GEN7_3DSTATE_SF_GlobalDepthOffsetEnableWireframe_start  40
   73754 #define GEN6_3DSTATE_SF_GlobalDepthOffsetEnableWireframe_start  72
   73755 
   73756 static inline uint32_t ATTRIBUTE_PURE
   73757 _3DSTATE_SF_GlobalDepthOffsetEnableWireframe_start(const struct gen_device_info *devinfo)
   73758 {
   73759    switch (devinfo->gen) {
   73760    case 10: return 0;
   73761    case 9: return 0;
   73762    case 8: return 0;
   73763    case 7:
   73764       if (devinfo->is_haswell) {
   73765          return 40;
   73766       } else {
   73767          return 40;
   73768       }
   73769    case 6: return 72;
   73770    case 5: return 0;
   73771    case 4:
   73772       if (devinfo->is_g4x) {
   73773          return 0;
   73774       } else {
   73775          return 0;
   73776       }
   73777    default:
   73778       unreachable("Invalid hardware generation");
   73779    }
   73780 }
   73781 
   73782 
   73783 
   73784 /* 3DSTATE_SF::Global Depth Offset Scale */
   73785 
   73786 
   73787 #define GEN75_3DSTATE_SF_GlobalDepthOffsetScale_bits  32
   73788 #define GEN7_3DSTATE_SF_GlobalDepthOffsetScale_bits  32
   73789 #define GEN6_3DSTATE_SF_GlobalDepthOffsetScale_bits  32
   73790 
   73791 static inline uint32_t ATTRIBUTE_PURE
   73792 _3DSTATE_SF_GlobalDepthOffsetScale_bits(const struct gen_device_info *devinfo)
   73793 {
   73794    switch (devinfo->gen) {
   73795    case 10: return 0;
   73796    case 9: return 0;
   73797    case 8: return 0;
   73798    case 7:
   73799       if (devinfo->is_haswell) {
   73800          return 32;
   73801       } else {
   73802          return 32;
   73803       }
   73804    case 6: return 32;
   73805    case 5: return 0;
   73806    case 4:
   73807       if (devinfo->is_g4x) {
   73808          return 0;
   73809       } else {
   73810          return 0;
   73811       }
   73812    default:
   73813       unreachable("Invalid hardware generation");
   73814    }
   73815 }
   73816 
   73817 
   73818 
   73819 #define GEN75_3DSTATE_SF_GlobalDepthOffsetScale_start  160
   73820 #define GEN7_3DSTATE_SF_GlobalDepthOffsetScale_start  160
   73821 #define GEN6_3DSTATE_SF_GlobalDepthOffsetScale_start  192
   73822 
   73823 static inline uint32_t ATTRIBUTE_PURE
   73824 _3DSTATE_SF_GlobalDepthOffsetScale_start(const struct gen_device_info *devinfo)
   73825 {
   73826    switch (devinfo->gen) {
   73827    case 10: return 0;
   73828    case 9: return 0;
   73829    case 8: return 0;
   73830    case 7:
   73831       if (devinfo->is_haswell) {
   73832          return 160;
   73833       } else {
   73834          return 160;
   73835       }
   73836    case 6: return 192;
   73837    case 5: return 0;
   73838    case 4:
   73839       if (devinfo->is_g4x) {
   73840          return 0;
   73841       } else {
   73842          return 0;
   73843       }
   73844    default:
   73845       unreachable("Invalid hardware generation");
   73846    }
   73847 }
   73848 
   73849 
   73850 
   73851 /* 3DSTATE_SF::Last Pixel Enable */
   73852 
   73853 
   73854 #define GEN10_3DSTATE_SF_LastPixelEnable_bits  1
   73855 #define GEN9_3DSTATE_SF_LastPixelEnable_bits  1
   73856 #define GEN8_3DSTATE_SF_LastPixelEnable_bits  1
   73857 #define GEN75_3DSTATE_SF_LastPixelEnable_bits  1
   73858 #define GEN7_3DSTATE_SF_LastPixelEnable_bits  1
   73859 #define GEN6_3DSTATE_SF_LastPixelEnable_bits  1
   73860 
   73861 static inline uint32_t ATTRIBUTE_PURE
   73862 _3DSTATE_SF_LastPixelEnable_bits(const struct gen_device_info *devinfo)
   73863 {
   73864    switch (devinfo->gen) {
   73865    case 10: return 1;
   73866    case 9: return 1;
   73867    case 8: return 1;
   73868    case 7:
   73869       if (devinfo->is_haswell) {
   73870          return 1;
   73871       } else {
   73872          return 1;
   73873       }
   73874    case 6: return 1;
   73875    case 5: return 0;
   73876    case 4:
   73877       if (devinfo->is_g4x) {
   73878          return 0;
   73879       } else {
   73880          return 0;
   73881       }
   73882    default:
   73883       unreachable("Invalid hardware generation");
   73884    }
   73885 }
   73886 
   73887 
   73888 
   73889 #define GEN10_3DSTATE_SF_LastPixelEnable_start  127
   73890 #define GEN9_3DSTATE_SF_LastPixelEnable_start  127
   73891 #define GEN8_3DSTATE_SF_LastPixelEnable_start  127
   73892 #define GEN75_3DSTATE_SF_LastPixelEnable_start  127
   73893 #define GEN7_3DSTATE_SF_LastPixelEnable_start  127
   73894 #define GEN6_3DSTATE_SF_LastPixelEnable_start  159
   73895 
   73896 static inline uint32_t ATTRIBUTE_PURE
   73897 _3DSTATE_SF_LastPixelEnable_start(const struct gen_device_info *devinfo)
   73898 {
   73899    switch (devinfo->gen) {
   73900    case 10: return 127;
   73901    case 9: return 127;
   73902    case 8: return 127;
   73903    case 7:
   73904       if (devinfo->is_haswell) {
   73905          return 127;
   73906       } else {
   73907          return 127;
   73908       }
   73909    case 6: return 159;
   73910    case 5: return 0;
   73911    case 4:
   73912       if (devinfo->is_g4x) {
   73913          return 0;
   73914       } else {
   73915          return 0;
   73916       }
   73917    default:
   73918       unreachable("Invalid hardware generation");
   73919    }
   73920 }
   73921 
   73922 
   73923 
   73924 /* 3DSTATE_SF::Legacy Global Depth Bias Enable */
   73925 
   73926 
   73927 #define GEN10_3DSTATE_SF_LegacyGlobalDepthBiasEnable_bits  1
   73928 #define GEN9_3DSTATE_SF_LegacyGlobalDepthBiasEnable_bits  1
   73929 #define GEN8_3DSTATE_SF_LegacyGlobalDepthBiasEnable_bits  1
   73930 #define GEN75_3DSTATE_SF_LegacyGlobalDepthBiasEnable_bits  1
   73931 #define GEN7_3DSTATE_SF_LegacyGlobalDepthBiasEnable_bits  1
   73932 #define GEN6_3DSTATE_SF_LegacyGlobalDepthBiasEnable_bits  1
   73933 
   73934 static inline uint32_t ATTRIBUTE_PURE
   73935 _3DSTATE_SF_LegacyGlobalDepthBiasEnable_bits(const struct gen_device_info *devinfo)
   73936 {
   73937    switch (devinfo->gen) {
   73938    case 10: return 1;
   73939    case 9: return 1;
   73940    case 8: return 1;
   73941    case 7:
   73942       if (devinfo->is_haswell) {
   73943          return 1;
   73944       } else {
   73945          return 1;
   73946       }
   73947    case 6: return 1;
   73948    case 5: return 0;
   73949    case 4:
   73950       if (devinfo->is_g4x) {
   73951          return 0;
   73952       } else {
   73953          return 0;
   73954       }
   73955    default:
   73956       unreachable("Invalid hardware generation");
   73957    }
   73958 }
   73959 
   73960 
   73961 
   73962 #define GEN10_3DSTATE_SF_LegacyGlobalDepthBiasEnable_start  43
   73963 #define GEN9_3DSTATE_SF_LegacyGlobalDepthBiasEnable_start  43
   73964 #define GEN8_3DSTATE_SF_LegacyGlobalDepthBiasEnable_start  43
   73965 #define GEN75_3DSTATE_SF_LegacyGlobalDepthBiasEnable_start  43
   73966 #define GEN7_3DSTATE_SF_LegacyGlobalDepthBiasEnable_start  43
   73967 #define GEN6_3DSTATE_SF_LegacyGlobalDepthBiasEnable_start  75
   73968 
   73969 static inline uint32_t ATTRIBUTE_PURE
   73970 _3DSTATE_SF_LegacyGlobalDepthBiasEnable_start(const struct gen_device_info *devinfo)
   73971 {
   73972    switch (devinfo->gen) {
   73973    case 10: return 43;
   73974    case 9: return 43;
   73975    case 8: return 43;
   73976    case 7:
   73977       if (devinfo->is_haswell) {
   73978          return 43;
   73979       } else {
   73980          return 43;
   73981       }
   73982    case 6: return 75;
   73983    case 5: return 0;
   73984    case 4:
   73985       if (devinfo->is_g4x) {
   73986          return 0;
   73987       } else {
   73988          return 0;
   73989       }
   73990    default:
   73991       unreachable("Invalid hardware generation");
   73992    }
   73993 }
   73994 
   73995 
   73996 
   73997 /* 3DSTATE_SF::Line End Cap Antialiasing Region Width */
   73998 
   73999 
   74000 #define GEN10_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_bits  2
   74001 #define GEN9_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_bits  2
   74002 #define GEN8_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_bits  2
   74003 #define GEN75_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_bits  2
   74004 #define GEN7_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_bits  2
   74005 #define GEN6_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_bits  2
   74006 
   74007 static inline uint32_t ATTRIBUTE_PURE
   74008 _3DSTATE_SF_LineEndCapAntialiasingRegionWidth_bits(const struct gen_device_info *devinfo)
   74009 {
   74010    switch (devinfo->gen) {
   74011    case 10: return 2;
   74012    case 9: return 2;
   74013    case 8: return 2;
   74014    case 7:
   74015       if (devinfo->is_haswell) {
   74016          return 2;
   74017       } else {
   74018          return 2;
   74019       }
   74020    case 6: return 2;
   74021    case 5: return 0;
   74022    case 4:
   74023       if (devinfo->is_g4x) {
   74024          return 0;
   74025       } else {
   74026          return 0;
   74027       }
   74028    default:
   74029       unreachable("Invalid hardware generation");
   74030    }
   74031 }
   74032 
   74033 
   74034 
   74035 #define GEN10_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_start  80
   74036 #define GEN9_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_start  80
   74037 #define GEN8_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_start  80
   74038 #define GEN75_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_start  80
   74039 #define GEN7_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_start  80
   74040 #define GEN6_3DSTATE_SF_LineEndCapAntialiasingRegionWidth_start  112
   74041 
   74042 static inline uint32_t ATTRIBUTE_PURE
   74043 _3DSTATE_SF_LineEndCapAntialiasingRegionWidth_start(const struct gen_device_info *devinfo)
   74044 {
   74045    switch (devinfo->gen) {
   74046    case 10: return 80;
   74047    case 9: return 80;
   74048    case 8: return 80;
   74049    case 7:
   74050       if (devinfo->is_haswell) {
   74051          return 80;
   74052       } else {
   74053          return 80;
   74054       }
   74055    case 6: return 112;
   74056    case 5: return 0;
   74057    case 4:
   74058       if (devinfo->is_g4x) {
   74059          return 0;
   74060       } else {
   74061          return 0;
   74062       }
   74063    default:
   74064       unreachable("Invalid hardware generation");
   74065    }
   74066 }
   74067 
   74068 
   74069 
   74070 /* 3DSTATE_SF::Line Stipple Enable */
   74071 
   74072 
   74073 #define GEN75_3DSTATE_SF_LineStippleEnable_bits  1
   74074 
   74075 static inline uint32_t ATTRIBUTE_PURE
   74076 _3DSTATE_SF_LineStippleEnable_bits(const struct gen_device_info *devinfo)
   74077 {
   74078    switch (devinfo->gen) {
   74079    case 10: return 0;
   74080    case 9: return 0;
   74081    case 8: return 0;
   74082    case 7:
   74083       if (devinfo->is_haswell) {
   74084          return 1;
   74085       } else {
   74086          return 0;
   74087       }
   74088    case 6: return 0;
   74089    case 5: return 0;
   74090    case 4:
   74091       if (devinfo->is_g4x) {
   74092          return 0;
   74093       } else {
   74094          return 0;
   74095       }
   74096    default:
   74097       unreachable("Invalid hardware generation");
   74098    }
   74099 }
   74100 
   74101 
   74102 
   74103 #define GEN75_3DSTATE_SF_LineStippleEnable_start  78
   74104 
   74105 static inline uint32_t ATTRIBUTE_PURE
   74106 _3DSTATE_SF_LineStippleEnable_start(const struct gen_device_info *devinfo)
   74107 {
   74108    switch (devinfo->gen) {
   74109    case 10: return 0;
   74110    case 9: return 0;
   74111    case 8: return 0;
   74112    case 7:
   74113       if (devinfo->is_haswell) {
   74114          return 78;
   74115       } else {
   74116          return 0;
   74117       }
   74118    case 6: return 0;
   74119    case 5: return 0;
   74120    case 4:
   74121       if (devinfo->is_g4x) {
   74122          return 0;
   74123       } else {
   74124          return 0;
   74125       }
   74126    default:
   74127       unreachable("Invalid hardware generation");
   74128    }
   74129 }
   74130 
   74131 
   74132 
   74133 /* 3DSTATE_SF::Line Strip/List Provoking Vertex Select */
   74134 
   74135 
   74136 #define GEN10_3DSTATE_SF_LineStripListProvokingVertexSelect_bits  2
   74137 #define GEN9_3DSTATE_SF_LineStripListProvokingVertexSelect_bits  2
   74138 #define GEN8_3DSTATE_SF_LineStripListProvokingVertexSelect_bits  2
   74139 #define GEN75_3DSTATE_SF_LineStripListProvokingVertexSelect_bits  2
   74140 #define GEN7_3DSTATE_SF_LineStripListProvokingVertexSelect_bits  2
   74141 #define GEN6_3DSTATE_SF_LineStripListProvokingVertexSelect_bits  2
   74142 
   74143 static inline uint32_t ATTRIBUTE_PURE
   74144 _3DSTATE_SF_LineStripListProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   74145 {
   74146    switch (devinfo->gen) {
   74147    case 10: return 2;
   74148    case 9: return 2;
   74149    case 8: return 2;
   74150    case 7:
   74151       if (devinfo->is_haswell) {
   74152          return 2;
   74153       } else {
   74154          return 2;
   74155       }
   74156    case 6: return 2;
   74157    case 5: return 0;
   74158    case 4:
   74159       if (devinfo->is_g4x) {
   74160          return 0;
   74161       } else {
   74162          return 0;
   74163       }
   74164    default:
   74165       unreachable("Invalid hardware generation");
   74166    }
   74167 }
   74168 
   74169 
   74170 
   74171 #define GEN10_3DSTATE_SF_LineStripListProvokingVertexSelect_start  123
   74172 #define GEN9_3DSTATE_SF_LineStripListProvokingVertexSelect_start  123
   74173 #define GEN8_3DSTATE_SF_LineStripListProvokingVertexSelect_start  123
   74174 #define GEN75_3DSTATE_SF_LineStripListProvokingVertexSelect_start  123
   74175 #define GEN7_3DSTATE_SF_LineStripListProvokingVertexSelect_start  123
   74176 #define GEN6_3DSTATE_SF_LineStripListProvokingVertexSelect_start  155
   74177 
   74178 static inline uint32_t ATTRIBUTE_PURE
   74179 _3DSTATE_SF_LineStripListProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   74180 {
   74181    switch (devinfo->gen) {
   74182    case 10: return 123;
   74183    case 9: return 123;
   74184    case 8: return 123;
   74185    case 7:
   74186       if (devinfo->is_haswell) {
   74187          return 123;
   74188       } else {
   74189          return 123;
   74190       }
   74191    case 6: return 155;
   74192    case 5: return 0;
   74193    case 4:
   74194       if (devinfo->is_g4x) {
   74195          return 0;
   74196       } else {
   74197          return 0;
   74198       }
   74199    default:
   74200       unreachable("Invalid hardware generation");
   74201    }
   74202 }
   74203 
   74204 
   74205 
   74206 /* 3DSTATE_SF::Line Width */
   74207 
   74208 
   74209 #define GEN10_3DSTATE_SF_LineWidth_bits  18
   74210 #define GEN9_3DSTATE_SF_LineWidth_bits  18
   74211 #define GEN8_3DSTATE_SF_LineWidth_bits  10
   74212 #define GEN75_3DSTATE_SF_LineWidth_bits  10
   74213 #define GEN7_3DSTATE_SF_LineWidth_bits  10
   74214 #define GEN6_3DSTATE_SF_LineWidth_bits  10
   74215 
   74216 static inline uint32_t ATTRIBUTE_PURE
   74217 _3DSTATE_SF_LineWidth_bits(const struct gen_device_info *devinfo)
   74218 {
   74219    switch (devinfo->gen) {
   74220    case 10: return 18;
   74221    case 9: return 18;
   74222    case 8: return 10;
   74223    case 7:
   74224       if (devinfo->is_haswell) {
   74225          return 10;
   74226       } else {
   74227          return 10;
   74228       }
   74229    case 6: return 10;
   74230    case 5: return 0;
   74231    case 4:
   74232       if (devinfo->is_g4x) {
   74233          return 0;
   74234       } else {
   74235          return 0;
   74236       }
   74237    default:
   74238       unreachable("Invalid hardware generation");
   74239    }
   74240 }
   74241 
   74242 
   74243 
   74244 #define GEN10_3DSTATE_SF_LineWidth_start  44
   74245 #define GEN9_3DSTATE_SF_LineWidth_start  44
   74246 #define GEN8_3DSTATE_SF_LineWidth_start  82
   74247 #define GEN75_3DSTATE_SF_LineWidth_start  82
   74248 #define GEN7_3DSTATE_SF_LineWidth_start  82
   74249 #define GEN6_3DSTATE_SF_LineWidth_start  114
   74250 
   74251 static inline uint32_t ATTRIBUTE_PURE
   74252 _3DSTATE_SF_LineWidth_start(const struct gen_device_info *devinfo)
   74253 {
   74254    switch (devinfo->gen) {
   74255    case 10: return 44;
   74256    case 9: return 44;
   74257    case 8: return 82;
   74258    case 7:
   74259       if (devinfo->is_haswell) {
   74260          return 82;
   74261       } else {
   74262          return 82;
   74263       }
   74264    case 6: return 114;
   74265    case 5: return 0;
   74266    case 4:
   74267       if (devinfo->is_g4x) {
   74268          return 0;
   74269       } else {
   74270          return 0;
   74271       }
   74272    default:
   74273       unreachable("Invalid hardware generation");
   74274    }
   74275 }
   74276 
   74277 
   74278 
   74279 /* 3DSTATE_SF::Multisample Rasterization Mode */
   74280 
   74281 
   74282 #define GEN75_3DSTATE_SF_MultisampleRasterizationMode_bits  2
   74283 #define GEN7_3DSTATE_SF_MultisampleRasterizationMode_bits  2
   74284 #define GEN6_3DSTATE_SF_MultisampleRasterizationMode_bits  2
   74285 
   74286 static inline uint32_t ATTRIBUTE_PURE
   74287 _3DSTATE_SF_MultisampleRasterizationMode_bits(const struct gen_device_info *devinfo)
   74288 {
   74289    switch (devinfo->gen) {
   74290    case 10: return 0;
   74291    case 9: return 0;
   74292    case 8: return 0;
   74293    case 7:
   74294       if (devinfo->is_haswell) {
   74295          return 2;
   74296       } else {
   74297          return 2;
   74298       }
   74299    case 6: return 2;
   74300    case 5: return 0;
   74301    case 4:
   74302       if (devinfo->is_g4x) {
   74303          return 0;
   74304       } else {
   74305          return 0;
   74306       }
   74307    default:
   74308       unreachable("Invalid hardware generation");
   74309    }
   74310 }
   74311 
   74312 
   74313 
   74314 #define GEN75_3DSTATE_SF_MultisampleRasterizationMode_start  72
   74315 #define GEN7_3DSTATE_SF_MultisampleRasterizationMode_start  72
   74316 #define GEN6_3DSTATE_SF_MultisampleRasterizationMode_start  104
   74317 
   74318 static inline uint32_t ATTRIBUTE_PURE
   74319 _3DSTATE_SF_MultisampleRasterizationMode_start(const struct gen_device_info *devinfo)
   74320 {
   74321    switch (devinfo->gen) {
   74322    case 10: return 0;
   74323    case 9: return 0;
   74324    case 8: return 0;
   74325    case 7:
   74326       if (devinfo->is_haswell) {
   74327          return 72;
   74328       } else {
   74329          return 72;
   74330       }
   74331    case 6: return 104;
   74332    case 5: return 0;
   74333    case 4:
   74334       if (devinfo->is_g4x) {
   74335          return 0;
   74336       } else {
   74337          return 0;
   74338       }
   74339    default:
   74340       unreachable("Invalid hardware generation");
   74341    }
   74342 }
   74343 
   74344 
   74345 
   74346 /* 3DSTATE_SF::Number of SF Output Attributes */
   74347 
   74348 
   74349 #define GEN6_3DSTATE_SF_NumberofSFOutputAttributes_bits  6
   74350 
   74351 static inline uint32_t ATTRIBUTE_PURE
   74352 _3DSTATE_SF_NumberofSFOutputAttributes_bits(const struct gen_device_info *devinfo)
   74353 {
   74354    switch (devinfo->gen) {
   74355    case 10: return 0;
   74356    case 9: return 0;
   74357    case 8: return 0;
   74358    case 7:
   74359       if (devinfo->is_haswell) {
   74360          return 0;
   74361       } else {
   74362          return 0;
   74363       }
   74364    case 6: return 6;
   74365    case 5: return 0;
   74366    case 4:
   74367       if (devinfo->is_g4x) {
   74368          return 0;
   74369       } else {
   74370          return 0;
   74371       }
   74372    default:
   74373       unreachable("Invalid hardware generation");
   74374    }
   74375 }
   74376 
   74377 
   74378 
   74379 #define GEN6_3DSTATE_SF_NumberofSFOutputAttributes_start  54
   74380 
   74381 static inline uint32_t ATTRIBUTE_PURE
   74382 _3DSTATE_SF_NumberofSFOutputAttributes_start(const struct gen_device_info *devinfo)
   74383 {
   74384    switch (devinfo->gen) {
   74385    case 10: return 0;
   74386    case 9: return 0;
   74387    case 8: return 0;
   74388    case 7:
   74389       if (devinfo->is_haswell) {
   74390          return 0;
   74391       } else {
   74392          return 0;
   74393       }
   74394    case 6: return 54;
   74395    case 5: return 0;
   74396    case 4:
   74397       if (devinfo->is_g4x) {
   74398          return 0;
   74399       } else {
   74400          return 0;
   74401       }
   74402    default:
   74403       unreachable("Invalid hardware generation");
   74404    }
   74405 }
   74406 
   74407 
   74408 
   74409 /* 3DSTATE_SF::Point Sprite Texture Coordinate Enable */
   74410 
   74411 
   74412 #define GEN6_3DSTATE_SF_PointSpriteTextureCoordinateEnable_bits  32
   74413 
   74414 static inline uint32_t ATTRIBUTE_PURE
   74415 _3DSTATE_SF_PointSpriteTextureCoordinateEnable_bits(const struct gen_device_info *devinfo)
   74416 {
   74417    switch (devinfo->gen) {
   74418    case 10: return 0;
   74419    case 9: return 0;
   74420    case 8: return 0;
   74421    case 7:
   74422       if (devinfo->is_haswell) {
   74423          return 0;
   74424       } else {
   74425          return 0;
   74426       }
   74427    case 6: return 32;
   74428    case 5: return 0;
   74429    case 4:
   74430       if (devinfo->is_g4x) {
   74431          return 0;
   74432       } else {
   74433          return 0;
   74434       }
   74435    default:
   74436       unreachable("Invalid hardware generation");
   74437    }
   74438 }
   74439 
   74440 
   74441 
   74442 #define GEN6_3DSTATE_SF_PointSpriteTextureCoordinateEnable_start  512
   74443 
   74444 static inline uint32_t ATTRIBUTE_PURE
   74445 _3DSTATE_SF_PointSpriteTextureCoordinateEnable_start(const struct gen_device_info *devinfo)
   74446 {
   74447    switch (devinfo->gen) {
   74448    case 10: return 0;
   74449    case 9: return 0;
   74450    case 8: return 0;
   74451    case 7:
   74452       if (devinfo->is_haswell) {
   74453          return 0;
   74454       } else {
   74455          return 0;
   74456       }
   74457    case 6: return 512;
   74458    case 5: return 0;
   74459    case 4:
   74460       if (devinfo->is_g4x) {
   74461          return 0;
   74462       } else {
   74463          return 0;
   74464       }
   74465    default:
   74466       unreachable("Invalid hardware generation");
   74467    }
   74468 }
   74469 
   74470 
   74471 
   74472 /* 3DSTATE_SF::Point Sprite Texture Coordinate Origin */
   74473 
   74474 
   74475 #define GEN6_3DSTATE_SF_PointSpriteTextureCoordinateOrigin_bits  1
   74476 
   74477 static inline uint32_t ATTRIBUTE_PURE
   74478 _3DSTATE_SF_PointSpriteTextureCoordinateOrigin_bits(const struct gen_device_info *devinfo)
   74479 {
   74480    switch (devinfo->gen) {
   74481    case 10: return 0;
   74482    case 9: return 0;
   74483    case 8: return 0;
   74484    case 7:
   74485       if (devinfo->is_haswell) {
   74486          return 0;
   74487       } else {
   74488          return 0;
   74489       }
   74490    case 6: return 1;
   74491    case 5: return 0;
   74492    case 4:
   74493       if (devinfo->is_g4x) {
   74494          return 0;
   74495       } else {
   74496          return 0;
   74497       }
   74498    default:
   74499       unreachable("Invalid hardware generation");
   74500    }
   74501 }
   74502 
   74503 
   74504 
   74505 #define GEN6_3DSTATE_SF_PointSpriteTextureCoordinateOrigin_start  52
   74506 
   74507 static inline uint32_t ATTRIBUTE_PURE
   74508 _3DSTATE_SF_PointSpriteTextureCoordinateOrigin_start(const struct gen_device_info *devinfo)
   74509 {
   74510    switch (devinfo->gen) {
   74511    case 10: return 0;
   74512    case 9: return 0;
   74513    case 8: return 0;
   74514    case 7:
   74515       if (devinfo->is_haswell) {
   74516          return 0;
   74517       } else {
   74518          return 0;
   74519       }
   74520    case 6: return 52;
   74521    case 5: return 0;
   74522    case 4:
   74523       if (devinfo->is_g4x) {
   74524          return 0;
   74525       } else {
   74526          return 0;
   74527       }
   74528    default:
   74529       unreachable("Invalid hardware generation");
   74530    }
   74531 }
   74532 
   74533 
   74534 
   74535 /* 3DSTATE_SF::Point Width */
   74536 
   74537 
   74538 #define GEN10_3DSTATE_SF_PointWidth_bits  11
   74539 #define GEN9_3DSTATE_SF_PointWidth_bits  11
   74540 #define GEN8_3DSTATE_SF_PointWidth_bits  11
   74541 #define GEN75_3DSTATE_SF_PointWidth_bits  11
   74542 #define GEN7_3DSTATE_SF_PointWidth_bits  11
   74543 #define GEN6_3DSTATE_SF_PointWidth_bits  11
   74544 
   74545 static inline uint32_t ATTRIBUTE_PURE
   74546 _3DSTATE_SF_PointWidth_bits(const struct gen_device_info *devinfo)
   74547 {
   74548    switch (devinfo->gen) {
   74549    case 10: return 11;
   74550    case 9: return 11;
   74551    case 8: return 11;
   74552    case 7:
   74553       if (devinfo->is_haswell) {
   74554          return 11;
   74555       } else {
   74556          return 11;
   74557       }
   74558    case 6: return 11;
   74559    case 5: return 0;
   74560    case 4:
   74561       if (devinfo->is_g4x) {
   74562          return 0;
   74563       } else {
   74564          return 0;
   74565       }
   74566    default:
   74567       unreachable("Invalid hardware generation");
   74568    }
   74569 }
   74570 
   74571 
   74572 
   74573 #define GEN10_3DSTATE_SF_PointWidth_start  96
   74574 #define GEN9_3DSTATE_SF_PointWidth_start  96
   74575 #define GEN8_3DSTATE_SF_PointWidth_start  96
   74576 #define GEN75_3DSTATE_SF_PointWidth_start  96
   74577 #define GEN7_3DSTATE_SF_PointWidth_start  96
   74578 #define GEN6_3DSTATE_SF_PointWidth_start  128
   74579 
   74580 static inline uint32_t ATTRIBUTE_PURE
   74581 _3DSTATE_SF_PointWidth_start(const struct gen_device_info *devinfo)
   74582 {
   74583    switch (devinfo->gen) {
   74584    case 10: return 96;
   74585    case 9: return 96;
   74586    case 8: return 96;
   74587    case 7:
   74588       if (devinfo->is_haswell) {
   74589          return 96;
   74590       } else {
   74591          return 96;
   74592       }
   74593    case 6: return 128;
   74594    case 5: return 0;
   74595    case 4:
   74596       if (devinfo->is_g4x) {
   74597          return 0;
   74598       } else {
   74599          return 0;
   74600       }
   74601    default:
   74602       unreachable("Invalid hardware generation");
   74603    }
   74604 }
   74605 
   74606 
   74607 
   74608 /* 3DSTATE_SF::Point Width Source */
   74609 
   74610 
   74611 #define GEN10_3DSTATE_SF_PointWidthSource_bits  1
   74612 #define GEN9_3DSTATE_SF_PointWidthSource_bits  1
   74613 #define GEN8_3DSTATE_SF_PointWidthSource_bits  1
   74614 #define GEN75_3DSTATE_SF_PointWidthSource_bits  1
   74615 #define GEN7_3DSTATE_SF_PointWidthSource_bits  1
   74616 #define GEN6_3DSTATE_SF_PointWidthSource_bits  1
   74617 
   74618 static inline uint32_t ATTRIBUTE_PURE
   74619 _3DSTATE_SF_PointWidthSource_bits(const struct gen_device_info *devinfo)
   74620 {
   74621    switch (devinfo->gen) {
   74622    case 10: return 1;
   74623    case 9: return 1;
   74624    case 8: return 1;
   74625    case 7:
   74626       if (devinfo->is_haswell) {
   74627          return 1;
   74628       } else {
   74629          return 1;
   74630       }
   74631    case 6: return 1;
   74632    case 5: return 0;
   74633    case 4:
   74634       if (devinfo->is_g4x) {
   74635          return 0;
   74636       } else {
   74637          return 0;
   74638       }
   74639    default:
   74640       unreachable("Invalid hardware generation");
   74641    }
   74642 }
   74643 
   74644 
   74645 
   74646 #define GEN10_3DSTATE_SF_PointWidthSource_start  107
   74647 #define GEN9_3DSTATE_SF_PointWidthSource_start  107
   74648 #define GEN8_3DSTATE_SF_PointWidthSource_start  107
   74649 #define GEN75_3DSTATE_SF_PointWidthSource_start  107
   74650 #define GEN7_3DSTATE_SF_PointWidthSource_start  107
   74651 #define GEN6_3DSTATE_SF_PointWidthSource_start  139
   74652 
   74653 static inline uint32_t ATTRIBUTE_PURE
   74654 _3DSTATE_SF_PointWidthSource_start(const struct gen_device_info *devinfo)
   74655 {
   74656    switch (devinfo->gen) {
   74657    case 10: return 107;
   74658    case 9: return 107;
   74659    case 8: return 107;
   74660    case 7:
   74661       if (devinfo->is_haswell) {
   74662          return 107;
   74663       } else {
   74664          return 107;
   74665       }
   74666    case 6: return 139;
   74667    case 5: return 0;
   74668    case 4:
   74669       if (devinfo->is_g4x) {
   74670          return 0;
   74671       } else {
   74672          return 0;
   74673       }
   74674    default:
   74675       unreachable("Invalid hardware generation");
   74676    }
   74677 }
   74678 
   74679 
   74680 
   74681 /* 3DSTATE_SF::RT Independent Rasterization Enable */
   74682 
   74683 
   74684 #define GEN75_3DSTATE_SF_RTIndependentRasterizationEnable_bits  1
   74685 
   74686 static inline uint32_t ATTRIBUTE_PURE
   74687 _3DSTATE_SF_RTIndependentRasterizationEnable_bits(const struct gen_device_info *devinfo)
   74688 {
   74689    switch (devinfo->gen) {
   74690    case 10: return 0;
   74691    case 9: return 0;
   74692    case 8: return 0;
   74693    case 7:
   74694       if (devinfo->is_haswell) {
   74695          return 1;
   74696       } else {
   74697          return 0;
   74698       }
   74699    case 6: return 0;
   74700    case 5: return 0;
   74701    case 4:
   74702       if (devinfo->is_g4x) {
   74703          return 0;
   74704       } else {
   74705          return 0;
   74706       }
   74707    default:
   74708       unreachable("Invalid hardware generation");
   74709    }
   74710 }
   74711 
   74712 
   74713 
   74714 #define GEN75_3DSTATE_SF_RTIndependentRasterizationEnable_start  74
   74715 
   74716 static inline uint32_t ATTRIBUTE_PURE
   74717 _3DSTATE_SF_RTIndependentRasterizationEnable_start(const struct gen_device_info *devinfo)
   74718 {
   74719    switch (devinfo->gen) {
   74720    case 10: return 0;
   74721    case 9: return 0;
   74722    case 8: return 0;
   74723    case 7:
   74724       if (devinfo->is_haswell) {
   74725          return 74;
   74726       } else {
   74727          return 0;
   74728       }
   74729    case 6: return 0;
   74730    case 5: return 0;
   74731    case 4:
   74732       if (devinfo->is_g4x) {
   74733          return 0;
   74734       } else {
   74735          return 0;
   74736       }
   74737    default:
   74738       unreachable("Invalid hardware generation");
   74739    }
   74740 }
   74741 
   74742 
   74743 
   74744 /* 3DSTATE_SF::Scissor Rectangle Enable */
   74745 
   74746 
   74747 #define GEN75_3DSTATE_SF_ScissorRectangleEnable_bits  1
   74748 #define GEN7_3DSTATE_SF_ScissorRectangleEnable_bits  1
   74749 #define GEN6_3DSTATE_SF_ScissorRectangleEnable_bits  1
   74750 
   74751 static inline uint32_t ATTRIBUTE_PURE
   74752 _3DSTATE_SF_ScissorRectangleEnable_bits(const struct gen_device_info *devinfo)
   74753 {
   74754    switch (devinfo->gen) {
   74755    case 10: return 0;
   74756    case 9: return 0;
   74757    case 8: return 0;
   74758    case 7:
   74759       if (devinfo->is_haswell) {
   74760          return 1;
   74761       } else {
   74762          return 1;
   74763       }
   74764    case 6: return 1;
   74765    case 5: return 0;
   74766    case 4:
   74767       if (devinfo->is_g4x) {
   74768          return 0;
   74769       } else {
   74770          return 0;
   74771       }
   74772    default:
   74773       unreachable("Invalid hardware generation");
   74774    }
   74775 }
   74776 
   74777 
   74778 
   74779 #define GEN75_3DSTATE_SF_ScissorRectangleEnable_start  75
   74780 #define GEN7_3DSTATE_SF_ScissorRectangleEnable_start  75
   74781 #define GEN6_3DSTATE_SF_ScissorRectangleEnable_start  107
   74782 
   74783 static inline uint32_t ATTRIBUTE_PURE
   74784 _3DSTATE_SF_ScissorRectangleEnable_start(const struct gen_device_info *devinfo)
   74785 {
   74786    switch (devinfo->gen) {
   74787    case 10: return 0;
   74788    case 9: return 0;
   74789    case 8: return 0;
   74790    case 7:
   74791       if (devinfo->is_haswell) {
   74792          return 75;
   74793       } else {
   74794          return 75;
   74795       }
   74796    case 6: return 107;
   74797    case 5: return 0;
   74798    case 4:
   74799       if (devinfo->is_g4x) {
   74800          return 0;
   74801       } else {
   74802          return 0;
   74803       }
   74804    default:
   74805       unreachable("Invalid hardware generation");
   74806    }
   74807 }
   74808 
   74809 
   74810 
   74811 /* 3DSTATE_SF::Smooth Point Enable */
   74812 
   74813 
   74814 #define GEN10_3DSTATE_SF_SmoothPointEnable_bits  1
   74815 #define GEN9_3DSTATE_SF_SmoothPointEnable_bits  1
   74816 #define GEN8_3DSTATE_SF_SmoothPointEnable_bits  1
   74817 
   74818 static inline uint32_t ATTRIBUTE_PURE
   74819 _3DSTATE_SF_SmoothPointEnable_bits(const struct gen_device_info *devinfo)
   74820 {
   74821    switch (devinfo->gen) {
   74822    case 10: return 1;
   74823    case 9: return 1;
   74824    case 8: return 1;
   74825    case 7:
   74826       if (devinfo->is_haswell) {
   74827          return 0;
   74828       } else {
   74829          return 0;
   74830       }
   74831    case 6: return 0;
   74832    case 5: return 0;
   74833    case 4:
   74834       if (devinfo->is_g4x) {
   74835          return 0;
   74836       } else {
   74837          return 0;
   74838       }
   74839    default:
   74840       unreachable("Invalid hardware generation");
   74841    }
   74842 }
   74843 
   74844 
   74845 
   74846 #define GEN10_3DSTATE_SF_SmoothPointEnable_start  109
   74847 #define GEN9_3DSTATE_SF_SmoothPointEnable_start  109
   74848 #define GEN8_3DSTATE_SF_SmoothPointEnable_start  109
   74849 
   74850 static inline uint32_t ATTRIBUTE_PURE
   74851 _3DSTATE_SF_SmoothPointEnable_start(const struct gen_device_info *devinfo)
   74852 {
   74853    switch (devinfo->gen) {
   74854    case 10: return 109;
   74855    case 9: return 109;
   74856    case 8: return 109;
   74857    case 7:
   74858       if (devinfo->is_haswell) {
   74859          return 0;
   74860       } else {
   74861          return 0;
   74862       }
   74863    case 6: return 0;
   74864    case 5: return 0;
   74865    case 4:
   74866       if (devinfo->is_g4x) {
   74867          return 0;
   74868       } else {
   74869          return 0;
   74870       }
   74871    default:
   74872       unreachable("Invalid hardware generation");
   74873    }
   74874 }
   74875 
   74876 
   74877 
   74878 /* 3DSTATE_SF::Statistics Enable */
   74879 
   74880 
   74881 #define GEN10_3DSTATE_SF_StatisticsEnable_bits  1
   74882 #define GEN9_3DSTATE_SF_StatisticsEnable_bits  1
   74883 #define GEN8_3DSTATE_SF_StatisticsEnable_bits  1
   74884 #define GEN75_3DSTATE_SF_StatisticsEnable_bits  1
   74885 #define GEN7_3DSTATE_SF_StatisticsEnable_bits  1
   74886 #define GEN6_3DSTATE_SF_StatisticsEnable_bits  1
   74887 
   74888 static inline uint32_t ATTRIBUTE_PURE
   74889 _3DSTATE_SF_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   74890 {
   74891    switch (devinfo->gen) {
   74892    case 10: return 1;
   74893    case 9: return 1;
   74894    case 8: return 1;
   74895    case 7:
   74896       if (devinfo->is_haswell) {
   74897          return 1;
   74898       } else {
   74899          return 1;
   74900       }
   74901    case 6: return 1;
   74902    case 5: return 0;
   74903    case 4:
   74904       if (devinfo->is_g4x) {
   74905          return 0;
   74906       } else {
   74907          return 0;
   74908       }
   74909    default:
   74910       unreachable("Invalid hardware generation");
   74911    }
   74912 }
   74913 
   74914 
   74915 
   74916 #define GEN10_3DSTATE_SF_StatisticsEnable_start  42
   74917 #define GEN9_3DSTATE_SF_StatisticsEnable_start  42
   74918 #define GEN8_3DSTATE_SF_StatisticsEnable_start  42
   74919 #define GEN75_3DSTATE_SF_StatisticsEnable_start  42
   74920 #define GEN7_3DSTATE_SF_StatisticsEnable_start  42
   74921 #define GEN6_3DSTATE_SF_StatisticsEnable_start  74
   74922 
   74923 static inline uint32_t ATTRIBUTE_PURE
   74924 _3DSTATE_SF_StatisticsEnable_start(const struct gen_device_info *devinfo)
   74925 {
   74926    switch (devinfo->gen) {
   74927    case 10: return 42;
   74928    case 9: return 42;
   74929    case 8: return 42;
   74930    case 7:
   74931       if (devinfo->is_haswell) {
   74932          return 42;
   74933       } else {
   74934          return 42;
   74935       }
   74936    case 6: return 74;
   74937    case 5: return 0;
   74938    case 4:
   74939       if (devinfo->is_g4x) {
   74940          return 0;
   74941       } else {
   74942          return 0;
   74943       }
   74944    default:
   74945       unreachable("Invalid hardware generation");
   74946    }
   74947 }
   74948 
   74949 
   74950 
   74951 /* 3DSTATE_SF::Triangle Fan Provoking Vertex Select */
   74952 
   74953 
   74954 #define GEN10_3DSTATE_SF_TriangleFanProvokingVertexSelect_bits  2
   74955 #define GEN9_3DSTATE_SF_TriangleFanProvokingVertexSelect_bits  2
   74956 #define GEN8_3DSTATE_SF_TriangleFanProvokingVertexSelect_bits  2
   74957 #define GEN75_3DSTATE_SF_TriangleFanProvokingVertexSelect_bits  2
   74958 #define GEN7_3DSTATE_SF_TriangleFanProvokingVertexSelect_bits  2
   74959 #define GEN6_3DSTATE_SF_TriangleFanProvokingVertexSelect_bits  2
   74960 
   74961 static inline uint32_t ATTRIBUTE_PURE
   74962 _3DSTATE_SF_TriangleFanProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   74963 {
   74964    switch (devinfo->gen) {
   74965    case 10: return 2;
   74966    case 9: return 2;
   74967    case 8: return 2;
   74968    case 7:
   74969       if (devinfo->is_haswell) {
   74970          return 2;
   74971       } else {
   74972          return 2;
   74973       }
   74974    case 6: return 2;
   74975    case 5: return 0;
   74976    case 4:
   74977       if (devinfo->is_g4x) {
   74978          return 0;
   74979       } else {
   74980          return 0;
   74981       }
   74982    default:
   74983       unreachable("Invalid hardware generation");
   74984    }
   74985 }
   74986 
   74987 
   74988 
   74989 #define GEN10_3DSTATE_SF_TriangleFanProvokingVertexSelect_start  121
   74990 #define GEN9_3DSTATE_SF_TriangleFanProvokingVertexSelect_start  121
   74991 #define GEN8_3DSTATE_SF_TriangleFanProvokingVertexSelect_start  121
   74992 #define GEN75_3DSTATE_SF_TriangleFanProvokingVertexSelect_start  121
   74993 #define GEN7_3DSTATE_SF_TriangleFanProvokingVertexSelect_start  121
   74994 #define GEN6_3DSTATE_SF_TriangleFanProvokingVertexSelect_start  153
   74995 
   74996 static inline uint32_t ATTRIBUTE_PURE
   74997 _3DSTATE_SF_TriangleFanProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   74998 {
   74999    switch (devinfo->gen) {
   75000    case 10: return 121;
   75001    case 9: return 121;
   75002    case 8: return 121;
   75003    case 7:
   75004       if (devinfo->is_haswell) {
   75005          return 121;
   75006       } else {
   75007          return 121;
   75008       }
   75009    case 6: return 153;
   75010    case 5: return 0;
   75011    case 4:
   75012       if (devinfo->is_g4x) {
   75013          return 0;
   75014       } else {
   75015          return 0;
   75016       }
   75017    default:
   75018       unreachable("Invalid hardware generation");
   75019    }
   75020 }
   75021 
   75022 
   75023 
   75024 /* 3DSTATE_SF::Triangle Strip/List Provoking Vertex Select */
   75025 
   75026 
   75027 #define GEN10_3DSTATE_SF_TriangleStripListProvokingVertexSelect_bits  2
   75028 #define GEN9_3DSTATE_SF_TriangleStripListProvokingVertexSelect_bits  2
   75029 #define GEN8_3DSTATE_SF_TriangleStripListProvokingVertexSelect_bits  2
   75030 #define GEN75_3DSTATE_SF_TriangleStripListProvokingVertexSelect_bits  2
   75031 #define GEN7_3DSTATE_SF_TriangleStripListProvokingVertexSelect_bits  2
   75032 #define GEN6_3DSTATE_SF_TriangleStripListProvokingVertexSelect_bits  2
   75033 
   75034 static inline uint32_t ATTRIBUTE_PURE
   75035 _3DSTATE_SF_TriangleStripListProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   75036 {
   75037    switch (devinfo->gen) {
   75038    case 10: return 2;
   75039    case 9: return 2;
   75040    case 8: return 2;
   75041    case 7:
   75042       if (devinfo->is_haswell) {
   75043          return 2;
   75044       } else {
   75045          return 2;
   75046       }
   75047    case 6: return 2;
   75048    case 5: return 0;
   75049    case 4:
   75050       if (devinfo->is_g4x) {
   75051          return 0;
   75052       } else {
   75053          return 0;
   75054       }
   75055    default:
   75056       unreachable("Invalid hardware generation");
   75057    }
   75058 }
   75059 
   75060 
   75061 
   75062 #define GEN10_3DSTATE_SF_TriangleStripListProvokingVertexSelect_start  125
   75063 #define GEN9_3DSTATE_SF_TriangleStripListProvokingVertexSelect_start  125
   75064 #define GEN8_3DSTATE_SF_TriangleStripListProvokingVertexSelect_start  125
   75065 #define GEN75_3DSTATE_SF_TriangleStripListProvokingVertexSelect_start  125
   75066 #define GEN7_3DSTATE_SF_TriangleStripListProvokingVertexSelect_start  125
   75067 #define GEN6_3DSTATE_SF_TriangleStripListProvokingVertexSelect_start  157
   75068 
   75069 static inline uint32_t ATTRIBUTE_PURE
   75070 _3DSTATE_SF_TriangleStripListProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   75071 {
   75072    switch (devinfo->gen) {
   75073    case 10: return 125;
   75074    case 9: return 125;
   75075    case 8: return 125;
   75076    case 7:
   75077       if (devinfo->is_haswell) {
   75078          return 125;
   75079       } else {
   75080          return 125;
   75081       }
   75082    case 6: return 157;
   75083    case 5: return 0;
   75084    case 4:
   75085       if (devinfo->is_g4x) {
   75086          return 0;
   75087       } else {
   75088          return 0;
   75089       }
   75090    default:
   75091       unreachable("Invalid hardware generation");
   75092    }
   75093 }
   75094 
   75095 
   75096 
   75097 /* 3DSTATE_SF::Vertex Sub Pixel Precision Select */
   75098 
   75099 
   75100 #define GEN10_3DSTATE_SF_VertexSubPixelPrecisionSelect_bits  1
   75101 #define GEN9_3DSTATE_SF_VertexSubPixelPrecisionSelect_bits  1
   75102 #define GEN8_3DSTATE_SF_VertexSubPixelPrecisionSelect_bits  1
   75103 #define GEN75_3DSTATE_SF_VertexSubPixelPrecisionSelect_bits  1
   75104 #define GEN7_3DSTATE_SF_VertexSubPixelPrecisionSelect_bits  1
   75105 #define GEN6_3DSTATE_SF_VertexSubPixelPrecisionSelect_bits  1
   75106 
   75107 static inline uint32_t ATTRIBUTE_PURE
   75108 _3DSTATE_SF_VertexSubPixelPrecisionSelect_bits(const struct gen_device_info *devinfo)
   75109 {
   75110    switch (devinfo->gen) {
   75111    case 10: return 1;
   75112    case 9: return 1;
   75113    case 8: return 1;
   75114    case 7:
   75115       if (devinfo->is_haswell) {
   75116          return 1;
   75117       } else {
   75118          return 1;
   75119       }
   75120    case 6: return 1;
   75121    case 5: return 0;
   75122    case 4:
   75123       if (devinfo->is_g4x) {
   75124          return 0;
   75125       } else {
   75126          return 0;
   75127       }
   75128    default:
   75129       unreachable("Invalid hardware generation");
   75130    }
   75131 }
   75132 
   75133 
   75134 
   75135 #define GEN10_3DSTATE_SF_VertexSubPixelPrecisionSelect_start  108
   75136 #define GEN9_3DSTATE_SF_VertexSubPixelPrecisionSelect_start  108
   75137 #define GEN8_3DSTATE_SF_VertexSubPixelPrecisionSelect_start  108
   75138 #define GEN75_3DSTATE_SF_VertexSubPixelPrecisionSelect_start  108
   75139 #define GEN7_3DSTATE_SF_VertexSubPixelPrecisionSelect_start  108
   75140 #define GEN6_3DSTATE_SF_VertexSubPixelPrecisionSelect_start  140
   75141 
   75142 static inline uint32_t ATTRIBUTE_PURE
   75143 _3DSTATE_SF_VertexSubPixelPrecisionSelect_start(const struct gen_device_info *devinfo)
   75144 {
   75145    switch (devinfo->gen) {
   75146    case 10: return 108;
   75147    case 9: return 108;
   75148    case 8: return 108;
   75149    case 7:
   75150       if (devinfo->is_haswell) {
   75151          return 108;
   75152       } else {
   75153          return 108;
   75154       }
   75155    case 6: return 140;
   75156    case 5: return 0;
   75157    case 4:
   75158       if (devinfo->is_g4x) {
   75159          return 0;
   75160       } else {
   75161          return 0;
   75162       }
   75163    default:
   75164       unreachable("Invalid hardware generation");
   75165    }
   75166 }
   75167 
   75168 
   75169 
   75170 /* 3DSTATE_SF::Vertex URB Entry Read Length */
   75171 
   75172 
   75173 #define GEN6_3DSTATE_SF_VertexURBEntryReadLength_bits  5
   75174 
   75175 static inline uint32_t ATTRIBUTE_PURE
   75176 _3DSTATE_SF_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   75177 {
   75178    switch (devinfo->gen) {
   75179    case 10: return 0;
   75180    case 9: return 0;
   75181    case 8: return 0;
   75182    case 7:
   75183       if (devinfo->is_haswell) {
   75184          return 0;
   75185       } else {
   75186          return 0;
   75187       }
   75188    case 6: return 5;
   75189    case 5: return 0;
   75190    case 4:
   75191       if (devinfo->is_g4x) {
   75192          return 0;
   75193       } else {
   75194          return 0;
   75195       }
   75196    default:
   75197       unreachable("Invalid hardware generation");
   75198    }
   75199 }
   75200 
   75201 
   75202 
   75203 #define GEN6_3DSTATE_SF_VertexURBEntryReadLength_start  43
   75204 
   75205 static inline uint32_t ATTRIBUTE_PURE
   75206 _3DSTATE_SF_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   75207 {
   75208    switch (devinfo->gen) {
   75209    case 10: return 0;
   75210    case 9: return 0;
   75211    case 8: return 0;
   75212    case 7:
   75213       if (devinfo->is_haswell) {
   75214          return 0;
   75215       } else {
   75216          return 0;
   75217       }
   75218    case 6: return 43;
   75219    case 5: return 0;
   75220    case 4:
   75221       if (devinfo->is_g4x) {
   75222          return 0;
   75223       } else {
   75224          return 0;
   75225       }
   75226    default:
   75227       unreachable("Invalid hardware generation");
   75228    }
   75229 }
   75230 
   75231 
   75232 
   75233 /* 3DSTATE_SF::Vertex URB Entry Read Offset */
   75234 
   75235 
   75236 #define GEN6_3DSTATE_SF_VertexURBEntryReadOffset_bits  6
   75237 
   75238 static inline uint32_t ATTRIBUTE_PURE
   75239 _3DSTATE_SF_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   75240 {
   75241    switch (devinfo->gen) {
   75242    case 10: return 0;
   75243    case 9: return 0;
   75244    case 8: return 0;
   75245    case 7:
   75246       if (devinfo->is_haswell) {
   75247          return 0;
   75248       } else {
   75249          return 0;
   75250       }
   75251    case 6: return 6;
   75252    case 5: return 0;
   75253    case 4:
   75254       if (devinfo->is_g4x) {
   75255          return 0;
   75256       } else {
   75257          return 0;
   75258       }
   75259    default:
   75260       unreachable("Invalid hardware generation");
   75261    }
   75262 }
   75263 
   75264 
   75265 
   75266 #define GEN6_3DSTATE_SF_VertexURBEntryReadOffset_start  36
   75267 
   75268 static inline uint32_t ATTRIBUTE_PURE
   75269 _3DSTATE_SF_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   75270 {
   75271    switch (devinfo->gen) {
   75272    case 10: return 0;
   75273    case 9: return 0;
   75274    case 8: return 0;
   75275    case 7:
   75276       if (devinfo->is_haswell) {
   75277          return 0;
   75278       } else {
   75279          return 0;
   75280       }
   75281    case 6: return 36;
   75282    case 5: return 0;
   75283    case 4:
   75284       if (devinfo->is_g4x) {
   75285          return 0;
   75286       } else {
   75287          return 0;
   75288       }
   75289    default:
   75290       unreachable("Invalid hardware generation");
   75291    }
   75292 }
   75293 
   75294 
   75295 
   75296 /* 3DSTATE_SF::Viewport Transform Enable */
   75297 
   75298 
   75299 #define GEN10_3DSTATE_SF_ViewportTransformEnable_bits  1
   75300 #define GEN9_3DSTATE_SF_ViewportTransformEnable_bits  1
   75301 #define GEN8_3DSTATE_SF_ViewportTransformEnable_bits  1
   75302 #define GEN75_3DSTATE_SF_ViewportTransformEnable_bits  1
   75303 #define GEN7_3DSTATE_SF_ViewportTransformEnable_bits  1
   75304 #define GEN6_3DSTATE_SF_ViewportTransformEnable_bits  1
   75305 
   75306 static inline uint32_t ATTRIBUTE_PURE
   75307 _3DSTATE_SF_ViewportTransformEnable_bits(const struct gen_device_info *devinfo)
   75308 {
   75309    switch (devinfo->gen) {
   75310    case 10: return 1;
   75311    case 9: return 1;
   75312    case 8: return 1;
   75313    case 7:
   75314       if (devinfo->is_haswell) {
   75315          return 1;
   75316       } else {
   75317          return 1;
   75318       }
   75319    case 6: return 1;
   75320    case 5: return 0;
   75321    case 4:
   75322       if (devinfo->is_g4x) {
   75323          return 0;
   75324       } else {
   75325          return 0;
   75326       }
   75327    default:
   75328       unreachable("Invalid hardware generation");
   75329    }
   75330 }
   75331 
   75332 
   75333 
   75334 #define GEN10_3DSTATE_SF_ViewportTransformEnable_start  33
   75335 #define GEN9_3DSTATE_SF_ViewportTransformEnable_start  33
   75336 #define GEN8_3DSTATE_SF_ViewportTransformEnable_start  33
   75337 #define GEN75_3DSTATE_SF_ViewportTransformEnable_start  33
   75338 #define GEN7_3DSTATE_SF_ViewportTransformEnable_start  33
   75339 #define GEN6_3DSTATE_SF_ViewportTransformEnable_start  65
   75340 
   75341 static inline uint32_t ATTRIBUTE_PURE
   75342 _3DSTATE_SF_ViewportTransformEnable_start(const struct gen_device_info *devinfo)
   75343 {
   75344    switch (devinfo->gen) {
   75345    case 10: return 33;
   75346    case 9: return 33;
   75347    case 8: return 33;
   75348    case 7:
   75349       if (devinfo->is_haswell) {
   75350          return 33;
   75351       } else {
   75352          return 33;
   75353       }
   75354    case 6: return 65;
   75355    case 5: return 0;
   75356    case 4:
   75357       if (devinfo->is_g4x) {
   75358          return 0;
   75359       } else {
   75360          return 0;
   75361       }
   75362    default:
   75363       unreachable("Invalid hardware generation");
   75364    }
   75365 }
   75366 
   75367 
   75368 
   75369 /* 3DSTATE_SO_BUFFER */
   75370 
   75371 
   75372 #define GEN10_3DSTATE_SO_BUFFER_length  8
   75373 #define GEN9_3DSTATE_SO_BUFFER_length  8
   75374 #define GEN8_3DSTATE_SO_BUFFER_length  8
   75375 #define GEN75_3DSTATE_SO_BUFFER_length  4
   75376 #define GEN7_3DSTATE_SO_BUFFER_length  4
   75377 
   75378 static inline uint32_t ATTRIBUTE_PURE
   75379 _3DSTATE_SO_BUFFER_length(const struct gen_device_info *devinfo)
   75380 {
   75381    switch (devinfo->gen) {
   75382    case 10: return 8;
   75383    case 9: return 8;
   75384    case 8: return 8;
   75385    case 7:
   75386       if (devinfo->is_haswell) {
   75387          return 4;
   75388       } else {
   75389          return 4;
   75390       }
   75391    case 6: return 0;
   75392    case 5: return 0;
   75393    case 4:
   75394       if (devinfo->is_g4x) {
   75395          return 0;
   75396       } else {
   75397          return 0;
   75398       }
   75399    default:
   75400       unreachable("Invalid hardware generation");
   75401    }
   75402 }
   75403 
   75404 
   75405 
   75406 /* 3DSTATE_SO_BUFFER::3D Command Opcode */
   75407 
   75408 
   75409 #define GEN10_3DSTATE_SO_BUFFER_3DCommandOpcode_bits  3
   75410 #define GEN9_3DSTATE_SO_BUFFER_3DCommandOpcode_bits  3
   75411 #define GEN8_3DSTATE_SO_BUFFER_3DCommandOpcode_bits  3
   75412 #define GEN75_3DSTATE_SO_BUFFER_3DCommandOpcode_bits  3
   75413 #define GEN7_3DSTATE_SO_BUFFER_3DCommandOpcode_bits  3
   75414 
   75415 static inline uint32_t ATTRIBUTE_PURE
   75416 _3DSTATE_SO_BUFFER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   75417 {
   75418    switch (devinfo->gen) {
   75419    case 10: return 3;
   75420    case 9: return 3;
   75421    case 8: return 3;
   75422    case 7:
   75423       if (devinfo->is_haswell) {
   75424          return 3;
   75425       } else {
   75426          return 3;
   75427       }
   75428    case 6: return 0;
   75429    case 5: return 0;
   75430    case 4:
   75431       if (devinfo->is_g4x) {
   75432          return 0;
   75433       } else {
   75434          return 0;
   75435       }
   75436    default:
   75437       unreachable("Invalid hardware generation");
   75438    }
   75439 }
   75440 
   75441 
   75442 
   75443 #define GEN10_3DSTATE_SO_BUFFER_3DCommandOpcode_start  24
   75444 #define GEN9_3DSTATE_SO_BUFFER_3DCommandOpcode_start  24
   75445 #define GEN8_3DSTATE_SO_BUFFER_3DCommandOpcode_start  24
   75446 #define GEN75_3DSTATE_SO_BUFFER_3DCommandOpcode_start  24
   75447 #define GEN7_3DSTATE_SO_BUFFER_3DCommandOpcode_start  24
   75448 
   75449 static inline uint32_t ATTRIBUTE_PURE
   75450 _3DSTATE_SO_BUFFER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   75451 {
   75452    switch (devinfo->gen) {
   75453    case 10: return 24;
   75454    case 9: return 24;
   75455    case 8: return 24;
   75456    case 7:
   75457       if (devinfo->is_haswell) {
   75458          return 24;
   75459       } else {
   75460          return 24;
   75461       }
   75462    case 6: return 0;
   75463    case 5: return 0;
   75464    case 4:
   75465       if (devinfo->is_g4x) {
   75466          return 0;
   75467       } else {
   75468          return 0;
   75469       }
   75470    default:
   75471       unreachable("Invalid hardware generation");
   75472    }
   75473 }
   75474 
   75475 
   75476 
   75477 /* 3DSTATE_SO_BUFFER::3D Command Sub Opcode */
   75478 
   75479 
   75480 #define GEN10_3DSTATE_SO_BUFFER_3DCommandSubOpcode_bits  8
   75481 #define GEN9_3DSTATE_SO_BUFFER_3DCommandSubOpcode_bits  8
   75482 #define GEN8_3DSTATE_SO_BUFFER_3DCommandSubOpcode_bits  8
   75483 #define GEN75_3DSTATE_SO_BUFFER_3DCommandSubOpcode_bits  8
   75484 #define GEN7_3DSTATE_SO_BUFFER_3DCommandSubOpcode_bits  8
   75485 
   75486 static inline uint32_t ATTRIBUTE_PURE
   75487 _3DSTATE_SO_BUFFER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   75488 {
   75489    switch (devinfo->gen) {
   75490    case 10: return 8;
   75491    case 9: return 8;
   75492    case 8: return 8;
   75493    case 7:
   75494       if (devinfo->is_haswell) {
   75495          return 8;
   75496       } else {
   75497          return 8;
   75498       }
   75499    case 6: return 0;
   75500    case 5: return 0;
   75501    case 4:
   75502       if (devinfo->is_g4x) {
   75503          return 0;
   75504       } else {
   75505          return 0;
   75506       }
   75507    default:
   75508       unreachable("Invalid hardware generation");
   75509    }
   75510 }
   75511 
   75512 
   75513 
   75514 #define GEN10_3DSTATE_SO_BUFFER_3DCommandSubOpcode_start  16
   75515 #define GEN9_3DSTATE_SO_BUFFER_3DCommandSubOpcode_start  16
   75516 #define GEN8_3DSTATE_SO_BUFFER_3DCommandSubOpcode_start  16
   75517 #define GEN75_3DSTATE_SO_BUFFER_3DCommandSubOpcode_start  16
   75518 #define GEN7_3DSTATE_SO_BUFFER_3DCommandSubOpcode_start  16
   75519 
   75520 static inline uint32_t ATTRIBUTE_PURE
   75521 _3DSTATE_SO_BUFFER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   75522 {
   75523    switch (devinfo->gen) {
   75524    case 10: return 16;
   75525    case 9: return 16;
   75526    case 8: return 16;
   75527    case 7:
   75528       if (devinfo->is_haswell) {
   75529          return 16;
   75530       } else {
   75531          return 16;
   75532       }
   75533    case 6: return 0;
   75534    case 5: return 0;
   75535    case 4:
   75536       if (devinfo->is_g4x) {
   75537          return 0;
   75538       } else {
   75539          return 0;
   75540       }
   75541    default:
   75542       unreachable("Invalid hardware generation");
   75543    }
   75544 }
   75545 
   75546 
   75547 
   75548 /* 3DSTATE_SO_BUFFER::Command SubType */
   75549 
   75550 
   75551 #define GEN10_3DSTATE_SO_BUFFER_CommandSubType_bits  2
   75552 #define GEN9_3DSTATE_SO_BUFFER_CommandSubType_bits  2
   75553 #define GEN8_3DSTATE_SO_BUFFER_CommandSubType_bits  2
   75554 #define GEN75_3DSTATE_SO_BUFFER_CommandSubType_bits  2
   75555 #define GEN7_3DSTATE_SO_BUFFER_CommandSubType_bits  2
   75556 
   75557 static inline uint32_t ATTRIBUTE_PURE
   75558 _3DSTATE_SO_BUFFER_CommandSubType_bits(const struct gen_device_info *devinfo)
   75559 {
   75560    switch (devinfo->gen) {
   75561    case 10: return 2;
   75562    case 9: return 2;
   75563    case 8: return 2;
   75564    case 7:
   75565       if (devinfo->is_haswell) {
   75566          return 2;
   75567       } else {
   75568          return 2;
   75569       }
   75570    case 6: return 0;
   75571    case 5: return 0;
   75572    case 4:
   75573       if (devinfo->is_g4x) {
   75574          return 0;
   75575       } else {
   75576          return 0;
   75577       }
   75578    default:
   75579       unreachable("Invalid hardware generation");
   75580    }
   75581 }
   75582 
   75583 
   75584 
   75585 #define GEN10_3DSTATE_SO_BUFFER_CommandSubType_start  27
   75586 #define GEN9_3DSTATE_SO_BUFFER_CommandSubType_start  27
   75587 #define GEN8_3DSTATE_SO_BUFFER_CommandSubType_start  27
   75588 #define GEN75_3DSTATE_SO_BUFFER_CommandSubType_start  27
   75589 #define GEN7_3DSTATE_SO_BUFFER_CommandSubType_start  27
   75590 
   75591 static inline uint32_t ATTRIBUTE_PURE
   75592 _3DSTATE_SO_BUFFER_CommandSubType_start(const struct gen_device_info *devinfo)
   75593 {
   75594    switch (devinfo->gen) {
   75595    case 10: return 27;
   75596    case 9: return 27;
   75597    case 8: return 27;
   75598    case 7:
   75599       if (devinfo->is_haswell) {
   75600          return 27;
   75601       } else {
   75602          return 27;
   75603       }
   75604    case 6: return 0;
   75605    case 5: return 0;
   75606    case 4:
   75607       if (devinfo->is_g4x) {
   75608          return 0;
   75609       } else {
   75610          return 0;
   75611       }
   75612    default:
   75613       unreachable("Invalid hardware generation");
   75614    }
   75615 }
   75616 
   75617 
   75618 
   75619 /* 3DSTATE_SO_BUFFER::Command Type */
   75620 
   75621 
   75622 #define GEN10_3DSTATE_SO_BUFFER_CommandType_bits  3
   75623 #define GEN9_3DSTATE_SO_BUFFER_CommandType_bits  3
   75624 #define GEN8_3DSTATE_SO_BUFFER_CommandType_bits  3
   75625 #define GEN75_3DSTATE_SO_BUFFER_CommandType_bits  3
   75626 #define GEN7_3DSTATE_SO_BUFFER_CommandType_bits  3
   75627 
   75628 static inline uint32_t ATTRIBUTE_PURE
   75629 _3DSTATE_SO_BUFFER_CommandType_bits(const struct gen_device_info *devinfo)
   75630 {
   75631    switch (devinfo->gen) {
   75632    case 10: return 3;
   75633    case 9: return 3;
   75634    case 8: return 3;
   75635    case 7:
   75636       if (devinfo->is_haswell) {
   75637          return 3;
   75638       } else {
   75639          return 3;
   75640       }
   75641    case 6: return 0;
   75642    case 5: return 0;
   75643    case 4:
   75644       if (devinfo->is_g4x) {
   75645          return 0;
   75646       } else {
   75647          return 0;
   75648       }
   75649    default:
   75650       unreachable("Invalid hardware generation");
   75651    }
   75652 }
   75653 
   75654 
   75655 
   75656 #define GEN10_3DSTATE_SO_BUFFER_CommandType_start  29
   75657 #define GEN9_3DSTATE_SO_BUFFER_CommandType_start  29
   75658 #define GEN8_3DSTATE_SO_BUFFER_CommandType_start  29
   75659 #define GEN75_3DSTATE_SO_BUFFER_CommandType_start  29
   75660 #define GEN7_3DSTATE_SO_BUFFER_CommandType_start  29
   75661 
   75662 static inline uint32_t ATTRIBUTE_PURE
   75663 _3DSTATE_SO_BUFFER_CommandType_start(const struct gen_device_info *devinfo)
   75664 {
   75665    switch (devinfo->gen) {
   75666    case 10: return 29;
   75667    case 9: return 29;
   75668    case 8: return 29;
   75669    case 7:
   75670       if (devinfo->is_haswell) {
   75671          return 29;
   75672       } else {
   75673          return 29;
   75674       }
   75675    case 6: return 0;
   75676    case 5: return 0;
   75677    case 4:
   75678       if (devinfo->is_g4x) {
   75679          return 0;
   75680       } else {
   75681          return 0;
   75682       }
   75683    default:
   75684       unreachable("Invalid hardware generation");
   75685    }
   75686 }
   75687 
   75688 
   75689 
   75690 /* 3DSTATE_SO_BUFFER::DWord Length */
   75691 
   75692 
   75693 #define GEN10_3DSTATE_SO_BUFFER_DWordLength_bits  8
   75694 #define GEN9_3DSTATE_SO_BUFFER_DWordLength_bits  8
   75695 #define GEN8_3DSTATE_SO_BUFFER_DWordLength_bits  8
   75696 #define GEN75_3DSTATE_SO_BUFFER_DWordLength_bits  8
   75697 #define GEN7_3DSTATE_SO_BUFFER_DWordLength_bits  8
   75698 
   75699 static inline uint32_t ATTRIBUTE_PURE
   75700 _3DSTATE_SO_BUFFER_DWordLength_bits(const struct gen_device_info *devinfo)
   75701 {
   75702    switch (devinfo->gen) {
   75703    case 10: return 8;
   75704    case 9: return 8;
   75705    case 8: return 8;
   75706    case 7:
   75707       if (devinfo->is_haswell) {
   75708          return 8;
   75709       } else {
   75710          return 8;
   75711       }
   75712    case 6: return 0;
   75713    case 5: return 0;
   75714    case 4:
   75715       if (devinfo->is_g4x) {
   75716          return 0;
   75717       } else {
   75718          return 0;
   75719       }
   75720    default:
   75721       unreachable("Invalid hardware generation");
   75722    }
   75723 }
   75724 
   75725 
   75726 
   75727 #define GEN10_3DSTATE_SO_BUFFER_DWordLength_start  0
   75728 #define GEN9_3DSTATE_SO_BUFFER_DWordLength_start  0
   75729 #define GEN8_3DSTATE_SO_BUFFER_DWordLength_start  0
   75730 #define GEN75_3DSTATE_SO_BUFFER_DWordLength_start  0
   75731 #define GEN7_3DSTATE_SO_BUFFER_DWordLength_start  0
   75732 
   75733 static inline uint32_t ATTRIBUTE_PURE
   75734 _3DSTATE_SO_BUFFER_DWordLength_start(const struct gen_device_info *devinfo)
   75735 {
   75736    switch (devinfo->gen) {
   75737    case 10: return 0;
   75738    case 9: return 0;
   75739    case 8: return 0;
   75740    case 7:
   75741       if (devinfo->is_haswell) {
   75742          return 0;
   75743       } else {
   75744          return 0;
   75745       }
   75746    case 6: return 0;
   75747    case 5: return 0;
   75748    case 4:
   75749       if (devinfo->is_g4x) {
   75750          return 0;
   75751       } else {
   75752          return 0;
   75753       }
   75754    default:
   75755       unreachable("Invalid hardware generation");
   75756    }
   75757 }
   75758 
   75759 
   75760 
   75761 /* 3DSTATE_SO_BUFFER::SO Buffer Enable */
   75762 
   75763 
   75764 #define GEN10_3DSTATE_SO_BUFFER_SOBufferEnable_bits  1
   75765 #define GEN9_3DSTATE_SO_BUFFER_SOBufferEnable_bits  1
   75766 #define GEN8_3DSTATE_SO_BUFFER_SOBufferEnable_bits  1
   75767 
   75768 static inline uint32_t ATTRIBUTE_PURE
   75769 _3DSTATE_SO_BUFFER_SOBufferEnable_bits(const struct gen_device_info *devinfo)
   75770 {
   75771    switch (devinfo->gen) {
   75772    case 10: return 1;
   75773    case 9: return 1;
   75774    case 8: return 1;
   75775    case 7:
   75776       if (devinfo->is_haswell) {
   75777          return 0;
   75778       } else {
   75779          return 0;
   75780       }
   75781    case 6: return 0;
   75782    case 5: return 0;
   75783    case 4:
   75784       if (devinfo->is_g4x) {
   75785          return 0;
   75786       } else {
   75787          return 0;
   75788       }
   75789    default:
   75790       unreachable("Invalid hardware generation");
   75791    }
   75792 }
   75793 
   75794 
   75795 
   75796 #define GEN10_3DSTATE_SO_BUFFER_SOBufferEnable_start  63
   75797 #define GEN9_3DSTATE_SO_BUFFER_SOBufferEnable_start  63
   75798 #define GEN8_3DSTATE_SO_BUFFER_SOBufferEnable_start  63
   75799 
   75800 static inline uint32_t ATTRIBUTE_PURE
   75801 _3DSTATE_SO_BUFFER_SOBufferEnable_start(const struct gen_device_info *devinfo)
   75802 {
   75803    switch (devinfo->gen) {
   75804    case 10: return 63;
   75805    case 9: return 63;
   75806    case 8: return 63;
   75807    case 7:
   75808       if (devinfo->is_haswell) {
   75809          return 0;
   75810       } else {
   75811          return 0;
   75812       }
   75813    case 6: return 0;
   75814    case 5: return 0;
   75815    case 4:
   75816       if (devinfo->is_g4x) {
   75817          return 0;
   75818       } else {
   75819          return 0;
   75820       }
   75821    default:
   75822       unreachable("Invalid hardware generation");
   75823    }
   75824 }
   75825 
   75826 
   75827 
   75828 /* 3DSTATE_SO_BUFFER::SO Buffer Index */
   75829 
   75830 
   75831 #define GEN10_3DSTATE_SO_BUFFER_SOBufferIndex_bits  2
   75832 #define GEN9_3DSTATE_SO_BUFFER_SOBufferIndex_bits  2
   75833 #define GEN8_3DSTATE_SO_BUFFER_SOBufferIndex_bits  2
   75834 #define GEN75_3DSTATE_SO_BUFFER_SOBufferIndex_bits  2
   75835 #define GEN7_3DSTATE_SO_BUFFER_SOBufferIndex_bits  2
   75836 
   75837 static inline uint32_t ATTRIBUTE_PURE
   75838 _3DSTATE_SO_BUFFER_SOBufferIndex_bits(const struct gen_device_info *devinfo)
   75839 {
   75840    switch (devinfo->gen) {
   75841    case 10: return 2;
   75842    case 9: return 2;
   75843    case 8: return 2;
   75844    case 7:
   75845       if (devinfo->is_haswell) {
   75846          return 2;
   75847       } else {
   75848          return 2;
   75849       }
   75850    case 6: return 0;
   75851    case 5: return 0;
   75852    case 4:
   75853       if (devinfo->is_g4x) {
   75854          return 0;
   75855       } else {
   75856          return 0;
   75857       }
   75858    default:
   75859       unreachable("Invalid hardware generation");
   75860    }
   75861 }
   75862 
   75863 
   75864 
   75865 #define GEN10_3DSTATE_SO_BUFFER_SOBufferIndex_start  61
   75866 #define GEN9_3DSTATE_SO_BUFFER_SOBufferIndex_start  61
   75867 #define GEN8_3DSTATE_SO_BUFFER_SOBufferIndex_start  61
   75868 #define GEN75_3DSTATE_SO_BUFFER_SOBufferIndex_start  61
   75869 #define GEN7_3DSTATE_SO_BUFFER_SOBufferIndex_start  61
   75870 
   75871 static inline uint32_t ATTRIBUTE_PURE
   75872 _3DSTATE_SO_BUFFER_SOBufferIndex_start(const struct gen_device_info *devinfo)
   75873 {
   75874    switch (devinfo->gen) {
   75875    case 10: return 61;
   75876    case 9: return 61;
   75877    case 8: return 61;
   75878    case 7:
   75879       if (devinfo->is_haswell) {
   75880          return 61;
   75881       } else {
   75882          return 61;
   75883       }
   75884    case 6: return 0;
   75885    case 5: return 0;
   75886    case 4:
   75887       if (devinfo->is_g4x) {
   75888          return 0;
   75889       } else {
   75890          return 0;
   75891       }
   75892    default:
   75893       unreachable("Invalid hardware generation");
   75894    }
   75895 }
   75896 
   75897 
   75898 
   75899 /* 3DSTATE_SO_BUFFER::SO Buffer MOCS */
   75900 
   75901 
   75902 #define GEN10_3DSTATE_SO_BUFFER_SOBufferMOCS_bits  7
   75903 #define GEN9_3DSTATE_SO_BUFFER_SOBufferMOCS_bits  7
   75904 #define GEN8_3DSTATE_SO_BUFFER_SOBufferMOCS_bits  7
   75905 #define GEN75_3DSTATE_SO_BUFFER_SOBufferMOCS_bits  4
   75906 #define GEN7_3DSTATE_SO_BUFFER_SOBufferMOCS_bits  4
   75907 
   75908 static inline uint32_t ATTRIBUTE_PURE
   75909 _3DSTATE_SO_BUFFER_SOBufferMOCS_bits(const struct gen_device_info *devinfo)
   75910 {
   75911    switch (devinfo->gen) {
   75912    case 10: return 7;
   75913    case 9: return 7;
   75914    case 8: return 7;
   75915    case 7:
   75916       if (devinfo->is_haswell) {
   75917          return 4;
   75918       } else {
   75919          return 4;
   75920       }
   75921    case 6: return 0;
   75922    case 5: return 0;
   75923    case 4:
   75924       if (devinfo->is_g4x) {
   75925          return 0;
   75926       } else {
   75927          return 0;
   75928       }
   75929    default:
   75930       unreachable("Invalid hardware generation");
   75931    }
   75932 }
   75933 
   75934 
   75935 
   75936 #define GEN10_3DSTATE_SO_BUFFER_SOBufferMOCS_start  54
   75937 #define GEN9_3DSTATE_SO_BUFFER_SOBufferMOCS_start  54
   75938 #define GEN8_3DSTATE_SO_BUFFER_SOBufferMOCS_start  54
   75939 #define GEN75_3DSTATE_SO_BUFFER_SOBufferMOCS_start  57
   75940 #define GEN7_3DSTATE_SO_BUFFER_SOBufferMOCS_start  57
   75941 
   75942 static inline uint32_t ATTRIBUTE_PURE
   75943 _3DSTATE_SO_BUFFER_SOBufferMOCS_start(const struct gen_device_info *devinfo)
   75944 {
   75945    switch (devinfo->gen) {
   75946    case 10: return 54;
   75947    case 9: return 54;
   75948    case 8: return 54;
   75949    case 7:
   75950       if (devinfo->is_haswell) {
   75951          return 57;
   75952       } else {
   75953          return 57;
   75954       }
   75955    case 6: return 0;
   75956    case 5: return 0;
   75957    case 4:
   75958       if (devinfo->is_g4x) {
   75959          return 0;
   75960       } else {
   75961          return 0;
   75962       }
   75963    default:
   75964       unreachable("Invalid hardware generation");
   75965    }
   75966 }
   75967 
   75968 
   75969 
   75970 /* 3DSTATE_SO_BUFFER::SO Buffer Object Control State */
   75971 
   75972 
   75973 #define GEN10_3DSTATE_SO_BUFFER_SOBufferObjectControlState_bits  7
   75974 #define GEN9_3DSTATE_SO_BUFFER_SOBufferObjectControlState_bits  7
   75975 #define GEN8_3DSTATE_SO_BUFFER_SOBufferObjectControlState_bits  7
   75976 #define GEN75_3DSTATE_SO_BUFFER_SOBufferObjectControlState_bits  4
   75977 #define GEN7_3DSTATE_SO_BUFFER_SOBufferObjectControlState_bits  4
   75978 
   75979 static inline uint32_t ATTRIBUTE_PURE
   75980 _3DSTATE_SO_BUFFER_SOBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   75981 {
   75982    switch (devinfo->gen) {
   75983    case 10: return 7;
   75984    case 9: return 7;
   75985    case 8: return 7;
   75986    case 7:
   75987       if (devinfo->is_haswell) {
   75988          return 4;
   75989       } else {
   75990          return 4;
   75991       }
   75992    case 6: return 0;
   75993    case 5: return 0;
   75994    case 4:
   75995       if (devinfo->is_g4x) {
   75996          return 0;
   75997       } else {
   75998          return 0;
   75999       }
   76000    default:
   76001       unreachable("Invalid hardware generation");
   76002    }
   76003 }
   76004 
   76005 
   76006 
   76007 #define GEN10_3DSTATE_SO_BUFFER_SOBufferObjectControlState_start  54
   76008 #define GEN9_3DSTATE_SO_BUFFER_SOBufferObjectControlState_start  54
   76009 #define GEN8_3DSTATE_SO_BUFFER_SOBufferObjectControlState_start  54
   76010 #define GEN75_3DSTATE_SO_BUFFER_SOBufferObjectControlState_start  57
   76011 #define GEN7_3DSTATE_SO_BUFFER_SOBufferObjectControlState_start  57
   76012 
   76013 static inline uint32_t ATTRIBUTE_PURE
   76014 _3DSTATE_SO_BUFFER_SOBufferObjectControlState_start(const struct gen_device_info *devinfo)
   76015 {
   76016    switch (devinfo->gen) {
   76017    case 10: return 54;
   76018    case 9: return 54;
   76019    case 8: return 54;
   76020    case 7:
   76021       if (devinfo->is_haswell) {
   76022          return 57;
   76023       } else {
   76024          return 57;
   76025       }
   76026    case 6: return 0;
   76027    case 5: return 0;
   76028    case 4:
   76029       if (devinfo->is_g4x) {
   76030          return 0;
   76031       } else {
   76032          return 0;
   76033       }
   76034    default:
   76035       unreachable("Invalid hardware generation");
   76036    }
   76037 }
   76038 
   76039 
   76040 
   76041 /* 3DSTATE_SO_BUFFER::Stream Offset */
   76042 
   76043 
   76044 #define GEN10_3DSTATE_SO_BUFFER_StreamOffset_bits  32
   76045 #define GEN9_3DSTATE_SO_BUFFER_StreamOffset_bits  32
   76046 #define GEN8_3DSTATE_SO_BUFFER_StreamOffset_bits  32
   76047 
   76048 static inline uint32_t ATTRIBUTE_PURE
   76049 _3DSTATE_SO_BUFFER_StreamOffset_bits(const struct gen_device_info *devinfo)
   76050 {
   76051    switch (devinfo->gen) {
   76052    case 10: return 32;
   76053    case 9: return 32;
   76054    case 8: return 32;
   76055    case 7:
   76056       if (devinfo->is_haswell) {
   76057          return 0;
   76058       } else {
   76059          return 0;
   76060       }
   76061    case 6: return 0;
   76062    case 5: return 0;
   76063    case 4:
   76064       if (devinfo->is_g4x) {
   76065          return 0;
   76066       } else {
   76067          return 0;
   76068       }
   76069    default:
   76070       unreachable("Invalid hardware generation");
   76071    }
   76072 }
   76073 
   76074 
   76075 
   76076 #define GEN10_3DSTATE_SO_BUFFER_StreamOffset_start  224
   76077 #define GEN9_3DSTATE_SO_BUFFER_StreamOffset_start  224
   76078 #define GEN8_3DSTATE_SO_BUFFER_StreamOffset_start  224
   76079 
   76080 static inline uint32_t ATTRIBUTE_PURE
   76081 _3DSTATE_SO_BUFFER_StreamOffset_start(const struct gen_device_info *devinfo)
   76082 {
   76083    switch (devinfo->gen) {
   76084    case 10: return 224;
   76085    case 9: return 224;
   76086    case 8: return 224;
   76087    case 7:
   76088       if (devinfo->is_haswell) {
   76089          return 0;
   76090       } else {
   76091          return 0;
   76092       }
   76093    case 6: return 0;
   76094    case 5: return 0;
   76095    case 4:
   76096       if (devinfo->is_g4x) {
   76097          return 0;
   76098       } else {
   76099          return 0;
   76100       }
   76101    default:
   76102       unreachable("Invalid hardware generation");
   76103    }
   76104 }
   76105 
   76106 
   76107 
   76108 /* 3DSTATE_SO_BUFFER::Stream Offset Write Enable */
   76109 
   76110 
   76111 #define GEN10_3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_bits  1
   76112 #define GEN9_3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_bits  1
   76113 #define GEN8_3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_bits  1
   76114 
   76115 static inline uint32_t ATTRIBUTE_PURE
   76116 _3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_bits(const struct gen_device_info *devinfo)
   76117 {
   76118    switch (devinfo->gen) {
   76119    case 10: return 1;
   76120    case 9: return 1;
   76121    case 8: return 1;
   76122    case 7:
   76123       if (devinfo->is_haswell) {
   76124          return 0;
   76125       } else {
   76126          return 0;
   76127       }
   76128    case 6: return 0;
   76129    case 5: return 0;
   76130    case 4:
   76131       if (devinfo->is_g4x) {
   76132          return 0;
   76133       } else {
   76134          return 0;
   76135       }
   76136    default:
   76137       unreachable("Invalid hardware generation");
   76138    }
   76139 }
   76140 
   76141 
   76142 
   76143 #define GEN10_3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_start  53
   76144 #define GEN9_3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_start  53
   76145 #define GEN8_3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_start  53
   76146 
   76147 static inline uint32_t ATTRIBUTE_PURE
   76148 _3DSTATE_SO_BUFFER_StreamOffsetWriteEnable_start(const struct gen_device_info *devinfo)
   76149 {
   76150    switch (devinfo->gen) {
   76151    case 10: return 53;
   76152    case 9: return 53;
   76153    case 8: return 53;
   76154    case 7:
   76155       if (devinfo->is_haswell) {
   76156          return 0;
   76157       } else {
   76158          return 0;
   76159       }
   76160    case 6: return 0;
   76161    case 5: return 0;
   76162    case 4:
   76163       if (devinfo->is_g4x) {
   76164          return 0;
   76165       } else {
   76166          return 0;
   76167       }
   76168    default:
   76169       unreachable("Invalid hardware generation");
   76170    }
   76171 }
   76172 
   76173 
   76174 
   76175 /* 3DSTATE_SO_BUFFER::Stream Output Buffer Offset Address */
   76176 
   76177 
   76178 #define GEN10_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_bits  46
   76179 #define GEN9_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_bits  46
   76180 #define GEN8_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_bits  46
   76181 
   76182 static inline uint32_t ATTRIBUTE_PURE
   76183 _3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_bits(const struct gen_device_info *devinfo)
   76184 {
   76185    switch (devinfo->gen) {
   76186    case 10: return 46;
   76187    case 9: return 46;
   76188    case 8: return 46;
   76189    case 7:
   76190       if (devinfo->is_haswell) {
   76191          return 0;
   76192       } else {
   76193          return 0;
   76194       }
   76195    case 6: return 0;
   76196    case 5: return 0;
   76197    case 4:
   76198       if (devinfo->is_g4x) {
   76199          return 0;
   76200       } else {
   76201          return 0;
   76202       }
   76203    default:
   76204       unreachable("Invalid hardware generation");
   76205    }
   76206 }
   76207 
   76208 
   76209 
   76210 #define GEN10_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_start  162
   76211 #define GEN9_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_start  162
   76212 #define GEN8_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_start  162
   76213 
   76214 static inline uint32_t ATTRIBUTE_PURE
   76215 _3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddress_start(const struct gen_device_info *devinfo)
   76216 {
   76217    switch (devinfo->gen) {
   76218    case 10: return 162;
   76219    case 9: return 162;
   76220    case 8: return 162;
   76221    case 7:
   76222       if (devinfo->is_haswell) {
   76223          return 0;
   76224       } else {
   76225          return 0;
   76226       }
   76227    case 6: return 0;
   76228    case 5: return 0;
   76229    case 4:
   76230       if (devinfo->is_g4x) {
   76231          return 0;
   76232       } else {
   76233          return 0;
   76234       }
   76235    default:
   76236       unreachable("Invalid hardware generation");
   76237    }
   76238 }
   76239 
   76240 
   76241 
   76242 /* 3DSTATE_SO_BUFFER::Stream Output Buffer Offset Address Enable */
   76243 
   76244 
   76245 #define GEN10_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_bits  1
   76246 #define GEN9_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_bits  1
   76247 #define GEN8_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_bits  1
   76248 
   76249 static inline uint32_t ATTRIBUTE_PURE
   76250 _3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_bits(const struct gen_device_info *devinfo)
   76251 {
   76252    switch (devinfo->gen) {
   76253    case 10: return 1;
   76254    case 9: return 1;
   76255    case 8: return 1;
   76256    case 7:
   76257       if (devinfo->is_haswell) {
   76258          return 0;
   76259       } else {
   76260          return 0;
   76261       }
   76262    case 6: return 0;
   76263    case 5: return 0;
   76264    case 4:
   76265       if (devinfo->is_g4x) {
   76266          return 0;
   76267       } else {
   76268          return 0;
   76269       }
   76270    default:
   76271       unreachable("Invalid hardware generation");
   76272    }
   76273 }
   76274 
   76275 
   76276 
   76277 #define GEN10_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_start  52
   76278 #define GEN9_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_start  52
   76279 #define GEN8_3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_start  52
   76280 
   76281 static inline uint32_t ATTRIBUTE_PURE
   76282 _3DSTATE_SO_BUFFER_StreamOutputBufferOffsetAddressEnable_start(const struct gen_device_info *devinfo)
   76283 {
   76284    switch (devinfo->gen) {
   76285    case 10: return 52;
   76286    case 9: return 52;
   76287    case 8: return 52;
   76288    case 7:
   76289       if (devinfo->is_haswell) {
   76290          return 0;
   76291       } else {
   76292          return 0;
   76293       }
   76294    case 6: return 0;
   76295    case 5: return 0;
   76296    case 4:
   76297       if (devinfo->is_g4x) {
   76298          return 0;
   76299       } else {
   76300          return 0;
   76301       }
   76302    default:
   76303       unreachable("Invalid hardware generation");
   76304    }
   76305 }
   76306 
   76307 
   76308 
   76309 /* 3DSTATE_SO_BUFFER::Surface Base Address */
   76310 
   76311 
   76312 #define GEN10_3DSTATE_SO_BUFFER_SurfaceBaseAddress_bits  46
   76313 #define GEN9_3DSTATE_SO_BUFFER_SurfaceBaseAddress_bits  46
   76314 #define GEN8_3DSTATE_SO_BUFFER_SurfaceBaseAddress_bits  46
   76315 #define GEN75_3DSTATE_SO_BUFFER_SurfaceBaseAddress_bits  30
   76316 #define GEN7_3DSTATE_SO_BUFFER_SurfaceBaseAddress_bits  30
   76317 
   76318 static inline uint32_t ATTRIBUTE_PURE
   76319 _3DSTATE_SO_BUFFER_SurfaceBaseAddress_bits(const struct gen_device_info *devinfo)
   76320 {
   76321    switch (devinfo->gen) {
   76322    case 10: return 46;
   76323    case 9: return 46;
   76324    case 8: return 46;
   76325    case 7:
   76326       if (devinfo->is_haswell) {
   76327          return 30;
   76328       } else {
   76329          return 30;
   76330       }
   76331    case 6: return 0;
   76332    case 5: return 0;
   76333    case 4:
   76334       if (devinfo->is_g4x) {
   76335          return 0;
   76336       } else {
   76337          return 0;
   76338       }
   76339    default:
   76340       unreachable("Invalid hardware generation");
   76341    }
   76342 }
   76343 
   76344 
   76345 
   76346 #define GEN10_3DSTATE_SO_BUFFER_SurfaceBaseAddress_start  66
   76347 #define GEN9_3DSTATE_SO_BUFFER_SurfaceBaseAddress_start  66
   76348 #define GEN8_3DSTATE_SO_BUFFER_SurfaceBaseAddress_start  66
   76349 #define GEN75_3DSTATE_SO_BUFFER_SurfaceBaseAddress_start  66
   76350 #define GEN7_3DSTATE_SO_BUFFER_SurfaceBaseAddress_start  66
   76351 
   76352 static inline uint32_t ATTRIBUTE_PURE
   76353 _3DSTATE_SO_BUFFER_SurfaceBaseAddress_start(const struct gen_device_info *devinfo)
   76354 {
   76355    switch (devinfo->gen) {
   76356    case 10: return 66;
   76357    case 9: return 66;
   76358    case 8: return 66;
   76359    case 7:
   76360       if (devinfo->is_haswell) {
   76361          return 66;
   76362       } else {
   76363          return 66;
   76364       }
   76365    case 6: return 0;
   76366    case 5: return 0;
   76367    case 4:
   76368       if (devinfo->is_g4x) {
   76369          return 0;
   76370       } else {
   76371          return 0;
   76372       }
   76373    default:
   76374       unreachable("Invalid hardware generation");
   76375    }
   76376 }
   76377 
   76378 
   76379 
   76380 /* 3DSTATE_SO_BUFFER::Surface End Address */
   76381 
   76382 
   76383 #define GEN75_3DSTATE_SO_BUFFER_SurfaceEndAddress_bits  30
   76384 #define GEN7_3DSTATE_SO_BUFFER_SurfaceEndAddress_bits  30
   76385 
   76386 static inline uint32_t ATTRIBUTE_PURE
   76387 _3DSTATE_SO_BUFFER_SurfaceEndAddress_bits(const struct gen_device_info *devinfo)
   76388 {
   76389    switch (devinfo->gen) {
   76390    case 10: return 0;
   76391    case 9: return 0;
   76392    case 8: return 0;
   76393    case 7:
   76394       if (devinfo->is_haswell) {
   76395          return 30;
   76396       } else {
   76397          return 30;
   76398       }
   76399    case 6: return 0;
   76400    case 5: return 0;
   76401    case 4:
   76402       if (devinfo->is_g4x) {
   76403          return 0;
   76404       } else {
   76405          return 0;
   76406       }
   76407    default:
   76408       unreachable("Invalid hardware generation");
   76409    }
   76410 }
   76411 
   76412 
   76413 
   76414 #define GEN75_3DSTATE_SO_BUFFER_SurfaceEndAddress_start  98
   76415 #define GEN7_3DSTATE_SO_BUFFER_SurfaceEndAddress_start  98
   76416 
   76417 static inline uint32_t ATTRIBUTE_PURE
   76418 _3DSTATE_SO_BUFFER_SurfaceEndAddress_start(const struct gen_device_info *devinfo)
   76419 {
   76420    switch (devinfo->gen) {
   76421    case 10: return 0;
   76422    case 9: return 0;
   76423    case 8: return 0;
   76424    case 7:
   76425       if (devinfo->is_haswell) {
   76426          return 98;
   76427       } else {
   76428          return 98;
   76429       }
   76430    case 6: return 0;
   76431    case 5: return 0;
   76432    case 4:
   76433       if (devinfo->is_g4x) {
   76434          return 0;
   76435       } else {
   76436          return 0;
   76437       }
   76438    default:
   76439       unreachable("Invalid hardware generation");
   76440    }
   76441 }
   76442 
   76443 
   76444 
   76445 /* 3DSTATE_SO_BUFFER::Surface Pitch */
   76446 
   76447 
   76448 #define GEN75_3DSTATE_SO_BUFFER_SurfacePitch_bits  12
   76449 #define GEN7_3DSTATE_SO_BUFFER_SurfacePitch_bits  12
   76450 
   76451 static inline uint32_t ATTRIBUTE_PURE
   76452 _3DSTATE_SO_BUFFER_SurfacePitch_bits(const struct gen_device_info *devinfo)
   76453 {
   76454    switch (devinfo->gen) {
   76455    case 10: return 0;
   76456    case 9: return 0;
   76457    case 8: return 0;
   76458    case 7:
   76459       if (devinfo->is_haswell) {
   76460          return 12;
   76461       } else {
   76462          return 12;
   76463       }
   76464    case 6: return 0;
   76465    case 5: return 0;
   76466    case 4:
   76467       if (devinfo->is_g4x) {
   76468          return 0;
   76469       } else {
   76470          return 0;
   76471       }
   76472    default:
   76473       unreachable("Invalid hardware generation");
   76474    }
   76475 }
   76476 
   76477 
   76478 
   76479 #define GEN75_3DSTATE_SO_BUFFER_SurfacePitch_start  32
   76480 #define GEN7_3DSTATE_SO_BUFFER_SurfacePitch_start  32
   76481 
   76482 static inline uint32_t ATTRIBUTE_PURE
   76483 _3DSTATE_SO_BUFFER_SurfacePitch_start(const struct gen_device_info *devinfo)
   76484 {
   76485    switch (devinfo->gen) {
   76486    case 10: return 0;
   76487    case 9: return 0;
   76488    case 8: return 0;
   76489    case 7:
   76490       if (devinfo->is_haswell) {
   76491          return 32;
   76492       } else {
   76493          return 32;
   76494       }
   76495    case 6: return 0;
   76496    case 5: return 0;
   76497    case 4:
   76498       if (devinfo->is_g4x) {
   76499          return 0;
   76500       } else {
   76501          return 0;
   76502       }
   76503    default:
   76504       unreachable("Invalid hardware generation");
   76505    }
   76506 }
   76507 
   76508 
   76509 
   76510 /* 3DSTATE_SO_BUFFER::Surface Size */
   76511 
   76512 
   76513 #define GEN10_3DSTATE_SO_BUFFER_SurfaceSize_bits  30
   76514 #define GEN9_3DSTATE_SO_BUFFER_SurfaceSize_bits  30
   76515 #define GEN8_3DSTATE_SO_BUFFER_SurfaceSize_bits  30
   76516 
   76517 static inline uint32_t ATTRIBUTE_PURE
   76518 _3DSTATE_SO_BUFFER_SurfaceSize_bits(const struct gen_device_info *devinfo)
   76519 {
   76520    switch (devinfo->gen) {
   76521    case 10: return 30;
   76522    case 9: return 30;
   76523    case 8: return 30;
   76524    case 7:
   76525       if (devinfo->is_haswell) {
   76526          return 0;
   76527       } else {
   76528          return 0;
   76529       }
   76530    case 6: return 0;
   76531    case 5: return 0;
   76532    case 4:
   76533       if (devinfo->is_g4x) {
   76534          return 0;
   76535       } else {
   76536          return 0;
   76537       }
   76538    default:
   76539       unreachable("Invalid hardware generation");
   76540    }
   76541 }
   76542 
   76543 
   76544 
   76545 #define GEN10_3DSTATE_SO_BUFFER_SurfaceSize_start  128
   76546 #define GEN9_3DSTATE_SO_BUFFER_SurfaceSize_start  128
   76547 #define GEN8_3DSTATE_SO_BUFFER_SurfaceSize_start  128
   76548 
   76549 static inline uint32_t ATTRIBUTE_PURE
   76550 _3DSTATE_SO_BUFFER_SurfaceSize_start(const struct gen_device_info *devinfo)
   76551 {
   76552    switch (devinfo->gen) {
   76553    case 10: return 128;
   76554    case 9: return 128;
   76555    case 8: return 128;
   76556    case 7:
   76557       if (devinfo->is_haswell) {
   76558          return 0;
   76559       } else {
   76560          return 0;
   76561       }
   76562    case 6: return 0;
   76563    case 5: return 0;
   76564    case 4:
   76565       if (devinfo->is_g4x) {
   76566          return 0;
   76567       } else {
   76568          return 0;
   76569       }
   76570    default:
   76571       unreachable("Invalid hardware generation");
   76572    }
   76573 }
   76574 
   76575 
   76576 
   76577 /* 3DSTATE_SO_DECL_LIST */
   76578 
   76579 
   76580 
   76581 
   76582 
   76583 /* 3DSTATE_SO_DECL_LIST::3D Command Opcode */
   76584 
   76585 
   76586 #define GEN10_3DSTATE_SO_DECL_LIST_3DCommandOpcode_bits  3
   76587 #define GEN9_3DSTATE_SO_DECL_LIST_3DCommandOpcode_bits  3
   76588 #define GEN8_3DSTATE_SO_DECL_LIST_3DCommandOpcode_bits  3
   76589 #define GEN75_3DSTATE_SO_DECL_LIST_3DCommandOpcode_bits  3
   76590 #define GEN7_3DSTATE_SO_DECL_LIST_3DCommandOpcode_bits  3
   76591 
   76592 static inline uint32_t ATTRIBUTE_PURE
   76593 _3DSTATE_SO_DECL_LIST_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   76594 {
   76595    switch (devinfo->gen) {
   76596    case 10: return 3;
   76597    case 9: return 3;
   76598    case 8: return 3;
   76599    case 7:
   76600       if (devinfo->is_haswell) {
   76601          return 3;
   76602       } else {
   76603          return 3;
   76604       }
   76605    case 6: return 0;
   76606    case 5: return 0;
   76607    case 4:
   76608       if (devinfo->is_g4x) {
   76609          return 0;
   76610       } else {
   76611          return 0;
   76612       }
   76613    default:
   76614       unreachable("Invalid hardware generation");
   76615    }
   76616 }
   76617 
   76618 
   76619 
   76620 #define GEN10_3DSTATE_SO_DECL_LIST_3DCommandOpcode_start  24
   76621 #define GEN9_3DSTATE_SO_DECL_LIST_3DCommandOpcode_start  24
   76622 #define GEN8_3DSTATE_SO_DECL_LIST_3DCommandOpcode_start  24
   76623 #define GEN75_3DSTATE_SO_DECL_LIST_3DCommandOpcode_start  24
   76624 #define GEN7_3DSTATE_SO_DECL_LIST_3DCommandOpcode_start  24
   76625 
   76626 static inline uint32_t ATTRIBUTE_PURE
   76627 _3DSTATE_SO_DECL_LIST_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   76628 {
   76629    switch (devinfo->gen) {
   76630    case 10: return 24;
   76631    case 9: return 24;
   76632    case 8: return 24;
   76633    case 7:
   76634       if (devinfo->is_haswell) {
   76635          return 24;
   76636       } else {
   76637          return 24;
   76638       }
   76639    case 6: return 0;
   76640    case 5: return 0;
   76641    case 4:
   76642       if (devinfo->is_g4x) {
   76643          return 0;
   76644       } else {
   76645          return 0;
   76646       }
   76647    default:
   76648       unreachable("Invalid hardware generation");
   76649    }
   76650 }
   76651 
   76652 
   76653 
   76654 /* 3DSTATE_SO_DECL_LIST::3D Command Sub Opcode */
   76655 
   76656 
   76657 #define GEN10_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_bits  8
   76658 #define GEN9_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_bits  8
   76659 #define GEN8_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_bits  8
   76660 #define GEN75_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_bits  8
   76661 #define GEN7_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_bits  8
   76662 
   76663 static inline uint32_t ATTRIBUTE_PURE
   76664 _3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   76665 {
   76666    switch (devinfo->gen) {
   76667    case 10: return 8;
   76668    case 9: return 8;
   76669    case 8: return 8;
   76670    case 7:
   76671       if (devinfo->is_haswell) {
   76672          return 8;
   76673       } else {
   76674          return 8;
   76675       }
   76676    case 6: return 0;
   76677    case 5: return 0;
   76678    case 4:
   76679       if (devinfo->is_g4x) {
   76680          return 0;
   76681       } else {
   76682          return 0;
   76683       }
   76684    default:
   76685       unreachable("Invalid hardware generation");
   76686    }
   76687 }
   76688 
   76689 
   76690 
   76691 #define GEN10_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_start  16
   76692 #define GEN9_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_start  16
   76693 #define GEN8_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_start  16
   76694 #define GEN75_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_start  16
   76695 #define GEN7_3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_start  16
   76696 
   76697 static inline uint32_t ATTRIBUTE_PURE
   76698 _3DSTATE_SO_DECL_LIST_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   76699 {
   76700    switch (devinfo->gen) {
   76701    case 10: return 16;
   76702    case 9: return 16;
   76703    case 8: return 16;
   76704    case 7:
   76705       if (devinfo->is_haswell) {
   76706          return 16;
   76707       } else {
   76708          return 16;
   76709       }
   76710    case 6: return 0;
   76711    case 5: return 0;
   76712    case 4:
   76713       if (devinfo->is_g4x) {
   76714          return 0;
   76715       } else {
   76716          return 0;
   76717       }
   76718    default:
   76719       unreachable("Invalid hardware generation");
   76720    }
   76721 }
   76722 
   76723 
   76724 
   76725 /* 3DSTATE_SO_DECL_LIST::Command SubType */
   76726 
   76727 
   76728 #define GEN10_3DSTATE_SO_DECL_LIST_CommandSubType_bits  2
   76729 #define GEN9_3DSTATE_SO_DECL_LIST_CommandSubType_bits  2
   76730 #define GEN8_3DSTATE_SO_DECL_LIST_CommandSubType_bits  2
   76731 #define GEN75_3DSTATE_SO_DECL_LIST_CommandSubType_bits  2
   76732 #define GEN7_3DSTATE_SO_DECL_LIST_CommandSubType_bits  2
   76733 
   76734 static inline uint32_t ATTRIBUTE_PURE
   76735 _3DSTATE_SO_DECL_LIST_CommandSubType_bits(const struct gen_device_info *devinfo)
   76736 {
   76737    switch (devinfo->gen) {
   76738    case 10: return 2;
   76739    case 9: return 2;
   76740    case 8: return 2;
   76741    case 7:
   76742       if (devinfo->is_haswell) {
   76743          return 2;
   76744       } else {
   76745          return 2;
   76746       }
   76747    case 6: return 0;
   76748    case 5: return 0;
   76749    case 4:
   76750       if (devinfo->is_g4x) {
   76751          return 0;
   76752       } else {
   76753          return 0;
   76754       }
   76755    default:
   76756       unreachable("Invalid hardware generation");
   76757    }
   76758 }
   76759 
   76760 
   76761 
   76762 #define GEN10_3DSTATE_SO_DECL_LIST_CommandSubType_start  27
   76763 #define GEN9_3DSTATE_SO_DECL_LIST_CommandSubType_start  27
   76764 #define GEN8_3DSTATE_SO_DECL_LIST_CommandSubType_start  27
   76765 #define GEN75_3DSTATE_SO_DECL_LIST_CommandSubType_start  27
   76766 #define GEN7_3DSTATE_SO_DECL_LIST_CommandSubType_start  27
   76767 
   76768 static inline uint32_t ATTRIBUTE_PURE
   76769 _3DSTATE_SO_DECL_LIST_CommandSubType_start(const struct gen_device_info *devinfo)
   76770 {
   76771    switch (devinfo->gen) {
   76772    case 10: return 27;
   76773    case 9: return 27;
   76774    case 8: return 27;
   76775    case 7:
   76776       if (devinfo->is_haswell) {
   76777          return 27;
   76778       } else {
   76779          return 27;
   76780       }
   76781    case 6: return 0;
   76782    case 5: return 0;
   76783    case 4:
   76784       if (devinfo->is_g4x) {
   76785          return 0;
   76786       } else {
   76787          return 0;
   76788       }
   76789    default:
   76790       unreachable("Invalid hardware generation");
   76791    }
   76792 }
   76793 
   76794 
   76795 
   76796 /* 3DSTATE_SO_DECL_LIST::Command Type */
   76797 
   76798 
   76799 #define GEN10_3DSTATE_SO_DECL_LIST_CommandType_bits  3
   76800 #define GEN9_3DSTATE_SO_DECL_LIST_CommandType_bits  3
   76801 #define GEN8_3DSTATE_SO_DECL_LIST_CommandType_bits  3
   76802 #define GEN75_3DSTATE_SO_DECL_LIST_CommandType_bits  3
   76803 #define GEN7_3DSTATE_SO_DECL_LIST_CommandType_bits  3
   76804 
   76805 static inline uint32_t ATTRIBUTE_PURE
   76806 _3DSTATE_SO_DECL_LIST_CommandType_bits(const struct gen_device_info *devinfo)
   76807 {
   76808    switch (devinfo->gen) {
   76809    case 10: return 3;
   76810    case 9: return 3;
   76811    case 8: return 3;
   76812    case 7:
   76813       if (devinfo->is_haswell) {
   76814          return 3;
   76815       } else {
   76816          return 3;
   76817       }
   76818    case 6: return 0;
   76819    case 5: return 0;
   76820    case 4:
   76821       if (devinfo->is_g4x) {
   76822          return 0;
   76823       } else {
   76824          return 0;
   76825       }
   76826    default:
   76827       unreachable("Invalid hardware generation");
   76828    }
   76829 }
   76830 
   76831 
   76832 
   76833 #define GEN10_3DSTATE_SO_DECL_LIST_CommandType_start  29
   76834 #define GEN9_3DSTATE_SO_DECL_LIST_CommandType_start  29
   76835 #define GEN8_3DSTATE_SO_DECL_LIST_CommandType_start  29
   76836 #define GEN75_3DSTATE_SO_DECL_LIST_CommandType_start  29
   76837 #define GEN7_3DSTATE_SO_DECL_LIST_CommandType_start  29
   76838 
   76839 static inline uint32_t ATTRIBUTE_PURE
   76840 _3DSTATE_SO_DECL_LIST_CommandType_start(const struct gen_device_info *devinfo)
   76841 {
   76842    switch (devinfo->gen) {
   76843    case 10: return 29;
   76844    case 9: return 29;
   76845    case 8: return 29;
   76846    case 7:
   76847       if (devinfo->is_haswell) {
   76848          return 29;
   76849       } else {
   76850          return 29;
   76851       }
   76852    case 6: return 0;
   76853    case 5: return 0;
   76854    case 4:
   76855       if (devinfo->is_g4x) {
   76856          return 0;
   76857       } else {
   76858          return 0;
   76859       }
   76860    default:
   76861       unreachable("Invalid hardware generation");
   76862    }
   76863 }
   76864 
   76865 
   76866 
   76867 /* 3DSTATE_SO_DECL_LIST::DWord Length */
   76868 
   76869 
   76870 #define GEN10_3DSTATE_SO_DECL_LIST_DWordLength_bits  9
   76871 #define GEN9_3DSTATE_SO_DECL_LIST_DWordLength_bits  9
   76872 #define GEN8_3DSTATE_SO_DECL_LIST_DWordLength_bits  9
   76873 #define GEN75_3DSTATE_SO_DECL_LIST_DWordLength_bits  9
   76874 #define GEN7_3DSTATE_SO_DECL_LIST_DWordLength_bits  9
   76875 
   76876 static inline uint32_t ATTRIBUTE_PURE
   76877 _3DSTATE_SO_DECL_LIST_DWordLength_bits(const struct gen_device_info *devinfo)
   76878 {
   76879    switch (devinfo->gen) {
   76880    case 10: return 9;
   76881    case 9: return 9;
   76882    case 8: return 9;
   76883    case 7:
   76884       if (devinfo->is_haswell) {
   76885          return 9;
   76886       } else {
   76887          return 9;
   76888       }
   76889    case 6: return 0;
   76890    case 5: return 0;
   76891    case 4:
   76892       if (devinfo->is_g4x) {
   76893          return 0;
   76894       } else {
   76895          return 0;
   76896       }
   76897    default:
   76898       unreachable("Invalid hardware generation");
   76899    }
   76900 }
   76901 
   76902 
   76903 
   76904 #define GEN10_3DSTATE_SO_DECL_LIST_DWordLength_start  0
   76905 #define GEN9_3DSTATE_SO_DECL_LIST_DWordLength_start  0
   76906 #define GEN8_3DSTATE_SO_DECL_LIST_DWordLength_start  0
   76907 #define GEN75_3DSTATE_SO_DECL_LIST_DWordLength_start  0
   76908 #define GEN7_3DSTATE_SO_DECL_LIST_DWordLength_start  0
   76909 
   76910 static inline uint32_t ATTRIBUTE_PURE
   76911 _3DSTATE_SO_DECL_LIST_DWordLength_start(const struct gen_device_info *devinfo)
   76912 {
   76913    switch (devinfo->gen) {
   76914    case 10: return 0;
   76915    case 9: return 0;
   76916    case 8: return 0;
   76917    case 7:
   76918       if (devinfo->is_haswell) {
   76919          return 0;
   76920       } else {
   76921          return 0;
   76922       }
   76923    case 6: return 0;
   76924    case 5: return 0;
   76925    case 4:
   76926       if (devinfo->is_g4x) {
   76927          return 0;
   76928       } else {
   76929          return 0;
   76930       }
   76931    default:
   76932       unreachable("Invalid hardware generation");
   76933    }
   76934 }
   76935 
   76936 
   76937 
   76938 /* 3DSTATE_SO_DECL_LIST::Entry */
   76939 
   76940 
   76941 #define GEN10_3DSTATE_SO_DECL_LIST_Entry_bits  64
   76942 #define GEN9_3DSTATE_SO_DECL_LIST_Entry_bits  64
   76943 #define GEN8_3DSTATE_SO_DECL_LIST_Entry_bits  64
   76944 #define GEN75_3DSTATE_SO_DECL_LIST_Entry_bits  64
   76945 #define GEN7_3DSTATE_SO_DECL_LIST_Entry_bits  64
   76946 
   76947 static inline uint32_t ATTRIBUTE_PURE
   76948 _3DSTATE_SO_DECL_LIST_Entry_bits(const struct gen_device_info *devinfo)
   76949 {
   76950    switch (devinfo->gen) {
   76951    case 10: return 64;
   76952    case 9: return 64;
   76953    case 8: return 64;
   76954    case 7:
   76955       if (devinfo->is_haswell) {
   76956          return 64;
   76957       } else {
   76958          return 64;
   76959       }
   76960    case 6: return 0;
   76961    case 5: return 0;
   76962    case 4:
   76963       if (devinfo->is_g4x) {
   76964          return 0;
   76965       } else {
   76966          return 0;
   76967       }
   76968    default:
   76969       unreachable("Invalid hardware generation");
   76970    }
   76971 }
   76972 
   76973 
   76974 
   76975 #define GEN10_3DSTATE_SO_DECL_LIST_Entry_start  0
   76976 #define GEN9_3DSTATE_SO_DECL_LIST_Entry_start  0
   76977 #define GEN8_3DSTATE_SO_DECL_LIST_Entry_start  0
   76978 #define GEN75_3DSTATE_SO_DECL_LIST_Entry_start  0
   76979 #define GEN7_3DSTATE_SO_DECL_LIST_Entry_start  0
   76980 
   76981 static inline uint32_t ATTRIBUTE_PURE
   76982 _3DSTATE_SO_DECL_LIST_Entry_start(const struct gen_device_info *devinfo)
   76983 {
   76984    switch (devinfo->gen) {
   76985    case 10: return 0;
   76986    case 9: return 0;
   76987    case 8: return 0;
   76988    case 7:
   76989       if (devinfo->is_haswell) {
   76990          return 0;
   76991       } else {
   76992          return 0;
   76993       }
   76994    case 6: return 0;
   76995    case 5: return 0;
   76996    case 4:
   76997       if (devinfo->is_g4x) {
   76998          return 0;
   76999       } else {
   77000          return 0;
   77001       }
   77002    default:
   77003       unreachable("Invalid hardware generation");
   77004    }
   77005 }
   77006 
   77007 
   77008 
   77009 /* 3DSTATE_SO_DECL_LIST::Num Entries [0] */
   77010 
   77011 
   77012 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries0_bits  8
   77013 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries0_bits  8
   77014 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries0_bits  8
   77015 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries0_bits  8
   77016 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries0_bits  8
   77017 
   77018 static inline uint32_t ATTRIBUTE_PURE
   77019 _3DSTATE_SO_DECL_LIST_NumEntries0_bits(const struct gen_device_info *devinfo)
   77020 {
   77021    switch (devinfo->gen) {
   77022    case 10: return 8;
   77023    case 9: return 8;
   77024    case 8: return 8;
   77025    case 7:
   77026       if (devinfo->is_haswell) {
   77027          return 8;
   77028       } else {
   77029          return 8;
   77030       }
   77031    case 6: return 0;
   77032    case 5: return 0;
   77033    case 4:
   77034       if (devinfo->is_g4x) {
   77035          return 0;
   77036       } else {
   77037          return 0;
   77038       }
   77039    default:
   77040       unreachable("Invalid hardware generation");
   77041    }
   77042 }
   77043 
   77044 
   77045 
   77046 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries0_start  64
   77047 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries0_start  64
   77048 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries0_start  64
   77049 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries0_start  64
   77050 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries0_start  64
   77051 
   77052 static inline uint32_t ATTRIBUTE_PURE
   77053 _3DSTATE_SO_DECL_LIST_NumEntries0_start(const struct gen_device_info *devinfo)
   77054 {
   77055    switch (devinfo->gen) {
   77056    case 10: return 64;
   77057    case 9: return 64;
   77058    case 8: return 64;
   77059    case 7:
   77060       if (devinfo->is_haswell) {
   77061          return 64;
   77062       } else {
   77063          return 64;
   77064       }
   77065    case 6: return 0;
   77066    case 5: return 0;
   77067    case 4:
   77068       if (devinfo->is_g4x) {
   77069          return 0;
   77070       } else {
   77071          return 0;
   77072       }
   77073    default:
   77074       unreachable("Invalid hardware generation");
   77075    }
   77076 }
   77077 
   77078 
   77079 
   77080 /* 3DSTATE_SO_DECL_LIST::Num Entries [1] */
   77081 
   77082 
   77083 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries1_bits  8
   77084 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries1_bits  8
   77085 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries1_bits  8
   77086 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries1_bits  8
   77087 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries1_bits  8
   77088 
   77089 static inline uint32_t ATTRIBUTE_PURE
   77090 _3DSTATE_SO_DECL_LIST_NumEntries1_bits(const struct gen_device_info *devinfo)
   77091 {
   77092    switch (devinfo->gen) {
   77093    case 10: return 8;
   77094    case 9: return 8;
   77095    case 8: return 8;
   77096    case 7:
   77097       if (devinfo->is_haswell) {
   77098          return 8;
   77099       } else {
   77100          return 8;
   77101       }
   77102    case 6: return 0;
   77103    case 5: return 0;
   77104    case 4:
   77105       if (devinfo->is_g4x) {
   77106          return 0;
   77107       } else {
   77108          return 0;
   77109       }
   77110    default:
   77111       unreachable("Invalid hardware generation");
   77112    }
   77113 }
   77114 
   77115 
   77116 
   77117 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries1_start  72
   77118 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries1_start  72
   77119 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries1_start  72
   77120 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries1_start  72
   77121 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries1_start  72
   77122 
   77123 static inline uint32_t ATTRIBUTE_PURE
   77124 _3DSTATE_SO_DECL_LIST_NumEntries1_start(const struct gen_device_info *devinfo)
   77125 {
   77126    switch (devinfo->gen) {
   77127    case 10: return 72;
   77128    case 9: return 72;
   77129    case 8: return 72;
   77130    case 7:
   77131       if (devinfo->is_haswell) {
   77132          return 72;
   77133       } else {
   77134          return 72;
   77135       }
   77136    case 6: return 0;
   77137    case 5: return 0;
   77138    case 4:
   77139       if (devinfo->is_g4x) {
   77140          return 0;
   77141       } else {
   77142          return 0;
   77143       }
   77144    default:
   77145       unreachable("Invalid hardware generation");
   77146    }
   77147 }
   77148 
   77149 
   77150 
   77151 /* 3DSTATE_SO_DECL_LIST::Num Entries [2] */
   77152 
   77153 
   77154 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries2_bits  8
   77155 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries2_bits  8
   77156 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries2_bits  8
   77157 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries2_bits  8
   77158 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries2_bits  8
   77159 
   77160 static inline uint32_t ATTRIBUTE_PURE
   77161 _3DSTATE_SO_DECL_LIST_NumEntries2_bits(const struct gen_device_info *devinfo)
   77162 {
   77163    switch (devinfo->gen) {
   77164    case 10: return 8;
   77165    case 9: return 8;
   77166    case 8: return 8;
   77167    case 7:
   77168       if (devinfo->is_haswell) {
   77169          return 8;
   77170       } else {
   77171          return 8;
   77172       }
   77173    case 6: return 0;
   77174    case 5: return 0;
   77175    case 4:
   77176       if (devinfo->is_g4x) {
   77177          return 0;
   77178       } else {
   77179          return 0;
   77180       }
   77181    default:
   77182       unreachable("Invalid hardware generation");
   77183    }
   77184 }
   77185 
   77186 
   77187 
   77188 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries2_start  80
   77189 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries2_start  80
   77190 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries2_start  80
   77191 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries2_start  80
   77192 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries2_start  80
   77193 
   77194 static inline uint32_t ATTRIBUTE_PURE
   77195 _3DSTATE_SO_DECL_LIST_NumEntries2_start(const struct gen_device_info *devinfo)
   77196 {
   77197    switch (devinfo->gen) {
   77198    case 10: return 80;
   77199    case 9: return 80;
   77200    case 8: return 80;
   77201    case 7:
   77202       if (devinfo->is_haswell) {
   77203          return 80;
   77204       } else {
   77205          return 80;
   77206       }
   77207    case 6: return 0;
   77208    case 5: return 0;
   77209    case 4:
   77210       if (devinfo->is_g4x) {
   77211          return 0;
   77212       } else {
   77213          return 0;
   77214       }
   77215    default:
   77216       unreachable("Invalid hardware generation");
   77217    }
   77218 }
   77219 
   77220 
   77221 
   77222 /* 3DSTATE_SO_DECL_LIST::Num Entries [3] */
   77223 
   77224 
   77225 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries3_bits  8
   77226 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries3_bits  8
   77227 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries3_bits  8
   77228 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries3_bits  8
   77229 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries3_bits  8
   77230 
   77231 static inline uint32_t ATTRIBUTE_PURE
   77232 _3DSTATE_SO_DECL_LIST_NumEntries3_bits(const struct gen_device_info *devinfo)
   77233 {
   77234    switch (devinfo->gen) {
   77235    case 10: return 8;
   77236    case 9: return 8;
   77237    case 8: return 8;
   77238    case 7:
   77239       if (devinfo->is_haswell) {
   77240          return 8;
   77241       } else {
   77242          return 8;
   77243       }
   77244    case 6: return 0;
   77245    case 5: return 0;
   77246    case 4:
   77247       if (devinfo->is_g4x) {
   77248          return 0;
   77249       } else {
   77250          return 0;
   77251       }
   77252    default:
   77253       unreachable("Invalid hardware generation");
   77254    }
   77255 }
   77256 
   77257 
   77258 
   77259 #define GEN10_3DSTATE_SO_DECL_LIST_NumEntries3_start  88
   77260 #define GEN9_3DSTATE_SO_DECL_LIST_NumEntries3_start  88
   77261 #define GEN8_3DSTATE_SO_DECL_LIST_NumEntries3_start  88
   77262 #define GEN75_3DSTATE_SO_DECL_LIST_NumEntries3_start  88
   77263 #define GEN7_3DSTATE_SO_DECL_LIST_NumEntries3_start  88
   77264 
   77265 static inline uint32_t ATTRIBUTE_PURE
   77266 _3DSTATE_SO_DECL_LIST_NumEntries3_start(const struct gen_device_info *devinfo)
   77267 {
   77268    switch (devinfo->gen) {
   77269    case 10: return 88;
   77270    case 9: return 88;
   77271    case 8: return 88;
   77272    case 7:
   77273       if (devinfo->is_haswell) {
   77274          return 88;
   77275       } else {
   77276          return 88;
   77277       }
   77278    case 6: return 0;
   77279    case 5: return 0;
   77280    case 4:
   77281       if (devinfo->is_g4x) {
   77282          return 0;
   77283       } else {
   77284          return 0;
   77285       }
   77286    default:
   77287       unreachable("Invalid hardware generation");
   77288    }
   77289 }
   77290 
   77291 
   77292 
   77293 /* 3DSTATE_SO_DECL_LIST::Stream to Buffer Selects [0] */
   77294 
   77295 
   77296 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_bits  4
   77297 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_bits  4
   77298 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_bits  4
   77299 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_bits  4
   77300 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_bits  4
   77301 
   77302 static inline uint32_t ATTRIBUTE_PURE
   77303 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_bits(const struct gen_device_info *devinfo)
   77304 {
   77305    switch (devinfo->gen) {
   77306    case 10: return 4;
   77307    case 9: return 4;
   77308    case 8: return 4;
   77309    case 7:
   77310       if (devinfo->is_haswell) {
   77311          return 4;
   77312       } else {
   77313          return 4;
   77314       }
   77315    case 6: return 0;
   77316    case 5: return 0;
   77317    case 4:
   77318       if (devinfo->is_g4x) {
   77319          return 0;
   77320       } else {
   77321          return 0;
   77322       }
   77323    default:
   77324       unreachable("Invalid hardware generation");
   77325    }
   77326 }
   77327 
   77328 
   77329 
   77330 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_start  32
   77331 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_start  32
   77332 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_start  32
   77333 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_start  32
   77334 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_start  32
   77335 
   77336 static inline uint32_t ATTRIBUTE_PURE
   77337 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects0_start(const struct gen_device_info *devinfo)
   77338 {
   77339    switch (devinfo->gen) {
   77340    case 10: return 32;
   77341    case 9: return 32;
   77342    case 8: return 32;
   77343    case 7:
   77344       if (devinfo->is_haswell) {
   77345          return 32;
   77346       } else {
   77347          return 32;
   77348       }
   77349    case 6: return 0;
   77350    case 5: return 0;
   77351    case 4:
   77352       if (devinfo->is_g4x) {
   77353          return 0;
   77354       } else {
   77355          return 0;
   77356       }
   77357    default:
   77358       unreachable("Invalid hardware generation");
   77359    }
   77360 }
   77361 
   77362 
   77363 
   77364 /* 3DSTATE_SO_DECL_LIST::Stream to Buffer Selects [1] */
   77365 
   77366 
   77367 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_bits  4
   77368 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_bits  4
   77369 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_bits  4
   77370 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_bits  4
   77371 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_bits  4
   77372 
   77373 static inline uint32_t ATTRIBUTE_PURE
   77374 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_bits(const struct gen_device_info *devinfo)
   77375 {
   77376    switch (devinfo->gen) {
   77377    case 10: return 4;
   77378    case 9: return 4;
   77379    case 8: return 4;
   77380    case 7:
   77381       if (devinfo->is_haswell) {
   77382          return 4;
   77383       } else {
   77384          return 4;
   77385       }
   77386    case 6: return 0;
   77387    case 5: return 0;
   77388    case 4:
   77389       if (devinfo->is_g4x) {
   77390          return 0;
   77391       } else {
   77392          return 0;
   77393       }
   77394    default:
   77395       unreachable("Invalid hardware generation");
   77396    }
   77397 }
   77398 
   77399 
   77400 
   77401 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_start  36
   77402 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_start  36
   77403 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_start  36
   77404 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_start  36
   77405 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_start  36
   77406 
   77407 static inline uint32_t ATTRIBUTE_PURE
   77408 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects1_start(const struct gen_device_info *devinfo)
   77409 {
   77410    switch (devinfo->gen) {
   77411    case 10: return 36;
   77412    case 9: return 36;
   77413    case 8: return 36;
   77414    case 7:
   77415       if (devinfo->is_haswell) {
   77416          return 36;
   77417       } else {
   77418          return 36;
   77419       }
   77420    case 6: return 0;
   77421    case 5: return 0;
   77422    case 4:
   77423       if (devinfo->is_g4x) {
   77424          return 0;
   77425       } else {
   77426          return 0;
   77427       }
   77428    default:
   77429       unreachable("Invalid hardware generation");
   77430    }
   77431 }
   77432 
   77433 
   77434 
   77435 /* 3DSTATE_SO_DECL_LIST::Stream to Buffer Selects [2] */
   77436 
   77437 
   77438 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_bits  4
   77439 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_bits  4
   77440 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_bits  4
   77441 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_bits  4
   77442 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_bits  4
   77443 
   77444 static inline uint32_t ATTRIBUTE_PURE
   77445 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_bits(const struct gen_device_info *devinfo)
   77446 {
   77447    switch (devinfo->gen) {
   77448    case 10: return 4;
   77449    case 9: return 4;
   77450    case 8: return 4;
   77451    case 7:
   77452       if (devinfo->is_haswell) {
   77453          return 4;
   77454       } else {
   77455          return 4;
   77456       }
   77457    case 6: return 0;
   77458    case 5: return 0;
   77459    case 4:
   77460       if (devinfo->is_g4x) {
   77461          return 0;
   77462       } else {
   77463          return 0;
   77464       }
   77465    default:
   77466       unreachable("Invalid hardware generation");
   77467    }
   77468 }
   77469 
   77470 
   77471 
   77472 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_start  40
   77473 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_start  40
   77474 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_start  40
   77475 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_start  40
   77476 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_start  40
   77477 
   77478 static inline uint32_t ATTRIBUTE_PURE
   77479 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects2_start(const struct gen_device_info *devinfo)
   77480 {
   77481    switch (devinfo->gen) {
   77482    case 10: return 40;
   77483    case 9: return 40;
   77484    case 8: return 40;
   77485    case 7:
   77486       if (devinfo->is_haswell) {
   77487          return 40;
   77488       } else {
   77489          return 40;
   77490       }
   77491    case 6: return 0;
   77492    case 5: return 0;
   77493    case 4:
   77494       if (devinfo->is_g4x) {
   77495          return 0;
   77496       } else {
   77497          return 0;
   77498       }
   77499    default:
   77500       unreachable("Invalid hardware generation");
   77501    }
   77502 }
   77503 
   77504 
   77505 
   77506 /* 3DSTATE_SO_DECL_LIST::Stream to Buffer Selects [3] */
   77507 
   77508 
   77509 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_bits  4
   77510 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_bits  4
   77511 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_bits  4
   77512 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_bits  4
   77513 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_bits  4
   77514 
   77515 static inline uint32_t ATTRIBUTE_PURE
   77516 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_bits(const struct gen_device_info *devinfo)
   77517 {
   77518    switch (devinfo->gen) {
   77519    case 10: return 4;
   77520    case 9: return 4;
   77521    case 8: return 4;
   77522    case 7:
   77523       if (devinfo->is_haswell) {
   77524          return 4;
   77525       } else {
   77526          return 4;
   77527       }
   77528    case 6: return 0;
   77529    case 5: return 0;
   77530    case 4:
   77531       if (devinfo->is_g4x) {
   77532          return 0;
   77533       } else {
   77534          return 0;
   77535       }
   77536    default:
   77537       unreachable("Invalid hardware generation");
   77538    }
   77539 }
   77540 
   77541 
   77542 
   77543 #define GEN10_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_start  44
   77544 #define GEN9_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_start  44
   77545 #define GEN8_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_start  44
   77546 #define GEN75_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_start  44
   77547 #define GEN7_3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_start  44
   77548 
   77549 static inline uint32_t ATTRIBUTE_PURE
   77550 _3DSTATE_SO_DECL_LIST_StreamtoBufferSelects3_start(const struct gen_device_info *devinfo)
   77551 {
   77552    switch (devinfo->gen) {
   77553    case 10: return 44;
   77554    case 9: return 44;
   77555    case 8: return 44;
   77556    case 7:
   77557       if (devinfo->is_haswell) {
   77558          return 44;
   77559       } else {
   77560          return 44;
   77561       }
   77562    case 6: return 0;
   77563    case 5: return 0;
   77564    case 4:
   77565       if (devinfo->is_g4x) {
   77566          return 0;
   77567       } else {
   77568          return 0;
   77569       }
   77570    default:
   77571       unreachable("Invalid hardware generation");
   77572    }
   77573 }
   77574 
   77575 
   77576 
   77577 /* 3DSTATE_STENCIL_BUFFER */
   77578 
   77579 
   77580 #define GEN10_3DSTATE_STENCIL_BUFFER_length  5
   77581 #define GEN9_3DSTATE_STENCIL_BUFFER_length  5
   77582 #define GEN8_3DSTATE_STENCIL_BUFFER_length  5
   77583 #define GEN75_3DSTATE_STENCIL_BUFFER_length  3
   77584 #define GEN7_3DSTATE_STENCIL_BUFFER_length  3
   77585 #define GEN6_3DSTATE_STENCIL_BUFFER_length  3
   77586 #define GEN5_3DSTATE_STENCIL_BUFFER_length  3
   77587 
   77588 static inline uint32_t ATTRIBUTE_PURE
   77589 _3DSTATE_STENCIL_BUFFER_length(const struct gen_device_info *devinfo)
   77590 {
   77591    switch (devinfo->gen) {
   77592    case 10: return 5;
   77593    case 9: return 5;
   77594    case 8: return 5;
   77595    case 7:
   77596       if (devinfo->is_haswell) {
   77597          return 3;
   77598       } else {
   77599          return 3;
   77600       }
   77601    case 6: return 3;
   77602    case 5: return 3;
   77603    case 4:
   77604       if (devinfo->is_g4x) {
   77605          return 0;
   77606       } else {
   77607          return 0;
   77608       }
   77609    default:
   77610       unreachable("Invalid hardware generation");
   77611    }
   77612 }
   77613 
   77614 
   77615 
   77616 /* 3DSTATE_STENCIL_BUFFER::3D Command Opcode */
   77617 
   77618 
   77619 #define GEN10_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits  3
   77620 #define GEN9_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits  3
   77621 #define GEN8_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits  3
   77622 #define GEN75_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits  3
   77623 #define GEN7_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits  3
   77624 #define GEN6_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits  3
   77625 #define GEN5_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits  3
   77626 
   77627 static inline uint32_t ATTRIBUTE_PURE
   77628 _3DSTATE_STENCIL_BUFFER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   77629 {
   77630    switch (devinfo->gen) {
   77631    case 10: return 3;
   77632    case 9: return 3;
   77633    case 8: return 3;
   77634    case 7:
   77635       if (devinfo->is_haswell) {
   77636          return 3;
   77637       } else {
   77638          return 3;
   77639       }
   77640    case 6: return 3;
   77641    case 5: return 3;
   77642    case 4:
   77643       if (devinfo->is_g4x) {
   77644          return 0;
   77645       } else {
   77646          return 0;
   77647       }
   77648    default:
   77649       unreachable("Invalid hardware generation");
   77650    }
   77651 }
   77652 
   77653 
   77654 
   77655 #define GEN10_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start  24
   77656 #define GEN9_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start  24
   77657 #define GEN8_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start  24
   77658 #define GEN75_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start  24
   77659 #define GEN7_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start  24
   77660 #define GEN6_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start  24
   77661 #define GEN5_3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start  24
   77662 
   77663 static inline uint32_t ATTRIBUTE_PURE
   77664 _3DSTATE_STENCIL_BUFFER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   77665 {
   77666    switch (devinfo->gen) {
   77667    case 10: return 24;
   77668    case 9: return 24;
   77669    case 8: return 24;
   77670    case 7:
   77671       if (devinfo->is_haswell) {
   77672          return 24;
   77673       } else {
   77674          return 24;
   77675       }
   77676    case 6: return 24;
   77677    case 5: return 24;
   77678    case 4:
   77679       if (devinfo->is_g4x) {
   77680          return 0;
   77681       } else {
   77682          return 0;
   77683       }
   77684    default:
   77685       unreachable("Invalid hardware generation");
   77686    }
   77687 }
   77688 
   77689 
   77690 
   77691 /* 3DSTATE_STENCIL_BUFFER::3D Command Sub Opcode */
   77692 
   77693 
   77694 #define GEN10_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits  8
   77695 #define GEN9_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits  8
   77696 #define GEN8_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits  8
   77697 #define GEN75_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits  8
   77698 #define GEN7_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits  8
   77699 #define GEN6_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits  8
   77700 #define GEN5_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits  8
   77701 
   77702 static inline uint32_t ATTRIBUTE_PURE
   77703 _3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   77704 {
   77705    switch (devinfo->gen) {
   77706    case 10: return 8;
   77707    case 9: return 8;
   77708    case 8: return 8;
   77709    case 7:
   77710       if (devinfo->is_haswell) {
   77711          return 8;
   77712       } else {
   77713          return 8;
   77714       }
   77715    case 6: return 8;
   77716    case 5: return 8;
   77717    case 4:
   77718       if (devinfo->is_g4x) {
   77719          return 0;
   77720       } else {
   77721          return 0;
   77722       }
   77723    default:
   77724       unreachable("Invalid hardware generation");
   77725    }
   77726 }
   77727 
   77728 
   77729 
   77730 #define GEN10_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start  16
   77731 #define GEN9_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start  16
   77732 #define GEN8_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start  16
   77733 #define GEN75_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start  16
   77734 #define GEN7_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start  16
   77735 #define GEN6_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start  16
   77736 #define GEN5_3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start  16
   77737 
   77738 static inline uint32_t ATTRIBUTE_PURE
   77739 _3DSTATE_STENCIL_BUFFER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   77740 {
   77741    switch (devinfo->gen) {
   77742    case 10: return 16;
   77743    case 9: return 16;
   77744    case 8: return 16;
   77745    case 7:
   77746       if (devinfo->is_haswell) {
   77747          return 16;
   77748       } else {
   77749          return 16;
   77750       }
   77751    case 6: return 16;
   77752    case 5: return 16;
   77753    case 4:
   77754       if (devinfo->is_g4x) {
   77755          return 0;
   77756       } else {
   77757          return 0;
   77758       }
   77759    default:
   77760       unreachable("Invalid hardware generation");
   77761    }
   77762 }
   77763 
   77764 
   77765 
   77766 /* 3DSTATE_STENCIL_BUFFER::Command SubType */
   77767 
   77768 
   77769 #define GEN10_3DSTATE_STENCIL_BUFFER_CommandSubType_bits  2
   77770 #define GEN9_3DSTATE_STENCIL_BUFFER_CommandSubType_bits  2
   77771 #define GEN8_3DSTATE_STENCIL_BUFFER_CommandSubType_bits  2
   77772 #define GEN75_3DSTATE_STENCIL_BUFFER_CommandSubType_bits  2
   77773 #define GEN7_3DSTATE_STENCIL_BUFFER_CommandSubType_bits  2
   77774 #define GEN6_3DSTATE_STENCIL_BUFFER_CommandSubType_bits  2
   77775 #define GEN5_3DSTATE_STENCIL_BUFFER_CommandSubType_bits  2
   77776 
   77777 static inline uint32_t ATTRIBUTE_PURE
   77778 _3DSTATE_STENCIL_BUFFER_CommandSubType_bits(const struct gen_device_info *devinfo)
   77779 {
   77780    switch (devinfo->gen) {
   77781    case 10: return 2;
   77782    case 9: return 2;
   77783    case 8: return 2;
   77784    case 7:
   77785       if (devinfo->is_haswell) {
   77786          return 2;
   77787       } else {
   77788          return 2;
   77789       }
   77790    case 6: return 2;
   77791    case 5: return 2;
   77792    case 4:
   77793       if (devinfo->is_g4x) {
   77794          return 0;
   77795       } else {
   77796          return 0;
   77797       }
   77798    default:
   77799       unreachable("Invalid hardware generation");
   77800    }
   77801 }
   77802 
   77803 
   77804 
   77805 #define GEN10_3DSTATE_STENCIL_BUFFER_CommandSubType_start  27
   77806 #define GEN9_3DSTATE_STENCIL_BUFFER_CommandSubType_start  27
   77807 #define GEN8_3DSTATE_STENCIL_BUFFER_CommandSubType_start  27
   77808 #define GEN75_3DSTATE_STENCIL_BUFFER_CommandSubType_start  27
   77809 #define GEN7_3DSTATE_STENCIL_BUFFER_CommandSubType_start  27
   77810 #define GEN6_3DSTATE_STENCIL_BUFFER_CommandSubType_start  27
   77811 #define GEN5_3DSTATE_STENCIL_BUFFER_CommandSubType_start  27
   77812 
   77813 static inline uint32_t ATTRIBUTE_PURE
   77814 _3DSTATE_STENCIL_BUFFER_CommandSubType_start(const struct gen_device_info *devinfo)
   77815 {
   77816    switch (devinfo->gen) {
   77817    case 10: return 27;
   77818    case 9: return 27;
   77819    case 8: return 27;
   77820    case 7:
   77821       if (devinfo->is_haswell) {
   77822          return 27;
   77823       } else {
   77824          return 27;
   77825       }
   77826    case 6: return 27;
   77827    case 5: return 27;
   77828    case 4:
   77829       if (devinfo->is_g4x) {
   77830          return 0;
   77831       } else {
   77832          return 0;
   77833       }
   77834    default:
   77835       unreachable("Invalid hardware generation");
   77836    }
   77837 }
   77838 
   77839 
   77840 
   77841 /* 3DSTATE_STENCIL_BUFFER::Command Type */
   77842 
   77843 
   77844 #define GEN10_3DSTATE_STENCIL_BUFFER_CommandType_bits  3
   77845 #define GEN9_3DSTATE_STENCIL_BUFFER_CommandType_bits  3
   77846 #define GEN8_3DSTATE_STENCIL_BUFFER_CommandType_bits  3
   77847 #define GEN75_3DSTATE_STENCIL_BUFFER_CommandType_bits  3
   77848 #define GEN7_3DSTATE_STENCIL_BUFFER_CommandType_bits  3
   77849 #define GEN6_3DSTATE_STENCIL_BUFFER_CommandType_bits  3
   77850 #define GEN5_3DSTATE_STENCIL_BUFFER_CommandType_bits  3
   77851 
   77852 static inline uint32_t ATTRIBUTE_PURE
   77853 _3DSTATE_STENCIL_BUFFER_CommandType_bits(const struct gen_device_info *devinfo)
   77854 {
   77855    switch (devinfo->gen) {
   77856    case 10: return 3;
   77857    case 9: return 3;
   77858    case 8: return 3;
   77859    case 7:
   77860       if (devinfo->is_haswell) {
   77861          return 3;
   77862       } else {
   77863          return 3;
   77864       }
   77865    case 6: return 3;
   77866    case 5: return 3;
   77867    case 4:
   77868       if (devinfo->is_g4x) {
   77869          return 0;
   77870       } else {
   77871          return 0;
   77872       }
   77873    default:
   77874       unreachable("Invalid hardware generation");
   77875    }
   77876 }
   77877 
   77878 
   77879 
   77880 #define GEN10_3DSTATE_STENCIL_BUFFER_CommandType_start  29
   77881 #define GEN9_3DSTATE_STENCIL_BUFFER_CommandType_start  29
   77882 #define GEN8_3DSTATE_STENCIL_BUFFER_CommandType_start  29
   77883 #define GEN75_3DSTATE_STENCIL_BUFFER_CommandType_start  29
   77884 #define GEN7_3DSTATE_STENCIL_BUFFER_CommandType_start  29
   77885 #define GEN6_3DSTATE_STENCIL_BUFFER_CommandType_start  29
   77886 #define GEN5_3DSTATE_STENCIL_BUFFER_CommandType_start  29
   77887 
   77888 static inline uint32_t ATTRIBUTE_PURE
   77889 _3DSTATE_STENCIL_BUFFER_CommandType_start(const struct gen_device_info *devinfo)
   77890 {
   77891    switch (devinfo->gen) {
   77892    case 10: return 29;
   77893    case 9: return 29;
   77894    case 8: return 29;
   77895    case 7:
   77896       if (devinfo->is_haswell) {
   77897          return 29;
   77898       } else {
   77899          return 29;
   77900       }
   77901    case 6: return 29;
   77902    case 5: return 29;
   77903    case 4:
   77904       if (devinfo->is_g4x) {
   77905          return 0;
   77906       } else {
   77907          return 0;
   77908       }
   77909    default:
   77910       unreachable("Invalid hardware generation");
   77911    }
   77912 }
   77913 
   77914 
   77915 
   77916 /* 3DSTATE_STENCIL_BUFFER::DWord Length */
   77917 
   77918 
   77919 #define GEN10_3DSTATE_STENCIL_BUFFER_DWordLength_bits  8
   77920 #define GEN9_3DSTATE_STENCIL_BUFFER_DWordLength_bits  8
   77921 #define GEN8_3DSTATE_STENCIL_BUFFER_DWordLength_bits  8
   77922 #define GEN75_3DSTATE_STENCIL_BUFFER_DWordLength_bits  8
   77923 #define GEN7_3DSTATE_STENCIL_BUFFER_DWordLength_bits  8
   77924 #define GEN6_3DSTATE_STENCIL_BUFFER_DWordLength_bits  8
   77925 #define GEN5_3DSTATE_STENCIL_BUFFER_DWordLength_bits  8
   77926 
   77927 static inline uint32_t ATTRIBUTE_PURE
   77928 _3DSTATE_STENCIL_BUFFER_DWordLength_bits(const struct gen_device_info *devinfo)
   77929 {
   77930    switch (devinfo->gen) {
   77931    case 10: return 8;
   77932    case 9: return 8;
   77933    case 8: return 8;
   77934    case 7:
   77935       if (devinfo->is_haswell) {
   77936          return 8;
   77937       } else {
   77938          return 8;
   77939       }
   77940    case 6: return 8;
   77941    case 5: return 8;
   77942    case 4:
   77943       if (devinfo->is_g4x) {
   77944          return 0;
   77945       } else {
   77946          return 0;
   77947       }
   77948    default:
   77949       unreachable("Invalid hardware generation");
   77950    }
   77951 }
   77952 
   77953 
   77954 
   77955 #define GEN10_3DSTATE_STENCIL_BUFFER_DWordLength_start  0
   77956 #define GEN9_3DSTATE_STENCIL_BUFFER_DWordLength_start  0
   77957 #define GEN8_3DSTATE_STENCIL_BUFFER_DWordLength_start  0
   77958 #define GEN75_3DSTATE_STENCIL_BUFFER_DWordLength_start  0
   77959 #define GEN7_3DSTATE_STENCIL_BUFFER_DWordLength_start  0
   77960 #define GEN6_3DSTATE_STENCIL_BUFFER_DWordLength_start  0
   77961 #define GEN5_3DSTATE_STENCIL_BUFFER_DWordLength_start  0
   77962 
   77963 static inline uint32_t ATTRIBUTE_PURE
   77964 _3DSTATE_STENCIL_BUFFER_DWordLength_start(const struct gen_device_info *devinfo)
   77965 {
   77966    switch (devinfo->gen) {
   77967    case 10: return 0;
   77968    case 9: return 0;
   77969    case 8: return 0;
   77970    case 7:
   77971       if (devinfo->is_haswell) {
   77972          return 0;
   77973       } else {
   77974          return 0;
   77975       }
   77976    case 6: return 0;
   77977    case 5: return 0;
   77978    case 4:
   77979       if (devinfo->is_g4x) {
   77980          return 0;
   77981       } else {
   77982          return 0;
   77983       }
   77984    default:
   77985       unreachable("Invalid hardware generation");
   77986    }
   77987 }
   77988 
   77989 
   77990 
   77991 /* 3DSTATE_STENCIL_BUFFER::Stencil Buffer Enable */
   77992 
   77993 
   77994 #define GEN10_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_bits  1
   77995 #define GEN9_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_bits  1
   77996 #define GEN8_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_bits  1
   77997 #define GEN75_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_bits  1
   77998 
   77999 static inline uint32_t ATTRIBUTE_PURE
   78000 _3DSTATE_STENCIL_BUFFER_StencilBufferEnable_bits(const struct gen_device_info *devinfo)
   78001 {
   78002    switch (devinfo->gen) {
   78003    case 10: return 1;
   78004    case 9: return 1;
   78005    case 8: return 1;
   78006    case 7:
   78007       if (devinfo->is_haswell) {
   78008          return 1;
   78009       } else {
   78010          return 0;
   78011       }
   78012    case 6: return 0;
   78013    case 5: return 0;
   78014    case 4:
   78015       if (devinfo->is_g4x) {
   78016          return 0;
   78017       } else {
   78018          return 0;
   78019       }
   78020    default:
   78021       unreachable("Invalid hardware generation");
   78022    }
   78023 }
   78024 
   78025 
   78026 
   78027 #define GEN10_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_start  63
   78028 #define GEN9_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_start  63
   78029 #define GEN8_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_start  63
   78030 #define GEN75_3DSTATE_STENCIL_BUFFER_StencilBufferEnable_start  63
   78031 
   78032 static inline uint32_t ATTRIBUTE_PURE
   78033 _3DSTATE_STENCIL_BUFFER_StencilBufferEnable_start(const struct gen_device_info *devinfo)
   78034 {
   78035    switch (devinfo->gen) {
   78036    case 10: return 63;
   78037    case 9: return 63;
   78038    case 8: return 63;
   78039    case 7:
   78040       if (devinfo->is_haswell) {
   78041          return 63;
   78042       } else {
   78043          return 0;
   78044       }
   78045    case 6: return 0;
   78046    case 5: return 0;
   78047    case 4:
   78048       if (devinfo->is_g4x) {
   78049          return 0;
   78050       } else {
   78051          return 0;
   78052       }
   78053    default:
   78054       unreachable("Invalid hardware generation");
   78055    }
   78056 }
   78057 
   78058 
   78059 
   78060 /* 3DSTATE_STENCIL_BUFFER::Stencil Buffer MOCS */
   78061 
   78062 
   78063 #define GEN10_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_bits  7
   78064 #define GEN9_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_bits  7
   78065 #define GEN8_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_bits  7
   78066 #define GEN75_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_bits  4
   78067 #define GEN7_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_bits  4
   78068 #define GEN6_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_bits  4
   78069 
   78070 static inline uint32_t ATTRIBUTE_PURE
   78071 _3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_bits(const struct gen_device_info *devinfo)
   78072 {
   78073    switch (devinfo->gen) {
   78074    case 10: return 7;
   78075    case 9: return 7;
   78076    case 8: return 7;
   78077    case 7:
   78078       if (devinfo->is_haswell) {
   78079          return 4;
   78080       } else {
   78081          return 4;
   78082       }
   78083    case 6: return 4;
   78084    case 5: return 0;
   78085    case 4:
   78086       if (devinfo->is_g4x) {
   78087          return 0;
   78088       } else {
   78089          return 0;
   78090       }
   78091    default:
   78092       unreachable("Invalid hardware generation");
   78093    }
   78094 }
   78095 
   78096 
   78097 
   78098 #define GEN10_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_start  54
   78099 #define GEN9_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_start  54
   78100 #define GEN8_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_start  54
   78101 #define GEN75_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_start  57
   78102 #define GEN7_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_start  57
   78103 #define GEN6_3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_start  57
   78104 
   78105 static inline uint32_t ATTRIBUTE_PURE
   78106 _3DSTATE_STENCIL_BUFFER_StencilBufferMOCS_start(const struct gen_device_info *devinfo)
   78107 {
   78108    switch (devinfo->gen) {
   78109    case 10: return 54;
   78110    case 9: return 54;
   78111    case 8: return 54;
   78112    case 7:
   78113       if (devinfo->is_haswell) {
   78114          return 57;
   78115       } else {
   78116          return 57;
   78117       }
   78118    case 6: return 57;
   78119    case 5: return 0;
   78120    case 4:
   78121       if (devinfo->is_g4x) {
   78122          return 0;
   78123       } else {
   78124          return 0;
   78125       }
   78126    default:
   78127       unreachable("Invalid hardware generation");
   78128    }
   78129 }
   78130 
   78131 
   78132 
   78133 /* 3DSTATE_STENCIL_BUFFER::Stencil Buffer Object Control State */
   78134 
   78135 
   78136 #define GEN10_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_bits  7
   78137 #define GEN9_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_bits  7
   78138 #define GEN8_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_bits  7
   78139 #define GEN75_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_bits  4
   78140 #define GEN7_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_bits  4
   78141 #define GEN6_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_bits  4
   78142 
   78143 static inline uint32_t ATTRIBUTE_PURE
   78144 _3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_bits(const struct gen_device_info *devinfo)
   78145 {
   78146    switch (devinfo->gen) {
   78147    case 10: return 7;
   78148    case 9: return 7;
   78149    case 8: return 7;
   78150    case 7:
   78151       if (devinfo->is_haswell) {
   78152          return 4;
   78153       } else {
   78154          return 4;
   78155       }
   78156    case 6: return 4;
   78157    case 5: return 0;
   78158    case 4:
   78159       if (devinfo->is_g4x) {
   78160          return 0;
   78161       } else {
   78162          return 0;
   78163       }
   78164    default:
   78165       unreachable("Invalid hardware generation");
   78166    }
   78167 }
   78168 
   78169 
   78170 
   78171 #define GEN10_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_start  54
   78172 #define GEN9_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_start  54
   78173 #define GEN8_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_start  54
   78174 #define GEN75_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_start  57
   78175 #define GEN7_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_start  57
   78176 #define GEN6_3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_start  57
   78177 
   78178 static inline uint32_t ATTRIBUTE_PURE
   78179 _3DSTATE_STENCIL_BUFFER_StencilBufferObjectControlState_start(const struct gen_device_info *devinfo)
   78180 {
   78181    switch (devinfo->gen) {
   78182    case 10: return 54;
   78183    case 9: return 54;
   78184    case 8: return 54;
   78185    case 7:
   78186       if (devinfo->is_haswell) {
   78187          return 57;
   78188       } else {
   78189          return 57;
   78190       }
   78191    case 6: return 57;
   78192    case 5: return 0;
   78193    case 4:
   78194       if (devinfo->is_g4x) {
   78195          return 0;
   78196       } else {
   78197          return 0;
   78198       }
   78199    default:
   78200       unreachable("Invalid hardware generation");
   78201    }
   78202 }
   78203 
   78204 
   78205 
   78206 /* 3DSTATE_STENCIL_BUFFER::Surface Base Address */
   78207 
   78208 
   78209 #define GEN10_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits  64
   78210 #define GEN9_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits  64
   78211 #define GEN8_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits  64
   78212 #define GEN75_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits  32
   78213 #define GEN7_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits  32
   78214 #define GEN6_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits  32
   78215 #define GEN5_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits  32
   78216 
   78217 static inline uint32_t ATTRIBUTE_PURE
   78218 _3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_bits(const struct gen_device_info *devinfo)
   78219 {
   78220    switch (devinfo->gen) {
   78221    case 10: return 64;
   78222    case 9: return 64;
   78223    case 8: return 64;
   78224    case 7:
   78225       if (devinfo->is_haswell) {
   78226          return 32;
   78227       } else {
   78228          return 32;
   78229       }
   78230    case 6: return 32;
   78231    case 5: return 32;
   78232    case 4:
   78233       if (devinfo->is_g4x) {
   78234          return 0;
   78235       } else {
   78236          return 0;
   78237       }
   78238    default:
   78239       unreachable("Invalid hardware generation");
   78240    }
   78241 }
   78242 
   78243 
   78244 
   78245 #define GEN10_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start  64
   78246 #define GEN9_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start  64
   78247 #define GEN8_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start  64
   78248 #define GEN75_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start  64
   78249 #define GEN7_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start  64
   78250 #define GEN6_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start  64
   78251 #define GEN5_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start  64
   78252 
   78253 static inline uint32_t ATTRIBUTE_PURE
   78254 _3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start(const struct gen_device_info *devinfo)
   78255 {
   78256    switch (devinfo->gen) {
   78257    case 10: return 64;
   78258    case 9: return 64;
   78259    case 8: return 64;
   78260    case 7:
   78261       if (devinfo->is_haswell) {
   78262          return 64;
   78263       } else {
   78264          return 64;
   78265       }
   78266    case 6: return 64;
   78267    case 5: return 64;
   78268    case 4:
   78269       if (devinfo->is_g4x) {
   78270          return 0;
   78271       } else {
   78272          return 0;
   78273       }
   78274    default:
   78275       unreachable("Invalid hardware generation");
   78276    }
   78277 }
   78278 
   78279 
   78280 
   78281 /* 3DSTATE_STENCIL_BUFFER::Surface Pitch */
   78282 
   78283 
   78284 #define GEN10_3DSTATE_STENCIL_BUFFER_SurfacePitch_bits  17
   78285 #define GEN9_3DSTATE_STENCIL_BUFFER_SurfacePitch_bits  17
   78286 #define GEN8_3DSTATE_STENCIL_BUFFER_SurfacePitch_bits  17
   78287 #define GEN75_3DSTATE_STENCIL_BUFFER_SurfacePitch_bits  17
   78288 #define GEN7_3DSTATE_STENCIL_BUFFER_SurfacePitch_bits  17
   78289 #define GEN6_3DSTATE_STENCIL_BUFFER_SurfacePitch_bits  17
   78290 #define GEN5_3DSTATE_STENCIL_BUFFER_SurfacePitch_bits  17
   78291 
   78292 static inline uint32_t ATTRIBUTE_PURE
   78293 _3DSTATE_STENCIL_BUFFER_SurfacePitch_bits(const struct gen_device_info *devinfo)
   78294 {
   78295    switch (devinfo->gen) {
   78296    case 10: return 17;
   78297    case 9: return 17;
   78298    case 8: return 17;
   78299    case 7:
   78300       if (devinfo->is_haswell) {
   78301          return 17;
   78302       } else {
   78303          return 17;
   78304       }
   78305    case 6: return 17;
   78306    case 5: return 17;
   78307    case 4:
   78308       if (devinfo->is_g4x) {
   78309          return 0;
   78310       } else {
   78311          return 0;
   78312       }
   78313    default:
   78314       unreachable("Invalid hardware generation");
   78315    }
   78316 }
   78317 
   78318 
   78319 
   78320 #define GEN10_3DSTATE_STENCIL_BUFFER_SurfacePitch_start  32
   78321 #define GEN9_3DSTATE_STENCIL_BUFFER_SurfacePitch_start  32
   78322 #define GEN8_3DSTATE_STENCIL_BUFFER_SurfacePitch_start  32
   78323 #define GEN75_3DSTATE_STENCIL_BUFFER_SurfacePitch_start  32
   78324 #define GEN7_3DSTATE_STENCIL_BUFFER_SurfacePitch_start  32
   78325 #define GEN6_3DSTATE_STENCIL_BUFFER_SurfacePitch_start  32
   78326 #define GEN5_3DSTATE_STENCIL_BUFFER_SurfacePitch_start  32
   78327 
   78328 static inline uint32_t ATTRIBUTE_PURE
   78329 _3DSTATE_STENCIL_BUFFER_SurfacePitch_start(const struct gen_device_info *devinfo)
   78330 {
   78331    switch (devinfo->gen) {
   78332    case 10: return 32;
   78333    case 9: return 32;
   78334    case 8: return 32;
   78335    case 7:
   78336       if (devinfo->is_haswell) {
   78337          return 32;
   78338       } else {
   78339          return 32;
   78340       }
   78341    case 6: return 32;
   78342    case 5: return 32;
   78343    case 4:
   78344       if (devinfo->is_g4x) {
   78345          return 0;
   78346       } else {
   78347          return 0;
   78348       }
   78349    default:
   78350       unreachable("Invalid hardware generation");
   78351    }
   78352 }
   78353 
   78354 
   78355 
   78356 /* 3DSTATE_STENCIL_BUFFER::Surface QPitch */
   78357 
   78358 
   78359 #define GEN10_3DSTATE_STENCIL_BUFFER_SurfaceQPitch_bits  15
   78360 #define GEN9_3DSTATE_STENCIL_BUFFER_SurfaceQPitch_bits  15
   78361 #define GEN8_3DSTATE_STENCIL_BUFFER_SurfaceQPitch_bits  15
   78362 
   78363 static inline uint32_t ATTRIBUTE_PURE
   78364 _3DSTATE_STENCIL_BUFFER_SurfaceQPitch_bits(const struct gen_device_info *devinfo)
   78365 {
   78366    switch (devinfo->gen) {
   78367    case 10: return 15;
   78368    case 9: return 15;
   78369    case 8: return 15;
   78370    case 7:
   78371       if (devinfo->is_haswell) {
   78372          return 0;
   78373       } else {
   78374          return 0;
   78375       }
   78376    case 6: return 0;
   78377    case 5: return 0;
   78378    case 4:
   78379       if (devinfo->is_g4x) {
   78380          return 0;
   78381       } else {
   78382          return 0;
   78383       }
   78384    default:
   78385       unreachable("Invalid hardware generation");
   78386    }
   78387 }
   78388 
   78389 
   78390 
   78391 #define GEN10_3DSTATE_STENCIL_BUFFER_SurfaceQPitch_start  128
   78392 #define GEN9_3DSTATE_STENCIL_BUFFER_SurfaceQPitch_start  128
   78393 #define GEN8_3DSTATE_STENCIL_BUFFER_SurfaceQPitch_start  128
   78394 
   78395 static inline uint32_t ATTRIBUTE_PURE
   78396 _3DSTATE_STENCIL_BUFFER_SurfaceQPitch_start(const struct gen_device_info *devinfo)
   78397 {
   78398    switch (devinfo->gen) {
   78399    case 10: return 128;
   78400    case 9: return 128;
   78401    case 8: return 128;
   78402    case 7:
   78403       if (devinfo->is_haswell) {
   78404          return 0;
   78405       } else {
   78406          return 0;
   78407       }
   78408    case 6: return 0;
   78409    case 5: return 0;
   78410    case 4:
   78411       if (devinfo->is_g4x) {
   78412          return 0;
   78413       } else {
   78414          return 0;
   78415       }
   78416    default:
   78417       unreachable("Invalid hardware generation");
   78418    }
   78419 }
   78420 
   78421 
   78422 
   78423 /* 3DSTATE_STREAMOUT */
   78424 
   78425 
   78426 #define GEN10_3DSTATE_STREAMOUT_length  5
   78427 #define GEN9_3DSTATE_STREAMOUT_length  5
   78428 #define GEN8_3DSTATE_STREAMOUT_length  5
   78429 #define GEN75_3DSTATE_STREAMOUT_length  3
   78430 #define GEN7_3DSTATE_STREAMOUT_length  3
   78431 
   78432 static inline uint32_t ATTRIBUTE_PURE
   78433 _3DSTATE_STREAMOUT_length(const struct gen_device_info *devinfo)
   78434 {
   78435    switch (devinfo->gen) {
   78436    case 10: return 5;
   78437    case 9: return 5;
   78438    case 8: return 5;
   78439    case 7:
   78440       if (devinfo->is_haswell) {
   78441          return 3;
   78442       } else {
   78443          return 3;
   78444       }
   78445    case 6: return 0;
   78446    case 5: return 0;
   78447    case 4:
   78448       if (devinfo->is_g4x) {
   78449          return 0;
   78450       } else {
   78451          return 0;
   78452       }
   78453    default:
   78454       unreachable("Invalid hardware generation");
   78455    }
   78456 }
   78457 
   78458 
   78459 
   78460 /* 3DSTATE_STREAMOUT::3D Command Opcode */
   78461 
   78462 
   78463 #define GEN10_3DSTATE_STREAMOUT_3DCommandOpcode_bits  3
   78464 #define GEN9_3DSTATE_STREAMOUT_3DCommandOpcode_bits  3
   78465 #define GEN8_3DSTATE_STREAMOUT_3DCommandOpcode_bits  3
   78466 #define GEN75_3DSTATE_STREAMOUT_3DCommandOpcode_bits  3
   78467 #define GEN7_3DSTATE_STREAMOUT_3DCommandOpcode_bits  3
   78468 
   78469 static inline uint32_t ATTRIBUTE_PURE
   78470 _3DSTATE_STREAMOUT_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   78471 {
   78472    switch (devinfo->gen) {
   78473    case 10: return 3;
   78474    case 9: return 3;
   78475    case 8: return 3;
   78476    case 7:
   78477       if (devinfo->is_haswell) {
   78478          return 3;
   78479       } else {
   78480          return 3;
   78481       }
   78482    case 6: return 0;
   78483    case 5: return 0;
   78484    case 4:
   78485       if (devinfo->is_g4x) {
   78486          return 0;
   78487       } else {
   78488          return 0;
   78489       }
   78490    default:
   78491       unreachable("Invalid hardware generation");
   78492    }
   78493 }
   78494 
   78495 
   78496 
   78497 #define GEN10_3DSTATE_STREAMOUT_3DCommandOpcode_start  24
   78498 #define GEN9_3DSTATE_STREAMOUT_3DCommandOpcode_start  24
   78499 #define GEN8_3DSTATE_STREAMOUT_3DCommandOpcode_start  24
   78500 #define GEN75_3DSTATE_STREAMOUT_3DCommandOpcode_start  24
   78501 #define GEN7_3DSTATE_STREAMOUT_3DCommandOpcode_start  24
   78502 
   78503 static inline uint32_t ATTRIBUTE_PURE
   78504 _3DSTATE_STREAMOUT_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   78505 {
   78506    switch (devinfo->gen) {
   78507    case 10: return 24;
   78508    case 9: return 24;
   78509    case 8: return 24;
   78510    case 7:
   78511       if (devinfo->is_haswell) {
   78512          return 24;
   78513       } else {
   78514          return 24;
   78515       }
   78516    case 6: return 0;
   78517    case 5: return 0;
   78518    case 4:
   78519       if (devinfo->is_g4x) {
   78520          return 0;
   78521       } else {
   78522          return 0;
   78523       }
   78524    default:
   78525       unreachable("Invalid hardware generation");
   78526    }
   78527 }
   78528 
   78529 
   78530 
   78531 /* 3DSTATE_STREAMOUT::3D Command Sub Opcode */
   78532 
   78533 
   78534 #define GEN10_3DSTATE_STREAMOUT_3DCommandSubOpcode_bits  8
   78535 #define GEN9_3DSTATE_STREAMOUT_3DCommandSubOpcode_bits  8
   78536 #define GEN8_3DSTATE_STREAMOUT_3DCommandSubOpcode_bits  8
   78537 #define GEN75_3DSTATE_STREAMOUT_3DCommandSubOpcode_bits  8
   78538 #define GEN7_3DSTATE_STREAMOUT_3DCommandSubOpcode_bits  8
   78539 
   78540 static inline uint32_t ATTRIBUTE_PURE
   78541 _3DSTATE_STREAMOUT_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   78542 {
   78543    switch (devinfo->gen) {
   78544    case 10: return 8;
   78545    case 9: return 8;
   78546    case 8: return 8;
   78547    case 7:
   78548       if (devinfo->is_haswell) {
   78549          return 8;
   78550       } else {
   78551          return 8;
   78552       }
   78553    case 6: return 0;
   78554    case 5: return 0;
   78555    case 4:
   78556       if (devinfo->is_g4x) {
   78557          return 0;
   78558       } else {
   78559          return 0;
   78560       }
   78561    default:
   78562       unreachable("Invalid hardware generation");
   78563    }
   78564 }
   78565 
   78566 
   78567 
   78568 #define GEN10_3DSTATE_STREAMOUT_3DCommandSubOpcode_start  16
   78569 #define GEN9_3DSTATE_STREAMOUT_3DCommandSubOpcode_start  16
   78570 #define GEN8_3DSTATE_STREAMOUT_3DCommandSubOpcode_start  16
   78571 #define GEN75_3DSTATE_STREAMOUT_3DCommandSubOpcode_start  16
   78572 #define GEN7_3DSTATE_STREAMOUT_3DCommandSubOpcode_start  16
   78573 
   78574 static inline uint32_t ATTRIBUTE_PURE
   78575 _3DSTATE_STREAMOUT_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   78576 {
   78577    switch (devinfo->gen) {
   78578    case 10: return 16;
   78579    case 9: return 16;
   78580    case 8: return 16;
   78581    case 7:
   78582       if (devinfo->is_haswell) {
   78583          return 16;
   78584       } else {
   78585          return 16;
   78586       }
   78587    case 6: return 0;
   78588    case 5: return 0;
   78589    case 4:
   78590       if (devinfo->is_g4x) {
   78591          return 0;
   78592       } else {
   78593          return 0;
   78594       }
   78595    default:
   78596       unreachable("Invalid hardware generation");
   78597    }
   78598 }
   78599 
   78600 
   78601 
   78602 /* 3DSTATE_STREAMOUT::Buffer 0 Surface Pitch */
   78603 
   78604 
   78605 #define GEN10_3DSTATE_STREAMOUT_Buffer0SurfacePitch_bits  12
   78606 #define GEN9_3DSTATE_STREAMOUT_Buffer0SurfacePitch_bits  12
   78607 #define GEN8_3DSTATE_STREAMOUT_Buffer0SurfacePitch_bits  12
   78608 
   78609 static inline uint32_t ATTRIBUTE_PURE
   78610 _3DSTATE_STREAMOUT_Buffer0SurfacePitch_bits(const struct gen_device_info *devinfo)
   78611 {
   78612    switch (devinfo->gen) {
   78613    case 10: return 12;
   78614    case 9: return 12;
   78615    case 8: return 12;
   78616    case 7:
   78617       if (devinfo->is_haswell) {
   78618          return 0;
   78619       } else {
   78620          return 0;
   78621       }
   78622    case 6: return 0;
   78623    case 5: return 0;
   78624    case 4:
   78625       if (devinfo->is_g4x) {
   78626          return 0;
   78627       } else {
   78628          return 0;
   78629       }
   78630    default:
   78631       unreachable("Invalid hardware generation");
   78632    }
   78633 }
   78634 
   78635 
   78636 
   78637 #define GEN10_3DSTATE_STREAMOUT_Buffer0SurfacePitch_start  96
   78638 #define GEN9_3DSTATE_STREAMOUT_Buffer0SurfacePitch_start  96
   78639 #define GEN8_3DSTATE_STREAMOUT_Buffer0SurfacePitch_start  96
   78640 
   78641 static inline uint32_t ATTRIBUTE_PURE
   78642 _3DSTATE_STREAMOUT_Buffer0SurfacePitch_start(const struct gen_device_info *devinfo)
   78643 {
   78644    switch (devinfo->gen) {
   78645    case 10: return 96;
   78646    case 9: return 96;
   78647    case 8: return 96;
   78648    case 7:
   78649       if (devinfo->is_haswell) {
   78650          return 0;
   78651       } else {
   78652          return 0;
   78653       }
   78654    case 6: return 0;
   78655    case 5: return 0;
   78656    case 4:
   78657       if (devinfo->is_g4x) {
   78658          return 0;
   78659       } else {
   78660          return 0;
   78661       }
   78662    default:
   78663       unreachable("Invalid hardware generation");
   78664    }
   78665 }
   78666 
   78667 
   78668 
   78669 /* 3DSTATE_STREAMOUT::Buffer 1 Surface Pitch */
   78670 
   78671 
   78672 #define GEN10_3DSTATE_STREAMOUT_Buffer1SurfacePitch_bits  12
   78673 #define GEN9_3DSTATE_STREAMOUT_Buffer1SurfacePitch_bits  12
   78674 #define GEN8_3DSTATE_STREAMOUT_Buffer1SurfacePitch_bits  12
   78675 
   78676 static inline uint32_t ATTRIBUTE_PURE
   78677 _3DSTATE_STREAMOUT_Buffer1SurfacePitch_bits(const struct gen_device_info *devinfo)
   78678 {
   78679    switch (devinfo->gen) {
   78680    case 10: return 12;
   78681    case 9: return 12;
   78682    case 8: return 12;
   78683    case 7:
   78684       if (devinfo->is_haswell) {
   78685          return 0;
   78686       } else {
   78687          return 0;
   78688       }
   78689    case 6: return 0;
   78690    case 5: return 0;
   78691    case 4:
   78692       if (devinfo->is_g4x) {
   78693          return 0;
   78694       } else {
   78695          return 0;
   78696       }
   78697    default:
   78698       unreachable("Invalid hardware generation");
   78699    }
   78700 }
   78701 
   78702 
   78703 
   78704 #define GEN10_3DSTATE_STREAMOUT_Buffer1SurfacePitch_start  112
   78705 #define GEN9_3DSTATE_STREAMOUT_Buffer1SurfacePitch_start  112
   78706 #define GEN8_3DSTATE_STREAMOUT_Buffer1SurfacePitch_start  112
   78707 
   78708 static inline uint32_t ATTRIBUTE_PURE
   78709 _3DSTATE_STREAMOUT_Buffer1SurfacePitch_start(const struct gen_device_info *devinfo)
   78710 {
   78711    switch (devinfo->gen) {
   78712    case 10: return 112;
   78713    case 9: return 112;
   78714    case 8: return 112;
   78715    case 7:
   78716       if (devinfo->is_haswell) {
   78717          return 0;
   78718       } else {
   78719          return 0;
   78720       }
   78721    case 6: return 0;
   78722    case 5: return 0;
   78723    case 4:
   78724       if (devinfo->is_g4x) {
   78725          return 0;
   78726       } else {
   78727          return 0;
   78728       }
   78729    default:
   78730       unreachable("Invalid hardware generation");
   78731    }
   78732 }
   78733 
   78734 
   78735 
   78736 /* 3DSTATE_STREAMOUT::Buffer 2 Surface Pitch */
   78737 
   78738 
   78739 #define GEN10_3DSTATE_STREAMOUT_Buffer2SurfacePitch_bits  12
   78740 #define GEN9_3DSTATE_STREAMOUT_Buffer2SurfacePitch_bits  12
   78741 #define GEN8_3DSTATE_STREAMOUT_Buffer2SurfacePitch_bits  12
   78742 
   78743 static inline uint32_t ATTRIBUTE_PURE
   78744 _3DSTATE_STREAMOUT_Buffer2SurfacePitch_bits(const struct gen_device_info *devinfo)
   78745 {
   78746    switch (devinfo->gen) {
   78747    case 10: return 12;
   78748    case 9: return 12;
   78749    case 8: return 12;
   78750    case 7:
   78751       if (devinfo->is_haswell) {
   78752          return 0;
   78753       } else {
   78754          return 0;
   78755       }
   78756    case 6: return 0;
   78757    case 5: return 0;
   78758    case 4:
   78759       if (devinfo->is_g4x) {
   78760          return 0;
   78761       } else {
   78762          return 0;
   78763       }
   78764    default:
   78765       unreachable("Invalid hardware generation");
   78766    }
   78767 }
   78768 
   78769 
   78770 
   78771 #define GEN10_3DSTATE_STREAMOUT_Buffer2SurfacePitch_start  128
   78772 #define GEN9_3DSTATE_STREAMOUT_Buffer2SurfacePitch_start  128
   78773 #define GEN8_3DSTATE_STREAMOUT_Buffer2SurfacePitch_start  128
   78774 
   78775 static inline uint32_t ATTRIBUTE_PURE
   78776 _3DSTATE_STREAMOUT_Buffer2SurfacePitch_start(const struct gen_device_info *devinfo)
   78777 {
   78778    switch (devinfo->gen) {
   78779    case 10: return 128;
   78780    case 9: return 128;
   78781    case 8: return 128;
   78782    case 7:
   78783       if (devinfo->is_haswell) {
   78784          return 0;
   78785       } else {
   78786          return 0;
   78787       }
   78788    case 6: return 0;
   78789    case 5: return 0;
   78790    case 4:
   78791       if (devinfo->is_g4x) {
   78792          return 0;
   78793       } else {
   78794          return 0;
   78795       }
   78796    default:
   78797       unreachable("Invalid hardware generation");
   78798    }
   78799 }
   78800 
   78801 
   78802 
   78803 /* 3DSTATE_STREAMOUT::Buffer 3 Surface Pitch */
   78804 
   78805 
   78806 #define GEN10_3DSTATE_STREAMOUT_Buffer3SurfacePitch_bits  12
   78807 #define GEN9_3DSTATE_STREAMOUT_Buffer3SurfacePitch_bits  12
   78808 #define GEN8_3DSTATE_STREAMOUT_Buffer3SurfacePitch_bits  12
   78809 
   78810 static inline uint32_t ATTRIBUTE_PURE
   78811 _3DSTATE_STREAMOUT_Buffer3SurfacePitch_bits(const struct gen_device_info *devinfo)
   78812 {
   78813    switch (devinfo->gen) {
   78814    case 10: return 12;
   78815    case 9: return 12;
   78816    case 8: return 12;
   78817    case 7:
   78818       if (devinfo->is_haswell) {
   78819          return 0;
   78820       } else {
   78821          return 0;
   78822       }
   78823    case 6: return 0;
   78824    case 5: return 0;
   78825    case 4:
   78826       if (devinfo->is_g4x) {
   78827          return 0;
   78828       } else {
   78829          return 0;
   78830       }
   78831    default:
   78832       unreachable("Invalid hardware generation");
   78833    }
   78834 }
   78835 
   78836 
   78837 
   78838 #define GEN10_3DSTATE_STREAMOUT_Buffer3SurfacePitch_start  144
   78839 #define GEN9_3DSTATE_STREAMOUT_Buffer3SurfacePitch_start  144
   78840 #define GEN8_3DSTATE_STREAMOUT_Buffer3SurfacePitch_start  144
   78841 
   78842 static inline uint32_t ATTRIBUTE_PURE
   78843 _3DSTATE_STREAMOUT_Buffer3SurfacePitch_start(const struct gen_device_info *devinfo)
   78844 {
   78845    switch (devinfo->gen) {
   78846    case 10: return 144;
   78847    case 9: return 144;
   78848    case 8: return 144;
   78849    case 7:
   78850       if (devinfo->is_haswell) {
   78851          return 0;
   78852       } else {
   78853          return 0;
   78854       }
   78855    case 6: return 0;
   78856    case 5: return 0;
   78857    case 4:
   78858       if (devinfo->is_g4x) {
   78859          return 0;
   78860       } else {
   78861          return 0;
   78862       }
   78863    default:
   78864       unreachable("Invalid hardware generation");
   78865    }
   78866 }
   78867 
   78868 
   78869 
   78870 /* 3DSTATE_STREAMOUT::Command SubType */
   78871 
   78872 
   78873 #define GEN10_3DSTATE_STREAMOUT_CommandSubType_bits  2
   78874 #define GEN9_3DSTATE_STREAMOUT_CommandSubType_bits  2
   78875 #define GEN8_3DSTATE_STREAMOUT_CommandSubType_bits  2
   78876 #define GEN75_3DSTATE_STREAMOUT_CommandSubType_bits  2
   78877 #define GEN7_3DSTATE_STREAMOUT_CommandSubType_bits  2
   78878 
   78879 static inline uint32_t ATTRIBUTE_PURE
   78880 _3DSTATE_STREAMOUT_CommandSubType_bits(const struct gen_device_info *devinfo)
   78881 {
   78882    switch (devinfo->gen) {
   78883    case 10: return 2;
   78884    case 9: return 2;
   78885    case 8: return 2;
   78886    case 7:
   78887       if (devinfo->is_haswell) {
   78888          return 2;
   78889       } else {
   78890          return 2;
   78891       }
   78892    case 6: return 0;
   78893    case 5: return 0;
   78894    case 4:
   78895       if (devinfo->is_g4x) {
   78896          return 0;
   78897       } else {
   78898          return 0;
   78899       }
   78900    default:
   78901       unreachable("Invalid hardware generation");
   78902    }
   78903 }
   78904 
   78905 
   78906 
   78907 #define GEN10_3DSTATE_STREAMOUT_CommandSubType_start  27
   78908 #define GEN9_3DSTATE_STREAMOUT_CommandSubType_start  27
   78909 #define GEN8_3DSTATE_STREAMOUT_CommandSubType_start  27
   78910 #define GEN75_3DSTATE_STREAMOUT_CommandSubType_start  27
   78911 #define GEN7_3DSTATE_STREAMOUT_CommandSubType_start  27
   78912 
   78913 static inline uint32_t ATTRIBUTE_PURE
   78914 _3DSTATE_STREAMOUT_CommandSubType_start(const struct gen_device_info *devinfo)
   78915 {
   78916    switch (devinfo->gen) {
   78917    case 10: return 27;
   78918    case 9: return 27;
   78919    case 8: return 27;
   78920    case 7:
   78921       if (devinfo->is_haswell) {
   78922          return 27;
   78923       } else {
   78924          return 27;
   78925       }
   78926    case 6: return 0;
   78927    case 5: return 0;
   78928    case 4:
   78929       if (devinfo->is_g4x) {
   78930          return 0;
   78931       } else {
   78932          return 0;
   78933       }
   78934    default:
   78935       unreachable("Invalid hardware generation");
   78936    }
   78937 }
   78938 
   78939 
   78940 
   78941 /* 3DSTATE_STREAMOUT::Command Type */
   78942 
   78943 
   78944 #define GEN10_3DSTATE_STREAMOUT_CommandType_bits  3
   78945 #define GEN9_3DSTATE_STREAMOUT_CommandType_bits  3
   78946 #define GEN8_3DSTATE_STREAMOUT_CommandType_bits  3
   78947 #define GEN75_3DSTATE_STREAMOUT_CommandType_bits  3
   78948 #define GEN7_3DSTATE_STREAMOUT_CommandType_bits  3
   78949 
   78950 static inline uint32_t ATTRIBUTE_PURE
   78951 _3DSTATE_STREAMOUT_CommandType_bits(const struct gen_device_info *devinfo)
   78952 {
   78953    switch (devinfo->gen) {
   78954    case 10: return 3;
   78955    case 9: return 3;
   78956    case 8: return 3;
   78957    case 7:
   78958       if (devinfo->is_haswell) {
   78959          return 3;
   78960       } else {
   78961          return 3;
   78962       }
   78963    case 6: return 0;
   78964    case 5: return 0;
   78965    case 4:
   78966       if (devinfo->is_g4x) {
   78967          return 0;
   78968       } else {
   78969          return 0;
   78970       }
   78971    default:
   78972       unreachable("Invalid hardware generation");
   78973    }
   78974 }
   78975 
   78976 
   78977 
   78978 #define GEN10_3DSTATE_STREAMOUT_CommandType_start  29
   78979 #define GEN9_3DSTATE_STREAMOUT_CommandType_start  29
   78980 #define GEN8_3DSTATE_STREAMOUT_CommandType_start  29
   78981 #define GEN75_3DSTATE_STREAMOUT_CommandType_start  29
   78982 #define GEN7_3DSTATE_STREAMOUT_CommandType_start  29
   78983 
   78984 static inline uint32_t ATTRIBUTE_PURE
   78985 _3DSTATE_STREAMOUT_CommandType_start(const struct gen_device_info *devinfo)
   78986 {
   78987    switch (devinfo->gen) {
   78988    case 10: return 29;
   78989    case 9: return 29;
   78990    case 8: return 29;
   78991    case 7:
   78992       if (devinfo->is_haswell) {
   78993          return 29;
   78994       } else {
   78995          return 29;
   78996       }
   78997    case 6: return 0;
   78998    case 5: return 0;
   78999    case 4:
   79000       if (devinfo->is_g4x) {
   79001          return 0;
   79002       } else {
   79003          return 0;
   79004       }
   79005    default:
   79006       unreachable("Invalid hardware generation");
   79007    }
   79008 }
   79009 
   79010 
   79011 
   79012 /* 3DSTATE_STREAMOUT::DWord Length */
   79013 
   79014 
   79015 #define GEN10_3DSTATE_STREAMOUT_DWordLength_bits  8
   79016 #define GEN9_3DSTATE_STREAMOUT_DWordLength_bits  8
   79017 #define GEN8_3DSTATE_STREAMOUT_DWordLength_bits  8
   79018 #define GEN75_3DSTATE_STREAMOUT_DWordLength_bits  8
   79019 #define GEN7_3DSTATE_STREAMOUT_DWordLength_bits  8
   79020 
   79021 static inline uint32_t ATTRIBUTE_PURE
   79022 _3DSTATE_STREAMOUT_DWordLength_bits(const struct gen_device_info *devinfo)
   79023 {
   79024    switch (devinfo->gen) {
   79025    case 10: return 8;
   79026    case 9: return 8;
   79027    case 8: return 8;
   79028    case 7:
   79029       if (devinfo->is_haswell) {
   79030          return 8;
   79031       } else {
   79032          return 8;
   79033       }
   79034    case 6: return 0;
   79035    case 5: return 0;
   79036    case 4:
   79037       if (devinfo->is_g4x) {
   79038          return 0;
   79039       } else {
   79040          return 0;
   79041       }
   79042    default:
   79043       unreachable("Invalid hardware generation");
   79044    }
   79045 }
   79046 
   79047 
   79048 
   79049 #define GEN10_3DSTATE_STREAMOUT_DWordLength_start  0
   79050 #define GEN9_3DSTATE_STREAMOUT_DWordLength_start  0
   79051 #define GEN8_3DSTATE_STREAMOUT_DWordLength_start  0
   79052 #define GEN75_3DSTATE_STREAMOUT_DWordLength_start  0
   79053 #define GEN7_3DSTATE_STREAMOUT_DWordLength_start  0
   79054 
   79055 static inline uint32_t ATTRIBUTE_PURE
   79056 _3DSTATE_STREAMOUT_DWordLength_start(const struct gen_device_info *devinfo)
   79057 {
   79058    switch (devinfo->gen) {
   79059    case 10: return 0;
   79060    case 9: return 0;
   79061    case 8: return 0;
   79062    case 7:
   79063       if (devinfo->is_haswell) {
   79064          return 0;
   79065       } else {
   79066          return 0;
   79067       }
   79068    case 6: return 0;
   79069    case 5: return 0;
   79070    case 4:
   79071       if (devinfo->is_g4x) {
   79072          return 0;
   79073       } else {
   79074          return 0;
   79075       }
   79076    default:
   79077       unreachable("Invalid hardware generation");
   79078    }
   79079 }
   79080 
   79081 
   79082 
   79083 /* 3DSTATE_STREAMOUT::Force Rendering */
   79084 
   79085 
   79086 #define GEN10_3DSTATE_STREAMOUT_ForceRendering_bits  2
   79087 #define GEN9_3DSTATE_STREAMOUT_ForceRendering_bits  2
   79088 #define GEN8_3DSTATE_STREAMOUT_ForceRendering_bits  2
   79089 
   79090 static inline uint32_t ATTRIBUTE_PURE
   79091 _3DSTATE_STREAMOUT_ForceRendering_bits(const struct gen_device_info *devinfo)
   79092 {
   79093    switch (devinfo->gen) {
   79094    case 10: return 2;
   79095    case 9: return 2;
   79096    case 8: return 2;
   79097    case 7:
   79098       if (devinfo->is_haswell) {
   79099          return 0;
   79100       } else {
   79101          return 0;
   79102       }
   79103    case 6: return 0;
   79104    case 5: return 0;
   79105    case 4:
   79106       if (devinfo->is_g4x) {
   79107          return 0;
   79108       } else {
   79109          return 0;
   79110       }
   79111    default:
   79112       unreachable("Invalid hardware generation");
   79113    }
   79114 }
   79115 
   79116 
   79117 
   79118 #define GEN10_3DSTATE_STREAMOUT_ForceRendering_start  55
   79119 #define GEN9_3DSTATE_STREAMOUT_ForceRendering_start  55
   79120 #define GEN8_3DSTATE_STREAMOUT_ForceRendering_start  55
   79121 
   79122 static inline uint32_t ATTRIBUTE_PURE
   79123 _3DSTATE_STREAMOUT_ForceRendering_start(const struct gen_device_info *devinfo)
   79124 {
   79125    switch (devinfo->gen) {
   79126    case 10: return 55;
   79127    case 9: return 55;
   79128    case 8: return 55;
   79129    case 7:
   79130       if (devinfo->is_haswell) {
   79131          return 0;
   79132       } else {
   79133          return 0;
   79134       }
   79135    case 6: return 0;
   79136    case 5: return 0;
   79137    case 4:
   79138       if (devinfo->is_g4x) {
   79139          return 0;
   79140       } else {
   79141          return 0;
   79142       }
   79143    default:
   79144       unreachable("Invalid hardware generation");
   79145    }
   79146 }
   79147 
   79148 
   79149 
   79150 /* 3DSTATE_STREAMOUT::Render Stream Select */
   79151 
   79152 
   79153 #define GEN10_3DSTATE_STREAMOUT_RenderStreamSelect_bits  2
   79154 #define GEN9_3DSTATE_STREAMOUT_RenderStreamSelect_bits  2
   79155 #define GEN8_3DSTATE_STREAMOUT_RenderStreamSelect_bits  2
   79156 #define GEN75_3DSTATE_STREAMOUT_RenderStreamSelect_bits  2
   79157 #define GEN7_3DSTATE_STREAMOUT_RenderStreamSelect_bits  2
   79158 
   79159 static inline uint32_t ATTRIBUTE_PURE
   79160 _3DSTATE_STREAMOUT_RenderStreamSelect_bits(const struct gen_device_info *devinfo)
   79161 {
   79162    switch (devinfo->gen) {
   79163    case 10: return 2;
   79164    case 9: return 2;
   79165    case 8: return 2;
   79166    case 7:
   79167       if (devinfo->is_haswell) {
   79168          return 2;
   79169       } else {
   79170          return 2;
   79171       }
   79172    case 6: return 0;
   79173    case 5: return 0;
   79174    case 4:
   79175       if (devinfo->is_g4x) {
   79176          return 0;
   79177       } else {
   79178          return 0;
   79179       }
   79180    default:
   79181       unreachable("Invalid hardware generation");
   79182    }
   79183 }
   79184 
   79185 
   79186 
   79187 #define GEN10_3DSTATE_STREAMOUT_RenderStreamSelect_start  59
   79188 #define GEN9_3DSTATE_STREAMOUT_RenderStreamSelect_start  59
   79189 #define GEN8_3DSTATE_STREAMOUT_RenderStreamSelect_start  59
   79190 #define GEN75_3DSTATE_STREAMOUT_RenderStreamSelect_start  59
   79191 #define GEN7_3DSTATE_STREAMOUT_RenderStreamSelect_start  59
   79192 
   79193 static inline uint32_t ATTRIBUTE_PURE
   79194 _3DSTATE_STREAMOUT_RenderStreamSelect_start(const struct gen_device_info *devinfo)
   79195 {
   79196    switch (devinfo->gen) {
   79197    case 10: return 59;
   79198    case 9: return 59;
   79199    case 8: return 59;
   79200    case 7:
   79201       if (devinfo->is_haswell) {
   79202          return 59;
   79203       } else {
   79204          return 59;
   79205       }
   79206    case 6: return 0;
   79207    case 5: return 0;
   79208    case 4:
   79209       if (devinfo->is_g4x) {
   79210          return 0;
   79211       } else {
   79212          return 0;
   79213       }
   79214    default:
   79215       unreachable("Invalid hardware generation");
   79216    }
   79217 }
   79218 
   79219 
   79220 
   79221 /* 3DSTATE_STREAMOUT::Rendering Disable */
   79222 
   79223 
   79224 #define GEN10_3DSTATE_STREAMOUT_RenderingDisable_bits  1
   79225 #define GEN9_3DSTATE_STREAMOUT_RenderingDisable_bits  1
   79226 #define GEN8_3DSTATE_STREAMOUT_RenderingDisable_bits  1
   79227 #define GEN75_3DSTATE_STREAMOUT_RenderingDisable_bits  1
   79228 #define GEN7_3DSTATE_STREAMOUT_RenderingDisable_bits  1
   79229 
   79230 static inline uint32_t ATTRIBUTE_PURE
   79231 _3DSTATE_STREAMOUT_RenderingDisable_bits(const struct gen_device_info *devinfo)
   79232 {
   79233    switch (devinfo->gen) {
   79234    case 10: return 1;
   79235    case 9: return 1;
   79236    case 8: return 1;
   79237    case 7:
   79238       if (devinfo->is_haswell) {
   79239          return 1;
   79240       } else {
   79241          return 1;
   79242       }
   79243    case 6: return 0;
   79244    case 5: return 0;
   79245    case 4:
   79246       if (devinfo->is_g4x) {
   79247          return 0;
   79248       } else {
   79249          return 0;
   79250       }
   79251    default:
   79252       unreachable("Invalid hardware generation");
   79253    }
   79254 }
   79255 
   79256 
   79257 
   79258 #define GEN10_3DSTATE_STREAMOUT_RenderingDisable_start  62
   79259 #define GEN9_3DSTATE_STREAMOUT_RenderingDisable_start  62
   79260 #define GEN8_3DSTATE_STREAMOUT_RenderingDisable_start  62
   79261 #define GEN75_3DSTATE_STREAMOUT_RenderingDisable_start  62
   79262 #define GEN7_3DSTATE_STREAMOUT_RenderingDisable_start  62
   79263 
   79264 static inline uint32_t ATTRIBUTE_PURE
   79265 _3DSTATE_STREAMOUT_RenderingDisable_start(const struct gen_device_info *devinfo)
   79266 {
   79267    switch (devinfo->gen) {
   79268    case 10: return 62;
   79269    case 9: return 62;
   79270    case 8: return 62;
   79271    case 7:
   79272       if (devinfo->is_haswell) {
   79273          return 62;
   79274       } else {
   79275          return 62;
   79276       }
   79277    case 6: return 0;
   79278    case 5: return 0;
   79279    case 4:
   79280       if (devinfo->is_g4x) {
   79281          return 0;
   79282       } else {
   79283          return 0;
   79284       }
   79285    default:
   79286       unreachable("Invalid hardware generation");
   79287    }
   79288 }
   79289 
   79290 
   79291 
   79292 /* 3DSTATE_STREAMOUT::Reorder Mode */
   79293 
   79294 
   79295 #define GEN10_3DSTATE_STREAMOUT_ReorderMode_bits  1
   79296 #define GEN9_3DSTATE_STREAMOUT_ReorderMode_bits  1
   79297 #define GEN8_3DSTATE_STREAMOUT_ReorderMode_bits  1
   79298 #define GEN75_3DSTATE_STREAMOUT_ReorderMode_bits  1
   79299 #define GEN7_3DSTATE_STREAMOUT_ReorderMode_bits  1
   79300 
   79301 static inline uint32_t ATTRIBUTE_PURE
   79302 _3DSTATE_STREAMOUT_ReorderMode_bits(const struct gen_device_info *devinfo)
   79303 {
   79304    switch (devinfo->gen) {
   79305    case 10: return 1;
   79306    case 9: return 1;
   79307    case 8: return 1;
   79308    case 7:
   79309       if (devinfo->is_haswell) {
   79310          return 1;
   79311       } else {
   79312          return 1;
   79313       }
   79314    case 6: return 0;
   79315    case 5: return 0;
   79316    case 4:
   79317       if (devinfo->is_g4x) {
   79318          return 0;
   79319       } else {
   79320          return 0;
   79321       }
   79322    default:
   79323       unreachable("Invalid hardware generation");
   79324    }
   79325 }
   79326 
   79327 
   79328 
   79329 #define GEN10_3DSTATE_STREAMOUT_ReorderMode_start  58
   79330 #define GEN9_3DSTATE_STREAMOUT_ReorderMode_start  58
   79331 #define GEN8_3DSTATE_STREAMOUT_ReorderMode_start  58
   79332 #define GEN75_3DSTATE_STREAMOUT_ReorderMode_start  58
   79333 #define GEN7_3DSTATE_STREAMOUT_ReorderMode_start  58
   79334 
   79335 static inline uint32_t ATTRIBUTE_PURE
   79336 _3DSTATE_STREAMOUT_ReorderMode_start(const struct gen_device_info *devinfo)
   79337 {
   79338    switch (devinfo->gen) {
   79339    case 10: return 58;
   79340    case 9: return 58;
   79341    case 8: return 58;
   79342    case 7:
   79343       if (devinfo->is_haswell) {
   79344          return 58;
   79345       } else {
   79346          return 58;
   79347       }
   79348    case 6: return 0;
   79349    case 5: return 0;
   79350    case 4:
   79351       if (devinfo->is_g4x) {
   79352          return 0;
   79353       } else {
   79354          return 0;
   79355       }
   79356    default:
   79357       unreachable("Invalid hardware generation");
   79358    }
   79359 }
   79360 
   79361 
   79362 
   79363 /* 3DSTATE_STREAMOUT::SO Buffer Enable [0] */
   79364 
   79365 
   79366 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable0_bits  1
   79367 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable0_bits  1
   79368 
   79369 static inline uint32_t ATTRIBUTE_PURE
   79370 _3DSTATE_STREAMOUT_SOBufferEnable0_bits(const struct gen_device_info *devinfo)
   79371 {
   79372    switch (devinfo->gen) {
   79373    case 10: return 0;
   79374    case 9: return 0;
   79375    case 8: return 0;
   79376    case 7:
   79377       if (devinfo->is_haswell) {
   79378          return 1;
   79379       } else {
   79380          return 1;
   79381       }
   79382    case 6: return 0;
   79383    case 5: return 0;
   79384    case 4:
   79385       if (devinfo->is_g4x) {
   79386          return 0;
   79387       } else {
   79388          return 0;
   79389       }
   79390    default:
   79391       unreachable("Invalid hardware generation");
   79392    }
   79393 }
   79394 
   79395 
   79396 
   79397 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable0_start  40
   79398 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable0_start  40
   79399 
   79400 static inline uint32_t ATTRIBUTE_PURE
   79401 _3DSTATE_STREAMOUT_SOBufferEnable0_start(const struct gen_device_info *devinfo)
   79402 {
   79403    switch (devinfo->gen) {
   79404    case 10: return 0;
   79405    case 9: return 0;
   79406    case 8: return 0;
   79407    case 7:
   79408       if (devinfo->is_haswell) {
   79409          return 40;
   79410       } else {
   79411          return 40;
   79412       }
   79413    case 6: return 0;
   79414    case 5: return 0;
   79415    case 4:
   79416       if (devinfo->is_g4x) {
   79417          return 0;
   79418       } else {
   79419          return 0;
   79420       }
   79421    default:
   79422       unreachable("Invalid hardware generation");
   79423    }
   79424 }
   79425 
   79426 
   79427 
   79428 /* 3DSTATE_STREAMOUT::SO Buffer Enable [1] */
   79429 
   79430 
   79431 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable1_bits  1
   79432 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable1_bits  1
   79433 
   79434 static inline uint32_t ATTRIBUTE_PURE
   79435 _3DSTATE_STREAMOUT_SOBufferEnable1_bits(const struct gen_device_info *devinfo)
   79436 {
   79437    switch (devinfo->gen) {
   79438    case 10: return 0;
   79439    case 9: return 0;
   79440    case 8: return 0;
   79441    case 7:
   79442       if (devinfo->is_haswell) {
   79443          return 1;
   79444       } else {
   79445          return 1;
   79446       }
   79447    case 6: return 0;
   79448    case 5: return 0;
   79449    case 4:
   79450       if (devinfo->is_g4x) {
   79451          return 0;
   79452       } else {
   79453          return 0;
   79454       }
   79455    default:
   79456       unreachable("Invalid hardware generation");
   79457    }
   79458 }
   79459 
   79460 
   79461 
   79462 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable1_start  41
   79463 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable1_start  41
   79464 
   79465 static inline uint32_t ATTRIBUTE_PURE
   79466 _3DSTATE_STREAMOUT_SOBufferEnable1_start(const struct gen_device_info *devinfo)
   79467 {
   79468    switch (devinfo->gen) {
   79469    case 10: return 0;
   79470    case 9: return 0;
   79471    case 8: return 0;
   79472    case 7:
   79473       if (devinfo->is_haswell) {
   79474          return 41;
   79475       } else {
   79476          return 41;
   79477       }
   79478    case 6: return 0;
   79479    case 5: return 0;
   79480    case 4:
   79481       if (devinfo->is_g4x) {
   79482          return 0;
   79483       } else {
   79484          return 0;
   79485       }
   79486    default:
   79487       unreachable("Invalid hardware generation");
   79488    }
   79489 }
   79490 
   79491 
   79492 
   79493 /* 3DSTATE_STREAMOUT::SO Buffer Enable [2] */
   79494 
   79495 
   79496 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable2_bits  1
   79497 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable2_bits  1
   79498 
   79499 static inline uint32_t ATTRIBUTE_PURE
   79500 _3DSTATE_STREAMOUT_SOBufferEnable2_bits(const struct gen_device_info *devinfo)
   79501 {
   79502    switch (devinfo->gen) {
   79503    case 10: return 0;
   79504    case 9: return 0;
   79505    case 8: return 0;
   79506    case 7:
   79507       if (devinfo->is_haswell) {
   79508          return 1;
   79509       } else {
   79510          return 1;
   79511       }
   79512    case 6: return 0;
   79513    case 5: return 0;
   79514    case 4:
   79515       if (devinfo->is_g4x) {
   79516          return 0;
   79517       } else {
   79518          return 0;
   79519       }
   79520    default:
   79521       unreachable("Invalid hardware generation");
   79522    }
   79523 }
   79524 
   79525 
   79526 
   79527 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable2_start  42
   79528 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable2_start  42
   79529 
   79530 static inline uint32_t ATTRIBUTE_PURE
   79531 _3DSTATE_STREAMOUT_SOBufferEnable2_start(const struct gen_device_info *devinfo)
   79532 {
   79533    switch (devinfo->gen) {
   79534    case 10: return 0;
   79535    case 9: return 0;
   79536    case 8: return 0;
   79537    case 7:
   79538       if (devinfo->is_haswell) {
   79539          return 42;
   79540       } else {
   79541          return 42;
   79542       }
   79543    case 6: return 0;
   79544    case 5: return 0;
   79545    case 4:
   79546       if (devinfo->is_g4x) {
   79547          return 0;
   79548       } else {
   79549          return 0;
   79550       }
   79551    default:
   79552       unreachable("Invalid hardware generation");
   79553    }
   79554 }
   79555 
   79556 
   79557 
   79558 /* 3DSTATE_STREAMOUT::SO Buffer Enable [3] */
   79559 
   79560 
   79561 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable3_bits  1
   79562 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable3_bits  1
   79563 
   79564 static inline uint32_t ATTRIBUTE_PURE
   79565 _3DSTATE_STREAMOUT_SOBufferEnable3_bits(const struct gen_device_info *devinfo)
   79566 {
   79567    switch (devinfo->gen) {
   79568    case 10: return 0;
   79569    case 9: return 0;
   79570    case 8: return 0;
   79571    case 7:
   79572       if (devinfo->is_haswell) {
   79573          return 1;
   79574       } else {
   79575          return 1;
   79576       }
   79577    case 6: return 0;
   79578    case 5: return 0;
   79579    case 4:
   79580       if (devinfo->is_g4x) {
   79581          return 0;
   79582       } else {
   79583          return 0;
   79584       }
   79585    default:
   79586       unreachable("Invalid hardware generation");
   79587    }
   79588 }
   79589 
   79590 
   79591 
   79592 #define GEN75_3DSTATE_STREAMOUT_SOBufferEnable3_start  43
   79593 #define GEN7_3DSTATE_STREAMOUT_SOBufferEnable3_start  43
   79594 
   79595 static inline uint32_t ATTRIBUTE_PURE
   79596 _3DSTATE_STREAMOUT_SOBufferEnable3_start(const struct gen_device_info *devinfo)
   79597 {
   79598    switch (devinfo->gen) {
   79599    case 10: return 0;
   79600    case 9: return 0;
   79601    case 8: return 0;
   79602    case 7:
   79603       if (devinfo->is_haswell) {
   79604          return 43;
   79605       } else {
   79606          return 43;
   79607       }
   79608    case 6: return 0;
   79609    case 5: return 0;
   79610    case 4:
   79611       if (devinfo->is_g4x) {
   79612          return 0;
   79613       } else {
   79614          return 0;
   79615       }
   79616    default:
   79617       unreachable("Invalid hardware generation");
   79618    }
   79619 }
   79620 
   79621 
   79622 
   79623 /* 3DSTATE_STREAMOUT::SO Function Enable */
   79624 
   79625 
   79626 #define GEN10_3DSTATE_STREAMOUT_SOFunctionEnable_bits  1
   79627 #define GEN9_3DSTATE_STREAMOUT_SOFunctionEnable_bits  1
   79628 #define GEN8_3DSTATE_STREAMOUT_SOFunctionEnable_bits  1
   79629 #define GEN75_3DSTATE_STREAMOUT_SOFunctionEnable_bits  1
   79630 #define GEN7_3DSTATE_STREAMOUT_SOFunctionEnable_bits  1
   79631 
   79632 static inline uint32_t ATTRIBUTE_PURE
   79633 _3DSTATE_STREAMOUT_SOFunctionEnable_bits(const struct gen_device_info *devinfo)
   79634 {
   79635    switch (devinfo->gen) {
   79636    case 10: return 1;
   79637    case 9: return 1;
   79638    case 8: return 1;
   79639    case 7:
   79640       if (devinfo->is_haswell) {
   79641          return 1;
   79642       } else {
   79643          return 1;
   79644       }
   79645    case 6: return 0;
   79646    case 5: return 0;
   79647    case 4:
   79648       if (devinfo->is_g4x) {
   79649          return 0;
   79650       } else {
   79651          return 0;
   79652       }
   79653    default:
   79654       unreachable("Invalid hardware generation");
   79655    }
   79656 }
   79657 
   79658 
   79659 
   79660 #define GEN10_3DSTATE_STREAMOUT_SOFunctionEnable_start  63
   79661 #define GEN9_3DSTATE_STREAMOUT_SOFunctionEnable_start  63
   79662 #define GEN8_3DSTATE_STREAMOUT_SOFunctionEnable_start  63
   79663 #define GEN75_3DSTATE_STREAMOUT_SOFunctionEnable_start  63
   79664 #define GEN7_3DSTATE_STREAMOUT_SOFunctionEnable_start  63
   79665 
   79666 static inline uint32_t ATTRIBUTE_PURE
   79667 _3DSTATE_STREAMOUT_SOFunctionEnable_start(const struct gen_device_info *devinfo)
   79668 {
   79669    switch (devinfo->gen) {
   79670    case 10: return 63;
   79671    case 9: return 63;
   79672    case 8: return 63;
   79673    case 7:
   79674       if (devinfo->is_haswell) {
   79675          return 63;
   79676       } else {
   79677          return 63;
   79678       }
   79679    case 6: return 0;
   79680    case 5: return 0;
   79681    case 4:
   79682       if (devinfo->is_g4x) {
   79683          return 0;
   79684       } else {
   79685          return 0;
   79686       }
   79687    default:
   79688       unreachable("Invalid hardware generation");
   79689    }
   79690 }
   79691 
   79692 
   79693 
   79694 /* 3DSTATE_STREAMOUT::SO Statistics Enable */
   79695 
   79696 
   79697 #define GEN10_3DSTATE_STREAMOUT_SOStatisticsEnable_bits  1
   79698 #define GEN9_3DSTATE_STREAMOUT_SOStatisticsEnable_bits  1
   79699 #define GEN8_3DSTATE_STREAMOUT_SOStatisticsEnable_bits  1
   79700 #define GEN75_3DSTATE_STREAMOUT_SOStatisticsEnable_bits  1
   79701 #define GEN7_3DSTATE_STREAMOUT_SOStatisticsEnable_bits  1
   79702 
   79703 static inline uint32_t ATTRIBUTE_PURE
   79704 _3DSTATE_STREAMOUT_SOStatisticsEnable_bits(const struct gen_device_info *devinfo)
   79705 {
   79706    switch (devinfo->gen) {
   79707    case 10: return 1;
   79708    case 9: return 1;
   79709    case 8: return 1;
   79710    case 7:
   79711       if (devinfo->is_haswell) {
   79712          return 1;
   79713       } else {
   79714          return 1;
   79715       }
   79716    case 6: return 0;
   79717    case 5: return 0;
   79718    case 4:
   79719       if (devinfo->is_g4x) {
   79720          return 0;
   79721       } else {
   79722          return 0;
   79723       }
   79724    default:
   79725       unreachable("Invalid hardware generation");
   79726    }
   79727 }
   79728 
   79729 
   79730 
   79731 #define GEN10_3DSTATE_STREAMOUT_SOStatisticsEnable_start  57
   79732 #define GEN9_3DSTATE_STREAMOUT_SOStatisticsEnable_start  57
   79733 #define GEN8_3DSTATE_STREAMOUT_SOStatisticsEnable_start  57
   79734 #define GEN75_3DSTATE_STREAMOUT_SOStatisticsEnable_start  57
   79735 #define GEN7_3DSTATE_STREAMOUT_SOStatisticsEnable_start  57
   79736 
   79737 static inline uint32_t ATTRIBUTE_PURE
   79738 _3DSTATE_STREAMOUT_SOStatisticsEnable_start(const struct gen_device_info *devinfo)
   79739 {
   79740    switch (devinfo->gen) {
   79741    case 10: return 57;
   79742    case 9: return 57;
   79743    case 8: return 57;
   79744    case 7:
   79745       if (devinfo->is_haswell) {
   79746          return 57;
   79747       } else {
   79748          return 57;
   79749       }
   79750    case 6: return 0;
   79751    case 5: return 0;
   79752    case 4:
   79753       if (devinfo->is_g4x) {
   79754          return 0;
   79755       } else {
   79756          return 0;
   79757       }
   79758    default:
   79759       unreachable("Invalid hardware generation");
   79760    }
   79761 }
   79762 
   79763 
   79764 
   79765 /* 3DSTATE_STREAMOUT::Stream 0 Vertex Read Length */
   79766 
   79767 
   79768 #define GEN10_3DSTATE_STREAMOUT_Stream0VertexReadLength_bits  5
   79769 #define GEN9_3DSTATE_STREAMOUT_Stream0VertexReadLength_bits  5
   79770 #define GEN8_3DSTATE_STREAMOUT_Stream0VertexReadLength_bits  5
   79771 #define GEN75_3DSTATE_STREAMOUT_Stream0VertexReadLength_bits  5
   79772 #define GEN7_3DSTATE_STREAMOUT_Stream0VertexReadLength_bits  5
   79773 
   79774 static inline uint32_t ATTRIBUTE_PURE
   79775 _3DSTATE_STREAMOUT_Stream0VertexReadLength_bits(const struct gen_device_info *devinfo)
   79776 {
   79777    switch (devinfo->gen) {
   79778    case 10: return 5;
   79779    case 9: return 5;
   79780    case 8: return 5;
   79781    case 7:
   79782       if (devinfo->is_haswell) {
   79783          return 5;
   79784       } else {
   79785          return 5;
   79786       }
   79787    case 6: return 0;
   79788    case 5: return 0;
   79789    case 4:
   79790       if (devinfo->is_g4x) {
   79791          return 0;
   79792       } else {
   79793          return 0;
   79794       }
   79795    default:
   79796       unreachable("Invalid hardware generation");
   79797    }
   79798 }
   79799 
   79800 
   79801 
   79802 #define GEN10_3DSTATE_STREAMOUT_Stream0VertexReadLength_start  64
   79803 #define GEN9_3DSTATE_STREAMOUT_Stream0VertexReadLength_start  64
   79804 #define GEN8_3DSTATE_STREAMOUT_Stream0VertexReadLength_start  64
   79805 #define GEN75_3DSTATE_STREAMOUT_Stream0VertexReadLength_start  64
   79806 #define GEN7_3DSTATE_STREAMOUT_Stream0VertexReadLength_start  64
   79807 
   79808 static inline uint32_t ATTRIBUTE_PURE
   79809 _3DSTATE_STREAMOUT_Stream0VertexReadLength_start(const struct gen_device_info *devinfo)
   79810 {
   79811    switch (devinfo->gen) {
   79812    case 10: return 64;
   79813    case 9: return 64;
   79814    case 8: return 64;
   79815    case 7:
   79816       if (devinfo->is_haswell) {
   79817          return 64;
   79818       } else {
   79819          return 64;
   79820       }
   79821    case 6: return 0;
   79822    case 5: return 0;
   79823    case 4:
   79824       if (devinfo->is_g4x) {
   79825          return 0;
   79826       } else {
   79827          return 0;
   79828       }
   79829    default:
   79830       unreachable("Invalid hardware generation");
   79831    }
   79832 }
   79833 
   79834 
   79835 
   79836 /* 3DSTATE_STREAMOUT::Stream 0 Vertex Read Offset */
   79837 
   79838 
   79839 #define GEN10_3DSTATE_STREAMOUT_Stream0VertexReadOffset_bits  1
   79840 #define GEN9_3DSTATE_STREAMOUT_Stream0VertexReadOffset_bits  1
   79841 #define GEN8_3DSTATE_STREAMOUT_Stream0VertexReadOffset_bits  1
   79842 #define GEN75_3DSTATE_STREAMOUT_Stream0VertexReadOffset_bits  1
   79843 #define GEN7_3DSTATE_STREAMOUT_Stream0VertexReadOffset_bits  1
   79844 
   79845 static inline uint32_t ATTRIBUTE_PURE
   79846 _3DSTATE_STREAMOUT_Stream0VertexReadOffset_bits(const struct gen_device_info *devinfo)
   79847 {
   79848    switch (devinfo->gen) {
   79849    case 10: return 1;
   79850    case 9: return 1;
   79851    case 8: return 1;
   79852    case 7:
   79853       if (devinfo->is_haswell) {
   79854          return 1;
   79855       } else {
   79856          return 1;
   79857       }
   79858    case 6: return 0;
   79859    case 5: return 0;
   79860    case 4:
   79861       if (devinfo->is_g4x) {
   79862          return 0;
   79863       } else {
   79864          return 0;
   79865       }
   79866    default:
   79867       unreachable("Invalid hardware generation");
   79868    }
   79869 }
   79870 
   79871 
   79872 
   79873 #define GEN10_3DSTATE_STREAMOUT_Stream0VertexReadOffset_start  69
   79874 #define GEN9_3DSTATE_STREAMOUT_Stream0VertexReadOffset_start  69
   79875 #define GEN8_3DSTATE_STREAMOUT_Stream0VertexReadOffset_start  69
   79876 #define GEN75_3DSTATE_STREAMOUT_Stream0VertexReadOffset_start  69
   79877 #define GEN7_3DSTATE_STREAMOUT_Stream0VertexReadOffset_start  69
   79878 
   79879 static inline uint32_t ATTRIBUTE_PURE
   79880 _3DSTATE_STREAMOUT_Stream0VertexReadOffset_start(const struct gen_device_info *devinfo)
   79881 {
   79882    switch (devinfo->gen) {
   79883    case 10: return 69;
   79884    case 9: return 69;
   79885    case 8: return 69;
   79886    case 7:
   79887       if (devinfo->is_haswell) {
   79888          return 69;
   79889       } else {
   79890          return 69;
   79891       }
   79892    case 6: return 0;
   79893    case 5: return 0;
   79894    case 4:
   79895       if (devinfo->is_g4x) {
   79896          return 0;
   79897       } else {
   79898          return 0;
   79899       }
   79900    default:
   79901       unreachable("Invalid hardware generation");
   79902    }
   79903 }
   79904 
   79905 
   79906 
   79907 /* 3DSTATE_STREAMOUT::Stream 1 Vertex Read Length */
   79908 
   79909 
   79910 #define GEN10_3DSTATE_STREAMOUT_Stream1VertexReadLength_bits  5
   79911 #define GEN9_3DSTATE_STREAMOUT_Stream1VertexReadLength_bits  5
   79912 #define GEN8_3DSTATE_STREAMOUT_Stream1VertexReadLength_bits  5
   79913 #define GEN75_3DSTATE_STREAMOUT_Stream1VertexReadLength_bits  5
   79914 #define GEN7_3DSTATE_STREAMOUT_Stream1VertexReadLength_bits  5
   79915 
   79916 static inline uint32_t ATTRIBUTE_PURE
   79917 _3DSTATE_STREAMOUT_Stream1VertexReadLength_bits(const struct gen_device_info *devinfo)
   79918 {
   79919    switch (devinfo->gen) {
   79920    case 10: return 5;
   79921    case 9: return 5;
   79922    case 8: return 5;
   79923    case 7:
   79924       if (devinfo->is_haswell) {
   79925          return 5;
   79926       } else {
   79927          return 5;
   79928       }
   79929    case 6: return 0;
   79930    case 5: return 0;
   79931    case 4:
   79932       if (devinfo->is_g4x) {
   79933          return 0;
   79934       } else {
   79935          return 0;
   79936       }
   79937    default:
   79938       unreachable("Invalid hardware generation");
   79939    }
   79940 }
   79941 
   79942 
   79943 
   79944 #define GEN10_3DSTATE_STREAMOUT_Stream1VertexReadLength_start  72
   79945 #define GEN9_3DSTATE_STREAMOUT_Stream1VertexReadLength_start  72
   79946 #define GEN8_3DSTATE_STREAMOUT_Stream1VertexReadLength_start  72
   79947 #define GEN75_3DSTATE_STREAMOUT_Stream1VertexReadLength_start  72
   79948 #define GEN7_3DSTATE_STREAMOUT_Stream1VertexReadLength_start  72
   79949 
   79950 static inline uint32_t ATTRIBUTE_PURE
   79951 _3DSTATE_STREAMOUT_Stream1VertexReadLength_start(const struct gen_device_info *devinfo)
   79952 {
   79953    switch (devinfo->gen) {
   79954    case 10: return 72;
   79955    case 9: return 72;
   79956    case 8: return 72;
   79957    case 7:
   79958       if (devinfo->is_haswell) {
   79959          return 72;
   79960       } else {
   79961          return 72;
   79962       }
   79963    case 6: return 0;
   79964    case 5: return 0;
   79965    case 4:
   79966       if (devinfo->is_g4x) {
   79967          return 0;
   79968       } else {
   79969          return 0;
   79970       }
   79971    default:
   79972       unreachable("Invalid hardware generation");
   79973    }
   79974 }
   79975 
   79976 
   79977 
   79978 /* 3DSTATE_STREAMOUT::Stream 1 Vertex Read Offset */
   79979 
   79980 
   79981 #define GEN10_3DSTATE_STREAMOUT_Stream1VertexReadOffset_bits  1
   79982 #define GEN9_3DSTATE_STREAMOUT_Stream1VertexReadOffset_bits  1
   79983 #define GEN8_3DSTATE_STREAMOUT_Stream1VertexReadOffset_bits  1
   79984 #define GEN75_3DSTATE_STREAMOUT_Stream1VertexReadOffset_bits  1
   79985 #define GEN7_3DSTATE_STREAMOUT_Stream1VertexReadOffset_bits  1
   79986 
   79987 static inline uint32_t ATTRIBUTE_PURE
   79988 _3DSTATE_STREAMOUT_Stream1VertexReadOffset_bits(const struct gen_device_info *devinfo)
   79989 {
   79990    switch (devinfo->gen) {
   79991    case 10: return 1;
   79992    case 9: return 1;
   79993    case 8: return 1;
   79994    case 7:
   79995       if (devinfo->is_haswell) {
   79996          return 1;
   79997       } else {
   79998          return 1;
   79999       }
   80000    case 6: return 0;
   80001    case 5: return 0;
   80002    case 4:
   80003       if (devinfo->is_g4x) {
   80004          return 0;
   80005       } else {
   80006          return 0;
   80007       }
   80008    default:
   80009       unreachable("Invalid hardware generation");
   80010    }
   80011 }
   80012 
   80013 
   80014 
   80015 #define GEN10_3DSTATE_STREAMOUT_Stream1VertexReadOffset_start  77
   80016 #define GEN9_3DSTATE_STREAMOUT_Stream1VertexReadOffset_start  77
   80017 #define GEN8_3DSTATE_STREAMOUT_Stream1VertexReadOffset_start  77
   80018 #define GEN75_3DSTATE_STREAMOUT_Stream1VertexReadOffset_start  77
   80019 #define GEN7_3DSTATE_STREAMOUT_Stream1VertexReadOffset_start  77
   80020 
   80021 static inline uint32_t ATTRIBUTE_PURE
   80022 _3DSTATE_STREAMOUT_Stream1VertexReadOffset_start(const struct gen_device_info *devinfo)
   80023 {
   80024    switch (devinfo->gen) {
   80025    case 10: return 77;
   80026    case 9: return 77;
   80027    case 8: return 77;
   80028    case 7:
   80029       if (devinfo->is_haswell) {
   80030          return 77;
   80031       } else {
   80032          return 77;
   80033       }
   80034    case 6: return 0;
   80035    case 5: return 0;
   80036    case 4:
   80037       if (devinfo->is_g4x) {
   80038          return 0;
   80039       } else {
   80040          return 0;
   80041       }
   80042    default:
   80043       unreachable("Invalid hardware generation");
   80044    }
   80045 }
   80046 
   80047 
   80048 
   80049 /* 3DSTATE_STREAMOUT::Stream 2 Vertex Read Length */
   80050 
   80051 
   80052 #define GEN10_3DSTATE_STREAMOUT_Stream2VertexReadLength_bits  5
   80053 #define GEN9_3DSTATE_STREAMOUT_Stream2VertexReadLength_bits  5
   80054 #define GEN8_3DSTATE_STREAMOUT_Stream2VertexReadLength_bits  5
   80055 #define GEN75_3DSTATE_STREAMOUT_Stream2VertexReadLength_bits  5
   80056 #define GEN7_3DSTATE_STREAMOUT_Stream2VertexReadLength_bits  5
   80057 
   80058 static inline uint32_t ATTRIBUTE_PURE
   80059 _3DSTATE_STREAMOUT_Stream2VertexReadLength_bits(const struct gen_device_info *devinfo)
   80060 {
   80061    switch (devinfo->gen) {
   80062    case 10: return 5;
   80063    case 9: return 5;
   80064    case 8: return 5;
   80065    case 7:
   80066       if (devinfo->is_haswell) {
   80067          return 5;
   80068       } else {
   80069          return 5;
   80070       }
   80071    case 6: return 0;
   80072    case 5: return 0;
   80073    case 4:
   80074       if (devinfo->is_g4x) {
   80075          return 0;
   80076       } else {
   80077          return 0;
   80078       }
   80079    default:
   80080       unreachable("Invalid hardware generation");
   80081    }
   80082 }
   80083 
   80084 
   80085 
   80086 #define GEN10_3DSTATE_STREAMOUT_Stream2VertexReadLength_start  80
   80087 #define GEN9_3DSTATE_STREAMOUT_Stream2VertexReadLength_start  80
   80088 #define GEN8_3DSTATE_STREAMOUT_Stream2VertexReadLength_start  80
   80089 #define GEN75_3DSTATE_STREAMOUT_Stream2VertexReadLength_start  80
   80090 #define GEN7_3DSTATE_STREAMOUT_Stream2VertexReadLength_start  80
   80091 
   80092 static inline uint32_t ATTRIBUTE_PURE
   80093 _3DSTATE_STREAMOUT_Stream2VertexReadLength_start(const struct gen_device_info *devinfo)
   80094 {
   80095    switch (devinfo->gen) {
   80096    case 10: return 80;
   80097    case 9: return 80;
   80098    case 8: return 80;
   80099    case 7:
   80100       if (devinfo->is_haswell) {
   80101          return 80;
   80102       } else {
   80103          return 80;
   80104       }
   80105    case 6: return 0;
   80106    case 5: return 0;
   80107    case 4:
   80108       if (devinfo->is_g4x) {
   80109          return 0;
   80110       } else {
   80111          return 0;
   80112       }
   80113    default:
   80114       unreachable("Invalid hardware generation");
   80115    }
   80116 }
   80117 
   80118 
   80119 
   80120 /* 3DSTATE_STREAMOUT::Stream 2 Vertex Read Offset */
   80121 
   80122 
   80123 #define GEN10_3DSTATE_STREAMOUT_Stream2VertexReadOffset_bits  1
   80124 #define GEN9_3DSTATE_STREAMOUT_Stream2VertexReadOffset_bits  1
   80125 #define GEN8_3DSTATE_STREAMOUT_Stream2VertexReadOffset_bits  1
   80126 #define GEN75_3DSTATE_STREAMOUT_Stream2VertexReadOffset_bits  1
   80127 #define GEN7_3DSTATE_STREAMOUT_Stream2VertexReadOffset_bits  1
   80128 
   80129 static inline uint32_t ATTRIBUTE_PURE
   80130 _3DSTATE_STREAMOUT_Stream2VertexReadOffset_bits(const struct gen_device_info *devinfo)
   80131 {
   80132    switch (devinfo->gen) {
   80133    case 10: return 1;
   80134    case 9: return 1;
   80135    case 8: return 1;
   80136    case 7:
   80137       if (devinfo->is_haswell) {
   80138          return 1;
   80139       } else {
   80140          return 1;
   80141       }
   80142    case 6: return 0;
   80143    case 5: return 0;
   80144    case 4:
   80145       if (devinfo->is_g4x) {
   80146          return 0;
   80147       } else {
   80148          return 0;
   80149       }
   80150    default:
   80151       unreachable("Invalid hardware generation");
   80152    }
   80153 }
   80154 
   80155 
   80156 
   80157 #define GEN10_3DSTATE_STREAMOUT_Stream2VertexReadOffset_start  85
   80158 #define GEN9_3DSTATE_STREAMOUT_Stream2VertexReadOffset_start  85
   80159 #define GEN8_3DSTATE_STREAMOUT_Stream2VertexReadOffset_start  85
   80160 #define GEN75_3DSTATE_STREAMOUT_Stream2VertexReadOffset_start  85
   80161 #define GEN7_3DSTATE_STREAMOUT_Stream2VertexReadOffset_start  85
   80162 
   80163 static inline uint32_t ATTRIBUTE_PURE
   80164 _3DSTATE_STREAMOUT_Stream2VertexReadOffset_start(const struct gen_device_info *devinfo)
   80165 {
   80166    switch (devinfo->gen) {
   80167    case 10: return 85;
   80168    case 9: return 85;
   80169    case 8: return 85;
   80170    case 7:
   80171       if (devinfo->is_haswell) {
   80172          return 85;
   80173       } else {
   80174          return 85;
   80175       }
   80176    case 6: return 0;
   80177    case 5: return 0;
   80178    case 4:
   80179       if (devinfo->is_g4x) {
   80180          return 0;
   80181       } else {
   80182          return 0;
   80183       }
   80184    default:
   80185       unreachable("Invalid hardware generation");
   80186    }
   80187 }
   80188 
   80189 
   80190 
   80191 /* 3DSTATE_STREAMOUT::Stream 3 Vertex Read Length */
   80192 
   80193 
   80194 #define GEN10_3DSTATE_STREAMOUT_Stream3VertexReadLength_bits  5
   80195 #define GEN9_3DSTATE_STREAMOUT_Stream3VertexReadLength_bits  5
   80196 #define GEN8_3DSTATE_STREAMOUT_Stream3VertexReadLength_bits  5
   80197 #define GEN75_3DSTATE_STREAMOUT_Stream3VertexReadLength_bits  5
   80198 #define GEN7_3DSTATE_STREAMOUT_Stream3VertexReadLength_bits  5
   80199 
   80200 static inline uint32_t ATTRIBUTE_PURE
   80201 _3DSTATE_STREAMOUT_Stream3VertexReadLength_bits(const struct gen_device_info *devinfo)
   80202 {
   80203    switch (devinfo->gen) {
   80204    case 10: return 5;
   80205    case 9: return 5;
   80206    case 8: return 5;
   80207    case 7:
   80208       if (devinfo->is_haswell) {
   80209          return 5;
   80210       } else {
   80211          return 5;
   80212       }
   80213    case 6: return 0;
   80214    case 5: return 0;
   80215    case 4:
   80216       if (devinfo->is_g4x) {
   80217          return 0;
   80218       } else {
   80219          return 0;
   80220       }
   80221    default:
   80222       unreachable("Invalid hardware generation");
   80223    }
   80224 }
   80225 
   80226 
   80227 
   80228 #define GEN10_3DSTATE_STREAMOUT_Stream3VertexReadLength_start  88
   80229 #define GEN9_3DSTATE_STREAMOUT_Stream3VertexReadLength_start  88
   80230 #define GEN8_3DSTATE_STREAMOUT_Stream3VertexReadLength_start  88
   80231 #define GEN75_3DSTATE_STREAMOUT_Stream3VertexReadLength_start  88
   80232 #define GEN7_3DSTATE_STREAMOUT_Stream3VertexReadLength_start  88
   80233 
   80234 static inline uint32_t ATTRIBUTE_PURE
   80235 _3DSTATE_STREAMOUT_Stream3VertexReadLength_start(const struct gen_device_info *devinfo)
   80236 {
   80237    switch (devinfo->gen) {
   80238    case 10: return 88;
   80239    case 9: return 88;
   80240    case 8: return 88;
   80241    case 7:
   80242       if (devinfo->is_haswell) {
   80243          return 88;
   80244       } else {
   80245          return 88;
   80246       }
   80247    case 6: return 0;
   80248    case 5: return 0;
   80249    case 4:
   80250       if (devinfo->is_g4x) {
   80251          return 0;
   80252       } else {
   80253          return 0;
   80254       }
   80255    default:
   80256       unreachable("Invalid hardware generation");
   80257    }
   80258 }
   80259 
   80260 
   80261 
   80262 /* 3DSTATE_STREAMOUT::Stream 3 Vertex Read Offset */
   80263 
   80264 
   80265 #define GEN10_3DSTATE_STREAMOUT_Stream3VertexReadOffset_bits  1
   80266 #define GEN9_3DSTATE_STREAMOUT_Stream3VertexReadOffset_bits  1
   80267 #define GEN8_3DSTATE_STREAMOUT_Stream3VertexReadOffset_bits  1
   80268 #define GEN75_3DSTATE_STREAMOUT_Stream3VertexReadOffset_bits  1
   80269 #define GEN7_3DSTATE_STREAMOUT_Stream3VertexReadOffset_bits  1
   80270 
   80271 static inline uint32_t ATTRIBUTE_PURE
   80272 _3DSTATE_STREAMOUT_Stream3VertexReadOffset_bits(const struct gen_device_info *devinfo)
   80273 {
   80274    switch (devinfo->gen) {
   80275    case 10: return 1;
   80276    case 9: return 1;
   80277    case 8: return 1;
   80278    case 7:
   80279       if (devinfo->is_haswell) {
   80280          return 1;
   80281       } else {
   80282          return 1;
   80283       }
   80284    case 6: return 0;
   80285    case 5: return 0;
   80286    case 4:
   80287       if (devinfo->is_g4x) {
   80288          return 0;
   80289       } else {
   80290          return 0;
   80291       }
   80292    default:
   80293       unreachable("Invalid hardware generation");
   80294    }
   80295 }
   80296 
   80297 
   80298 
   80299 #define GEN10_3DSTATE_STREAMOUT_Stream3VertexReadOffset_start  93
   80300 #define GEN9_3DSTATE_STREAMOUT_Stream3VertexReadOffset_start  93
   80301 #define GEN8_3DSTATE_STREAMOUT_Stream3VertexReadOffset_start  93
   80302 #define GEN75_3DSTATE_STREAMOUT_Stream3VertexReadOffset_start  93
   80303 #define GEN7_3DSTATE_STREAMOUT_Stream3VertexReadOffset_start  93
   80304 
   80305 static inline uint32_t ATTRIBUTE_PURE
   80306 _3DSTATE_STREAMOUT_Stream3VertexReadOffset_start(const struct gen_device_info *devinfo)
   80307 {
   80308    switch (devinfo->gen) {
   80309    case 10: return 93;
   80310    case 9: return 93;
   80311    case 8: return 93;
   80312    case 7:
   80313       if (devinfo->is_haswell) {
   80314          return 93;
   80315       } else {
   80316          return 93;
   80317       }
   80318    case 6: return 0;
   80319    case 5: return 0;
   80320    case 4:
   80321       if (devinfo->is_g4x) {
   80322          return 0;
   80323       } else {
   80324          return 0;
   80325       }
   80326    default:
   80327       unreachable("Invalid hardware generation");
   80328    }
   80329 }
   80330 
   80331 
   80332 
   80333 /* 3DSTATE_TE */
   80334 
   80335 
   80336 #define GEN10_3DSTATE_TE_length  4
   80337 #define GEN9_3DSTATE_TE_length  4
   80338 #define GEN8_3DSTATE_TE_length  4
   80339 #define GEN75_3DSTATE_TE_length  4
   80340 #define GEN7_3DSTATE_TE_length  4
   80341 
   80342 static inline uint32_t ATTRIBUTE_PURE
   80343 _3DSTATE_TE_length(const struct gen_device_info *devinfo)
   80344 {
   80345    switch (devinfo->gen) {
   80346    case 10: return 4;
   80347    case 9: return 4;
   80348    case 8: return 4;
   80349    case 7:
   80350       if (devinfo->is_haswell) {
   80351          return 4;
   80352       } else {
   80353          return 4;
   80354       }
   80355    case 6: return 0;
   80356    case 5: return 0;
   80357    case 4:
   80358       if (devinfo->is_g4x) {
   80359          return 0;
   80360       } else {
   80361          return 0;
   80362       }
   80363    default:
   80364       unreachable("Invalid hardware generation");
   80365    }
   80366 }
   80367 
   80368 
   80369 
   80370 /* 3DSTATE_TE::3D Command Opcode */
   80371 
   80372 
   80373 #define GEN10_3DSTATE_TE_3DCommandOpcode_bits  3
   80374 #define GEN9_3DSTATE_TE_3DCommandOpcode_bits  3
   80375 #define GEN8_3DSTATE_TE_3DCommandOpcode_bits  3
   80376 #define GEN75_3DSTATE_TE_3DCommandOpcode_bits  3
   80377 #define GEN7_3DSTATE_TE_3DCommandOpcode_bits  3
   80378 
   80379 static inline uint32_t ATTRIBUTE_PURE
   80380 _3DSTATE_TE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   80381 {
   80382    switch (devinfo->gen) {
   80383    case 10: return 3;
   80384    case 9: return 3;
   80385    case 8: return 3;
   80386    case 7:
   80387       if (devinfo->is_haswell) {
   80388          return 3;
   80389       } else {
   80390          return 3;
   80391       }
   80392    case 6: return 0;
   80393    case 5: return 0;
   80394    case 4:
   80395       if (devinfo->is_g4x) {
   80396          return 0;
   80397       } else {
   80398          return 0;
   80399       }
   80400    default:
   80401       unreachable("Invalid hardware generation");
   80402    }
   80403 }
   80404 
   80405 
   80406 
   80407 #define GEN10_3DSTATE_TE_3DCommandOpcode_start  24
   80408 #define GEN9_3DSTATE_TE_3DCommandOpcode_start  24
   80409 #define GEN8_3DSTATE_TE_3DCommandOpcode_start  24
   80410 #define GEN75_3DSTATE_TE_3DCommandOpcode_start  24
   80411 #define GEN7_3DSTATE_TE_3DCommandOpcode_start  24
   80412 
   80413 static inline uint32_t ATTRIBUTE_PURE
   80414 _3DSTATE_TE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   80415 {
   80416    switch (devinfo->gen) {
   80417    case 10: return 24;
   80418    case 9: return 24;
   80419    case 8: return 24;
   80420    case 7:
   80421       if (devinfo->is_haswell) {
   80422          return 24;
   80423       } else {
   80424          return 24;
   80425       }
   80426    case 6: return 0;
   80427    case 5: return 0;
   80428    case 4:
   80429       if (devinfo->is_g4x) {
   80430          return 0;
   80431       } else {
   80432          return 0;
   80433       }
   80434    default:
   80435       unreachable("Invalid hardware generation");
   80436    }
   80437 }
   80438 
   80439 
   80440 
   80441 /* 3DSTATE_TE::3D Command Sub Opcode */
   80442 
   80443 
   80444 #define GEN10_3DSTATE_TE_3DCommandSubOpcode_bits  8
   80445 #define GEN9_3DSTATE_TE_3DCommandSubOpcode_bits  8
   80446 #define GEN8_3DSTATE_TE_3DCommandSubOpcode_bits  8
   80447 #define GEN75_3DSTATE_TE_3DCommandSubOpcode_bits  8
   80448 #define GEN7_3DSTATE_TE_3DCommandSubOpcode_bits  8
   80449 
   80450 static inline uint32_t ATTRIBUTE_PURE
   80451 _3DSTATE_TE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   80452 {
   80453    switch (devinfo->gen) {
   80454    case 10: return 8;
   80455    case 9: return 8;
   80456    case 8: return 8;
   80457    case 7:
   80458       if (devinfo->is_haswell) {
   80459          return 8;
   80460       } else {
   80461          return 8;
   80462       }
   80463    case 6: return 0;
   80464    case 5: return 0;
   80465    case 4:
   80466       if (devinfo->is_g4x) {
   80467          return 0;
   80468       } else {
   80469          return 0;
   80470       }
   80471    default:
   80472       unreachable("Invalid hardware generation");
   80473    }
   80474 }
   80475 
   80476 
   80477 
   80478 #define GEN10_3DSTATE_TE_3DCommandSubOpcode_start  16
   80479 #define GEN9_3DSTATE_TE_3DCommandSubOpcode_start  16
   80480 #define GEN8_3DSTATE_TE_3DCommandSubOpcode_start  16
   80481 #define GEN75_3DSTATE_TE_3DCommandSubOpcode_start  16
   80482 #define GEN7_3DSTATE_TE_3DCommandSubOpcode_start  16
   80483 
   80484 static inline uint32_t ATTRIBUTE_PURE
   80485 _3DSTATE_TE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   80486 {
   80487    switch (devinfo->gen) {
   80488    case 10: return 16;
   80489    case 9: return 16;
   80490    case 8: return 16;
   80491    case 7:
   80492       if (devinfo->is_haswell) {
   80493          return 16;
   80494       } else {
   80495          return 16;
   80496       }
   80497    case 6: return 0;
   80498    case 5: return 0;
   80499    case 4:
   80500       if (devinfo->is_g4x) {
   80501          return 0;
   80502       } else {
   80503          return 0;
   80504       }
   80505    default:
   80506       unreachable("Invalid hardware generation");
   80507    }
   80508 }
   80509 
   80510 
   80511 
   80512 /* 3DSTATE_TE::Command SubType */
   80513 
   80514 
   80515 #define GEN10_3DSTATE_TE_CommandSubType_bits  2
   80516 #define GEN9_3DSTATE_TE_CommandSubType_bits  2
   80517 #define GEN8_3DSTATE_TE_CommandSubType_bits  2
   80518 #define GEN75_3DSTATE_TE_CommandSubType_bits  2
   80519 #define GEN7_3DSTATE_TE_CommandSubType_bits  2
   80520 
   80521 static inline uint32_t ATTRIBUTE_PURE
   80522 _3DSTATE_TE_CommandSubType_bits(const struct gen_device_info *devinfo)
   80523 {
   80524    switch (devinfo->gen) {
   80525    case 10: return 2;
   80526    case 9: return 2;
   80527    case 8: return 2;
   80528    case 7:
   80529       if (devinfo->is_haswell) {
   80530          return 2;
   80531       } else {
   80532          return 2;
   80533       }
   80534    case 6: return 0;
   80535    case 5: return 0;
   80536    case 4:
   80537       if (devinfo->is_g4x) {
   80538          return 0;
   80539       } else {
   80540          return 0;
   80541       }
   80542    default:
   80543       unreachable("Invalid hardware generation");
   80544    }
   80545 }
   80546 
   80547 
   80548 
   80549 #define GEN10_3DSTATE_TE_CommandSubType_start  27
   80550 #define GEN9_3DSTATE_TE_CommandSubType_start  27
   80551 #define GEN8_3DSTATE_TE_CommandSubType_start  27
   80552 #define GEN75_3DSTATE_TE_CommandSubType_start  27
   80553 #define GEN7_3DSTATE_TE_CommandSubType_start  27
   80554 
   80555 static inline uint32_t ATTRIBUTE_PURE
   80556 _3DSTATE_TE_CommandSubType_start(const struct gen_device_info *devinfo)
   80557 {
   80558    switch (devinfo->gen) {
   80559    case 10: return 27;
   80560    case 9: return 27;
   80561    case 8: return 27;
   80562    case 7:
   80563       if (devinfo->is_haswell) {
   80564          return 27;
   80565       } else {
   80566          return 27;
   80567       }
   80568    case 6: return 0;
   80569    case 5: return 0;
   80570    case 4:
   80571       if (devinfo->is_g4x) {
   80572          return 0;
   80573       } else {
   80574          return 0;
   80575       }
   80576    default:
   80577       unreachable("Invalid hardware generation");
   80578    }
   80579 }
   80580 
   80581 
   80582 
   80583 /* 3DSTATE_TE::Command Type */
   80584 
   80585 
   80586 #define GEN10_3DSTATE_TE_CommandType_bits  3
   80587 #define GEN9_3DSTATE_TE_CommandType_bits  3
   80588 #define GEN8_3DSTATE_TE_CommandType_bits  3
   80589 #define GEN75_3DSTATE_TE_CommandType_bits  3
   80590 #define GEN7_3DSTATE_TE_CommandType_bits  3
   80591 
   80592 static inline uint32_t ATTRIBUTE_PURE
   80593 _3DSTATE_TE_CommandType_bits(const struct gen_device_info *devinfo)
   80594 {
   80595    switch (devinfo->gen) {
   80596    case 10: return 3;
   80597    case 9: return 3;
   80598    case 8: return 3;
   80599    case 7:
   80600       if (devinfo->is_haswell) {
   80601          return 3;
   80602       } else {
   80603          return 3;
   80604       }
   80605    case 6: return 0;
   80606    case 5: return 0;
   80607    case 4:
   80608       if (devinfo->is_g4x) {
   80609          return 0;
   80610       } else {
   80611          return 0;
   80612       }
   80613    default:
   80614       unreachable("Invalid hardware generation");
   80615    }
   80616 }
   80617 
   80618 
   80619 
   80620 #define GEN10_3DSTATE_TE_CommandType_start  29
   80621 #define GEN9_3DSTATE_TE_CommandType_start  29
   80622 #define GEN8_3DSTATE_TE_CommandType_start  29
   80623 #define GEN75_3DSTATE_TE_CommandType_start  29
   80624 #define GEN7_3DSTATE_TE_CommandType_start  29
   80625 
   80626 static inline uint32_t ATTRIBUTE_PURE
   80627 _3DSTATE_TE_CommandType_start(const struct gen_device_info *devinfo)
   80628 {
   80629    switch (devinfo->gen) {
   80630    case 10: return 29;
   80631    case 9: return 29;
   80632    case 8: return 29;
   80633    case 7:
   80634       if (devinfo->is_haswell) {
   80635          return 29;
   80636       } else {
   80637          return 29;
   80638       }
   80639    case 6: return 0;
   80640    case 5: return 0;
   80641    case 4:
   80642       if (devinfo->is_g4x) {
   80643          return 0;
   80644       } else {
   80645          return 0;
   80646       }
   80647    default:
   80648       unreachable("Invalid hardware generation");
   80649    }
   80650 }
   80651 
   80652 
   80653 
   80654 /* 3DSTATE_TE::DWord Length */
   80655 
   80656 
   80657 #define GEN10_3DSTATE_TE_DWordLength_bits  8
   80658 #define GEN9_3DSTATE_TE_DWordLength_bits  8
   80659 #define GEN8_3DSTATE_TE_DWordLength_bits  8
   80660 #define GEN75_3DSTATE_TE_DWordLength_bits  8
   80661 #define GEN7_3DSTATE_TE_DWordLength_bits  8
   80662 
   80663 static inline uint32_t ATTRIBUTE_PURE
   80664 _3DSTATE_TE_DWordLength_bits(const struct gen_device_info *devinfo)
   80665 {
   80666    switch (devinfo->gen) {
   80667    case 10: return 8;
   80668    case 9: return 8;
   80669    case 8: return 8;
   80670    case 7:
   80671       if (devinfo->is_haswell) {
   80672          return 8;
   80673       } else {
   80674          return 8;
   80675       }
   80676    case 6: return 0;
   80677    case 5: return 0;
   80678    case 4:
   80679       if (devinfo->is_g4x) {
   80680          return 0;
   80681       } else {
   80682          return 0;
   80683       }
   80684    default:
   80685       unreachable("Invalid hardware generation");
   80686    }
   80687 }
   80688 
   80689 
   80690 
   80691 #define GEN10_3DSTATE_TE_DWordLength_start  0
   80692 #define GEN9_3DSTATE_TE_DWordLength_start  0
   80693 #define GEN8_3DSTATE_TE_DWordLength_start  0
   80694 #define GEN75_3DSTATE_TE_DWordLength_start  0
   80695 #define GEN7_3DSTATE_TE_DWordLength_start  0
   80696 
   80697 static inline uint32_t ATTRIBUTE_PURE
   80698 _3DSTATE_TE_DWordLength_start(const struct gen_device_info *devinfo)
   80699 {
   80700    switch (devinfo->gen) {
   80701    case 10: return 0;
   80702    case 9: return 0;
   80703    case 8: return 0;
   80704    case 7:
   80705       if (devinfo->is_haswell) {
   80706          return 0;
   80707       } else {
   80708          return 0;
   80709       }
   80710    case 6: return 0;
   80711    case 5: return 0;
   80712    case 4:
   80713       if (devinfo->is_g4x) {
   80714          return 0;
   80715       } else {
   80716          return 0;
   80717       }
   80718    default:
   80719       unreachable("Invalid hardware generation");
   80720    }
   80721 }
   80722 
   80723 
   80724 
   80725 /* 3DSTATE_TE::Maximum Tessellation Factor Not Odd */
   80726 
   80727 
   80728 #define GEN10_3DSTATE_TE_MaximumTessellationFactorNotOdd_bits  32
   80729 #define GEN9_3DSTATE_TE_MaximumTessellationFactorNotOdd_bits  32
   80730 #define GEN8_3DSTATE_TE_MaximumTessellationFactorNotOdd_bits  32
   80731 #define GEN75_3DSTATE_TE_MaximumTessellationFactorNotOdd_bits  32
   80732 #define GEN7_3DSTATE_TE_MaximumTessellationFactorNotOdd_bits  32
   80733 
   80734 static inline uint32_t ATTRIBUTE_PURE
   80735 _3DSTATE_TE_MaximumTessellationFactorNotOdd_bits(const struct gen_device_info *devinfo)
   80736 {
   80737    switch (devinfo->gen) {
   80738    case 10: return 32;
   80739    case 9: return 32;
   80740    case 8: return 32;
   80741    case 7:
   80742       if (devinfo->is_haswell) {
   80743          return 32;
   80744       } else {
   80745          return 32;
   80746       }
   80747    case 6: return 0;
   80748    case 5: return 0;
   80749    case 4:
   80750       if (devinfo->is_g4x) {
   80751          return 0;
   80752       } else {
   80753          return 0;
   80754       }
   80755    default:
   80756       unreachable("Invalid hardware generation");
   80757    }
   80758 }
   80759 
   80760 
   80761 
   80762 #define GEN10_3DSTATE_TE_MaximumTessellationFactorNotOdd_start  96
   80763 #define GEN9_3DSTATE_TE_MaximumTessellationFactorNotOdd_start  96
   80764 #define GEN8_3DSTATE_TE_MaximumTessellationFactorNotOdd_start  96
   80765 #define GEN75_3DSTATE_TE_MaximumTessellationFactorNotOdd_start  96
   80766 #define GEN7_3DSTATE_TE_MaximumTessellationFactorNotOdd_start  96
   80767 
   80768 static inline uint32_t ATTRIBUTE_PURE
   80769 _3DSTATE_TE_MaximumTessellationFactorNotOdd_start(const struct gen_device_info *devinfo)
   80770 {
   80771    switch (devinfo->gen) {
   80772    case 10: return 96;
   80773    case 9: return 96;
   80774    case 8: return 96;
   80775    case 7:
   80776       if (devinfo->is_haswell) {
   80777          return 96;
   80778       } else {
   80779          return 96;
   80780       }
   80781    case 6: return 0;
   80782    case 5: return 0;
   80783    case 4:
   80784       if (devinfo->is_g4x) {
   80785          return 0;
   80786       } else {
   80787          return 0;
   80788       }
   80789    default:
   80790       unreachable("Invalid hardware generation");
   80791    }
   80792 }
   80793 
   80794 
   80795 
   80796 /* 3DSTATE_TE::Maximum Tessellation Factor Odd */
   80797 
   80798 
   80799 #define GEN10_3DSTATE_TE_MaximumTessellationFactorOdd_bits  32
   80800 #define GEN9_3DSTATE_TE_MaximumTessellationFactorOdd_bits  32
   80801 #define GEN8_3DSTATE_TE_MaximumTessellationFactorOdd_bits  32
   80802 #define GEN75_3DSTATE_TE_MaximumTessellationFactorOdd_bits  32
   80803 #define GEN7_3DSTATE_TE_MaximumTessellationFactorOdd_bits  32
   80804 
   80805 static inline uint32_t ATTRIBUTE_PURE
   80806 _3DSTATE_TE_MaximumTessellationFactorOdd_bits(const struct gen_device_info *devinfo)
   80807 {
   80808    switch (devinfo->gen) {
   80809    case 10: return 32;
   80810    case 9: return 32;
   80811    case 8: return 32;
   80812    case 7:
   80813       if (devinfo->is_haswell) {
   80814          return 32;
   80815       } else {
   80816          return 32;
   80817       }
   80818    case 6: return 0;
   80819    case 5: return 0;
   80820    case 4:
   80821       if (devinfo->is_g4x) {
   80822          return 0;
   80823       } else {
   80824          return 0;
   80825       }
   80826    default:
   80827       unreachable("Invalid hardware generation");
   80828    }
   80829 }
   80830 
   80831 
   80832 
   80833 #define GEN10_3DSTATE_TE_MaximumTessellationFactorOdd_start  64
   80834 #define GEN9_3DSTATE_TE_MaximumTessellationFactorOdd_start  64
   80835 #define GEN8_3DSTATE_TE_MaximumTessellationFactorOdd_start  64
   80836 #define GEN75_3DSTATE_TE_MaximumTessellationFactorOdd_start  64
   80837 #define GEN7_3DSTATE_TE_MaximumTessellationFactorOdd_start  64
   80838 
   80839 static inline uint32_t ATTRIBUTE_PURE
   80840 _3DSTATE_TE_MaximumTessellationFactorOdd_start(const struct gen_device_info *devinfo)
   80841 {
   80842    switch (devinfo->gen) {
   80843    case 10: return 64;
   80844    case 9: return 64;
   80845    case 8: return 64;
   80846    case 7:
   80847       if (devinfo->is_haswell) {
   80848          return 64;
   80849       } else {
   80850          return 64;
   80851       }
   80852    case 6: return 0;
   80853    case 5: return 0;
   80854    case 4:
   80855       if (devinfo->is_g4x) {
   80856          return 0;
   80857       } else {
   80858          return 0;
   80859       }
   80860    default:
   80861       unreachable("Invalid hardware generation");
   80862    }
   80863 }
   80864 
   80865 
   80866 
   80867 /* 3DSTATE_TE::Output Topology */
   80868 
   80869 
   80870 #define GEN10_3DSTATE_TE_OutputTopology_bits  2
   80871 #define GEN9_3DSTATE_TE_OutputTopology_bits  2
   80872 #define GEN8_3DSTATE_TE_OutputTopology_bits  2
   80873 #define GEN75_3DSTATE_TE_OutputTopology_bits  2
   80874 #define GEN7_3DSTATE_TE_OutputTopology_bits  2
   80875 
   80876 static inline uint32_t ATTRIBUTE_PURE
   80877 _3DSTATE_TE_OutputTopology_bits(const struct gen_device_info *devinfo)
   80878 {
   80879    switch (devinfo->gen) {
   80880    case 10: return 2;
   80881    case 9: return 2;
   80882    case 8: return 2;
   80883    case 7:
   80884       if (devinfo->is_haswell) {
   80885          return 2;
   80886       } else {
   80887          return 2;
   80888       }
   80889    case 6: return 0;
   80890    case 5: return 0;
   80891    case 4:
   80892       if (devinfo->is_g4x) {
   80893          return 0;
   80894       } else {
   80895          return 0;
   80896       }
   80897    default:
   80898       unreachable("Invalid hardware generation");
   80899    }
   80900 }
   80901 
   80902 
   80903 
   80904 #define GEN10_3DSTATE_TE_OutputTopology_start  40
   80905 #define GEN9_3DSTATE_TE_OutputTopology_start  40
   80906 #define GEN8_3DSTATE_TE_OutputTopology_start  40
   80907 #define GEN75_3DSTATE_TE_OutputTopology_start  40
   80908 #define GEN7_3DSTATE_TE_OutputTopology_start  40
   80909 
   80910 static inline uint32_t ATTRIBUTE_PURE
   80911 _3DSTATE_TE_OutputTopology_start(const struct gen_device_info *devinfo)
   80912 {
   80913    switch (devinfo->gen) {
   80914    case 10: return 40;
   80915    case 9: return 40;
   80916    case 8: return 40;
   80917    case 7:
   80918       if (devinfo->is_haswell) {
   80919          return 40;
   80920       } else {
   80921          return 40;
   80922       }
   80923    case 6: return 0;
   80924    case 5: return 0;
   80925    case 4:
   80926       if (devinfo->is_g4x) {
   80927          return 0;
   80928       } else {
   80929          return 0;
   80930       }
   80931    default:
   80932       unreachable("Invalid hardware generation");
   80933    }
   80934 }
   80935 
   80936 
   80937 
   80938 /* 3DSTATE_TE::Partitioning */
   80939 
   80940 
   80941 #define GEN10_3DSTATE_TE_Partitioning_bits  2
   80942 #define GEN9_3DSTATE_TE_Partitioning_bits  2
   80943 #define GEN8_3DSTATE_TE_Partitioning_bits  2
   80944 #define GEN75_3DSTATE_TE_Partitioning_bits  2
   80945 #define GEN7_3DSTATE_TE_Partitioning_bits  2
   80946 
   80947 static inline uint32_t ATTRIBUTE_PURE
   80948 _3DSTATE_TE_Partitioning_bits(const struct gen_device_info *devinfo)
   80949 {
   80950    switch (devinfo->gen) {
   80951    case 10: return 2;
   80952    case 9: return 2;
   80953    case 8: return 2;
   80954    case 7:
   80955       if (devinfo->is_haswell) {
   80956          return 2;
   80957       } else {
   80958          return 2;
   80959       }
   80960    case 6: return 0;
   80961    case 5: return 0;
   80962    case 4:
   80963       if (devinfo->is_g4x) {
   80964          return 0;
   80965       } else {
   80966          return 0;
   80967       }
   80968    default:
   80969       unreachable("Invalid hardware generation");
   80970    }
   80971 }
   80972 
   80973 
   80974 
   80975 #define GEN10_3DSTATE_TE_Partitioning_start  44
   80976 #define GEN9_3DSTATE_TE_Partitioning_start  44
   80977 #define GEN8_3DSTATE_TE_Partitioning_start  44
   80978 #define GEN75_3DSTATE_TE_Partitioning_start  44
   80979 #define GEN7_3DSTATE_TE_Partitioning_start  44
   80980 
   80981 static inline uint32_t ATTRIBUTE_PURE
   80982 _3DSTATE_TE_Partitioning_start(const struct gen_device_info *devinfo)
   80983 {
   80984    switch (devinfo->gen) {
   80985    case 10: return 44;
   80986    case 9: return 44;
   80987    case 8: return 44;
   80988    case 7:
   80989       if (devinfo->is_haswell) {
   80990          return 44;
   80991       } else {
   80992          return 44;
   80993       }
   80994    case 6: return 0;
   80995    case 5: return 0;
   80996    case 4:
   80997       if (devinfo->is_g4x) {
   80998          return 0;
   80999       } else {
   81000          return 0;
   81001       }
   81002    default:
   81003       unreachable("Invalid hardware generation");
   81004    }
   81005 }
   81006 
   81007 
   81008 
   81009 /* 3DSTATE_TE::TE Domain */
   81010 
   81011 
   81012 #define GEN10_3DSTATE_TE_TEDomain_bits  2
   81013 #define GEN9_3DSTATE_TE_TEDomain_bits  2
   81014 #define GEN8_3DSTATE_TE_TEDomain_bits  2
   81015 #define GEN75_3DSTATE_TE_TEDomain_bits  2
   81016 #define GEN7_3DSTATE_TE_TEDomain_bits  2
   81017 
   81018 static inline uint32_t ATTRIBUTE_PURE
   81019 _3DSTATE_TE_TEDomain_bits(const struct gen_device_info *devinfo)
   81020 {
   81021    switch (devinfo->gen) {
   81022    case 10: return 2;
   81023    case 9: return 2;
   81024    case 8: return 2;
   81025    case 7:
   81026       if (devinfo->is_haswell) {
   81027          return 2;
   81028       } else {
   81029          return 2;
   81030       }
   81031    case 6: return 0;
   81032    case 5: return 0;
   81033    case 4:
   81034       if (devinfo->is_g4x) {
   81035          return 0;
   81036       } else {
   81037          return 0;
   81038       }
   81039    default:
   81040       unreachable("Invalid hardware generation");
   81041    }
   81042 }
   81043 
   81044 
   81045 
   81046 #define GEN10_3DSTATE_TE_TEDomain_start  36
   81047 #define GEN9_3DSTATE_TE_TEDomain_start  36
   81048 #define GEN8_3DSTATE_TE_TEDomain_start  36
   81049 #define GEN75_3DSTATE_TE_TEDomain_start  36
   81050 #define GEN7_3DSTATE_TE_TEDomain_start  36
   81051 
   81052 static inline uint32_t ATTRIBUTE_PURE
   81053 _3DSTATE_TE_TEDomain_start(const struct gen_device_info *devinfo)
   81054 {
   81055    switch (devinfo->gen) {
   81056    case 10: return 36;
   81057    case 9: return 36;
   81058    case 8: return 36;
   81059    case 7:
   81060       if (devinfo->is_haswell) {
   81061          return 36;
   81062       } else {
   81063          return 36;
   81064       }
   81065    case 6: return 0;
   81066    case 5: return 0;
   81067    case 4:
   81068       if (devinfo->is_g4x) {
   81069          return 0;
   81070       } else {
   81071          return 0;
   81072       }
   81073    default:
   81074       unreachable("Invalid hardware generation");
   81075    }
   81076 }
   81077 
   81078 
   81079 
   81080 /* 3DSTATE_TE::TE Enable */
   81081 
   81082 
   81083 #define GEN10_3DSTATE_TE_TEEnable_bits  1
   81084 #define GEN9_3DSTATE_TE_TEEnable_bits  1
   81085 #define GEN8_3DSTATE_TE_TEEnable_bits  1
   81086 #define GEN75_3DSTATE_TE_TEEnable_bits  1
   81087 #define GEN7_3DSTATE_TE_TEEnable_bits  1
   81088 
   81089 static inline uint32_t ATTRIBUTE_PURE
   81090 _3DSTATE_TE_TEEnable_bits(const struct gen_device_info *devinfo)
   81091 {
   81092    switch (devinfo->gen) {
   81093    case 10: return 1;
   81094    case 9: return 1;
   81095    case 8: return 1;
   81096    case 7:
   81097       if (devinfo->is_haswell) {
   81098          return 1;
   81099       } else {
   81100          return 1;
   81101       }
   81102    case 6: return 0;
   81103    case 5: return 0;
   81104    case 4:
   81105       if (devinfo->is_g4x) {
   81106          return 0;
   81107       } else {
   81108          return 0;
   81109       }
   81110    default:
   81111       unreachable("Invalid hardware generation");
   81112    }
   81113 }
   81114 
   81115 
   81116 
   81117 #define GEN10_3DSTATE_TE_TEEnable_start  32
   81118 #define GEN9_3DSTATE_TE_TEEnable_start  32
   81119 #define GEN8_3DSTATE_TE_TEEnable_start  32
   81120 #define GEN75_3DSTATE_TE_TEEnable_start  32
   81121 #define GEN7_3DSTATE_TE_TEEnable_start  32
   81122 
   81123 static inline uint32_t ATTRIBUTE_PURE
   81124 _3DSTATE_TE_TEEnable_start(const struct gen_device_info *devinfo)
   81125 {
   81126    switch (devinfo->gen) {
   81127    case 10: return 32;
   81128    case 9: return 32;
   81129    case 8: return 32;
   81130    case 7:
   81131       if (devinfo->is_haswell) {
   81132          return 32;
   81133       } else {
   81134          return 32;
   81135       }
   81136    case 6: return 0;
   81137    case 5: return 0;
   81138    case 4:
   81139       if (devinfo->is_g4x) {
   81140          return 0;
   81141       } else {
   81142          return 0;
   81143       }
   81144    default:
   81145       unreachable("Invalid hardware generation");
   81146    }
   81147 }
   81148 
   81149 
   81150 
   81151 /* 3DSTATE_TE::TE Mode */
   81152 
   81153 
   81154 #define GEN10_3DSTATE_TE_TEMode_bits  2
   81155 #define GEN9_3DSTATE_TE_TEMode_bits  2
   81156 #define GEN8_3DSTATE_TE_TEMode_bits  2
   81157 #define GEN75_3DSTATE_TE_TEMode_bits  2
   81158 #define GEN7_3DSTATE_TE_TEMode_bits  2
   81159 
   81160 static inline uint32_t ATTRIBUTE_PURE
   81161 _3DSTATE_TE_TEMode_bits(const struct gen_device_info *devinfo)
   81162 {
   81163    switch (devinfo->gen) {
   81164    case 10: return 2;
   81165    case 9: return 2;
   81166    case 8: return 2;
   81167    case 7:
   81168       if (devinfo->is_haswell) {
   81169          return 2;
   81170       } else {
   81171          return 2;
   81172       }
   81173    case 6: return 0;
   81174    case 5: return 0;
   81175    case 4:
   81176       if (devinfo->is_g4x) {
   81177          return 0;
   81178       } else {
   81179          return 0;
   81180       }
   81181    default:
   81182       unreachable("Invalid hardware generation");
   81183    }
   81184 }
   81185 
   81186 
   81187 
   81188 #define GEN10_3DSTATE_TE_TEMode_start  33
   81189 #define GEN9_3DSTATE_TE_TEMode_start  33
   81190 #define GEN8_3DSTATE_TE_TEMode_start  33
   81191 #define GEN75_3DSTATE_TE_TEMode_start  33
   81192 #define GEN7_3DSTATE_TE_TEMode_start  33
   81193 
   81194 static inline uint32_t ATTRIBUTE_PURE
   81195 _3DSTATE_TE_TEMode_start(const struct gen_device_info *devinfo)
   81196 {
   81197    switch (devinfo->gen) {
   81198    case 10: return 33;
   81199    case 9: return 33;
   81200    case 8: return 33;
   81201    case 7:
   81202       if (devinfo->is_haswell) {
   81203          return 33;
   81204       } else {
   81205          return 33;
   81206       }
   81207    case 6: return 0;
   81208    case 5: return 0;
   81209    case 4:
   81210       if (devinfo->is_g4x) {
   81211          return 0;
   81212       } else {
   81213          return 0;
   81214       }
   81215    default:
   81216       unreachable("Invalid hardware generation");
   81217    }
   81218 }
   81219 
   81220 
   81221 
   81222 /* 3DSTATE_URB */
   81223 
   81224 
   81225 #define GEN6_3DSTATE_URB_length  3
   81226 
   81227 static inline uint32_t ATTRIBUTE_PURE
   81228 _3DSTATE_URB_length(const struct gen_device_info *devinfo)
   81229 {
   81230    switch (devinfo->gen) {
   81231    case 10: return 0;
   81232    case 9: return 0;
   81233    case 8: return 0;
   81234    case 7:
   81235       if (devinfo->is_haswell) {
   81236          return 0;
   81237       } else {
   81238          return 0;
   81239       }
   81240    case 6: return 3;
   81241    case 5: return 0;
   81242    case 4:
   81243       if (devinfo->is_g4x) {
   81244          return 0;
   81245       } else {
   81246          return 0;
   81247       }
   81248    default:
   81249       unreachable("Invalid hardware generation");
   81250    }
   81251 }
   81252 
   81253 
   81254 
   81255 /* 3DSTATE_URB::3D Command Opcode */
   81256 
   81257 
   81258 #define GEN6_3DSTATE_URB_3DCommandOpcode_bits  3
   81259 
   81260 static inline uint32_t ATTRIBUTE_PURE
   81261 _3DSTATE_URB_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   81262 {
   81263    switch (devinfo->gen) {
   81264    case 10: return 0;
   81265    case 9: return 0;
   81266    case 8: return 0;
   81267    case 7:
   81268       if (devinfo->is_haswell) {
   81269          return 0;
   81270       } else {
   81271          return 0;
   81272       }
   81273    case 6: return 3;
   81274    case 5: return 0;
   81275    case 4:
   81276       if (devinfo->is_g4x) {
   81277          return 0;
   81278       } else {
   81279          return 0;
   81280       }
   81281    default:
   81282       unreachable("Invalid hardware generation");
   81283    }
   81284 }
   81285 
   81286 
   81287 
   81288 #define GEN6_3DSTATE_URB_3DCommandOpcode_start  24
   81289 
   81290 static inline uint32_t ATTRIBUTE_PURE
   81291 _3DSTATE_URB_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   81292 {
   81293    switch (devinfo->gen) {
   81294    case 10: return 0;
   81295    case 9: return 0;
   81296    case 8: return 0;
   81297    case 7:
   81298       if (devinfo->is_haswell) {
   81299          return 0;
   81300       } else {
   81301          return 0;
   81302       }
   81303    case 6: return 24;
   81304    case 5: return 0;
   81305    case 4:
   81306       if (devinfo->is_g4x) {
   81307          return 0;
   81308       } else {
   81309          return 0;
   81310       }
   81311    default:
   81312       unreachable("Invalid hardware generation");
   81313    }
   81314 }
   81315 
   81316 
   81317 
   81318 /* 3DSTATE_URB::3D Command Sub Opcode */
   81319 
   81320 
   81321 #define GEN6_3DSTATE_URB_3DCommandSubOpcode_bits  8
   81322 
   81323 static inline uint32_t ATTRIBUTE_PURE
   81324 _3DSTATE_URB_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   81325 {
   81326    switch (devinfo->gen) {
   81327    case 10: return 0;
   81328    case 9: return 0;
   81329    case 8: return 0;
   81330    case 7:
   81331       if (devinfo->is_haswell) {
   81332          return 0;
   81333       } else {
   81334          return 0;
   81335       }
   81336    case 6: return 8;
   81337    case 5: return 0;
   81338    case 4:
   81339       if (devinfo->is_g4x) {
   81340          return 0;
   81341       } else {
   81342          return 0;
   81343       }
   81344    default:
   81345       unreachable("Invalid hardware generation");
   81346    }
   81347 }
   81348 
   81349 
   81350 
   81351 #define GEN6_3DSTATE_URB_3DCommandSubOpcode_start  16
   81352 
   81353 static inline uint32_t ATTRIBUTE_PURE
   81354 _3DSTATE_URB_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   81355 {
   81356    switch (devinfo->gen) {
   81357    case 10: return 0;
   81358    case 9: return 0;
   81359    case 8: return 0;
   81360    case 7:
   81361       if (devinfo->is_haswell) {
   81362          return 0;
   81363       } else {
   81364          return 0;
   81365       }
   81366    case 6: return 16;
   81367    case 5: return 0;
   81368    case 4:
   81369       if (devinfo->is_g4x) {
   81370          return 0;
   81371       } else {
   81372          return 0;
   81373       }
   81374    default:
   81375       unreachable("Invalid hardware generation");
   81376    }
   81377 }
   81378 
   81379 
   81380 
   81381 /* 3DSTATE_URB::Command SubType */
   81382 
   81383 
   81384 #define GEN6_3DSTATE_URB_CommandSubType_bits  2
   81385 
   81386 static inline uint32_t ATTRIBUTE_PURE
   81387 _3DSTATE_URB_CommandSubType_bits(const struct gen_device_info *devinfo)
   81388 {
   81389    switch (devinfo->gen) {
   81390    case 10: return 0;
   81391    case 9: return 0;
   81392    case 8: return 0;
   81393    case 7:
   81394       if (devinfo->is_haswell) {
   81395          return 0;
   81396       } else {
   81397          return 0;
   81398       }
   81399    case 6: return 2;
   81400    case 5: return 0;
   81401    case 4:
   81402       if (devinfo->is_g4x) {
   81403          return 0;
   81404       } else {
   81405          return 0;
   81406       }
   81407    default:
   81408       unreachable("Invalid hardware generation");
   81409    }
   81410 }
   81411 
   81412 
   81413 
   81414 #define GEN6_3DSTATE_URB_CommandSubType_start  27
   81415 
   81416 static inline uint32_t ATTRIBUTE_PURE
   81417 _3DSTATE_URB_CommandSubType_start(const struct gen_device_info *devinfo)
   81418 {
   81419    switch (devinfo->gen) {
   81420    case 10: return 0;
   81421    case 9: return 0;
   81422    case 8: return 0;
   81423    case 7:
   81424       if (devinfo->is_haswell) {
   81425          return 0;
   81426       } else {
   81427          return 0;
   81428       }
   81429    case 6: return 27;
   81430    case 5: return 0;
   81431    case 4:
   81432       if (devinfo->is_g4x) {
   81433          return 0;
   81434       } else {
   81435          return 0;
   81436       }
   81437    default:
   81438       unreachable("Invalid hardware generation");
   81439    }
   81440 }
   81441 
   81442 
   81443 
   81444 /* 3DSTATE_URB::Command Type */
   81445 
   81446 
   81447 #define GEN6_3DSTATE_URB_CommandType_bits  3
   81448 
   81449 static inline uint32_t ATTRIBUTE_PURE
   81450 _3DSTATE_URB_CommandType_bits(const struct gen_device_info *devinfo)
   81451 {
   81452    switch (devinfo->gen) {
   81453    case 10: return 0;
   81454    case 9: return 0;
   81455    case 8: return 0;
   81456    case 7:
   81457       if (devinfo->is_haswell) {
   81458          return 0;
   81459       } else {
   81460          return 0;
   81461       }
   81462    case 6: return 3;
   81463    case 5: return 0;
   81464    case 4:
   81465       if (devinfo->is_g4x) {
   81466          return 0;
   81467       } else {
   81468          return 0;
   81469       }
   81470    default:
   81471       unreachable("Invalid hardware generation");
   81472    }
   81473 }
   81474 
   81475 
   81476 
   81477 #define GEN6_3DSTATE_URB_CommandType_start  29
   81478 
   81479 static inline uint32_t ATTRIBUTE_PURE
   81480 _3DSTATE_URB_CommandType_start(const struct gen_device_info *devinfo)
   81481 {
   81482    switch (devinfo->gen) {
   81483    case 10: return 0;
   81484    case 9: return 0;
   81485    case 8: return 0;
   81486    case 7:
   81487       if (devinfo->is_haswell) {
   81488          return 0;
   81489       } else {
   81490          return 0;
   81491       }
   81492    case 6: return 29;
   81493    case 5: return 0;
   81494    case 4:
   81495       if (devinfo->is_g4x) {
   81496          return 0;
   81497       } else {
   81498          return 0;
   81499       }
   81500    default:
   81501       unreachable("Invalid hardware generation");
   81502    }
   81503 }
   81504 
   81505 
   81506 
   81507 /* 3DSTATE_URB::DWord Length */
   81508 
   81509 
   81510 #define GEN6_3DSTATE_URB_DWordLength_bits  8
   81511 
   81512 static inline uint32_t ATTRIBUTE_PURE
   81513 _3DSTATE_URB_DWordLength_bits(const struct gen_device_info *devinfo)
   81514 {
   81515    switch (devinfo->gen) {
   81516    case 10: return 0;
   81517    case 9: return 0;
   81518    case 8: return 0;
   81519    case 7:
   81520       if (devinfo->is_haswell) {
   81521          return 0;
   81522       } else {
   81523          return 0;
   81524       }
   81525    case 6: return 8;
   81526    case 5: return 0;
   81527    case 4:
   81528       if (devinfo->is_g4x) {
   81529          return 0;
   81530       } else {
   81531          return 0;
   81532       }
   81533    default:
   81534       unreachable("Invalid hardware generation");
   81535    }
   81536 }
   81537 
   81538 
   81539 
   81540 #define GEN6_3DSTATE_URB_DWordLength_start  0
   81541 
   81542 static inline uint32_t ATTRIBUTE_PURE
   81543 _3DSTATE_URB_DWordLength_start(const struct gen_device_info *devinfo)
   81544 {
   81545    switch (devinfo->gen) {
   81546    case 10: return 0;
   81547    case 9: return 0;
   81548    case 8: return 0;
   81549    case 7:
   81550       if (devinfo->is_haswell) {
   81551          return 0;
   81552       } else {
   81553          return 0;
   81554       }
   81555    case 6: return 0;
   81556    case 5: return 0;
   81557    case 4:
   81558       if (devinfo->is_g4x) {
   81559          return 0;
   81560       } else {
   81561          return 0;
   81562       }
   81563    default:
   81564       unreachable("Invalid hardware generation");
   81565    }
   81566 }
   81567 
   81568 
   81569 
   81570 /* 3DSTATE_URB::GS Number of URB Entries */
   81571 
   81572 
   81573 #define GEN6_3DSTATE_URB_GSNumberofURBEntries_bits  10
   81574 
   81575 static inline uint32_t ATTRIBUTE_PURE
   81576 _3DSTATE_URB_GSNumberofURBEntries_bits(const struct gen_device_info *devinfo)
   81577 {
   81578    switch (devinfo->gen) {
   81579    case 10: return 0;
   81580    case 9: return 0;
   81581    case 8: return 0;
   81582    case 7:
   81583       if (devinfo->is_haswell) {
   81584          return 0;
   81585       } else {
   81586          return 0;
   81587       }
   81588    case 6: return 10;
   81589    case 5: return 0;
   81590    case 4:
   81591       if (devinfo->is_g4x) {
   81592          return 0;
   81593       } else {
   81594          return 0;
   81595       }
   81596    default:
   81597       unreachable("Invalid hardware generation");
   81598    }
   81599 }
   81600 
   81601 
   81602 
   81603 #define GEN6_3DSTATE_URB_GSNumberofURBEntries_start  72
   81604 
   81605 static inline uint32_t ATTRIBUTE_PURE
   81606 _3DSTATE_URB_GSNumberofURBEntries_start(const struct gen_device_info *devinfo)
   81607 {
   81608    switch (devinfo->gen) {
   81609    case 10: return 0;
   81610    case 9: return 0;
   81611    case 8: return 0;
   81612    case 7:
   81613       if (devinfo->is_haswell) {
   81614          return 0;
   81615       } else {
   81616          return 0;
   81617       }
   81618    case 6: return 72;
   81619    case 5: return 0;
   81620    case 4:
   81621       if (devinfo->is_g4x) {
   81622          return 0;
   81623       } else {
   81624          return 0;
   81625       }
   81626    default:
   81627       unreachable("Invalid hardware generation");
   81628    }
   81629 }
   81630 
   81631 
   81632 
   81633 /* 3DSTATE_URB::GS URB Entry Allocation Size */
   81634 
   81635 
   81636 #define GEN6_3DSTATE_URB_GSURBEntryAllocationSize_bits  3
   81637 
   81638 static inline uint32_t ATTRIBUTE_PURE
   81639 _3DSTATE_URB_GSURBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   81640 {
   81641    switch (devinfo->gen) {
   81642    case 10: return 0;
   81643    case 9: return 0;
   81644    case 8: return 0;
   81645    case 7:
   81646       if (devinfo->is_haswell) {
   81647          return 0;
   81648       } else {
   81649          return 0;
   81650       }
   81651    case 6: return 3;
   81652    case 5: return 0;
   81653    case 4:
   81654       if (devinfo->is_g4x) {
   81655          return 0;
   81656       } else {
   81657          return 0;
   81658       }
   81659    default:
   81660       unreachable("Invalid hardware generation");
   81661    }
   81662 }
   81663 
   81664 
   81665 
   81666 #define GEN6_3DSTATE_URB_GSURBEntryAllocationSize_start  64
   81667 
   81668 static inline uint32_t ATTRIBUTE_PURE
   81669 _3DSTATE_URB_GSURBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   81670 {
   81671    switch (devinfo->gen) {
   81672    case 10: return 0;
   81673    case 9: return 0;
   81674    case 8: return 0;
   81675    case 7:
   81676       if (devinfo->is_haswell) {
   81677          return 0;
   81678       } else {
   81679          return 0;
   81680       }
   81681    case 6: return 64;
   81682    case 5: return 0;
   81683    case 4:
   81684       if (devinfo->is_g4x) {
   81685          return 0;
   81686       } else {
   81687          return 0;
   81688       }
   81689    default:
   81690       unreachable("Invalid hardware generation");
   81691    }
   81692 }
   81693 
   81694 
   81695 
   81696 /* 3DSTATE_URB::VS Number of URB Entries */
   81697 
   81698 
   81699 #define GEN6_3DSTATE_URB_VSNumberofURBEntries_bits  16
   81700 
   81701 static inline uint32_t ATTRIBUTE_PURE
   81702 _3DSTATE_URB_VSNumberofURBEntries_bits(const struct gen_device_info *devinfo)
   81703 {
   81704    switch (devinfo->gen) {
   81705    case 10: return 0;
   81706    case 9: return 0;
   81707    case 8: return 0;
   81708    case 7:
   81709       if (devinfo->is_haswell) {
   81710          return 0;
   81711       } else {
   81712          return 0;
   81713       }
   81714    case 6: return 16;
   81715    case 5: return 0;
   81716    case 4:
   81717       if (devinfo->is_g4x) {
   81718          return 0;
   81719       } else {
   81720          return 0;
   81721       }
   81722    default:
   81723       unreachable("Invalid hardware generation");
   81724    }
   81725 }
   81726 
   81727 
   81728 
   81729 #define GEN6_3DSTATE_URB_VSNumberofURBEntries_start  32
   81730 
   81731 static inline uint32_t ATTRIBUTE_PURE
   81732 _3DSTATE_URB_VSNumberofURBEntries_start(const struct gen_device_info *devinfo)
   81733 {
   81734    switch (devinfo->gen) {
   81735    case 10: return 0;
   81736    case 9: return 0;
   81737    case 8: return 0;
   81738    case 7:
   81739       if (devinfo->is_haswell) {
   81740          return 0;
   81741       } else {
   81742          return 0;
   81743       }
   81744    case 6: return 32;
   81745    case 5: return 0;
   81746    case 4:
   81747       if (devinfo->is_g4x) {
   81748          return 0;
   81749       } else {
   81750          return 0;
   81751       }
   81752    default:
   81753       unreachable("Invalid hardware generation");
   81754    }
   81755 }
   81756 
   81757 
   81758 
   81759 /* 3DSTATE_URB::VS URB Entry Allocation Size */
   81760 
   81761 
   81762 #define GEN6_3DSTATE_URB_VSURBEntryAllocationSize_bits  8
   81763 
   81764 static inline uint32_t ATTRIBUTE_PURE
   81765 _3DSTATE_URB_VSURBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   81766 {
   81767    switch (devinfo->gen) {
   81768    case 10: return 0;
   81769    case 9: return 0;
   81770    case 8: return 0;
   81771    case 7:
   81772       if (devinfo->is_haswell) {
   81773          return 0;
   81774       } else {
   81775          return 0;
   81776       }
   81777    case 6: return 8;
   81778    case 5: return 0;
   81779    case 4:
   81780       if (devinfo->is_g4x) {
   81781          return 0;
   81782       } else {
   81783          return 0;
   81784       }
   81785    default:
   81786       unreachable("Invalid hardware generation");
   81787    }
   81788 }
   81789 
   81790 
   81791 
   81792 #define GEN6_3DSTATE_URB_VSURBEntryAllocationSize_start  48
   81793 
   81794 static inline uint32_t ATTRIBUTE_PURE
   81795 _3DSTATE_URB_VSURBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   81796 {
   81797    switch (devinfo->gen) {
   81798    case 10: return 0;
   81799    case 9: return 0;
   81800    case 8: return 0;
   81801    case 7:
   81802       if (devinfo->is_haswell) {
   81803          return 0;
   81804       } else {
   81805          return 0;
   81806       }
   81807    case 6: return 48;
   81808    case 5: return 0;
   81809    case 4:
   81810       if (devinfo->is_g4x) {
   81811          return 0;
   81812       } else {
   81813          return 0;
   81814       }
   81815    default:
   81816       unreachable("Invalid hardware generation");
   81817    }
   81818 }
   81819 
   81820 
   81821 
   81822 /* 3DSTATE_URB_CLEAR */
   81823 
   81824 
   81825 #define GEN10_3DSTATE_URB_CLEAR_length  2
   81826 #define GEN9_3DSTATE_URB_CLEAR_length  2
   81827 
   81828 static inline uint32_t ATTRIBUTE_PURE
   81829 _3DSTATE_URB_CLEAR_length(const struct gen_device_info *devinfo)
   81830 {
   81831    switch (devinfo->gen) {
   81832    case 10: return 2;
   81833    case 9: return 2;
   81834    case 8: return 0;
   81835    case 7:
   81836       if (devinfo->is_haswell) {
   81837          return 0;
   81838       } else {
   81839          return 0;
   81840       }
   81841    case 6: return 0;
   81842    case 5: return 0;
   81843    case 4:
   81844       if (devinfo->is_g4x) {
   81845          return 0;
   81846       } else {
   81847          return 0;
   81848       }
   81849    default:
   81850       unreachable("Invalid hardware generation");
   81851    }
   81852 }
   81853 
   81854 
   81855 
   81856 /* 3DSTATE_URB_CLEAR::3D Command Opcode */
   81857 
   81858 
   81859 #define GEN10_3DSTATE_URB_CLEAR_3DCommandOpcode_bits  3
   81860 #define GEN9_3DSTATE_URB_CLEAR_3DCommandOpcode_bits  3
   81861 
   81862 static inline uint32_t ATTRIBUTE_PURE
   81863 _3DSTATE_URB_CLEAR_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   81864 {
   81865    switch (devinfo->gen) {
   81866    case 10: return 3;
   81867    case 9: return 3;
   81868    case 8: return 0;
   81869    case 7:
   81870       if (devinfo->is_haswell) {
   81871          return 0;
   81872       } else {
   81873          return 0;
   81874       }
   81875    case 6: return 0;
   81876    case 5: return 0;
   81877    case 4:
   81878       if (devinfo->is_g4x) {
   81879          return 0;
   81880       } else {
   81881          return 0;
   81882       }
   81883    default:
   81884       unreachable("Invalid hardware generation");
   81885    }
   81886 }
   81887 
   81888 
   81889 
   81890 #define GEN10_3DSTATE_URB_CLEAR_3DCommandOpcode_start  24
   81891 #define GEN9_3DSTATE_URB_CLEAR_3DCommandOpcode_start  24
   81892 
   81893 static inline uint32_t ATTRIBUTE_PURE
   81894 _3DSTATE_URB_CLEAR_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   81895 {
   81896    switch (devinfo->gen) {
   81897    case 10: return 24;
   81898    case 9: return 24;
   81899    case 8: return 0;
   81900    case 7:
   81901       if (devinfo->is_haswell) {
   81902          return 0;
   81903       } else {
   81904          return 0;
   81905       }
   81906    case 6: return 0;
   81907    case 5: return 0;
   81908    case 4:
   81909       if (devinfo->is_g4x) {
   81910          return 0;
   81911       } else {
   81912          return 0;
   81913       }
   81914    default:
   81915       unreachable("Invalid hardware generation");
   81916    }
   81917 }
   81918 
   81919 
   81920 
   81921 /* 3DSTATE_URB_CLEAR::3D Command Sub Opcode */
   81922 
   81923 
   81924 #define GEN10_3DSTATE_URB_CLEAR_3DCommandSubOpcode_bits  8
   81925 #define GEN9_3DSTATE_URB_CLEAR_3DCommandSubOpcode_bits  8
   81926 
   81927 static inline uint32_t ATTRIBUTE_PURE
   81928 _3DSTATE_URB_CLEAR_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   81929 {
   81930    switch (devinfo->gen) {
   81931    case 10: return 8;
   81932    case 9: return 8;
   81933    case 8: return 0;
   81934    case 7:
   81935       if (devinfo->is_haswell) {
   81936          return 0;
   81937       } else {
   81938          return 0;
   81939       }
   81940    case 6: return 0;
   81941    case 5: return 0;
   81942    case 4:
   81943       if (devinfo->is_g4x) {
   81944          return 0;
   81945       } else {
   81946          return 0;
   81947       }
   81948    default:
   81949       unreachable("Invalid hardware generation");
   81950    }
   81951 }
   81952 
   81953 
   81954 
   81955 #define GEN10_3DSTATE_URB_CLEAR_3DCommandSubOpcode_start  16
   81956 #define GEN9_3DSTATE_URB_CLEAR_3DCommandSubOpcode_start  16
   81957 
   81958 static inline uint32_t ATTRIBUTE_PURE
   81959 _3DSTATE_URB_CLEAR_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   81960 {
   81961    switch (devinfo->gen) {
   81962    case 10: return 16;
   81963    case 9: return 16;
   81964    case 8: return 0;
   81965    case 7:
   81966       if (devinfo->is_haswell) {
   81967          return 0;
   81968       } else {
   81969          return 0;
   81970       }
   81971    case 6: return 0;
   81972    case 5: return 0;
   81973    case 4:
   81974       if (devinfo->is_g4x) {
   81975          return 0;
   81976       } else {
   81977          return 0;
   81978       }
   81979    default:
   81980       unreachable("Invalid hardware generation");
   81981    }
   81982 }
   81983 
   81984 
   81985 
   81986 /* 3DSTATE_URB_CLEAR::Command SubType */
   81987 
   81988 
   81989 #define GEN10_3DSTATE_URB_CLEAR_CommandSubType_bits  2
   81990 #define GEN9_3DSTATE_URB_CLEAR_CommandSubType_bits  2
   81991 
   81992 static inline uint32_t ATTRIBUTE_PURE
   81993 _3DSTATE_URB_CLEAR_CommandSubType_bits(const struct gen_device_info *devinfo)
   81994 {
   81995    switch (devinfo->gen) {
   81996    case 10: return 2;
   81997    case 9: return 2;
   81998    case 8: return 0;
   81999    case 7:
   82000       if (devinfo->is_haswell) {
   82001          return 0;
   82002       } else {
   82003          return 0;
   82004       }
   82005    case 6: return 0;
   82006    case 5: return 0;
   82007    case 4:
   82008       if (devinfo->is_g4x) {
   82009          return 0;
   82010       } else {
   82011          return 0;
   82012       }
   82013    default:
   82014       unreachable("Invalid hardware generation");
   82015    }
   82016 }
   82017 
   82018 
   82019 
   82020 #define GEN10_3DSTATE_URB_CLEAR_CommandSubType_start  27
   82021 #define GEN9_3DSTATE_URB_CLEAR_CommandSubType_start  27
   82022 
   82023 static inline uint32_t ATTRIBUTE_PURE
   82024 _3DSTATE_URB_CLEAR_CommandSubType_start(const struct gen_device_info *devinfo)
   82025 {
   82026    switch (devinfo->gen) {
   82027    case 10: return 27;
   82028    case 9: return 27;
   82029    case 8: return 0;
   82030    case 7:
   82031       if (devinfo->is_haswell) {
   82032          return 0;
   82033       } else {
   82034          return 0;
   82035       }
   82036    case 6: return 0;
   82037    case 5: return 0;
   82038    case 4:
   82039       if (devinfo->is_g4x) {
   82040          return 0;
   82041       } else {
   82042          return 0;
   82043       }
   82044    default:
   82045       unreachable("Invalid hardware generation");
   82046    }
   82047 }
   82048 
   82049 
   82050 
   82051 /* 3DSTATE_URB_CLEAR::Command Type */
   82052 
   82053 
   82054 #define GEN10_3DSTATE_URB_CLEAR_CommandType_bits  3
   82055 #define GEN9_3DSTATE_URB_CLEAR_CommandType_bits  3
   82056 
   82057 static inline uint32_t ATTRIBUTE_PURE
   82058 _3DSTATE_URB_CLEAR_CommandType_bits(const struct gen_device_info *devinfo)
   82059 {
   82060    switch (devinfo->gen) {
   82061    case 10: return 3;
   82062    case 9: return 3;
   82063    case 8: return 0;
   82064    case 7:
   82065       if (devinfo->is_haswell) {
   82066          return 0;
   82067       } else {
   82068          return 0;
   82069       }
   82070    case 6: return 0;
   82071    case 5: return 0;
   82072    case 4:
   82073       if (devinfo->is_g4x) {
   82074          return 0;
   82075       } else {
   82076          return 0;
   82077       }
   82078    default:
   82079       unreachable("Invalid hardware generation");
   82080    }
   82081 }
   82082 
   82083 
   82084 
   82085 #define GEN10_3DSTATE_URB_CLEAR_CommandType_start  29
   82086 #define GEN9_3DSTATE_URB_CLEAR_CommandType_start  29
   82087 
   82088 static inline uint32_t ATTRIBUTE_PURE
   82089 _3DSTATE_URB_CLEAR_CommandType_start(const struct gen_device_info *devinfo)
   82090 {
   82091    switch (devinfo->gen) {
   82092    case 10: return 29;
   82093    case 9: return 29;
   82094    case 8: return 0;
   82095    case 7:
   82096       if (devinfo->is_haswell) {
   82097          return 0;
   82098       } else {
   82099          return 0;
   82100       }
   82101    case 6: return 0;
   82102    case 5: return 0;
   82103    case 4:
   82104       if (devinfo->is_g4x) {
   82105          return 0;
   82106       } else {
   82107          return 0;
   82108       }
   82109    default:
   82110       unreachable("Invalid hardware generation");
   82111    }
   82112 }
   82113 
   82114 
   82115 
   82116 /* 3DSTATE_URB_CLEAR::DWord Length */
   82117 
   82118 
   82119 #define GEN10_3DSTATE_URB_CLEAR_DWordLength_bits  8
   82120 #define GEN9_3DSTATE_URB_CLEAR_DWordLength_bits  8
   82121 
   82122 static inline uint32_t ATTRIBUTE_PURE
   82123 _3DSTATE_URB_CLEAR_DWordLength_bits(const struct gen_device_info *devinfo)
   82124 {
   82125    switch (devinfo->gen) {
   82126    case 10: return 8;
   82127    case 9: return 8;
   82128    case 8: return 0;
   82129    case 7:
   82130       if (devinfo->is_haswell) {
   82131          return 0;
   82132       } else {
   82133          return 0;
   82134       }
   82135    case 6: return 0;
   82136    case 5: return 0;
   82137    case 4:
   82138       if (devinfo->is_g4x) {
   82139          return 0;
   82140       } else {
   82141          return 0;
   82142       }
   82143    default:
   82144       unreachable("Invalid hardware generation");
   82145    }
   82146 }
   82147 
   82148 
   82149 
   82150 #define GEN10_3DSTATE_URB_CLEAR_DWordLength_start  0
   82151 #define GEN9_3DSTATE_URB_CLEAR_DWordLength_start  0
   82152 
   82153 static inline uint32_t ATTRIBUTE_PURE
   82154 _3DSTATE_URB_CLEAR_DWordLength_start(const struct gen_device_info *devinfo)
   82155 {
   82156    switch (devinfo->gen) {
   82157    case 10: return 0;
   82158    case 9: return 0;
   82159    case 8: return 0;
   82160    case 7:
   82161       if (devinfo->is_haswell) {
   82162          return 0;
   82163       } else {
   82164          return 0;
   82165       }
   82166    case 6: return 0;
   82167    case 5: return 0;
   82168    case 4:
   82169       if (devinfo->is_g4x) {
   82170          return 0;
   82171       } else {
   82172          return 0;
   82173       }
   82174    default:
   82175       unreachable("Invalid hardware generation");
   82176    }
   82177 }
   82178 
   82179 
   82180 
   82181 /* 3DSTATE_URB_CLEAR::URB Address */
   82182 
   82183 
   82184 #define GEN10_3DSTATE_URB_CLEAR_URBAddress_bits  15
   82185 #define GEN9_3DSTATE_URB_CLEAR_URBAddress_bits  15
   82186 
   82187 static inline uint32_t ATTRIBUTE_PURE
   82188 _3DSTATE_URB_CLEAR_URBAddress_bits(const struct gen_device_info *devinfo)
   82189 {
   82190    switch (devinfo->gen) {
   82191    case 10: return 15;
   82192    case 9: return 15;
   82193    case 8: return 0;
   82194    case 7:
   82195       if (devinfo->is_haswell) {
   82196          return 0;
   82197       } else {
   82198          return 0;
   82199       }
   82200    case 6: return 0;
   82201    case 5: return 0;
   82202    case 4:
   82203       if (devinfo->is_g4x) {
   82204          return 0;
   82205       } else {
   82206          return 0;
   82207       }
   82208    default:
   82209       unreachable("Invalid hardware generation");
   82210    }
   82211 }
   82212 
   82213 
   82214 
   82215 #define GEN10_3DSTATE_URB_CLEAR_URBAddress_start  32
   82216 #define GEN9_3DSTATE_URB_CLEAR_URBAddress_start  32
   82217 
   82218 static inline uint32_t ATTRIBUTE_PURE
   82219 _3DSTATE_URB_CLEAR_URBAddress_start(const struct gen_device_info *devinfo)
   82220 {
   82221    switch (devinfo->gen) {
   82222    case 10: return 32;
   82223    case 9: return 32;
   82224    case 8: return 0;
   82225    case 7:
   82226       if (devinfo->is_haswell) {
   82227          return 0;
   82228       } else {
   82229          return 0;
   82230       }
   82231    case 6: return 0;
   82232    case 5: return 0;
   82233    case 4:
   82234       if (devinfo->is_g4x) {
   82235          return 0;
   82236       } else {
   82237          return 0;
   82238       }
   82239    default:
   82240       unreachable("Invalid hardware generation");
   82241    }
   82242 }
   82243 
   82244 
   82245 
   82246 /* 3DSTATE_URB_CLEAR::URB Clear Length */
   82247 
   82248 
   82249 #define GEN10_3DSTATE_URB_CLEAR_URBClearLength_bits  14
   82250 #define GEN9_3DSTATE_URB_CLEAR_URBClearLength_bits  14
   82251 
   82252 static inline uint32_t ATTRIBUTE_PURE
   82253 _3DSTATE_URB_CLEAR_URBClearLength_bits(const struct gen_device_info *devinfo)
   82254 {
   82255    switch (devinfo->gen) {
   82256    case 10: return 14;
   82257    case 9: return 14;
   82258    case 8: return 0;
   82259    case 7:
   82260       if (devinfo->is_haswell) {
   82261          return 0;
   82262       } else {
   82263          return 0;
   82264       }
   82265    case 6: return 0;
   82266    case 5: return 0;
   82267    case 4:
   82268       if (devinfo->is_g4x) {
   82269          return 0;
   82270       } else {
   82271          return 0;
   82272       }
   82273    default:
   82274       unreachable("Invalid hardware generation");
   82275    }
   82276 }
   82277 
   82278 
   82279 
   82280 #define GEN10_3DSTATE_URB_CLEAR_URBClearLength_start  48
   82281 #define GEN9_3DSTATE_URB_CLEAR_URBClearLength_start  48
   82282 
   82283 static inline uint32_t ATTRIBUTE_PURE
   82284 _3DSTATE_URB_CLEAR_URBClearLength_start(const struct gen_device_info *devinfo)
   82285 {
   82286    switch (devinfo->gen) {
   82287    case 10: return 48;
   82288    case 9: return 48;
   82289    case 8: return 0;
   82290    case 7:
   82291       if (devinfo->is_haswell) {
   82292          return 0;
   82293       } else {
   82294          return 0;
   82295       }
   82296    case 6: return 0;
   82297    case 5: return 0;
   82298    case 4:
   82299       if (devinfo->is_g4x) {
   82300          return 0;
   82301       } else {
   82302          return 0;
   82303       }
   82304    default:
   82305       unreachable("Invalid hardware generation");
   82306    }
   82307 }
   82308 
   82309 
   82310 
   82311 /* 3DSTATE_URB_DS */
   82312 
   82313 
   82314 #define GEN10_3DSTATE_URB_DS_length  2
   82315 #define GEN9_3DSTATE_URB_DS_length  2
   82316 #define GEN8_3DSTATE_URB_DS_length  2
   82317 #define GEN75_3DSTATE_URB_DS_length  2
   82318 #define GEN7_3DSTATE_URB_DS_length  2
   82319 
   82320 static inline uint32_t ATTRIBUTE_PURE
   82321 _3DSTATE_URB_DS_length(const struct gen_device_info *devinfo)
   82322 {
   82323    switch (devinfo->gen) {
   82324    case 10: return 2;
   82325    case 9: return 2;
   82326    case 8: return 2;
   82327    case 7:
   82328       if (devinfo->is_haswell) {
   82329          return 2;
   82330       } else {
   82331          return 2;
   82332       }
   82333    case 6: return 0;
   82334    case 5: return 0;
   82335    case 4:
   82336       if (devinfo->is_g4x) {
   82337          return 0;
   82338       } else {
   82339          return 0;
   82340       }
   82341    default:
   82342       unreachable("Invalid hardware generation");
   82343    }
   82344 }
   82345 
   82346 
   82347 
   82348 /* 3DSTATE_URB_DS::3D Command Opcode */
   82349 
   82350 
   82351 #define GEN10_3DSTATE_URB_DS_3DCommandOpcode_bits  3
   82352 #define GEN9_3DSTATE_URB_DS_3DCommandOpcode_bits  3
   82353 #define GEN8_3DSTATE_URB_DS_3DCommandOpcode_bits  3
   82354 #define GEN75_3DSTATE_URB_DS_3DCommandOpcode_bits  3
   82355 #define GEN7_3DSTATE_URB_DS_3DCommandOpcode_bits  3
   82356 
   82357 static inline uint32_t ATTRIBUTE_PURE
   82358 _3DSTATE_URB_DS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   82359 {
   82360    switch (devinfo->gen) {
   82361    case 10: return 3;
   82362    case 9: return 3;
   82363    case 8: return 3;
   82364    case 7:
   82365       if (devinfo->is_haswell) {
   82366          return 3;
   82367       } else {
   82368          return 3;
   82369       }
   82370    case 6: return 0;
   82371    case 5: return 0;
   82372    case 4:
   82373       if (devinfo->is_g4x) {
   82374          return 0;
   82375       } else {
   82376          return 0;
   82377       }
   82378    default:
   82379       unreachable("Invalid hardware generation");
   82380    }
   82381 }
   82382 
   82383 
   82384 
   82385 #define GEN10_3DSTATE_URB_DS_3DCommandOpcode_start  24
   82386 #define GEN9_3DSTATE_URB_DS_3DCommandOpcode_start  24
   82387 #define GEN8_3DSTATE_URB_DS_3DCommandOpcode_start  24
   82388 #define GEN75_3DSTATE_URB_DS_3DCommandOpcode_start  24
   82389 #define GEN7_3DSTATE_URB_DS_3DCommandOpcode_start  24
   82390 
   82391 static inline uint32_t ATTRIBUTE_PURE
   82392 _3DSTATE_URB_DS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   82393 {
   82394    switch (devinfo->gen) {
   82395    case 10: return 24;
   82396    case 9: return 24;
   82397    case 8: return 24;
   82398    case 7:
   82399       if (devinfo->is_haswell) {
   82400          return 24;
   82401       } else {
   82402          return 24;
   82403       }
   82404    case 6: return 0;
   82405    case 5: return 0;
   82406    case 4:
   82407       if (devinfo->is_g4x) {
   82408          return 0;
   82409       } else {
   82410          return 0;
   82411       }
   82412    default:
   82413       unreachable("Invalid hardware generation");
   82414    }
   82415 }
   82416 
   82417 
   82418 
   82419 /* 3DSTATE_URB_DS::3D Command Sub Opcode */
   82420 
   82421 
   82422 #define GEN10_3DSTATE_URB_DS_3DCommandSubOpcode_bits  8
   82423 #define GEN9_3DSTATE_URB_DS_3DCommandSubOpcode_bits  8
   82424 #define GEN8_3DSTATE_URB_DS_3DCommandSubOpcode_bits  8
   82425 #define GEN75_3DSTATE_URB_DS_3DCommandSubOpcode_bits  8
   82426 #define GEN7_3DSTATE_URB_DS_3DCommandSubOpcode_bits  8
   82427 
   82428 static inline uint32_t ATTRIBUTE_PURE
   82429 _3DSTATE_URB_DS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   82430 {
   82431    switch (devinfo->gen) {
   82432    case 10: return 8;
   82433    case 9: return 8;
   82434    case 8: return 8;
   82435    case 7:
   82436       if (devinfo->is_haswell) {
   82437          return 8;
   82438       } else {
   82439          return 8;
   82440       }
   82441    case 6: return 0;
   82442    case 5: return 0;
   82443    case 4:
   82444       if (devinfo->is_g4x) {
   82445          return 0;
   82446       } else {
   82447          return 0;
   82448       }
   82449    default:
   82450       unreachable("Invalid hardware generation");
   82451    }
   82452 }
   82453 
   82454 
   82455 
   82456 #define GEN10_3DSTATE_URB_DS_3DCommandSubOpcode_start  16
   82457 #define GEN9_3DSTATE_URB_DS_3DCommandSubOpcode_start  16
   82458 #define GEN8_3DSTATE_URB_DS_3DCommandSubOpcode_start  16
   82459 #define GEN75_3DSTATE_URB_DS_3DCommandSubOpcode_start  16
   82460 #define GEN7_3DSTATE_URB_DS_3DCommandSubOpcode_start  16
   82461 
   82462 static inline uint32_t ATTRIBUTE_PURE
   82463 _3DSTATE_URB_DS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   82464 {
   82465    switch (devinfo->gen) {
   82466    case 10: return 16;
   82467    case 9: return 16;
   82468    case 8: return 16;
   82469    case 7:
   82470       if (devinfo->is_haswell) {
   82471          return 16;
   82472       } else {
   82473          return 16;
   82474       }
   82475    case 6: return 0;
   82476    case 5: return 0;
   82477    case 4:
   82478       if (devinfo->is_g4x) {
   82479          return 0;
   82480       } else {
   82481          return 0;
   82482       }
   82483    default:
   82484       unreachable("Invalid hardware generation");
   82485    }
   82486 }
   82487 
   82488 
   82489 
   82490 /* 3DSTATE_URB_DS::Command SubType */
   82491 
   82492 
   82493 #define GEN10_3DSTATE_URB_DS_CommandSubType_bits  2
   82494 #define GEN9_3DSTATE_URB_DS_CommandSubType_bits  2
   82495 #define GEN8_3DSTATE_URB_DS_CommandSubType_bits  2
   82496 #define GEN75_3DSTATE_URB_DS_CommandSubType_bits  2
   82497 #define GEN7_3DSTATE_URB_DS_CommandSubType_bits  2
   82498 
   82499 static inline uint32_t ATTRIBUTE_PURE
   82500 _3DSTATE_URB_DS_CommandSubType_bits(const struct gen_device_info *devinfo)
   82501 {
   82502    switch (devinfo->gen) {
   82503    case 10: return 2;
   82504    case 9: return 2;
   82505    case 8: return 2;
   82506    case 7:
   82507       if (devinfo->is_haswell) {
   82508          return 2;
   82509       } else {
   82510          return 2;
   82511       }
   82512    case 6: return 0;
   82513    case 5: return 0;
   82514    case 4:
   82515       if (devinfo->is_g4x) {
   82516          return 0;
   82517       } else {
   82518          return 0;
   82519       }
   82520    default:
   82521       unreachable("Invalid hardware generation");
   82522    }
   82523 }
   82524 
   82525 
   82526 
   82527 #define GEN10_3DSTATE_URB_DS_CommandSubType_start  27
   82528 #define GEN9_3DSTATE_URB_DS_CommandSubType_start  27
   82529 #define GEN8_3DSTATE_URB_DS_CommandSubType_start  27
   82530 #define GEN75_3DSTATE_URB_DS_CommandSubType_start  27
   82531 #define GEN7_3DSTATE_URB_DS_CommandSubType_start  27
   82532 
   82533 static inline uint32_t ATTRIBUTE_PURE
   82534 _3DSTATE_URB_DS_CommandSubType_start(const struct gen_device_info *devinfo)
   82535 {
   82536    switch (devinfo->gen) {
   82537    case 10: return 27;
   82538    case 9: return 27;
   82539    case 8: return 27;
   82540    case 7:
   82541       if (devinfo->is_haswell) {
   82542          return 27;
   82543       } else {
   82544          return 27;
   82545       }
   82546    case 6: return 0;
   82547    case 5: return 0;
   82548    case 4:
   82549       if (devinfo->is_g4x) {
   82550          return 0;
   82551       } else {
   82552          return 0;
   82553       }
   82554    default:
   82555       unreachable("Invalid hardware generation");
   82556    }
   82557 }
   82558 
   82559 
   82560 
   82561 /* 3DSTATE_URB_DS::Command Type */
   82562 
   82563 
   82564 #define GEN10_3DSTATE_URB_DS_CommandType_bits  3
   82565 #define GEN9_3DSTATE_URB_DS_CommandType_bits  3
   82566 #define GEN8_3DSTATE_URB_DS_CommandType_bits  3
   82567 #define GEN75_3DSTATE_URB_DS_CommandType_bits  3
   82568 #define GEN7_3DSTATE_URB_DS_CommandType_bits  3
   82569 
   82570 static inline uint32_t ATTRIBUTE_PURE
   82571 _3DSTATE_URB_DS_CommandType_bits(const struct gen_device_info *devinfo)
   82572 {
   82573    switch (devinfo->gen) {
   82574    case 10: return 3;
   82575    case 9: return 3;
   82576    case 8: return 3;
   82577    case 7:
   82578       if (devinfo->is_haswell) {
   82579          return 3;
   82580       } else {
   82581          return 3;
   82582       }
   82583    case 6: return 0;
   82584    case 5: return 0;
   82585    case 4:
   82586       if (devinfo->is_g4x) {
   82587          return 0;
   82588       } else {
   82589          return 0;
   82590       }
   82591    default:
   82592       unreachable("Invalid hardware generation");
   82593    }
   82594 }
   82595 
   82596 
   82597 
   82598 #define GEN10_3DSTATE_URB_DS_CommandType_start  29
   82599 #define GEN9_3DSTATE_URB_DS_CommandType_start  29
   82600 #define GEN8_3DSTATE_URB_DS_CommandType_start  29
   82601 #define GEN75_3DSTATE_URB_DS_CommandType_start  29
   82602 #define GEN7_3DSTATE_URB_DS_CommandType_start  29
   82603 
   82604 static inline uint32_t ATTRIBUTE_PURE
   82605 _3DSTATE_URB_DS_CommandType_start(const struct gen_device_info *devinfo)
   82606 {
   82607    switch (devinfo->gen) {
   82608    case 10: return 29;
   82609    case 9: return 29;
   82610    case 8: return 29;
   82611    case 7:
   82612       if (devinfo->is_haswell) {
   82613          return 29;
   82614       } else {
   82615          return 29;
   82616       }
   82617    case 6: return 0;
   82618    case 5: return 0;
   82619    case 4:
   82620       if (devinfo->is_g4x) {
   82621          return 0;
   82622       } else {
   82623          return 0;
   82624       }
   82625    default:
   82626       unreachable("Invalid hardware generation");
   82627    }
   82628 }
   82629 
   82630 
   82631 
   82632 /* 3DSTATE_URB_DS::DS Number of URB Entries */
   82633 
   82634 
   82635 #define GEN10_3DSTATE_URB_DS_DSNumberofURBEntries_bits  16
   82636 #define GEN9_3DSTATE_URB_DS_DSNumberofURBEntries_bits  16
   82637 #define GEN8_3DSTATE_URB_DS_DSNumberofURBEntries_bits  16
   82638 #define GEN75_3DSTATE_URB_DS_DSNumberofURBEntries_bits  16
   82639 #define GEN7_3DSTATE_URB_DS_DSNumberofURBEntries_bits  16
   82640 
   82641 static inline uint32_t ATTRIBUTE_PURE
   82642 _3DSTATE_URB_DS_DSNumberofURBEntries_bits(const struct gen_device_info *devinfo)
   82643 {
   82644    switch (devinfo->gen) {
   82645    case 10: return 16;
   82646    case 9: return 16;
   82647    case 8: return 16;
   82648    case 7:
   82649       if (devinfo->is_haswell) {
   82650          return 16;
   82651       } else {
   82652          return 16;
   82653       }
   82654    case 6: return 0;
   82655    case 5: return 0;
   82656    case 4:
   82657       if (devinfo->is_g4x) {
   82658          return 0;
   82659       } else {
   82660          return 0;
   82661       }
   82662    default:
   82663       unreachable("Invalid hardware generation");
   82664    }
   82665 }
   82666 
   82667 
   82668 
   82669 #define GEN10_3DSTATE_URB_DS_DSNumberofURBEntries_start  32
   82670 #define GEN9_3DSTATE_URB_DS_DSNumberofURBEntries_start  32
   82671 #define GEN8_3DSTATE_URB_DS_DSNumberofURBEntries_start  32
   82672 #define GEN75_3DSTATE_URB_DS_DSNumberofURBEntries_start  32
   82673 #define GEN7_3DSTATE_URB_DS_DSNumberofURBEntries_start  32
   82674 
   82675 static inline uint32_t ATTRIBUTE_PURE
   82676 _3DSTATE_URB_DS_DSNumberofURBEntries_start(const struct gen_device_info *devinfo)
   82677 {
   82678    switch (devinfo->gen) {
   82679    case 10: return 32;
   82680    case 9: return 32;
   82681    case 8: return 32;
   82682    case 7:
   82683       if (devinfo->is_haswell) {
   82684          return 32;
   82685       } else {
   82686          return 32;
   82687       }
   82688    case 6: return 0;
   82689    case 5: return 0;
   82690    case 4:
   82691       if (devinfo->is_g4x) {
   82692          return 0;
   82693       } else {
   82694          return 0;
   82695       }
   82696    default:
   82697       unreachable("Invalid hardware generation");
   82698    }
   82699 }
   82700 
   82701 
   82702 
   82703 /* 3DSTATE_URB_DS::DS URB Entry Allocation Size */
   82704 
   82705 
   82706 #define GEN10_3DSTATE_URB_DS_DSURBEntryAllocationSize_bits  9
   82707 #define GEN9_3DSTATE_URB_DS_DSURBEntryAllocationSize_bits  9
   82708 #define GEN8_3DSTATE_URB_DS_DSURBEntryAllocationSize_bits  9
   82709 #define GEN75_3DSTATE_URB_DS_DSURBEntryAllocationSize_bits  9
   82710 #define GEN7_3DSTATE_URB_DS_DSURBEntryAllocationSize_bits  9
   82711 
   82712 static inline uint32_t ATTRIBUTE_PURE
   82713 _3DSTATE_URB_DS_DSURBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   82714 {
   82715    switch (devinfo->gen) {
   82716    case 10: return 9;
   82717    case 9: return 9;
   82718    case 8: return 9;
   82719    case 7:
   82720       if (devinfo->is_haswell) {
   82721          return 9;
   82722       } else {
   82723          return 9;
   82724       }
   82725    case 6: return 0;
   82726    case 5: return 0;
   82727    case 4:
   82728       if (devinfo->is_g4x) {
   82729          return 0;
   82730       } else {
   82731          return 0;
   82732       }
   82733    default:
   82734       unreachable("Invalid hardware generation");
   82735    }
   82736 }
   82737 
   82738 
   82739 
   82740 #define GEN10_3DSTATE_URB_DS_DSURBEntryAllocationSize_start  48
   82741 #define GEN9_3DSTATE_URB_DS_DSURBEntryAllocationSize_start  48
   82742 #define GEN8_3DSTATE_URB_DS_DSURBEntryAllocationSize_start  48
   82743 #define GEN75_3DSTATE_URB_DS_DSURBEntryAllocationSize_start  48
   82744 #define GEN7_3DSTATE_URB_DS_DSURBEntryAllocationSize_start  48
   82745 
   82746 static inline uint32_t ATTRIBUTE_PURE
   82747 _3DSTATE_URB_DS_DSURBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   82748 {
   82749    switch (devinfo->gen) {
   82750    case 10: return 48;
   82751    case 9: return 48;
   82752    case 8: return 48;
   82753    case 7:
   82754       if (devinfo->is_haswell) {
   82755          return 48;
   82756       } else {
   82757          return 48;
   82758       }
   82759    case 6: return 0;
   82760    case 5: return 0;
   82761    case 4:
   82762       if (devinfo->is_g4x) {
   82763          return 0;
   82764       } else {
   82765          return 0;
   82766       }
   82767    default:
   82768       unreachable("Invalid hardware generation");
   82769    }
   82770 }
   82771 
   82772 
   82773 
   82774 /* 3DSTATE_URB_DS::DS URB Starting Address */
   82775 
   82776 
   82777 #define GEN10_3DSTATE_URB_DS_DSURBStartingAddress_bits  7
   82778 #define GEN9_3DSTATE_URB_DS_DSURBStartingAddress_bits  7
   82779 #define GEN8_3DSTATE_URB_DS_DSURBStartingAddress_bits  7
   82780 #define GEN75_3DSTATE_URB_DS_DSURBStartingAddress_bits  6
   82781 #define GEN7_3DSTATE_URB_DS_DSURBStartingAddress_bits  5
   82782 
   82783 static inline uint32_t ATTRIBUTE_PURE
   82784 _3DSTATE_URB_DS_DSURBStartingAddress_bits(const struct gen_device_info *devinfo)
   82785 {
   82786    switch (devinfo->gen) {
   82787    case 10: return 7;
   82788    case 9: return 7;
   82789    case 8: return 7;
   82790    case 7:
   82791       if (devinfo->is_haswell) {
   82792          return 6;
   82793       } else {
   82794          return 5;
   82795       }
   82796    case 6: return 0;
   82797    case 5: return 0;
   82798    case 4:
   82799       if (devinfo->is_g4x) {
   82800          return 0;
   82801       } else {
   82802          return 0;
   82803       }
   82804    default:
   82805       unreachable("Invalid hardware generation");
   82806    }
   82807 }
   82808 
   82809 
   82810 
   82811 #define GEN10_3DSTATE_URB_DS_DSURBStartingAddress_start  57
   82812 #define GEN9_3DSTATE_URB_DS_DSURBStartingAddress_start  57
   82813 #define GEN8_3DSTATE_URB_DS_DSURBStartingAddress_start  57
   82814 #define GEN75_3DSTATE_URB_DS_DSURBStartingAddress_start  57
   82815 #define GEN7_3DSTATE_URB_DS_DSURBStartingAddress_start  57
   82816 
   82817 static inline uint32_t ATTRIBUTE_PURE
   82818 _3DSTATE_URB_DS_DSURBStartingAddress_start(const struct gen_device_info *devinfo)
   82819 {
   82820    switch (devinfo->gen) {
   82821    case 10: return 57;
   82822    case 9: return 57;
   82823    case 8: return 57;
   82824    case 7:
   82825       if (devinfo->is_haswell) {
   82826          return 57;
   82827       } else {
   82828          return 57;
   82829       }
   82830    case 6: return 0;
   82831    case 5: return 0;
   82832    case 4:
   82833       if (devinfo->is_g4x) {
   82834          return 0;
   82835       } else {
   82836          return 0;
   82837       }
   82838    default:
   82839       unreachable("Invalid hardware generation");
   82840    }
   82841 }
   82842 
   82843 
   82844 
   82845 /* 3DSTATE_URB_DS::DWord Length */
   82846 
   82847 
   82848 #define GEN10_3DSTATE_URB_DS_DWordLength_bits  8
   82849 #define GEN9_3DSTATE_URB_DS_DWordLength_bits  8
   82850 #define GEN8_3DSTATE_URB_DS_DWordLength_bits  8
   82851 #define GEN75_3DSTATE_URB_DS_DWordLength_bits  8
   82852 #define GEN7_3DSTATE_URB_DS_DWordLength_bits  8
   82853 
   82854 static inline uint32_t ATTRIBUTE_PURE
   82855 _3DSTATE_URB_DS_DWordLength_bits(const struct gen_device_info *devinfo)
   82856 {
   82857    switch (devinfo->gen) {
   82858    case 10: return 8;
   82859    case 9: return 8;
   82860    case 8: return 8;
   82861    case 7:
   82862       if (devinfo->is_haswell) {
   82863          return 8;
   82864       } else {
   82865          return 8;
   82866       }
   82867    case 6: return 0;
   82868    case 5: return 0;
   82869    case 4:
   82870       if (devinfo->is_g4x) {
   82871          return 0;
   82872       } else {
   82873          return 0;
   82874       }
   82875    default:
   82876       unreachable("Invalid hardware generation");
   82877    }
   82878 }
   82879 
   82880 
   82881 
   82882 #define GEN10_3DSTATE_URB_DS_DWordLength_start  0
   82883 #define GEN9_3DSTATE_URB_DS_DWordLength_start  0
   82884 #define GEN8_3DSTATE_URB_DS_DWordLength_start  0
   82885 #define GEN75_3DSTATE_URB_DS_DWordLength_start  0
   82886 #define GEN7_3DSTATE_URB_DS_DWordLength_start  0
   82887 
   82888 static inline uint32_t ATTRIBUTE_PURE
   82889 _3DSTATE_URB_DS_DWordLength_start(const struct gen_device_info *devinfo)
   82890 {
   82891    switch (devinfo->gen) {
   82892    case 10: return 0;
   82893    case 9: return 0;
   82894    case 8: return 0;
   82895    case 7:
   82896       if (devinfo->is_haswell) {
   82897          return 0;
   82898       } else {
   82899          return 0;
   82900       }
   82901    case 6: return 0;
   82902    case 5: return 0;
   82903    case 4:
   82904       if (devinfo->is_g4x) {
   82905          return 0;
   82906       } else {
   82907          return 0;
   82908       }
   82909    default:
   82910       unreachable("Invalid hardware generation");
   82911    }
   82912 }
   82913 
   82914 
   82915 
   82916 /* 3DSTATE_URB_GS */
   82917 
   82918 
   82919 #define GEN10_3DSTATE_URB_GS_length  2
   82920 #define GEN9_3DSTATE_URB_GS_length  2
   82921 #define GEN8_3DSTATE_URB_GS_length  2
   82922 #define GEN75_3DSTATE_URB_GS_length  2
   82923 #define GEN7_3DSTATE_URB_GS_length  2
   82924 
   82925 static inline uint32_t ATTRIBUTE_PURE
   82926 _3DSTATE_URB_GS_length(const struct gen_device_info *devinfo)
   82927 {
   82928    switch (devinfo->gen) {
   82929    case 10: return 2;
   82930    case 9: return 2;
   82931    case 8: return 2;
   82932    case 7:
   82933       if (devinfo->is_haswell) {
   82934          return 2;
   82935       } else {
   82936          return 2;
   82937       }
   82938    case 6: return 0;
   82939    case 5: return 0;
   82940    case 4:
   82941       if (devinfo->is_g4x) {
   82942          return 0;
   82943       } else {
   82944          return 0;
   82945       }
   82946    default:
   82947       unreachable("Invalid hardware generation");
   82948    }
   82949 }
   82950 
   82951 
   82952 
   82953 /* 3DSTATE_URB_GS::3D Command Opcode */
   82954 
   82955 
   82956 #define GEN10_3DSTATE_URB_GS_3DCommandOpcode_bits  3
   82957 #define GEN9_3DSTATE_URB_GS_3DCommandOpcode_bits  3
   82958 #define GEN8_3DSTATE_URB_GS_3DCommandOpcode_bits  3
   82959 #define GEN75_3DSTATE_URB_GS_3DCommandOpcode_bits  3
   82960 #define GEN7_3DSTATE_URB_GS_3DCommandOpcode_bits  3
   82961 
   82962 static inline uint32_t ATTRIBUTE_PURE
   82963 _3DSTATE_URB_GS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   82964 {
   82965    switch (devinfo->gen) {
   82966    case 10: return 3;
   82967    case 9: return 3;
   82968    case 8: return 3;
   82969    case 7:
   82970       if (devinfo->is_haswell) {
   82971          return 3;
   82972       } else {
   82973          return 3;
   82974       }
   82975    case 6: return 0;
   82976    case 5: return 0;
   82977    case 4:
   82978       if (devinfo->is_g4x) {
   82979          return 0;
   82980       } else {
   82981          return 0;
   82982       }
   82983    default:
   82984       unreachable("Invalid hardware generation");
   82985    }
   82986 }
   82987 
   82988 
   82989 
   82990 #define GEN10_3DSTATE_URB_GS_3DCommandOpcode_start  24
   82991 #define GEN9_3DSTATE_URB_GS_3DCommandOpcode_start  24
   82992 #define GEN8_3DSTATE_URB_GS_3DCommandOpcode_start  24
   82993 #define GEN75_3DSTATE_URB_GS_3DCommandOpcode_start  24
   82994 #define GEN7_3DSTATE_URB_GS_3DCommandOpcode_start  24
   82995 
   82996 static inline uint32_t ATTRIBUTE_PURE
   82997 _3DSTATE_URB_GS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   82998 {
   82999    switch (devinfo->gen) {
   83000    case 10: return 24;
   83001    case 9: return 24;
   83002    case 8: return 24;
   83003    case 7:
   83004       if (devinfo->is_haswell) {
   83005          return 24;
   83006       } else {
   83007          return 24;
   83008       }
   83009    case 6: return 0;
   83010    case 5: return 0;
   83011    case 4:
   83012       if (devinfo->is_g4x) {
   83013          return 0;
   83014       } else {
   83015          return 0;
   83016       }
   83017    default:
   83018       unreachable("Invalid hardware generation");
   83019    }
   83020 }
   83021 
   83022 
   83023 
   83024 /* 3DSTATE_URB_GS::3D Command Sub Opcode */
   83025 
   83026 
   83027 #define GEN10_3DSTATE_URB_GS_3DCommandSubOpcode_bits  8
   83028 #define GEN9_3DSTATE_URB_GS_3DCommandSubOpcode_bits  8
   83029 #define GEN8_3DSTATE_URB_GS_3DCommandSubOpcode_bits  8
   83030 #define GEN75_3DSTATE_URB_GS_3DCommandSubOpcode_bits  8
   83031 #define GEN7_3DSTATE_URB_GS_3DCommandSubOpcode_bits  8
   83032 
   83033 static inline uint32_t ATTRIBUTE_PURE
   83034 _3DSTATE_URB_GS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   83035 {
   83036    switch (devinfo->gen) {
   83037    case 10: return 8;
   83038    case 9: return 8;
   83039    case 8: return 8;
   83040    case 7:
   83041       if (devinfo->is_haswell) {
   83042          return 8;
   83043       } else {
   83044          return 8;
   83045       }
   83046    case 6: return 0;
   83047    case 5: return 0;
   83048    case 4:
   83049       if (devinfo->is_g4x) {
   83050          return 0;
   83051       } else {
   83052          return 0;
   83053       }
   83054    default:
   83055       unreachable("Invalid hardware generation");
   83056    }
   83057 }
   83058 
   83059 
   83060 
   83061 #define GEN10_3DSTATE_URB_GS_3DCommandSubOpcode_start  16
   83062 #define GEN9_3DSTATE_URB_GS_3DCommandSubOpcode_start  16
   83063 #define GEN8_3DSTATE_URB_GS_3DCommandSubOpcode_start  16
   83064 #define GEN75_3DSTATE_URB_GS_3DCommandSubOpcode_start  16
   83065 #define GEN7_3DSTATE_URB_GS_3DCommandSubOpcode_start  16
   83066 
   83067 static inline uint32_t ATTRIBUTE_PURE
   83068 _3DSTATE_URB_GS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   83069 {
   83070    switch (devinfo->gen) {
   83071    case 10: return 16;
   83072    case 9: return 16;
   83073    case 8: return 16;
   83074    case 7:
   83075       if (devinfo->is_haswell) {
   83076          return 16;
   83077       } else {
   83078          return 16;
   83079       }
   83080    case 6: return 0;
   83081    case 5: return 0;
   83082    case 4:
   83083       if (devinfo->is_g4x) {
   83084          return 0;
   83085       } else {
   83086          return 0;
   83087       }
   83088    default:
   83089       unreachable("Invalid hardware generation");
   83090    }
   83091 }
   83092 
   83093 
   83094 
   83095 /* 3DSTATE_URB_GS::Command SubType */
   83096 
   83097 
   83098 #define GEN10_3DSTATE_URB_GS_CommandSubType_bits  2
   83099 #define GEN9_3DSTATE_URB_GS_CommandSubType_bits  2
   83100 #define GEN8_3DSTATE_URB_GS_CommandSubType_bits  2
   83101 #define GEN75_3DSTATE_URB_GS_CommandSubType_bits  2
   83102 #define GEN7_3DSTATE_URB_GS_CommandSubType_bits  2
   83103 
   83104 static inline uint32_t ATTRIBUTE_PURE
   83105 _3DSTATE_URB_GS_CommandSubType_bits(const struct gen_device_info *devinfo)
   83106 {
   83107    switch (devinfo->gen) {
   83108    case 10: return 2;
   83109    case 9: return 2;
   83110    case 8: return 2;
   83111    case 7:
   83112       if (devinfo->is_haswell) {
   83113          return 2;
   83114       } else {
   83115          return 2;
   83116       }
   83117    case 6: return 0;
   83118    case 5: return 0;
   83119    case 4:
   83120       if (devinfo->is_g4x) {
   83121          return 0;
   83122       } else {
   83123          return 0;
   83124       }
   83125    default:
   83126       unreachable("Invalid hardware generation");
   83127    }
   83128 }
   83129 
   83130 
   83131 
   83132 #define GEN10_3DSTATE_URB_GS_CommandSubType_start  27
   83133 #define GEN9_3DSTATE_URB_GS_CommandSubType_start  27
   83134 #define GEN8_3DSTATE_URB_GS_CommandSubType_start  27
   83135 #define GEN75_3DSTATE_URB_GS_CommandSubType_start  27
   83136 #define GEN7_3DSTATE_URB_GS_CommandSubType_start  27
   83137 
   83138 static inline uint32_t ATTRIBUTE_PURE
   83139 _3DSTATE_URB_GS_CommandSubType_start(const struct gen_device_info *devinfo)
   83140 {
   83141    switch (devinfo->gen) {
   83142    case 10: return 27;
   83143    case 9: return 27;
   83144    case 8: return 27;
   83145    case 7:
   83146       if (devinfo->is_haswell) {
   83147          return 27;
   83148       } else {
   83149          return 27;
   83150       }
   83151    case 6: return 0;
   83152    case 5: return 0;
   83153    case 4:
   83154       if (devinfo->is_g4x) {
   83155          return 0;
   83156       } else {
   83157          return 0;
   83158       }
   83159    default:
   83160       unreachable("Invalid hardware generation");
   83161    }
   83162 }
   83163 
   83164 
   83165 
   83166 /* 3DSTATE_URB_GS::Command Type */
   83167 
   83168 
   83169 #define GEN10_3DSTATE_URB_GS_CommandType_bits  3
   83170 #define GEN9_3DSTATE_URB_GS_CommandType_bits  3
   83171 #define GEN8_3DSTATE_URB_GS_CommandType_bits  3
   83172 #define GEN75_3DSTATE_URB_GS_CommandType_bits  3
   83173 #define GEN7_3DSTATE_URB_GS_CommandType_bits  3
   83174 
   83175 static inline uint32_t ATTRIBUTE_PURE
   83176 _3DSTATE_URB_GS_CommandType_bits(const struct gen_device_info *devinfo)
   83177 {
   83178    switch (devinfo->gen) {
   83179    case 10: return 3;
   83180    case 9: return 3;
   83181    case 8: return 3;
   83182    case 7:
   83183       if (devinfo->is_haswell) {
   83184          return 3;
   83185       } else {
   83186          return 3;
   83187       }
   83188    case 6: return 0;
   83189    case 5: return 0;
   83190    case 4:
   83191       if (devinfo->is_g4x) {
   83192          return 0;
   83193       } else {
   83194          return 0;
   83195       }
   83196    default:
   83197       unreachable("Invalid hardware generation");
   83198    }
   83199 }
   83200 
   83201 
   83202 
   83203 #define GEN10_3DSTATE_URB_GS_CommandType_start  29
   83204 #define GEN9_3DSTATE_URB_GS_CommandType_start  29
   83205 #define GEN8_3DSTATE_URB_GS_CommandType_start  29
   83206 #define GEN75_3DSTATE_URB_GS_CommandType_start  29
   83207 #define GEN7_3DSTATE_URB_GS_CommandType_start  29
   83208 
   83209 static inline uint32_t ATTRIBUTE_PURE
   83210 _3DSTATE_URB_GS_CommandType_start(const struct gen_device_info *devinfo)
   83211 {
   83212    switch (devinfo->gen) {
   83213    case 10: return 29;
   83214    case 9: return 29;
   83215    case 8: return 29;
   83216    case 7:
   83217       if (devinfo->is_haswell) {
   83218          return 29;
   83219       } else {
   83220          return 29;
   83221       }
   83222    case 6: return 0;
   83223    case 5: return 0;
   83224    case 4:
   83225       if (devinfo->is_g4x) {
   83226          return 0;
   83227       } else {
   83228          return 0;
   83229       }
   83230    default:
   83231       unreachable("Invalid hardware generation");
   83232    }
   83233 }
   83234 
   83235 
   83236 
   83237 /* 3DSTATE_URB_GS::DWord Length */
   83238 
   83239 
   83240 #define GEN10_3DSTATE_URB_GS_DWordLength_bits  8
   83241 #define GEN9_3DSTATE_URB_GS_DWordLength_bits  8
   83242 #define GEN8_3DSTATE_URB_GS_DWordLength_bits  8
   83243 #define GEN75_3DSTATE_URB_GS_DWordLength_bits  8
   83244 #define GEN7_3DSTATE_URB_GS_DWordLength_bits  8
   83245 
   83246 static inline uint32_t ATTRIBUTE_PURE
   83247 _3DSTATE_URB_GS_DWordLength_bits(const struct gen_device_info *devinfo)
   83248 {
   83249    switch (devinfo->gen) {
   83250    case 10: return 8;
   83251    case 9: return 8;
   83252    case 8: return 8;
   83253    case 7:
   83254       if (devinfo->is_haswell) {
   83255          return 8;
   83256       } else {
   83257          return 8;
   83258       }
   83259    case 6: return 0;
   83260    case 5: return 0;
   83261    case 4:
   83262       if (devinfo->is_g4x) {
   83263          return 0;
   83264       } else {
   83265          return 0;
   83266       }
   83267    default:
   83268       unreachable("Invalid hardware generation");
   83269    }
   83270 }
   83271 
   83272 
   83273 
   83274 #define GEN10_3DSTATE_URB_GS_DWordLength_start  0
   83275 #define GEN9_3DSTATE_URB_GS_DWordLength_start  0
   83276 #define GEN8_3DSTATE_URB_GS_DWordLength_start  0
   83277 #define GEN75_3DSTATE_URB_GS_DWordLength_start  0
   83278 #define GEN7_3DSTATE_URB_GS_DWordLength_start  0
   83279 
   83280 static inline uint32_t ATTRIBUTE_PURE
   83281 _3DSTATE_URB_GS_DWordLength_start(const struct gen_device_info *devinfo)
   83282 {
   83283    switch (devinfo->gen) {
   83284    case 10: return 0;
   83285    case 9: return 0;
   83286    case 8: return 0;
   83287    case 7:
   83288       if (devinfo->is_haswell) {
   83289          return 0;
   83290       } else {
   83291          return 0;
   83292       }
   83293    case 6: return 0;
   83294    case 5: return 0;
   83295    case 4:
   83296       if (devinfo->is_g4x) {
   83297          return 0;
   83298       } else {
   83299          return 0;
   83300       }
   83301    default:
   83302       unreachable("Invalid hardware generation");
   83303    }
   83304 }
   83305 
   83306 
   83307 
   83308 /* 3DSTATE_URB_GS::GS Number of URB Entries */
   83309 
   83310 
   83311 #define GEN10_3DSTATE_URB_GS_GSNumberofURBEntries_bits  16
   83312 #define GEN9_3DSTATE_URB_GS_GSNumberofURBEntries_bits  16
   83313 #define GEN8_3DSTATE_URB_GS_GSNumberofURBEntries_bits  16
   83314 #define GEN75_3DSTATE_URB_GS_GSNumberofURBEntries_bits  16
   83315 #define GEN7_3DSTATE_URB_GS_GSNumberofURBEntries_bits  16
   83316 
   83317 static inline uint32_t ATTRIBUTE_PURE
   83318 _3DSTATE_URB_GS_GSNumberofURBEntries_bits(const struct gen_device_info *devinfo)
   83319 {
   83320    switch (devinfo->gen) {
   83321    case 10: return 16;
   83322    case 9: return 16;
   83323    case 8: return 16;
   83324    case 7:
   83325       if (devinfo->is_haswell) {
   83326          return 16;
   83327       } else {
   83328          return 16;
   83329       }
   83330    case 6: return 0;
   83331    case 5: return 0;
   83332    case 4:
   83333       if (devinfo->is_g4x) {
   83334          return 0;
   83335       } else {
   83336          return 0;
   83337       }
   83338    default:
   83339       unreachable("Invalid hardware generation");
   83340    }
   83341 }
   83342 
   83343 
   83344 
   83345 #define GEN10_3DSTATE_URB_GS_GSNumberofURBEntries_start  32
   83346 #define GEN9_3DSTATE_URB_GS_GSNumberofURBEntries_start  32
   83347 #define GEN8_3DSTATE_URB_GS_GSNumberofURBEntries_start  32
   83348 #define GEN75_3DSTATE_URB_GS_GSNumberofURBEntries_start  32
   83349 #define GEN7_3DSTATE_URB_GS_GSNumberofURBEntries_start  32
   83350 
   83351 static inline uint32_t ATTRIBUTE_PURE
   83352 _3DSTATE_URB_GS_GSNumberofURBEntries_start(const struct gen_device_info *devinfo)
   83353 {
   83354    switch (devinfo->gen) {
   83355    case 10: return 32;
   83356    case 9: return 32;
   83357    case 8: return 32;
   83358    case 7:
   83359       if (devinfo->is_haswell) {
   83360          return 32;
   83361       } else {
   83362          return 32;
   83363       }
   83364    case 6: return 0;
   83365    case 5: return 0;
   83366    case 4:
   83367       if (devinfo->is_g4x) {
   83368          return 0;
   83369       } else {
   83370          return 0;
   83371       }
   83372    default:
   83373       unreachable("Invalid hardware generation");
   83374    }
   83375 }
   83376 
   83377 
   83378 
   83379 /* 3DSTATE_URB_GS::GS URB Entry Allocation Size */
   83380 
   83381 
   83382 #define GEN10_3DSTATE_URB_GS_GSURBEntryAllocationSize_bits  9
   83383 #define GEN9_3DSTATE_URB_GS_GSURBEntryAllocationSize_bits  9
   83384 #define GEN8_3DSTATE_URB_GS_GSURBEntryAllocationSize_bits  9
   83385 #define GEN75_3DSTATE_URB_GS_GSURBEntryAllocationSize_bits  9
   83386 #define GEN7_3DSTATE_URB_GS_GSURBEntryAllocationSize_bits  9
   83387 
   83388 static inline uint32_t ATTRIBUTE_PURE
   83389 _3DSTATE_URB_GS_GSURBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   83390 {
   83391    switch (devinfo->gen) {
   83392    case 10: return 9;
   83393    case 9: return 9;
   83394    case 8: return 9;
   83395    case 7:
   83396       if (devinfo->is_haswell) {
   83397          return 9;
   83398       } else {
   83399          return 9;
   83400       }
   83401    case 6: return 0;
   83402    case 5: return 0;
   83403    case 4:
   83404       if (devinfo->is_g4x) {
   83405          return 0;
   83406       } else {
   83407          return 0;
   83408       }
   83409    default:
   83410       unreachable("Invalid hardware generation");
   83411    }
   83412 }
   83413 
   83414 
   83415 
   83416 #define GEN10_3DSTATE_URB_GS_GSURBEntryAllocationSize_start  48
   83417 #define GEN9_3DSTATE_URB_GS_GSURBEntryAllocationSize_start  48
   83418 #define GEN8_3DSTATE_URB_GS_GSURBEntryAllocationSize_start  48
   83419 #define GEN75_3DSTATE_URB_GS_GSURBEntryAllocationSize_start  48
   83420 #define GEN7_3DSTATE_URB_GS_GSURBEntryAllocationSize_start  48
   83421 
   83422 static inline uint32_t ATTRIBUTE_PURE
   83423 _3DSTATE_URB_GS_GSURBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   83424 {
   83425    switch (devinfo->gen) {
   83426    case 10: return 48;
   83427    case 9: return 48;
   83428    case 8: return 48;
   83429    case 7:
   83430       if (devinfo->is_haswell) {
   83431          return 48;
   83432       } else {
   83433          return 48;
   83434       }
   83435    case 6: return 0;
   83436    case 5: return 0;
   83437    case 4:
   83438       if (devinfo->is_g4x) {
   83439          return 0;
   83440       } else {
   83441          return 0;
   83442       }
   83443    default:
   83444       unreachable("Invalid hardware generation");
   83445    }
   83446 }
   83447 
   83448 
   83449 
   83450 /* 3DSTATE_URB_GS::GS URB Starting Address */
   83451 
   83452 
   83453 #define GEN10_3DSTATE_URB_GS_GSURBStartingAddress_bits  7
   83454 #define GEN9_3DSTATE_URB_GS_GSURBStartingAddress_bits  7
   83455 #define GEN8_3DSTATE_URB_GS_GSURBStartingAddress_bits  7
   83456 #define GEN75_3DSTATE_URB_GS_GSURBStartingAddress_bits  6
   83457 #define GEN7_3DSTATE_URB_GS_GSURBStartingAddress_bits  5
   83458 
   83459 static inline uint32_t ATTRIBUTE_PURE
   83460 _3DSTATE_URB_GS_GSURBStartingAddress_bits(const struct gen_device_info *devinfo)
   83461 {
   83462    switch (devinfo->gen) {
   83463    case 10: return 7;
   83464    case 9: return 7;
   83465    case 8: return 7;
   83466    case 7:
   83467       if (devinfo->is_haswell) {
   83468          return 6;
   83469       } else {
   83470          return 5;
   83471       }
   83472    case 6: return 0;
   83473    case 5: return 0;
   83474    case 4:
   83475       if (devinfo->is_g4x) {
   83476          return 0;
   83477       } else {
   83478          return 0;
   83479       }
   83480    default:
   83481       unreachable("Invalid hardware generation");
   83482    }
   83483 }
   83484 
   83485 
   83486 
   83487 #define GEN10_3DSTATE_URB_GS_GSURBStartingAddress_start  57
   83488 #define GEN9_3DSTATE_URB_GS_GSURBStartingAddress_start  57
   83489 #define GEN8_3DSTATE_URB_GS_GSURBStartingAddress_start  57
   83490 #define GEN75_3DSTATE_URB_GS_GSURBStartingAddress_start  57
   83491 #define GEN7_3DSTATE_URB_GS_GSURBStartingAddress_start  57
   83492 
   83493 static inline uint32_t ATTRIBUTE_PURE
   83494 _3DSTATE_URB_GS_GSURBStartingAddress_start(const struct gen_device_info *devinfo)
   83495 {
   83496    switch (devinfo->gen) {
   83497    case 10: return 57;
   83498    case 9: return 57;
   83499    case 8: return 57;
   83500    case 7:
   83501       if (devinfo->is_haswell) {
   83502          return 57;
   83503       } else {
   83504          return 57;
   83505       }
   83506    case 6: return 0;
   83507    case 5: return 0;
   83508    case 4:
   83509       if (devinfo->is_g4x) {
   83510          return 0;
   83511       } else {
   83512          return 0;
   83513       }
   83514    default:
   83515       unreachable("Invalid hardware generation");
   83516    }
   83517 }
   83518 
   83519 
   83520 
   83521 /* 3DSTATE_URB_HS */
   83522 
   83523 
   83524 #define GEN10_3DSTATE_URB_HS_length  2
   83525 #define GEN9_3DSTATE_URB_HS_length  2
   83526 #define GEN8_3DSTATE_URB_HS_length  2
   83527 #define GEN75_3DSTATE_URB_HS_length  2
   83528 #define GEN7_3DSTATE_URB_HS_length  2
   83529 
   83530 static inline uint32_t ATTRIBUTE_PURE
   83531 _3DSTATE_URB_HS_length(const struct gen_device_info *devinfo)
   83532 {
   83533    switch (devinfo->gen) {
   83534    case 10: return 2;
   83535    case 9: return 2;
   83536    case 8: return 2;
   83537    case 7:
   83538       if (devinfo->is_haswell) {
   83539          return 2;
   83540       } else {
   83541          return 2;
   83542       }
   83543    case 6: return 0;
   83544    case 5: return 0;
   83545    case 4:
   83546       if (devinfo->is_g4x) {
   83547          return 0;
   83548       } else {
   83549          return 0;
   83550       }
   83551    default:
   83552       unreachable("Invalid hardware generation");
   83553    }
   83554 }
   83555 
   83556 
   83557 
   83558 /* 3DSTATE_URB_HS::3D Command Opcode */
   83559 
   83560 
   83561 #define GEN10_3DSTATE_URB_HS_3DCommandOpcode_bits  3
   83562 #define GEN9_3DSTATE_URB_HS_3DCommandOpcode_bits  3
   83563 #define GEN8_3DSTATE_URB_HS_3DCommandOpcode_bits  3
   83564 #define GEN75_3DSTATE_URB_HS_3DCommandOpcode_bits  3
   83565 #define GEN7_3DSTATE_URB_HS_3DCommandOpcode_bits  3
   83566 
   83567 static inline uint32_t ATTRIBUTE_PURE
   83568 _3DSTATE_URB_HS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   83569 {
   83570    switch (devinfo->gen) {
   83571    case 10: return 3;
   83572    case 9: return 3;
   83573    case 8: return 3;
   83574    case 7:
   83575       if (devinfo->is_haswell) {
   83576          return 3;
   83577       } else {
   83578          return 3;
   83579       }
   83580    case 6: return 0;
   83581    case 5: return 0;
   83582    case 4:
   83583       if (devinfo->is_g4x) {
   83584          return 0;
   83585       } else {
   83586          return 0;
   83587       }
   83588    default:
   83589       unreachable("Invalid hardware generation");
   83590    }
   83591 }
   83592 
   83593 
   83594 
   83595 #define GEN10_3DSTATE_URB_HS_3DCommandOpcode_start  24
   83596 #define GEN9_3DSTATE_URB_HS_3DCommandOpcode_start  24
   83597 #define GEN8_3DSTATE_URB_HS_3DCommandOpcode_start  24
   83598 #define GEN75_3DSTATE_URB_HS_3DCommandOpcode_start  24
   83599 #define GEN7_3DSTATE_URB_HS_3DCommandOpcode_start  24
   83600 
   83601 static inline uint32_t ATTRIBUTE_PURE
   83602 _3DSTATE_URB_HS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   83603 {
   83604    switch (devinfo->gen) {
   83605    case 10: return 24;
   83606    case 9: return 24;
   83607    case 8: return 24;
   83608    case 7:
   83609       if (devinfo->is_haswell) {
   83610          return 24;
   83611       } else {
   83612          return 24;
   83613       }
   83614    case 6: return 0;
   83615    case 5: return 0;
   83616    case 4:
   83617       if (devinfo->is_g4x) {
   83618          return 0;
   83619       } else {
   83620          return 0;
   83621       }
   83622    default:
   83623       unreachable("Invalid hardware generation");
   83624    }
   83625 }
   83626 
   83627 
   83628 
   83629 /* 3DSTATE_URB_HS::3D Command Sub Opcode */
   83630 
   83631 
   83632 #define GEN10_3DSTATE_URB_HS_3DCommandSubOpcode_bits  8
   83633 #define GEN9_3DSTATE_URB_HS_3DCommandSubOpcode_bits  8
   83634 #define GEN8_3DSTATE_URB_HS_3DCommandSubOpcode_bits  8
   83635 #define GEN75_3DSTATE_URB_HS_3DCommandSubOpcode_bits  8
   83636 #define GEN7_3DSTATE_URB_HS_3DCommandSubOpcode_bits  8
   83637 
   83638 static inline uint32_t ATTRIBUTE_PURE
   83639 _3DSTATE_URB_HS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   83640 {
   83641    switch (devinfo->gen) {
   83642    case 10: return 8;
   83643    case 9: return 8;
   83644    case 8: return 8;
   83645    case 7:
   83646       if (devinfo->is_haswell) {
   83647          return 8;
   83648       } else {
   83649          return 8;
   83650       }
   83651    case 6: return 0;
   83652    case 5: return 0;
   83653    case 4:
   83654       if (devinfo->is_g4x) {
   83655          return 0;
   83656       } else {
   83657          return 0;
   83658       }
   83659    default:
   83660       unreachable("Invalid hardware generation");
   83661    }
   83662 }
   83663 
   83664 
   83665 
   83666 #define GEN10_3DSTATE_URB_HS_3DCommandSubOpcode_start  16
   83667 #define GEN9_3DSTATE_URB_HS_3DCommandSubOpcode_start  16
   83668 #define GEN8_3DSTATE_URB_HS_3DCommandSubOpcode_start  16
   83669 #define GEN75_3DSTATE_URB_HS_3DCommandSubOpcode_start  16
   83670 #define GEN7_3DSTATE_URB_HS_3DCommandSubOpcode_start  16
   83671 
   83672 static inline uint32_t ATTRIBUTE_PURE
   83673 _3DSTATE_URB_HS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   83674 {
   83675    switch (devinfo->gen) {
   83676    case 10: return 16;
   83677    case 9: return 16;
   83678    case 8: return 16;
   83679    case 7:
   83680       if (devinfo->is_haswell) {
   83681          return 16;
   83682       } else {
   83683          return 16;
   83684       }
   83685    case 6: return 0;
   83686    case 5: return 0;
   83687    case 4:
   83688       if (devinfo->is_g4x) {
   83689          return 0;
   83690       } else {
   83691          return 0;
   83692       }
   83693    default:
   83694       unreachable("Invalid hardware generation");
   83695    }
   83696 }
   83697 
   83698 
   83699 
   83700 /* 3DSTATE_URB_HS::Command SubType */
   83701 
   83702 
   83703 #define GEN10_3DSTATE_URB_HS_CommandSubType_bits  2
   83704 #define GEN9_3DSTATE_URB_HS_CommandSubType_bits  2
   83705 #define GEN8_3DSTATE_URB_HS_CommandSubType_bits  2
   83706 #define GEN75_3DSTATE_URB_HS_CommandSubType_bits  2
   83707 #define GEN7_3DSTATE_URB_HS_CommandSubType_bits  2
   83708 
   83709 static inline uint32_t ATTRIBUTE_PURE
   83710 _3DSTATE_URB_HS_CommandSubType_bits(const struct gen_device_info *devinfo)
   83711 {
   83712    switch (devinfo->gen) {
   83713    case 10: return 2;
   83714    case 9: return 2;
   83715    case 8: return 2;
   83716    case 7:
   83717       if (devinfo->is_haswell) {
   83718          return 2;
   83719       } else {
   83720          return 2;
   83721       }
   83722    case 6: return 0;
   83723    case 5: return 0;
   83724    case 4:
   83725       if (devinfo->is_g4x) {
   83726          return 0;
   83727       } else {
   83728          return 0;
   83729       }
   83730    default:
   83731       unreachable("Invalid hardware generation");
   83732    }
   83733 }
   83734 
   83735 
   83736 
   83737 #define GEN10_3DSTATE_URB_HS_CommandSubType_start  27
   83738 #define GEN9_3DSTATE_URB_HS_CommandSubType_start  27
   83739 #define GEN8_3DSTATE_URB_HS_CommandSubType_start  27
   83740 #define GEN75_3DSTATE_URB_HS_CommandSubType_start  27
   83741 #define GEN7_3DSTATE_URB_HS_CommandSubType_start  27
   83742 
   83743 static inline uint32_t ATTRIBUTE_PURE
   83744 _3DSTATE_URB_HS_CommandSubType_start(const struct gen_device_info *devinfo)
   83745 {
   83746    switch (devinfo->gen) {
   83747    case 10: return 27;
   83748    case 9: return 27;
   83749    case 8: return 27;
   83750    case 7:
   83751       if (devinfo->is_haswell) {
   83752          return 27;
   83753       } else {
   83754          return 27;
   83755       }
   83756    case 6: return 0;
   83757    case 5: return 0;
   83758    case 4:
   83759       if (devinfo->is_g4x) {
   83760          return 0;
   83761       } else {
   83762          return 0;
   83763       }
   83764    default:
   83765       unreachable("Invalid hardware generation");
   83766    }
   83767 }
   83768 
   83769 
   83770 
   83771 /* 3DSTATE_URB_HS::Command Type */
   83772 
   83773 
   83774 #define GEN10_3DSTATE_URB_HS_CommandType_bits  3
   83775 #define GEN9_3DSTATE_URB_HS_CommandType_bits  3
   83776 #define GEN8_3DSTATE_URB_HS_CommandType_bits  3
   83777 #define GEN75_3DSTATE_URB_HS_CommandType_bits  3
   83778 #define GEN7_3DSTATE_URB_HS_CommandType_bits  3
   83779 
   83780 static inline uint32_t ATTRIBUTE_PURE
   83781 _3DSTATE_URB_HS_CommandType_bits(const struct gen_device_info *devinfo)
   83782 {
   83783    switch (devinfo->gen) {
   83784    case 10: return 3;
   83785    case 9: return 3;
   83786    case 8: return 3;
   83787    case 7:
   83788       if (devinfo->is_haswell) {
   83789          return 3;
   83790       } else {
   83791          return 3;
   83792       }
   83793    case 6: return 0;
   83794    case 5: return 0;
   83795    case 4:
   83796       if (devinfo->is_g4x) {
   83797          return 0;
   83798       } else {
   83799          return 0;
   83800       }
   83801    default:
   83802       unreachable("Invalid hardware generation");
   83803    }
   83804 }
   83805 
   83806 
   83807 
   83808 #define GEN10_3DSTATE_URB_HS_CommandType_start  29
   83809 #define GEN9_3DSTATE_URB_HS_CommandType_start  29
   83810 #define GEN8_3DSTATE_URB_HS_CommandType_start  29
   83811 #define GEN75_3DSTATE_URB_HS_CommandType_start  29
   83812 #define GEN7_3DSTATE_URB_HS_CommandType_start  29
   83813 
   83814 static inline uint32_t ATTRIBUTE_PURE
   83815 _3DSTATE_URB_HS_CommandType_start(const struct gen_device_info *devinfo)
   83816 {
   83817    switch (devinfo->gen) {
   83818    case 10: return 29;
   83819    case 9: return 29;
   83820    case 8: return 29;
   83821    case 7:
   83822       if (devinfo->is_haswell) {
   83823          return 29;
   83824       } else {
   83825          return 29;
   83826       }
   83827    case 6: return 0;
   83828    case 5: return 0;
   83829    case 4:
   83830       if (devinfo->is_g4x) {
   83831          return 0;
   83832       } else {
   83833          return 0;
   83834       }
   83835    default:
   83836       unreachable("Invalid hardware generation");
   83837    }
   83838 }
   83839 
   83840 
   83841 
   83842 /* 3DSTATE_URB_HS::DWord Length */
   83843 
   83844 
   83845 #define GEN10_3DSTATE_URB_HS_DWordLength_bits  8
   83846 #define GEN9_3DSTATE_URB_HS_DWordLength_bits  8
   83847 #define GEN8_3DSTATE_URB_HS_DWordLength_bits  8
   83848 #define GEN75_3DSTATE_URB_HS_DWordLength_bits  8
   83849 #define GEN7_3DSTATE_URB_HS_DWordLength_bits  8
   83850 
   83851 static inline uint32_t ATTRIBUTE_PURE
   83852 _3DSTATE_URB_HS_DWordLength_bits(const struct gen_device_info *devinfo)
   83853 {
   83854    switch (devinfo->gen) {
   83855    case 10: return 8;
   83856    case 9: return 8;
   83857    case 8: return 8;
   83858    case 7:
   83859       if (devinfo->is_haswell) {
   83860          return 8;
   83861       } else {
   83862          return 8;
   83863       }
   83864    case 6: return 0;
   83865    case 5: return 0;
   83866    case 4:
   83867       if (devinfo->is_g4x) {
   83868          return 0;
   83869       } else {
   83870          return 0;
   83871       }
   83872    default:
   83873       unreachable("Invalid hardware generation");
   83874    }
   83875 }
   83876 
   83877 
   83878 
   83879 #define GEN10_3DSTATE_URB_HS_DWordLength_start  0
   83880 #define GEN9_3DSTATE_URB_HS_DWordLength_start  0
   83881 #define GEN8_3DSTATE_URB_HS_DWordLength_start  0
   83882 #define GEN75_3DSTATE_URB_HS_DWordLength_start  0
   83883 #define GEN7_3DSTATE_URB_HS_DWordLength_start  0
   83884 
   83885 static inline uint32_t ATTRIBUTE_PURE
   83886 _3DSTATE_URB_HS_DWordLength_start(const struct gen_device_info *devinfo)
   83887 {
   83888    switch (devinfo->gen) {
   83889    case 10: return 0;
   83890    case 9: return 0;
   83891    case 8: return 0;
   83892    case 7:
   83893       if (devinfo->is_haswell) {
   83894          return 0;
   83895       } else {
   83896          return 0;
   83897       }
   83898    case 6: return 0;
   83899    case 5: return 0;
   83900    case 4:
   83901       if (devinfo->is_g4x) {
   83902          return 0;
   83903       } else {
   83904          return 0;
   83905       }
   83906    default:
   83907       unreachable("Invalid hardware generation");
   83908    }
   83909 }
   83910 
   83911 
   83912 
   83913 /* 3DSTATE_URB_HS::HS Number of URB Entries */
   83914 
   83915 
   83916 #define GEN10_3DSTATE_URB_HS_HSNumberofURBEntries_bits  16
   83917 #define GEN9_3DSTATE_URB_HS_HSNumberofURBEntries_bits  16
   83918 #define GEN8_3DSTATE_URB_HS_HSNumberofURBEntries_bits  16
   83919 #define GEN75_3DSTATE_URB_HS_HSNumberofURBEntries_bits  16
   83920 #define GEN7_3DSTATE_URB_HS_HSNumberofURBEntries_bits  16
   83921 
   83922 static inline uint32_t ATTRIBUTE_PURE
   83923 _3DSTATE_URB_HS_HSNumberofURBEntries_bits(const struct gen_device_info *devinfo)
   83924 {
   83925    switch (devinfo->gen) {
   83926    case 10: return 16;
   83927    case 9: return 16;
   83928    case 8: return 16;
   83929    case 7:
   83930       if (devinfo->is_haswell) {
   83931          return 16;
   83932       } else {
   83933          return 16;
   83934       }
   83935    case 6: return 0;
   83936    case 5: return 0;
   83937    case 4:
   83938       if (devinfo->is_g4x) {
   83939          return 0;
   83940       } else {
   83941          return 0;
   83942       }
   83943    default:
   83944       unreachable("Invalid hardware generation");
   83945    }
   83946 }
   83947 
   83948 
   83949 
   83950 #define GEN10_3DSTATE_URB_HS_HSNumberofURBEntries_start  32
   83951 #define GEN9_3DSTATE_URB_HS_HSNumberofURBEntries_start  32
   83952 #define GEN8_3DSTATE_URB_HS_HSNumberofURBEntries_start  32
   83953 #define GEN75_3DSTATE_URB_HS_HSNumberofURBEntries_start  32
   83954 #define GEN7_3DSTATE_URB_HS_HSNumberofURBEntries_start  32
   83955 
   83956 static inline uint32_t ATTRIBUTE_PURE
   83957 _3DSTATE_URB_HS_HSNumberofURBEntries_start(const struct gen_device_info *devinfo)
   83958 {
   83959    switch (devinfo->gen) {
   83960    case 10: return 32;
   83961    case 9: return 32;
   83962    case 8: return 32;
   83963    case 7:
   83964       if (devinfo->is_haswell) {
   83965          return 32;
   83966       } else {
   83967          return 32;
   83968       }
   83969    case 6: return 0;
   83970    case 5: return 0;
   83971    case 4:
   83972       if (devinfo->is_g4x) {
   83973          return 0;
   83974       } else {
   83975          return 0;
   83976       }
   83977    default:
   83978       unreachable("Invalid hardware generation");
   83979    }
   83980 }
   83981 
   83982 
   83983 
   83984 /* 3DSTATE_URB_HS::HS URB Entry Allocation Size */
   83985 
   83986 
   83987 #define GEN10_3DSTATE_URB_HS_HSURBEntryAllocationSize_bits  9
   83988 #define GEN9_3DSTATE_URB_HS_HSURBEntryAllocationSize_bits  9
   83989 #define GEN8_3DSTATE_URB_HS_HSURBEntryAllocationSize_bits  9
   83990 #define GEN75_3DSTATE_URB_HS_HSURBEntryAllocationSize_bits  9
   83991 #define GEN7_3DSTATE_URB_HS_HSURBEntryAllocationSize_bits  9
   83992 
   83993 static inline uint32_t ATTRIBUTE_PURE
   83994 _3DSTATE_URB_HS_HSURBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   83995 {
   83996    switch (devinfo->gen) {
   83997    case 10: return 9;
   83998    case 9: return 9;
   83999    case 8: return 9;
   84000    case 7:
   84001       if (devinfo->is_haswell) {
   84002          return 9;
   84003       } else {
   84004          return 9;
   84005       }
   84006    case 6: return 0;
   84007    case 5: return 0;
   84008    case 4:
   84009       if (devinfo->is_g4x) {
   84010          return 0;
   84011       } else {
   84012          return 0;
   84013       }
   84014    default:
   84015       unreachable("Invalid hardware generation");
   84016    }
   84017 }
   84018 
   84019 
   84020 
   84021 #define GEN10_3DSTATE_URB_HS_HSURBEntryAllocationSize_start  48
   84022 #define GEN9_3DSTATE_URB_HS_HSURBEntryAllocationSize_start  48
   84023 #define GEN8_3DSTATE_URB_HS_HSURBEntryAllocationSize_start  48
   84024 #define GEN75_3DSTATE_URB_HS_HSURBEntryAllocationSize_start  48
   84025 #define GEN7_3DSTATE_URB_HS_HSURBEntryAllocationSize_start  48
   84026 
   84027 static inline uint32_t ATTRIBUTE_PURE
   84028 _3DSTATE_URB_HS_HSURBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   84029 {
   84030    switch (devinfo->gen) {
   84031    case 10: return 48;
   84032    case 9: return 48;
   84033    case 8: return 48;
   84034    case 7:
   84035       if (devinfo->is_haswell) {
   84036          return 48;
   84037       } else {
   84038          return 48;
   84039       }
   84040    case 6: return 0;
   84041    case 5: return 0;
   84042    case 4:
   84043       if (devinfo->is_g4x) {
   84044          return 0;
   84045       } else {
   84046          return 0;
   84047       }
   84048    default:
   84049       unreachable("Invalid hardware generation");
   84050    }
   84051 }
   84052 
   84053 
   84054 
   84055 /* 3DSTATE_URB_HS::HS URB Starting Address */
   84056 
   84057 
   84058 #define GEN10_3DSTATE_URB_HS_HSURBStartingAddress_bits  7
   84059 #define GEN9_3DSTATE_URB_HS_HSURBStartingAddress_bits  7
   84060 #define GEN8_3DSTATE_URB_HS_HSURBStartingAddress_bits  7
   84061 #define GEN75_3DSTATE_URB_HS_HSURBStartingAddress_bits  6
   84062 #define GEN7_3DSTATE_URB_HS_HSURBStartingAddress_bits  5
   84063 
   84064 static inline uint32_t ATTRIBUTE_PURE
   84065 _3DSTATE_URB_HS_HSURBStartingAddress_bits(const struct gen_device_info *devinfo)
   84066 {
   84067    switch (devinfo->gen) {
   84068    case 10: return 7;
   84069    case 9: return 7;
   84070    case 8: return 7;
   84071    case 7:
   84072       if (devinfo->is_haswell) {
   84073          return 6;
   84074       } else {
   84075          return 5;
   84076       }
   84077    case 6: return 0;
   84078    case 5: return 0;
   84079    case 4:
   84080       if (devinfo->is_g4x) {
   84081          return 0;
   84082       } else {
   84083          return 0;
   84084       }
   84085    default:
   84086       unreachable("Invalid hardware generation");
   84087    }
   84088 }
   84089 
   84090 
   84091 
   84092 #define GEN10_3DSTATE_URB_HS_HSURBStartingAddress_start  57
   84093 #define GEN9_3DSTATE_URB_HS_HSURBStartingAddress_start  57
   84094 #define GEN8_3DSTATE_URB_HS_HSURBStartingAddress_start  57
   84095 #define GEN75_3DSTATE_URB_HS_HSURBStartingAddress_start  57
   84096 #define GEN7_3DSTATE_URB_HS_HSURBStartingAddress_start  57
   84097 
   84098 static inline uint32_t ATTRIBUTE_PURE
   84099 _3DSTATE_URB_HS_HSURBStartingAddress_start(const struct gen_device_info *devinfo)
   84100 {
   84101    switch (devinfo->gen) {
   84102    case 10: return 57;
   84103    case 9: return 57;
   84104    case 8: return 57;
   84105    case 7:
   84106       if (devinfo->is_haswell) {
   84107          return 57;
   84108       } else {
   84109          return 57;
   84110       }
   84111    case 6: return 0;
   84112    case 5: return 0;
   84113    case 4:
   84114       if (devinfo->is_g4x) {
   84115          return 0;
   84116       } else {
   84117          return 0;
   84118       }
   84119    default:
   84120       unreachable("Invalid hardware generation");
   84121    }
   84122 }
   84123 
   84124 
   84125 
   84126 /* 3DSTATE_URB_VS */
   84127 
   84128 
   84129 #define GEN10_3DSTATE_URB_VS_length  2
   84130 #define GEN9_3DSTATE_URB_VS_length  2
   84131 #define GEN8_3DSTATE_URB_VS_length  2
   84132 #define GEN75_3DSTATE_URB_VS_length  2
   84133 #define GEN7_3DSTATE_URB_VS_length  2
   84134 
   84135 static inline uint32_t ATTRIBUTE_PURE
   84136 _3DSTATE_URB_VS_length(const struct gen_device_info *devinfo)
   84137 {
   84138    switch (devinfo->gen) {
   84139    case 10: return 2;
   84140    case 9: return 2;
   84141    case 8: return 2;
   84142    case 7:
   84143       if (devinfo->is_haswell) {
   84144          return 2;
   84145       } else {
   84146          return 2;
   84147       }
   84148    case 6: return 0;
   84149    case 5: return 0;
   84150    case 4:
   84151       if (devinfo->is_g4x) {
   84152          return 0;
   84153       } else {
   84154          return 0;
   84155       }
   84156    default:
   84157       unreachable("Invalid hardware generation");
   84158    }
   84159 }
   84160 
   84161 
   84162 
   84163 /* 3DSTATE_URB_VS::3D Command Opcode */
   84164 
   84165 
   84166 #define GEN10_3DSTATE_URB_VS_3DCommandOpcode_bits  3
   84167 #define GEN9_3DSTATE_URB_VS_3DCommandOpcode_bits  3
   84168 #define GEN8_3DSTATE_URB_VS_3DCommandOpcode_bits  3
   84169 #define GEN75_3DSTATE_URB_VS_3DCommandOpcode_bits  3
   84170 #define GEN7_3DSTATE_URB_VS_3DCommandOpcode_bits  3
   84171 
   84172 static inline uint32_t ATTRIBUTE_PURE
   84173 _3DSTATE_URB_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   84174 {
   84175    switch (devinfo->gen) {
   84176    case 10: return 3;
   84177    case 9: return 3;
   84178    case 8: return 3;
   84179    case 7:
   84180       if (devinfo->is_haswell) {
   84181          return 3;
   84182       } else {
   84183          return 3;
   84184       }
   84185    case 6: return 0;
   84186    case 5: return 0;
   84187    case 4:
   84188       if (devinfo->is_g4x) {
   84189          return 0;
   84190       } else {
   84191          return 0;
   84192       }
   84193    default:
   84194       unreachable("Invalid hardware generation");
   84195    }
   84196 }
   84197 
   84198 
   84199 
   84200 #define GEN10_3DSTATE_URB_VS_3DCommandOpcode_start  24
   84201 #define GEN9_3DSTATE_URB_VS_3DCommandOpcode_start  24
   84202 #define GEN8_3DSTATE_URB_VS_3DCommandOpcode_start  24
   84203 #define GEN75_3DSTATE_URB_VS_3DCommandOpcode_start  24
   84204 #define GEN7_3DSTATE_URB_VS_3DCommandOpcode_start  24
   84205 
   84206 static inline uint32_t ATTRIBUTE_PURE
   84207 _3DSTATE_URB_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   84208 {
   84209    switch (devinfo->gen) {
   84210    case 10: return 24;
   84211    case 9: return 24;
   84212    case 8: return 24;
   84213    case 7:
   84214       if (devinfo->is_haswell) {
   84215          return 24;
   84216       } else {
   84217          return 24;
   84218       }
   84219    case 6: return 0;
   84220    case 5: return 0;
   84221    case 4:
   84222       if (devinfo->is_g4x) {
   84223          return 0;
   84224       } else {
   84225          return 0;
   84226       }
   84227    default:
   84228       unreachable("Invalid hardware generation");
   84229    }
   84230 }
   84231 
   84232 
   84233 
   84234 /* 3DSTATE_URB_VS::3D Command Sub Opcode */
   84235 
   84236 
   84237 #define GEN10_3DSTATE_URB_VS_3DCommandSubOpcode_bits  8
   84238 #define GEN9_3DSTATE_URB_VS_3DCommandSubOpcode_bits  8
   84239 #define GEN8_3DSTATE_URB_VS_3DCommandSubOpcode_bits  8
   84240 #define GEN75_3DSTATE_URB_VS_3DCommandSubOpcode_bits  8
   84241 #define GEN7_3DSTATE_URB_VS_3DCommandSubOpcode_bits  8
   84242 
   84243 static inline uint32_t ATTRIBUTE_PURE
   84244 _3DSTATE_URB_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   84245 {
   84246    switch (devinfo->gen) {
   84247    case 10: return 8;
   84248    case 9: return 8;
   84249    case 8: return 8;
   84250    case 7:
   84251       if (devinfo->is_haswell) {
   84252          return 8;
   84253       } else {
   84254          return 8;
   84255       }
   84256    case 6: return 0;
   84257    case 5: return 0;
   84258    case 4:
   84259       if (devinfo->is_g4x) {
   84260          return 0;
   84261       } else {
   84262          return 0;
   84263       }
   84264    default:
   84265       unreachable("Invalid hardware generation");
   84266    }
   84267 }
   84268 
   84269 
   84270 
   84271 #define GEN10_3DSTATE_URB_VS_3DCommandSubOpcode_start  16
   84272 #define GEN9_3DSTATE_URB_VS_3DCommandSubOpcode_start  16
   84273 #define GEN8_3DSTATE_URB_VS_3DCommandSubOpcode_start  16
   84274 #define GEN75_3DSTATE_URB_VS_3DCommandSubOpcode_start  16
   84275 #define GEN7_3DSTATE_URB_VS_3DCommandSubOpcode_start  16
   84276 
   84277 static inline uint32_t ATTRIBUTE_PURE
   84278 _3DSTATE_URB_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   84279 {
   84280    switch (devinfo->gen) {
   84281    case 10: return 16;
   84282    case 9: return 16;
   84283    case 8: return 16;
   84284    case 7:
   84285       if (devinfo->is_haswell) {
   84286          return 16;
   84287       } else {
   84288          return 16;
   84289       }
   84290    case 6: return 0;
   84291    case 5: return 0;
   84292    case 4:
   84293       if (devinfo->is_g4x) {
   84294          return 0;
   84295       } else {
   84296          return 0;
   84297       }
   84298    default:
   84299       unreachable("Invalid hardware generation");
   84300    }
   84301 }
   84302 
   84303 
   84304 
   84305 /* 3DSTATE_URB_VS::Command SubType */
   84306 
   84307 
   84308 #define GEN10_3DSTATE_URB_VS_CommandSubType_bits  2
   84309 #define GEN9_3DSTATE_URB_VS_CommandSubType_bits  2
   84310 #define GEN8_3DSTATE_URB_VS_CommandSubType_bits  2
   84311 #define GEN75_3DSTATE_URB_VS_CommandSubType_bits  2
   84312 #define GEN7_3DSTATE_URB_VS_CommandSubType_bits  2
   84313 
   84314 static inline uint32_t ATTRIBUTE_PURE
   84315 _3DSTATE_URB_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   84316 {
   84317    switch (devinfo->gen) {
   84318    case 10: return 2;
   84319    case 9: return 2;
   84320    case 8: return 2;
   84321    case 7:
   84322       if (devinfo->is_haswell) {
   84323          return 2;
   84324       } else {
   84325          return 2;
   84326       }
   84327    case 6: return 0;
   84328    case 5: return 0;
   84329    case 4:
   84330       if (devinfo->is_g4x) {
   84331          return 0;
   84332       } else {
   84333          return 0;
   84334       }
   84335    default:
   84336       unreachable("Invalid hardware generation");
   84337    }
   84338 }
   84339 
   84340 
   84341 
   84342 #define GEN10_3DSTATE_URB_VS_CommandSubType_start  27
   84343 #define GEN9_3DSTATE_URB_VS_CommandSubType_start  27
   84344 #define GEN8_3DSTATE_URB_VS_CommandSubType_start  27
   84345 #define GEN75_3DSTATE_URB_VS_CommandSubType_start  27
   84346 #define GEN7_3DSTATE_URB_VS_CommandSubType_start  27
   84347 
   84348 static inline uint32_t ATTRIBUTE_PURE
   84349 _3DSTATE_URB_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   84350 {
   84351    switch (devinfo->gen) {
   84352    case 10: return 27;
   84353    case 9: return 27;
   84354    case 8: return 27;
   84355    case 7:
   84356       if (devinfo->is_haswell) {
   84357          return 27;
   84358       } else {
   84359          return 27;
   84360       }
   84361    case 6: return 0;
   84362    case 5: return 0;
   84363    case 4:
   84364       if (devinfo->is_g4x) {
   84365          return 0;
   84366       } else {
   84367          return 0;
   84368       }
   84369    default:
   84370       unreachable("Invalid hardware generation");
   84371    }
   84372 }
   84373 
   84374 
   84375 
   84376 /* 3DSTATE_URB_VS::Command Type */
   84377 
   84378 
   84379 #define GEN10_3DSTATE_URB_VS_CommandType_bits  3
   84380 #define GEN9_3DSTATE_URB_VS_CommandType_bits  3
   84381 #define GEN8_3DSTATE_URB_VS_CommandType_bits  3
   84382 #define GEN75_3DSTATE_URB_VS_CommandType_bits  3
   84383 #define GEN7_3DSTATE_URB_VS_CommandType_bits  3
   84384 
   84385 static inline uint32_t ATTRIBUTE_PURE
   84386 _3DSTATE_URB_VS_CommandType_bits(const struct gen_device_info *devinfo)
   84387 {
   84388    switch (devinfo->gen) {
   84389    case 10: return 3;
   84390    case 9: return 3;
   84391    case 8: return 3;
   84392    case 7:
   84393       if (devinfo->is_haswell) {
   84394          return 3;
   84395       } else {
   84396          return 3;
   84397       }
   84398    case 6: return 0;
   84399    case 5: return 0;
   84400    case 4:
   84401       if (devinfo->is_g4x) {
   84402          return 0;
   84403       } else {
   84404          return 0;
   84405       }
   84406    default:
   84407       unreachable("Invalid hardware generation");
   84408    }
   84409 }
   84410 
   84411 
   84412 
   84413 #define GEN10_3DSTATE_URB_VS_CommandType_start  29
   84414 #define GEN9_3DSTATE_URB_VS_CommandType_start  29
   84415 #define GEN8_3DSTATE_URB_VS_CommandType_start  29
   84416 #define GEN75_3DSTATE_URB_VS_CommandType_start  29
   84417 #define GEN7_3DSTATE_URB_VS_CommandType_start  29
   84418 
   84419 static inline uint32_t ATTRIBUTE_PURE
   84420 _3DSTATE_URB_VS_CommandType_start(const struct gen_device_info *devinfo)
   84421 {
   84422    switch (devinfo->gen) {
   84423    case 10: return 29;
   84424    case 9: return 29;
   84425    case 8: return 29;
   84426    case 7:
   84427       if (devinfo->is_haswell) {
   84428          return 29;
   84429       } else {
   84430          return 29;
   84431       }
   84432    case 6: return 0;
   84433    case 5: return 0;
   84434    case 4:
   84435       if (devinfo->is_g4x) {
   84436          return 0;
   84437       } else {
   84438          return 0;
   84439       }
   84440    default:
   84441       unreachable("Invalid hardware generation");
   84442    }
   84443 }
   84444 
   84445 
   84446 
   84447 /* 3DSTATE_URB_VS::DWord Length */
   84448 
   84449 
   84450 #define GEN10_3DSTATE_URB_VS_DWordLength_bits  8
   84451 #define GEN9_3DSTATE_URB_VS_DWordLength_bits  8
   84452 #define GEN8_3DSTATE_URB_VS_DWordLength_bits  8
   84453 #define GEN75_3DSTATE_URB_VS_DWordLength_bits  8
   84454 #define GEN7_3DSTATE_URB_VS_DWordLength_bits  8
   84455 
   84456 static inline uint32_t ATTRIBUTE_PURE
   84457 _3DSTATE_URB_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   84458 {
   84459    switch (devinfo->gen) {
   84460    case 10: return 8;
   84461    case 9: return 8;
   84462    case 8: return 8;
   84463    case 7:
   84464       if (devinfo->is_haswell) {
   84465          return 8;
   84466       } else {
   84467          return 8;
   84468       }
   84469    case 6: return 0;
   84470    case 5: return 0;
   84471    case 4:
   84472       if (devinfo->is_g4x) {
   84473          return 0;
   84474       } else {
   84475          return 0;
   84476       }
   84477    default:
   84478       unreachable("Invalid hardware generation");
   84479    }
   84480 }
   84481 
   84482 
   84483 
   84484 #define GEN10_3DSTATE_URB_VS_DWordLength_start  0
   84485 #define GEN9_3DSTATE_URB_VS_DWordLength_start  0
   84486 #define GEN8_3DSTATE_URB_VS_DWordLength_start  0
   84487 #define GEN75_3DSTATE_URB_VS_DWordLength_start  0
   84488 #define GEN7_3DSTATE_URB_VS_DWordLength_start  0
   84489 
   84490 static inline uint32_t ATTRIBUTE_PURE
   84491 _3DSTATE_URB_VS_DWordLength_start(const struct gen_device_info *devinfo)
   84492 {
   84493    switch (devinfo->gen) {
   84494    case 10: return 0;
   84495    case 9: return 0;
   84496    case 8: return 0;
   84497    case 7:
   84498       if (devinfo->is_haswell) {
   84499          return 0;
   84500       } else {
   84501          return 0;
   84502       }
   84503    case 6: return 0;
   84504    case 5: return 0;
   84505    case 4:
   84506       if (devinfo->is_g4x) {
   84507          return 0;
   84508       } else {
   84509          return 0;
   84510       }
   84511    default:
   84512       unreachable("Invalid hardware generation");
   84513    }
   84514 }
   84515 
   84516 
   84517 
   84518 /* 3DSTATE_URB_VS::VS Number of URB Entries */
   84519 
   84520 
   84521 #define GEN10_3DSTATE_URB_VS_VSNumberofURBEntries_bits  16
   84522 #define GEN9_3DSTATE_URB_VS_VSNumberofURBEntries_bits  16
   84523 #define GEN8_3DSTATE_URB_VS_VSNumberofURBEntries_bits  16
   84524 #define GEN75_3DSTATE_URB_VS_VSNumberofURBEntries_bits  16
   84525 #define GEN7_3DSTATE_URB_VS_VSNumberofURBEntries_bits  16
   84526 
   84527 static inline uint32_t ATTRIBUTE_PURE
   84528 _3DSTATE_URB_VS_VSNumberofURBEntries_bits(const struct gen_device_info *devinfo)
   84529 {
   84530    switch (devinfo->gen) {
   84531    case 10: return 16;
   84532    case 9: return 16;
   84533    case 8: return 16;
   84534    case 7:
   84535       if (devinfo->is_haswell) {
   84536          return 16;
   84537       } else {
   84538          return 16;
   84539       }
   84540    case 6: return 0;
   84541    case 5: return 0;
   84542    case 4:
   84543       if (devinfo->is_g4x) {
   84544          return 0;
   84545       } else {
   84546          return 0;
   84547       }
   84548    default:
   84549       unreachable("Invalid hardware generation");
   84550    }
   84551 }
   84552 
   84553 
   84554 
   84555 #define GEN10_3DSTATE_URB_VS_VSNumberofURBEntries_start  32
   84556 #define GEN9_3DSTATE_URB_VS_VSNumberofURBEntries_start  32
   84557 #define GEN8_3DSTATE_URB_VS_VSNumberofURBEntries_start  32
   84558 #define GEN75_3DSTATE_URB_VS_VSNumberofURBEntries_start  32
   84559 #define GEN7_3DSTATE_URB_VS_VSNumberofURBEntries_start  32
   84560 
   84561 static inline uint32_t ATTRIBUTE_PURE
   84562 _3DSTATE_URB_VS_VSNumberofURBEntries_start(const struct gen_device_info *devinfo)
   84563 {
   84564    switch (devinfo->gen) {
   84565    case 10: return 32;
   84566    case 9: return 32;
   84567    case 8: return 32;
   84568    case 7:
   84569       if (devinfo->is_haswell) {
   84570          return 32;
   84571       } else {
   84572          return 32;
   84573       }
   84574    case 6: return 0;
   84575    case 5: return 0;
   84576    case 4:
   84577       if (devinfo->is_g4x) {
   84578          return 0;
   84579       } else {
   84580          return 0;
   84581       }
   84582    default:
   84583       unreachable("Invalid hardware generation");
   84584    }
   84585 }
   84586 
   84587 
   84588 
   84589 /* 3DSTATE_URB_VS::VS URB Entry Allocation Size */
   84590 
   84591 
   84592 #define GEN10_3DSTATE_URB_VS_VSURBEntryAllocationSize_bits  9
   84593 #define GEN9_3DSTATE_URB_VS_VSURBEntryAllocationSize_bits  9
   84594 #define GEN8_3DSTATE_URB_VS_VSURBEntryAllocationSize_bits  9
   84595 #define GEN75_3DSTATE_URB_VS_VSURBEntryAllocationSize_bits  9
   84596 #define GEN7_3DSTATE_URB_VS_VSURBEntryAllocationSize_bits  9
   84597 
   84598 static inline uint32_t ATTRIBUTE_PURE
   84599 _3DSTATE_URB_VS_VSURBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   84600 {
   84601    switch (devinfo->gen) {
   84602    case 10: return 9;
   84603    case 9: return 9;
   84604    case 8: return 9;
   84605    case 7:
   84606       if (devinfo->is_haswell) {
   84607          return 9;
   84608       } else {
   84609          return 9;
   84610       }
   84611    case 6: return 0;
   84612    case 5: return 0;
   84613    case 4:
   84614       if (devinfo->is_g4x) {
   84615          return 0;
   84616       } else {
   84617          return 0;
   84618       }
   84619    default:
   84620       unreachable("Invalid hardware generation");
   84621    }
   84622 }
   84623 
   84624 
   84625 
   84626 #define GEN10_3DSTATE_URB_VS_VSURBEntryAllocationSize_start  48
   84627 #define GEN9_3DSTATE_URB_VS_VSURBEntryAllocationSize_start  48
   84628 #define GEN8_3DSTATE_URB_VS_VSURBEntryAllocationSize_start  48
   84629 #define GEN75_3DSTATE_URB_VS_VSURBEntryAllocationSize_start  48
   84630 #define GEN7_3DSTATE_URB_VS_VSURBEntryAllocationSize_start  48
   84631 
   84632 static inline uint32_t ATTRIBUTE_PURE
   84633 _3DSTATE_URB_VS_VSURBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   84634 {
   84635    switch (devinfo->gen) {
   84636    case 10: return 48;
   84637    case 9: return 48;
   84638    case 8: return 48;
   84639    case 7:
   84640       if (devinfo->is_haswell) {
   84641          return 48;
   84642       } else {
   84643          return 48;
   84644       }
   84645    case 6: return 0;
   84646    case 5: return 0;
   84647    case 4:
   84648       if (devinfo->is_g4x) {
   84649          return 0;
   84650       } else {
   84651          return 0;
   84652       }
   84653    default:
   84654       unreachable("Invalid hardware generation");
   84655    }
   84656 }
   84657 
   84658 
   84659 
   84660 /* 3DSTATE_URB_VS::VS URB Starting Address */
   84661 
   84662 
   84663 #define GEN10_3DSTATE_URB_VS_VSURBStartingAddress_bits  7
   84664 #define GEN9_3DSTATE_URB_VS_VSURBStartingAddress_bits  7
   84665 #define GEN8_3DSTATE_URB_VS_VSURBStartingAddress_bits  7
   84666 #define GEN75_3DSTATE_URB_VS_VSURBStartingAddress_bits  6
   84667 #define GEN7_3DSTATE_URB_VS_VSURBStartingAddress_bits  5
   84668 
   84669 static inline uint32_t ATTRIBUTE_PURE
   84670 _3DSTATE_URB_VS_VSURBStartingAddress_bits(const struct gen_device_info *devinfo)
   84671 {
   84672    switch (devinfo->gen) {
   84673    case 10: return 7;
   84674    case 9: return 7;
   84675    case 8: return 7;
   84676    case 7:
   84677       if (devinfo->is_haswell) {
   84678          return 6;
   84679       } else {
   84680          return 5;
   84681       }
   84682    case 6: return 0;
   84683    case 5: return 0;
   84684    case 4:
   84685       if (devinfo->is_g4x) {
   84686          return 0;
   84687       } else {
   84688          return 0;
   84689       }
   84690    default:
   84691       unreachable("Invalid hardware generation");
   84692    }
   84693 }
   84694 
   84695 
   84696 
   84697 #define GEN10_3DSTATE_URB_VS_VSURBStartingAddress_start  57
   84698 #define GEN9_3DSTATE_URB_VS_VSURBStartingAddress_start  57
   84699 #define GEN8_3DSTATE_URB_VS_VSURBStartingAddress_start  57
   84700 #define GEN75_3DSTATE_URB_VS_VSURBStartingAddress_start  57
   84701 #define GEN7_3DSTATE_URB_VS_VSURBStartingAddress_start  57
   84702 
   84703 static inline uint32_t ATTRIBUTE_PURE
   84704 _3DSTATE_URB_VS_VSURBStartingAddress_start(const struct gen_device_info *devinfo)
   84705 {
   84706    switch (devinfo->gen) {
   84707    case 10: return 57;
   84708    case 9: return 57;
   84709    case 8: return 57;
   84710    case 7:
   84711       if (devinfo->is_haswell) {
   84712          return 57;
   84713       } else {
   84714          return 57;
   84715       }
   84716    case 6: return 0;
   84717    case 5: return 0;
   84718    case 4:
   84719       if (devinfo->is_g4x) {
   84720          return 0;
   84721       } else {
   84722          return 0;
   84723       }
   84724    default:
   84725       unreachable("Invalid hardware generation");
   84726    }
   84727 }
   84728 
   84729 
   84730 
   84731 /* 3DSTATE_VERTEX_BUFFERS */
   84732 
   84733 
   84734 
   84735 
   84736 
   84737 /* 3DSTATE_VERTEX_BUFFERS::3D Command Opcode */
   84738 
   84739 
   84740 #define GEN10_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84741 #define GEN9_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84742 #define GEN8_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84743 #define GEN75_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84744 #define GEN7_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84745 #define GEN6_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84746 #define GEN5_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84747 #define GEN45_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84748 #define GEN4_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits  3
   84749 
   84750 static inline uint32_t ATTRIBUTE_PURE
   84751 _3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   84752 {
   84753    switch (devinfo->gen) {
   84754    case 10: return 3;
   84755    case 9: return 3;
   84756    case 8: return 3;
   84757    case 7:
   84758       if (devinfo->is_haswell) {
   84759          return 3;
   84760       } else {
   84761          return 3;
   84762       }
   84763    case 6: return 3;
   84764    case 5: return 3;
   84765    case 4:
   84766       if (devinfo->is_g4x) {
   84767          return 3;
   84768       } else {
   84769          return 3;
   84770       }
   84771    default:
   84772       unreachable("Invalid hardware generation");
   84773    }
   84774 }
   84775 
   84776 
   84777 
   84778 #define GEN10_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84779 #define GEN9_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84780 #define GEN8_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84781 #define GEN75_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84782 #define GEN7_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84783 #define GEN6_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84784 #define GEN5_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84785 #define GEN45_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84786 #define GEN4_3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start  24
   84787 
   84788 static inline uint32_t ATTRIBUTE_PURE
   84789 _3DSTATE_VERTEX_BUFFERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   84790 {
   84791    switch (devinfo->gen) {
   84792    case 10: return 24;
   84793    case 9: return 24;
   84794    case 8: return 24;
   84795    case 7:
   84796       if (devinfo->is_haswell) {
   84797          return 24;
   84798       } else {
   84799          return 24;
   84800       }
   84801    case 6: return 24;
   84802    case 5: return 24;
   84803    case 4:
   84804       if (devinfo->is_g4x) {
   84805          return 24;
   84806       } else {
   84807          return 24;
   84808       }
   84809    default:
   84810       unreachable("Invalid hardware generation");
   84811    }
   84812 }
   84813 
   84814 
   84815 
   84816 /* 3DSTATE_VERTEX_BUFFERS::3D Command Sub Opcode */
   84817 
   84818 
   84819 #define GEN10_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84820 #define GEN9_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84821 #define GEN8_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84822 #define GEN75_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84823 #define GEN7_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84824 #define GEN6_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84825 #define GEN5_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84826 #define GEN45_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84827 #define GEN4_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits  8
   84828 
   84829 static inline uint32_t ATTRIBUTE_PURE
   84830 _3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   84831 {
   84832    switch (devinfo->gen) {
   84833    case 10: return 8;
   84834    case 9: return 8;
   84835    case 8: return 8;
   84836    case 7:
   84837       if (devinfo->is_haswell) {
   84838          return 8;
   84839       } else {
   84840          return 8;
   84841       }
   84842    case 6: return 8;
   84843    case 5: return 8;
   84844    case 4:
   84845       if (devinfo->is_g4x) {
   84846          return 8;
   84847       } else {
   84848          return 8;
   84849       }
   84850    default:
   84851       unreachable("Invalid hardware generation");
   84852    }
   84853 }
   84854 
   84855 
   84856 
   84857 #define GEN10_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84858 #define GEN9_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84859 #define GEN8_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84860 #define GEN75_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84861 #define GEN7_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84862 #define GEN6_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84863 #define GEN5_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84864 #define GEN45_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84865 #define GEN4_3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start  16
   84866 
   84867 static inline uint32_t ATTRIBUTE_PURE
   84868 _3DSTATE_VERTEX_BUFFERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   84869 {
   84870    switch (devinfo->gen) {
   84871    case 10: return 16;
   84872    case 9: return 16;
   84873    case 8: return 16;
   84874    case 7:
   84875       if (devinfo->is_haswell) {
   84876          return 16;
   84877       } else {
   84878          return 16;
   84879       }
   84880    case 6: return 16;
   84881    case 5: return 16;
   84882    case 4:
   84883       if (devinfo->is_g4x) {
   84884          return 16;
   84885       } else {
   84886          return 16;
   84887       }
   84888    default:
   84889       unreachable("Invalid hardware generation");
   84890    }
   84891 }
   84892 
   84893 
   84894 
   84895 /* 3DSTATE_VERTEX_BUFFERS::Command SubType */
   84896 
   84897 
   84898 #define GEN10_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84899 #define GEN9_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84900 #define GEN8_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84901 #define GEN75_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84902 #define GEN7_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84903 #define GEN6_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84904 #define GEN5_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84905 #define GEN45_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84906 #define GEN4_3DSTATE_VERTEX_BUFFERS_CommandSubType_bits  2
   84907 
   84908 static inline uint32_t ATTRIBUTE_PURE
   84909 _3DSTATE_VERTEX_BUFFERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   84910 {
   84911    switch (devinfo->gen) {
   84912    case 10: return 2;
   84913    case 9: return 2;
   84914    case 8: return 2;
   84915    case 7:
   84916       if (devinfo->is_haswell) {
   84917          return 2;
   84918       } else {
   84919          return 2;
   84920       }
   84921    case 6: return 2;
   84922    case 5: return 2;
   84923    case 4:
   84924       if (devinfo->is_g4x) {
   84925          return 2;
   84926       } else {
   84927          return 2;
   84928       }
   84929    default:
   84930       unreachable("Invalid hardware generation");
   84931    }
   84932 }
   84933 
   84934 
   84935 
   84936 #define GEN10_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84937 #define GEN9_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84938 #define GEN8_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84939 #define GEN75_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84940 #define GEN7_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84941 #define GEN6_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84942 #define GEN5_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84943 #define GEN45_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84944 #define GEN4_3DSTATE_VERTEX_BUFFERS_CommandSubType_start  27
   84945 
   84946 static inline uint32_t ATTRIBUTE_PURE
   84947 _3DSTATE_VERTEX_BUFFERS_CommandSubType_start(const struct gen_device_info *devinfo)
   84948 {
   84949    switch (devinfo->gen) {
   84950    case 10: return 27;
   84951    case 9: return 27;
   84952    case 8: return 27;
   84953    case 7:
   84954       if (devinfo->is_haswell) {
   84955          return 27;
   84956       } else {
   84957          return 27;
   84958       }
   84959    case 6: return 27;
   84960    case 5: return 27;
   84961    case 4:
   84962       if (devinfo->is_g4x) {
   84963          return 27;
   84964       } else {
   84965          return 27;
   84966       }
   84967    default:
   84968       unreachable("Invalid hardware generation");
   84969    }
   84970 }
   84971 
   84972 
   84973 
   84974 /* 3DSTATE_VERTEX_BUFFERS::Command Type */
   84975 
   84976 
   84977 #define GEN10_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84978 #define GEN9_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84979 #define GEN8_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84980 #define GEN75_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84981 #define GEN7_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84982 #define GEN6_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84983 #define GEN5_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84984 #define GEN45_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84985 #define GEN4_3DSTATE_VERTEX_BUFFERS_CommandType_bits  3
   84986 
   84987 static inline uint32_t ATTRIBUTE_PURE
   84988 _3DSTATE_VERTEX_BUFFERS_CommandType_bits(const struct gen_device_info *devinfo)
   84989 {
   84990    switch (devinfo->gen) {
   84991    case 10: return 3;
   84992    case 9: return 3;
   84993    case 8: return 3;
   84994    case 7:
   84995       if (devinfo->is_haswell) {
   84996          return 3;
   84997       } else {
   84998          return 3;
   84999       }
   85000    case 6: return 3;
   85001    case 5: return 3;
   85002    case 4:
   85003       if (devinfo->is_g4x) {
   85004          return 3;
   85005       } else {
   85006          return 3;
   85007       }
   85008    default:
   85009       unreachable("Invalid hardware generation");
   85010    }
   85011 }
   85012 
   85013 
   85014 
   85015 #define GEN10_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85016 #define GEN9_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85017 #define GEN8_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85018 #define GEN75_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85019 #define GEN7_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85020 #define GEN6_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85021 #define GEN5_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85022 #define GEN45_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85023 #define GEN4_3DSTATE_VERTEX_BUFFERS_CommandType_start  29
   85024 
   85025 static inline uint32_t ATTRIBUTE_PURE
   85026 _3DSTATE_VERTEX_BUFFERS_CommandType_start(const struct gen_device_info *devinfo)
   85027 {
   85028    switch (devinfo->gen) {
   85029    case 10: return 29;
   85030    case 9: return 29;
   85031    case 8: return 29;
   85032    case 7:
   85033       if (devinfo->is_haswell) {
   85034          return 29;
   85035       } else {
   85036          return 29;
   85037       }
   85038    case 6: return 29;
   85039    case 5: return 29;
   85040    case 4:
   85041       if (devinfo->is_g4x) {
   85042          return 29;
   85043       } else {
   85044          return 29;
   85045       }
   85046    default:
   85047       unreachable("Invalid hardware generation");
   85048    }
   85049 }
   85050 
   85051 
   85052 
   85053 /* 3DSTATE_VERTEX_BUFFERS::DWord Length */
   85054 
   85055 
   85056 #define GEN10_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85057 #define GEN9_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85058 #define GEN8_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85059 #define GEN75_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85060 #define GEN7_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85061 #define GEN6_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85062 #define GEN5_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85063 #define GEN45_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85064 #define GEN4_3DSTATE_VERTEX_BUFFERS_DWordLength_bits  8
   85065 
   85066 static inline uint32_t ATTRIBUTE_PURE
   85067 _3DSTATE_VERTEX_BUFFERS_DWordLength_bits(const struct gen_device_info *devinfo)
   85068 {
   85069    switch (devinfo->gen) {
   85070    case 10: return 8;
   85071    case 9: return 8;
   85072    case 8: return 8;
   85073    case 7:
   85074       if (devinfo->is_haswell) {
   85075          return 8;
   85076       } else {
   85077          return 8;
   85078       }
   85079    case 6: return 8;
   85080    case 5: return 8;
   85081    case 4:
   85082       if (devinfo->is_g4x) {
   85083          return 8;
   85084       } else {
   85085          return 8;
   85086       }
   85087    default:
   85088       unreachable("Invalid hardware generation");
   85089    }
   85090 }
   85091 
   85092 
   85093 
   85094 #define GEN10_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85095 #define GEN9_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85096 #define GEN8_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85097 #define GEN75_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85098 #define GEN7_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85099 #define GEN6_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85100 #define GEN5_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85101 #define GEN45_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85102 #define GEN4_3DSTATE_VERTEX_BUFFERS_DWordLength_start  0
   85103 
   85104 static inline uint32_t ATTRIBUTE_PURE
   85105 _3DSTATE_VERTEX_BUFFERS_DWordLength_start(const struct gen_device_info *devinfo)
   85106 {
   85107    switch (devinfo->gen) {
   85108    case 10: return 0;
   85109    case 9: return 0;
   85110    case 8: return 0;
   85111    case 7:
   85112       if (devinfo->is_haswell) {
   85113          return 0;
   85114       } else {
   85115          return 0;
   85116       }
   85117    case 6: return 0;
   85118    case 5: return 0;
   85119    case 4:
   85120       if (devinfo->is_g4x) {
   85121          return 0;
   85122       } else {
   85123          return 0;
   85124       }
   85125    default:
   85126       unreachable("Invalid hardware generation");
   85127    }
   85128 }
   85129 
   85130 
   85131 
   85132 /* 3DSTATE_VERTEX_BUFFERS::Vertex Buffer State */
   85133 
   85134 
   85135 #define GEN10_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85136 #define GEN9_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85137 #define GEN8_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85138 #define GEN75_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85139 #define GEN7_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85140 #define GEN6_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85141 #define GEN5_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85142 #define GEN45_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85143 #define GEN4_3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits  128
   85144 
   85145 static inline uint32_t ATTRIBUTE_PURE
   85146 _3DSTATE_VERTEX_BUFFERS_VertexBufferState_bits(const struct gen_device_info *devinfo)
   85147 {
   85148    switch (devinfo->gen) {
   85149    case 10: return 128;
   85150    case 9: return 128;
   85151    case 8: return 128;
   85152    case 7:
   85153       if (devinfo->is_haswell) {
   85154          return 128;
   85155       } else {
   85156          return 128;
   85157       }
   85158    case 6: return 128;
   85159    case 5: return 128;
   85160    case 4:
   85161       if (devinfo->is_g4x) {
   85162          return 128;
   85163       } else {
   85164          return 128;
   85165       }
   85166    default:
   85167       unreachable("Invalid hardware generation");
   85168    }
   85169 }
   85170 
   85171 
   85172 
   85173 #define GEN10_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85174 #define GEN9_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85175 #define GEN8_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85176 #define GEN75_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85177 #define GEN7_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85178 #define GEN6_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85179 #define GEN5_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85180 #define GEN45_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85181 #define GEN4_3DSTATE_VERTEX_BUFFERS_VertexBufferState_start  0
   85182 
   85183 static inline uint32_t ATTRIBUTE_PURE
   85184 _3DSTATE_VERTEX_BUFFERS_VertexBufferState_start(const struct gen_device_info *devinfo)
   85185 {
   85186    switch (devinfo->gen) {
   85187    case 10: return 0;
   85188    case 9: return 0;
   85189    case 8: return 0;
   85190    case 7:
   85191       if (devinfo->is_haswell) {
   85192          return 0;
   85193       } else {
   85194          return 0;
   85195       }
   85196    case 6: return 0;
   85197    case 5: return 0;
   85198    case 4:
   85199       if (devinfo->is_g4x) {
   85200          return 0;
   85201       } else {
   85202          return 0;
   85203       }
   85204    default:
   85205       unreachable("Invalid hardware generation");
   85206    }
   85207 }
   85208 
   85209 
   85210 
   85211 /* 3DSTATE_VERTEX_ELEMENTS */
   85212 
   85213 
   85214 
   85215 
   85216 
   85217 /* 3DSTATE_VERTEX_ELEMENTS::3D Command Opcode */
   85218 
   85219 
   85220 #define GEN10_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85221 #define GEN9_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85222 #define GEN8_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85223 #define GEN75_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85224 #define GEN7_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85225 #define GEN6_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85226 #define GEN5_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85227 #define GEN45_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85228 #define GEN4_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits  3
   85229 
   85230 static inline uint32_t ATTRIBUTE_PURE
   85231 _3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   85232 {
   85233    switch (devinfo->gen) {
   85234    case 10: return 3;
   85235    case 9: return 3;
   85236    case 8: return 3;
   85237    case 7:
   85238       if (devinfo->is_haswell) {
   85239          return 3;
   85240       } else {
   85241          return 3;
   85242       }
   85243    case 6: return 3;
   85244    case 5: return 3;
   85245    case 4:
   85246       if (devinfo->is_g4x) {
   85247          return 3;
   85248       } else {
   85249          return 3;
   85250       }
   85251    default:
   85252       unreachable("Invalid hardware generation");
   85253    }
   85254 }
   85255 
   85256 
   85257 
   85258 #define GEN10_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85259 #define GEN9_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85260 #define GEN8_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85261 #define GEN75_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85262 #define GEN7_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85263 #define GEN6_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85264 #define GEN5_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85265 #define GEN45_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85266 #define GEN4_3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start  24
   85267 
   85268 static inline uint32_t ATTRIBUTE_PURE
   85269 _3DSTATE_VERTEX_ELEMENTS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   85270 {
   85271    switch (devinfo->gen) {
   85272    case 10: return 24;
   85273    case 9: return 24;
   85274    case 8: return 24;
   85275    case 7:
   85276       if (devinfo->is_haswell) {
   85277          return 24;
   85278       } else {
   85279          return 24;
   85280       }
   85281    case 6: return 24;
   85282    case 5: return 24;
   85283    case 4:
   85284       if (devinfo->is_g4x) {
   85285          return 24;
   85286       } else {
   85287          return 24;
   85288       }
   85289    default:
   85290       unreachable("Invalid hardware generation");
   85291    }
   85292 }
   85293 
   85294 
   85295 
   85296 /* 3DSTATE_VERTEX_ELEMENTS::3D Command Sub Opcode */
   85297 
   85298 
   85299 #define GEN10_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85300 #define GEN9_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85301 #define GEN8_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85302 #define GEN75_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85303 #define GEN7_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85304 #define GEN6_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85305 #define GEN5_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85306 #define GEN45_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85307 #define GEN4_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits  8
   85308 
   85309 static inline uint32_t ATTRIBUTE_PURE
   85310 _3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   85311 {
   85312    switch (devinfo->gen) {
   85313    case 10: return 8;
   85314    case 9: return 8;
   85315    case 8: return 8;
   85316    case 7:
   85317       if (devinfo->is_haswell) {
   85318          return 8;
   85319       } else {
   85320          return 8;
   85321       }
   85322    case 6: return 8;
   85323    case 5: return 8;
   85324    case 4:
   85325       if (devinfo->is_g4x) {
   85326          return 8;
   85327       } else {
   85328          return 8;
   85329       }
   85330    default:
   85331       unreachable("Invalid hardware generation");
   85332    }
   85333 }
   85334 
   85335 
   85336 
   85337 #define GEN10_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85338 #define GEN9_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85339 #define GEN8_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85340 #define GEN75_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85341 #define GEN7_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85342 #define GEN6_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85343 #define GEN5_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85344 #define GEN45_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85345 #define GEN4_3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start  16
   85346 
   85347 static inline uint32_t ATTRIBUTE_PURE
   85348 _3DSTATE_VERTEX_ELEMENTS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   85349 {
   85350    switch (devinfo->gen) {
   85351    case 10: return 16;
   85352    case 9: return 16;
   85353    case 8: return 16;
   85354    case 7:
   85355       if (devinfo->is_haswell) {
   85356          return 16;
   85357       } else {
   85358          return 16;
   85359       }
   85360    case 6: return 16;
   85361    case 5: return 16;
   85362    case 4:
   85363       if (devinfo->is_g4x) {
   85364          return 16;
   85365       } else {
   85366          return 16;
   85367       }
   85368    default:
   85369       unreachable("Invalid hardware generation");
   85370    }
   85371 }
   85372 
   85373 
   85374 
   85375 /* 3DSTATE_VERTEX_ELEMENTS::Command SubType */
   85376 
   85377 
   85378 #define GEN10_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85379 #define GEN9_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85380 #define GEN8_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85381 #define GEN75_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85382 #define GEN7_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85383 #define GEN6_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85384 #define GEN5_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85385 #define GEN45_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85386 #define GEN4_3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits  2
   85387 
   85388 static inline uint32_t ATTRIBUTE_PURE
   85389 _3DSTATE_VERTEX_ELEMENTS_CommandSubType_bits(const struct gen_device_info *devinfo)
   85390 {
   85391    switch (devinfo->gen) {
   85392    case 10: return 2;
   85393    case 9: return 2;
   85394    case 8: return 2;
   85395    case 7:
   85396       if (devinfo->is_haswell) {
   85397          return 2;
   85398       } else {
   85399          return 2;
   85400       }
   85401    case 6: return 2;
   85402    case 5: return 2;
   85403    case 4:
   85404       if (devinfo->is_g4x) {
   85405          return 2;
   85406       } else {
   85407          return 2;
   85408       }
   85409    default:
   85410       unreachable("Invalid hardware generation");
   85411    }
   85412 }
   85413 
   85414 
   85415 
   85416 #define GEN10_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85417 #define GEN9_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85418 #define GEN8_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85419 #define GEN75_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85420 #define GEN7_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85421 #define GEN6_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85422 #define GEN5_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85423 #define GEN45_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85424 #define GEN4_3DSTATE_VERTEX_ELEMENTS_CommandSubType_start  27
   85425 
   85426 static inline uint32_t ATTRIBUTE_PURE
   85427 _3DSTATE_VERTEX_ELEMENTS_CommandSubType_start(const struct gen_device_info *devinfo)
   85428 {
   85429    switch (devinfo->gen) {
   85430    case 10: return 27;
   85431    case 9: return 27;
   85432    case 8: return 27;
   85433    case 7:
   85434       if (devinfo->is_haswell) {
   85435          return 27;
   85436       } else {
   85437          return 27;
   85438       }
   85439    case 6: return 27;
   85440    case 5: return 27;
   85441    case 4:
   85442       if (devinfo->is_g4x) {
   85443          return 27;
   85444       } else {
   85445          return 27;
   85446       }
   85447    default:
   85448       unreachable("Invalid hardware generation");
   85449    }
   85450 }
   85451 
   85452 
   85453 
   85454 /* 3DSTATE_VERTEX_ELEMENTS::Command Type */
   85455 
   85456 
   85457 #define GEN10_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85458 #define GEN9_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85459 #define GEN8_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85460 #define GEN75_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85461 #define GEN7_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85462 #define GEN6_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85463 #define GEN5_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85464 #define GEN45_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85465 #define GEN4_3DSTATE_VERTEX_ELEMENTS_CommandType_bits  3
   85466 
   85467 static inline uint32_t ATTRIBUTE_PURE
   85468 _3DSTATE_VERTEX_ELEMENTS_CommandType_bits(const struct gen_device_info *devinfo)
   85469 {
   85470    switch (devinfo->gen) {
   85471    case 10: return 3;
   85472    case 9: return 3;
   85473    case 8: return 3;
   85474    case 7:
   85475       if (devinfo->is_haswell) {
   85476          return 3;
   85477       } else {
   85478          return 3;
   85479       }
   85480    case 6: return 3;
   85481    case 5: return 3;
   85482    case 4:
   85483       if (devinfo->is_g4x) {
   85484          return 3;
   85485       } else {
   85486          return 3;
   85487       }
   85488    default:
   85489       unreachable("Invalid hardware generation");
   85490    }
   85491 }
   85492 
   85493 
   85494 
   85495 #define GEN10_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85496 #define GEN9_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85497 #define GEN8_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85498 #define GEN75_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85499 #define GEN7_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85500 #define GEN6_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85501 #define GEN5_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85502 #define GEN45_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85503 #define GEN4_3DSTATE_VERTEX_ELEMENTS_CommandType_start  29
   85504 
   85505 static inline uint32_t ATTRIBUTE_PURE
   85506 _3DSTATE_VERTEX_ELEMENTS_CommandType_start(const struct gen_device_info *devinfo)
   85507 {
   85508    switch (devinfo->gen) {
   85509    case 10: return 29;
   85510    case 9: return 29;
   85511    case 8: return 29;
   85512    case 7:
   85513       if (devinfo->is_haswell) {
   85514          return 29;
   85515       } else {
   85516          return 29;
   85517       }
   85518    case 6: return 29;
   85519    case 5: return 29;
   85520    case 4:
   85521       if (devinfo->is_g4x) {
   85522          return 29;
   85523       } else {
   85524          return 29;
   85525       }
   85526    default:
   85527       unreachable("Invalid hardware generation");
   85528    }
   85529 }
   85530 
   85531 
   85532 
   85533 /* 3DSTATE_VERTEX_ELEMENTS::DWord Length */
   85534 
   85535 
   85536 #define GEN10_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85537 #define GEN9_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85538 #define GEN8_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85539 #define GEN75_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85540 #define GEN7_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85541 #define GEN6_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85542 #define GEN5_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85543 #define GEN45_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85544 #define GEN4_3DSTATE_VERTEX_ELEMENTS_DWordLength_bits  8
   85545 
   85546 static inline uint32_t ATTRIBUTE_PURE
   85547 _3DSTATE_VERTEX_ELEMENTS_DWordLength_bits(const struct gen_device_info *devinfo)
   85548 {
   85549    switch (devinfo->gen) {
   85550    case 10: return 8;
   85551    case 9: return 8;
   85552    case 8: return 8;
   85553    case 7:
   85554       if (devinfo->is_haswell) {
   85555          return 8;
   85556       } else {
   85557          return 8;
   85558       }
   85559    case 6: return 8;
   85560    case 5: return 8;
   85561    case 4:
   85562       if (devinfo->is_g4x) {
   85563          return 8;
   85564       } else {
   85565          return 8;
   85566       }
   85567    default:
   85568       unreachable("Invalid hardware generation");
   85569    }
   85570 }
   85571 
   85572 
   85573 
   85574 #define GEN10_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85575 #define GEN9_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85576 #define GEN8_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85577 #define GEN75_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85578 #define GEN7_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85579 #define GEN6_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85580 #define GEN5_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85581 #define GEN45_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85582 #define GEN4_3DSTATE_VERTEX_ELEMENTS_DWordLength_start  0
   85583 
   85584 static inline uint32_t ATTRIBUTE_PURE
   85585 _3DSTATE_VERTEX_ELEMENTS_DWordLength_start(const struct gen_device_info *devinfo)
   85586 {
   85587    switch (devinfo->gen) {
   85588    case 10: return 0;
   85589    case 9: return 0;
   85590    case 8: return 0;
   85591    case 7:
   85592       if (devinfo->is_haswell) {
   85593          return 0;
   85594       } else {
   85595          return 0;
   85596       }
   85597    case 6: return 0;
   85598    case 5: return 0;
   85599    case 4:
   85600       if (devinfo->is_g4x) {
   85601          return 0;
   85602       } else {
   85603          return 0;
   85604       }
   85605    default:
   85606       unreachable("Invalid hardware generation");
   85607    }
   85608 }
   85609 
   85610 
   85611 
   85612 /* 3DSTATE_VERTEX_ELEMENTS::Element */
   85613 
   85614 
   85615 #define GEN10_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85616 #define GEN9_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85617 #define GEN8_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85618 #define GEN75_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85619 #define GEN7_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85620 #define GEN6_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85621 #define GEN5_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85622 #define GEN45_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85623 #define GEN4_3DSTATE_VERTEX_ELEMENTS_Element_bits  64
   85624 
   85625 static inline uint32_t ATTRIBUTE_PURE
   85626 _3DSTATE_VERTEX_ELEMENTS_Element_bits(const struct gen_device_info *devinfo)
   85627 {
   85628    switch (devinfo->gen) {
   85629    case 10: return 64;
   85630    case 9: return 64;
   85631    case 8: return 64;
   85632    case 7:
   85633       if (devinfo->is_haswell) {
   85634          return 64;
   85635       } else {
   85636          return 64;
   85637       }
   85638    case 6: return 64;
   85639    case 5: return 64;
   85640    case 4:
   85641       if (devinfo->is_g4x) {
   85642          return 64;
   85643       } else {
   85644          return 64;
   85645       }
   85646    default:
   85647       unreachable("Invalid hardware generation");
   85648    }
   85649 }
   85650 
   85651 
   85652 
   85653 #define GEN10_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85654 #define GEN9_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85655 #define GEN8_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85656 #define GEN75_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85657 #define GEN7_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85658 #define GEN6_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85659 #define GEN5_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85660 #define GEN45_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85661 #define GEN4_3DSTATE_VERTEX_ELEMENTS_Element_start  0
   85662 
   85663 static inline uint32_t ATTRIBUTE_PURE
   85664 _3DSTATE_VERTEX_ELEMENTS_Element_start(const struct gen_device_info *devinfo)
   85665 {
   85666    switch (devinfo->gen) {
   85667    case 10: return 0;
   85668    case 9: return 0;
   85669    case 8: return 0;
   85670    case 7:
   85671       if (devinfo->is_haswell) {
   85672          return 0;
   85673       } else {
   85674          return 0;
   85675       }
   85676    case 6: return 0;
   85677    case 5: return 0;
   85678    case 4:
   85679       if (devinfo->is_g4x) {
   85680          return 0;
   85681       } else {
   85682          return 0;
   85683       }
   85684    default:
   85685       unreachable("Invalid hardware generation");
   85686    }
   85687 }
   85688 
   85689 
   85690 
   85691 /* 3DSTATE_VF */
   85692 
   85693 
   85694 #define GEN10_3DSTATE_VF_length  2
   85695 #define GEN9_3DSTATE_VF_length  2
   85696 #define GEN8_3DSTATE_VF_length  2
   85697 #define GEN75_3DSTATE_VF_length  2
   85698 
   85699 static inline uint32_t ATTRIBUTE_PURE
   85700 _3DSTATE_VF_length(const struct gen_device_info *devinfo)
   85701 {
   85702    switch (devinfo->gen) {
   85703    case 10: return 2;
   85704    case 9: return 2;
   85705    case 8: return 2;
   85706    case 7:
   85707       if (devinfo->is_haswell) {
   85708          return 2;
   85709       } else {
   85710          return 0;
   85711       }
   85712    case 6: return 0;
   85713    case 5: return 0;
   85714    case 4:
   85715       if (devinfo->is_g4x) {
   85716          return 0;
   85717       } else {
   85718          return 0;
   85719       }
   85720    default:
   85721       unreachable("Invalid hardware generation");
   85722    }
   85723 }
   85724 
   85725 
   85726 
   85727 /* 3DSTATE_VF::3D Command Opcode */
   85728 
   85729 
   85730 #define GEN10_3DSTATE_VF_3DCommandOpcode_bits  3
   85731 #define GEN9_3DSTATE_VF_3DCommandOpcode_bits  3
   85732 #define GEN8_3DSTATE_VF_3DCommandOpcode_bits  3
   85733 #define GEN75_3DSTATE_VF_3DCommandOpcode_bits  3
   85734 
   85735 static inline uint32_t ATTRIBUTE_PURE
   85736 _3DSTATE_VF_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   85737 {
   85738    switch (devinfo->gen) {
   85739    case 10: return 3;
   85740    case 9: return 3;
   85741    case 8: return 3;
   85742    case 7:
   85743       if (devinfo->is_haswell) {
   85744          return 3;
   85745       } else {
   85746          return 0;
   85747       }
   85748    case 6: return 0;
   85749    case 5: return 0;
   85750    case 4:
   85751       if (devinfo->is_g4x) {
   85752          return 0;
   85753       } else {
   85754          return 0;
   85755       }
   85756    default:
   85757       unreachable("Invalid hardware generation");
   85758    }
   85759 }
   85760 
   85761 
   85762 
   85763 #define GEN10_3DSTATE_VF_3DCommandOpcode_start  24
   85764 #define GEN9_3DSTATE_VF_3DCommandOpcode_start  24
   85765 #define GEN8_3DSTATE_VF_3DCommandOpcode_start  24
   85766 #define GEN75_3DSTATE_VF_3DCommandOpcode_start  24
   85767 
   85768 static inline uint32_t ATTRIBUTE_PURE
   85769 _3DSTATE_VF_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   85770 {
   85771    switch (devinfo->gen) {
   85772    case 10: return 24;
   85773    case 9: return 24;
   85774    case 8: return 24;
   85775    case 7:
   85776       if (devinfo->is_haswell) {
   85777          return 24;
   85778       } else {
   85779          return 0;
   85780       }
   85781    case 6: return 0;
   85782    case 5: return 0;
   85783    case 4:
   85784       if (devinfo->is_g4x) {
   85785          return 0;
   85786       } else {
   85787          return 0;
   85788       }
   85789    default:
   85790       unreachable("Invalid hardware generation");
   85791    }
   85792 }
   85793 
   85794 
   85795 
   85796 /* 3DSTATE_VF::3D Command Sub Opcode */
   85797 
   85798 
   85799 #define GEN10_3DSTATE_VF_3DCommandSubOpcode_bits  8
   85800 #define GEN9_3DSTATE_VF_3DCommandSubOpcode_bits  8
   85801 #define GEN8_3DSTATE_VF_3DCommandSubOpcode_bits  8
   85802 #define GEN75_3DSTATE_VF_3DCommandSubOpcode_bits  8
   85803 
   85804 static inline uint32_t ATTRIBUTE_PURE
   85805 _3DSTATE_VF_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   85806 {
   85807    switch (devinfo->gen) {
   85808    case 10: return 8;
   85809    case 9: return 8;
   85810    case 8: return 8;
   85811    case 7:
   85812       if (devinfo->is_haswell) {
   85813          return 8;
   85814       } else {
   85815          return 0;
   85816       }
   85817    case 6: return 0;
   85818    case 5: return 0;
   85819    case 4:
   85820       if (devinfo->is_g4x) {
   85821          return 0;
   85822       } else {
   85823          return 0;
   85824       }
   85825    default:
   85826       unreachable("Invalid hardware generation");
   85827    }
   85828 }
   85829 
   85830 
   85831 
   85832 #define GEN10_3DSTATE_VF_3DCommandSubOpcode_start  16
   85833 #define GEN9_3DSTATE_VF_3DCommandSubOpcode_start  16
   85834 #define GEN8_3DSTATE_VF_3DCommandSubOpcode_start  16
   85835 #define GEN75_3DSTATE_VF_3DCommandSubOpcode_start  16
   85836 
   85837 static inline uint32_t ATTRIBUTE_PURE
   85838 _3DSTATE_VF_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   85839 {
   85840    switch (devinfo->gen) {
   85841    case 10: return 16;
   85842    case 9: return 16;
   85843    case 8: return 16;
   85844    case 7:
   85845       if (devinfo->is_haswell) {
   85846          return 16;
   85847       } else {
   85848          return 0;
   85849       }
   85850    case 6: return 0;
   85851    case 5: return 0;
   85852    case 4:
   85853       if (devinfo->is_g4x) {
   85854          return 0;
   85855       } else {
   85856          return 0;
   85857       }
   85858    default:
   85859       unreachable("Invalid hardware generation");
   85860    }
   85861 }
   85862 
   85863 
   85864 
   85865 /* 3DSTATE_VF::Command SubType */
   85866 
   85867 
   85868 #define GEN10_3DSTATE_VF_CommandSubType_bits  2
   85869 #define GEN9_3DSTATE_VF_CommandSubType_bits  2
   85870 #define GEN8_3DSTATE_VF_CommandSubType_bits  2
   85871 #define GEN75_3DSTATE_VF_CommandSubType_bits  2
   85872 
   85873 static inline uint32_t ATTRIBUTE_PURE
   85874 _3DSTATE_VF_CommandSubType_bits(const struct gen_device_info *devinfo)
   85875 {
   85876    switch (devinfo->gen) {
   85877    case 10: return 2;
   85878    case 9: return 2;
   85879    case 8: return 2;
   85880    case 7:
   85881       if (devinfo->is_haswell) {
   85882          return 2;
   85883       } else {
   85884          return 0;
   85885       }
   85886    case 6: return 0;
   85887    case 5: return 0;
   85888    case 4:
   85889       if (devinfo->is_g4x) {
   85890          return 0;
   85891       } else {
   85892          return 0;
   85893       }
   85894    default:
   85895       unreachable("Invalid hardware generation");
   85896    }
   85897 }
   85898 
   85899 
   85900 
   85901 #define GEN10_3DSTATE_VF_CommandSubType_start  27
   85902 #define GEN9_3DSTATE_VF_CommandSubType_start  27
   85903 #define GEN8_3DSTATE_VF_CommandSubType_start  27
   85904 #define GEN75_3DSTATE_VF_CommandSubType_start  27
   85905 
   85906 static inline uint32_t ATTRIBUTE_PURE
   85907 _3DSTATE_VF_CommandSubType_start(const struct gen_device_info *devinfo)
   85908 {
   85909    switch (devinfo->gen) {
   85910    case 10: return 27;
   85911    case 9: return 27;
   85912    case 8: return 27;
   85913    case 7:
   85914       if (devinfo->is_haswell) {
   85915          return 27;
   85916       } else {
   85917          return 0;
   85918       }
   85919    case 6: return 0;
   85920    case 5: return 0;
   85921    case 4:
   85922       if (devinfo->is_g4x) {
   85923          return 0;
   85924       } else {
   85925          return 0;
   85926       }
   85927    default:
   85928       unreachable("Invalid hardware generation");
   85929    }
   85930 }
   85931 
   85932 
   85933 
   85934 /* 3DSTATE_VF::Command Type */
   85935 
   85936 
   85937 #define GEN10_3DSTATE_VF_CommandType_bits  3
   85938 #define GEN9_3DSTATE_VF_CommandType_bits  3
   85939 #define GEN8_3DSTATE_VF_CommandType_bits  3
   85940 #define GEN75_3DSTATE_VF_CommandType_bits  3
   85941 
   85942 static inline uint32_t ATTRIBUTE_PURE
   85943 _3DSTATE_VF_CommandType_bits(const struct gen_device_info *devinfo)
   85944 {
   85945    switch (devinfo->gen) {
   85946    case 10: return 3;
   85947    case 9: return 3;
   85948    case 8: return 3;
   85949    case 7:
   85950       if (devinfo->is_haswell) {
   85951          return 3;
   85952       } else {
   85953          return 0;
   85954       }
   85955    case 6: return 0;
   85956    case 5: return 0;
   85957    case 4:
   85958       if (devinfo->is_g4x) {
   85959          return 0;
   85960       } else {
   85961          return 0;
   85962       }
   85963    default:
   85964       unreachable("Invalid hardware generation");
   85965    }
   85966 }
   85967 
   85968 
   85969 
   85970 #define GEN10_3DSTATE_VF_CommandType_start  29
   85971 #define GEN9_3DSTATE_VF_CommandType_start  29
   85972 #define GEN8_3DSTATE_VF_CommandType_start  29
   85973 #define GEN75_3DSTATE_VF_CommandType_start  29
   85974 
   85975 static inline uint32_t ATTRIBUTE_PURE
   85976 _3DSTATE_VF_CommandType_start(const struct gen_device_info *devinfo)
   85977 {
   85978    switch (devinfo->gen) {
   85979    case 10: return 29;
   85980    case 9: return 29;
   85981    case 8: return 29;
   85982    case 7:
   85983       if (devinfo->is_haswell) {
   85984          return 29;
   85985       } else {
   85986          return 0;
   85987       }
   85988    case 6: return 0;
   85989    case 5: return 0;
   85990    case 4:
   85991       if (devinfo->is_g4x) {
   85992          return 0;
   85993       } else {
   85994          return 0;
   85995       }
   85996    default:
   85997       unreachable("Invalid hardware generation");
   85998    }
   85999 }
   86000 
   86001 
   86002 
   86003 /* 3DSTATE_VF::Component Packing Enable */
   86004 
   86005 
   86006 #define GEN10_3DSTATE_VF_ComponentPackingEnable_bits  1
   86007 #define GEN9_3DSTATE_VF_ComponentPackingEnable_bits  1
   86008 
   86009 static inline uint32_t ATTRIBUTE_PURE
   86010 _3DSTATE_VF_ComponentPackingEnable_bits(const struct gen_device_info *devinfo)
   86011 {
   86012    switch (devinfo->gen) {
   86013    case 10: return 1;
   86014    case 9: return 1;
   86015    case 8: return 0;
   86016    case 7:
   86017       if (devinfo->is_haswell) {
   86018          return 0;
   86019       } else {
   86020          return 0;
   86021       }
   86022    case 6: return 0;
   86023    case 5: return 0;
   86024    case 4:
   86025       if (devinfo->is_g4x) {
   86026          return 0;
   86027       } else {
   86028          return 0;
   86029       }
   86030    default:
   86031       unreachable("Invalid hardware generation");
   86032    }
   86033 }
   86034 
   86035 
   86036 
   86037 #define GEN10_3DSTATE_VF_ComponentPackingEnable_start  9
   86038 #define GEN9_3DSTATE_VF_ComponentPackingEnable_start  9
   86039 
   86040 static inline uint32_t ATTRIBUTE_PURE
   86041 _3DSTATE_VF_ComponentPackingEnable_start(const struct gen_device_info *devinfo)
   86042 {
   86043    switch (devinfo->gen) {
   86044    case 10: return 9;
   86045    case 9: return 9;
   86046    case 8: return 0;
   86047    case 7:
   86048       if (devinfo->is_haswell) {
   86049          return 0;
   86050       } else {
   86051          return 0;
   86052       }
   86053    case 6: return 0;
   86054    case 5: return 0;
   86055    case 4:
   86056       if (devinfo->is_g4x) {
   86057          return 0;
   86058       } else {
   86059          return 0;
   86060       }
   86061    default:
   86062       unreachable("Invalid hardware generation");
   86063    }
   86064 }
   86065 
   86066 
   86067 
   86068 /* 3DSTATE_VF::Cut Index */
   86069 
   86070 
   86071 #define GEN10_3DSTATE_VF_CutIndex_bits  32
   86072 #define GEN9_3DSTATE_VF_CutIndex_bits  32
   86073 #define GEN8_3DSTATE_VF_CutIndex_bits  32
   86074 #define GEN75_3DSTATE_VF_CutIndex_bits  32
   86075 
   86076 static inline uint32_t ATTRIBUTE_PURE
   86077 _3DSTATE_VF_CutIndex_bits(const struct gen_device_info *devinfo)
   86078 {
   86079    switch (devinfo->gen) {
   86080    case 10: return 32;
   86081    case 9: return 32;
   86082    case 8: return 32;
   86083    case 7:
   86084       if (devinfo->is_haswell) {
   86085          return 32;
   86086       } else {
   86087          return 0;
   86088       }
   86089    case 6: return 0;
   86090    case 5: return 0;
   86091    case 4:
   86092       if (devinfo->is_g4x) {
   86093          return 0;
   86094       } else {
   86095          return 0;
   86096       }
   86097    default:
   86098       unreachable("Invalid hardware generation");
   86099    }
   86100 }
   86101 
   86102 
   86103 
   86104 #define GEN10_3DSTATE_VF_CutIndex_start  32
   86105 #define GEN9_3DSTATE_VF_CutIndex_start  32
   86106 #define GEN8_3DSTATE_VF_CutIndex_start  32
   86107 #define GEN75_3DSTATE_VF_CutIndex_start  32
   86108 
   86109 static inline uint32_t ATTRIBUTE_PURE
   86110 _3DSTATE_VF_CutIndex_start(const struct gen_device_info *devinfo)
   86111 {
   86112    switch (devinfo->gen) {
   86113    case 10: return 32;
   86114    case 9: return 32;
   86115    case 8: return 32;
   86116    case 7:
   86117       if (devinfo->is_haswell) {
   86118          return 32;
   86119       } else {
   86120          return 0;
   86121       }
   86122    case 6: return 0;
   86123    case 5: return 0;
   86124    case 4:
   86125       if (devinfo->is_g4x) {
   86126          return 0;
   86127       } else {
   86128          return 0;
   86129       }
   86130    default:
   86131       unreachable("Invalid hardware generation");
   86132    }
   86133 }
   86134 
   86135 
   86136 
   86137 /* 3DSTATE_VF::DWord Length */
   86138 
   86139 
   86140 #define GEN10_3DSTATE_VF_DWordLength_bits  8
   86141 #define GEN9_3DSTATE_VF_DWordLength_bits  8
   86142 #define GEN8_3DSTATE_VF_DWordLength_bits  8
   86143 #define GEN75_3DSTATE_VF_DWordLength_bits  8
   86144 
   86145 static inline uint32_t ATTRIBUTE_PURE
   86146 _3DSTATE_VF_DWordLength_bits(const struct gen_device_info *devinfo)
   86147 {
   86148    switch (devinfo->gen) {
   86149    case 10: return 8;
   86150    case 9: return 8;
   86151    case 8: return 8;
   86152    case 7:
   86153       if (devinfo->is_haswell) {
   86154          return 8;
   86155       } else {
   86156          return 0;
   86157       }
   86158    case 6: return 0;
   86159    case 5: return 0;
   86160    case 4:
   86161       if (devinfo->is_g4x) {
   86162          return 0;
   86163       } else {
   86164          return 0;
   86165       }
   86166    default:
   86167       unreachable("Invalid hardware generation");
   86168    }
   86169 }
   86170 
   86171 
   86172 
   86173 #define GEN10_3DSTATE_VF_DWordLength_start  0
   86174 #define GEN9_3DSTATE_VF_DWordLength_start  0
   86175 #define GEN8_3DSTATE_VF_DWordLength_start  0
   86176 #define GEN75_3DSTATE_VF_DWordLength_start  0
   86177 
   86178 static inline uint32_t ATTRIBUTE_PURE
   86179 _3DSTATE_VF_DWordLength_start(const struct gen_device_info *devinfo)
   86180 {
   86181    switch (devinfo->gen) {
   86182    case 10: return 0;
   86183    case 9: return 0;
   86184    case 8: return 0;
   86185    case 7:
   86186       if (devinfo->is_haswell) {
   86187          return 0;
   86188       } else {
   86189          return 0;
   86190       }
   86191    case 6: return 0;
   86192    case 5: return 0;
   86193    case 4:
   86194       if (devinfo->is_g4x) {
   86195          return 0;
   86196       } else {
   86197          return 0;
   86198       }
   86199    default:
   86200       unreachable("Invalid hardware generation");
   86201    }
   86202 }
   86203 
   86204 
   86205 
   86206 /* 3DSTATE_VF::Indexed Draw Cut Index Enable */
   86207 
   86208 
   86209 #define GEN10_3DSTATE_VF_IndexedDrawCutIndexEnable_bits  1
   86210 #define GEN9_3DSTATE_VF_IndexedDrawCutIndexEnable_bits  1
   86211 #define GEN8_3DSTATE_VF_IndexedDrawCutIndexEnable_bits  1
   86212 #define GEN75_3DSTATE_VF_IndexedDrawCutIndexEnable_bits  1
   86213 
   86214 static inline uint32_t ATTRIBUTE_PURE
   86215 _3DSTATE_VF_IndexedDrawCutIndexEnable_bits(const struct gen_device_info *devinfo)
   86216 {
   86217    switch (devinfo->gen) {
   86218    case 10: return 1;
   86219    case 9: return 1;
   86220    case 8: return 1;
   86221    case 7:
   86222       if (devinfo->is_haswell) {
   86223          return 1;
   86224       } else {
   86225          return 0;
   86226       }
   86227    case 6: return 0;
   86228    case 5: return 0;
   86229    case 4:
   86230       if (devinfo->is_g4x) {
   86231          return 0;
   86232       } else {
   86233          return 0;
   86234       }
   86235    default:
   86236       unreachable("Invalid hardware generation");
   86237    }
   86238 }
   86239 
   86240 
   86241 
   86242 #define GEN10_3DSTATE_VF_IndexedDrawCutIndexEnable_start  8
   86243 #define GEN9_3DSTATE_VF_IndexedDrawCutIndexEnable_start  8
   86244 #define GEN8_3DSTATE_VF_IndexedDrawCutIndexEnable_start  8
   86245 #define GEN75_3DSTATE_VF_IndexedDrawCutIndexEnable_start  8
   86246 
   86247 static inline uint32_t ATTRIBUTE_PURE
   86248 _3DSTATE_VF_IndexedDrawCutIndexEnable_start(const struct gen_device_info *devinfo)
   86249 {
   86250    switch (devinfo->gen) {
   86251    case 10: return 8;
   86252    case 9: return 8;
   86253    case 8: return 8;
   86254    case 7:
   86255       if (devinfo->is_haswell) {
   86256          return 8;
   86257       } else {
   86258          return 0;
   86259       }
   86260    case 6: return 0;
   86261    case 5: return 0;
   86262    case 4:
   86263       if (devinfo->is_g4x) {
   86264          return 0;
   86265       } else {
   86266          return 0;
   86267       }
   86268    default:
   86269       unreachable("Invalid hardware generation");
   86270    }
   86271 }
   86272 
   86273 
   86274 
   86275 /* 3DSTATE_VF::Sequential Draw Cut Index Enable */
   86276 
   86277 
   86278 #define GEN10_3DSTATE_VF_SequentialDrawCutIndexEnable_bits  1
   86279 #define GEN9_3DSTATE_VF_SequentialDrawCutIndexEnable_bits  1
   86280 
   86281 static inline uint32_t ATTRIBUTE_PURE
   86282 _3DSTATE_VF_SequentialDrawCutIndexEnable_bits(const struct gen_device_info *devinfo)
   86283 {
   86284    switch (devinfo->gen) {
   86285    case 10: return 1;
   86286    case 9: return 1;
   86287    case 8: return 0;
   86288    case 7:
   86289       if (devinfo->is_haswell) {
   86290          return 0;
   86291       } else {
   86292          return 0;
   86293       }
   86294    case 6: return 0;
   86295    case 5: return 0;
   86296    case 4:
   86297       if (devinfo->is_g4x) {
   86298          return 0;
   86299       } else {
   86300          return 0;
   86301       }
   86302    default:
   86303       unreachable("Invalid hardware generation");
   86304    }
   86305 }
   86306 
   86307 
   86308 
   86309 #define GEN10_3DSTATE_VF_SequentialDrawCutIndexEnable_start  10
   86310 #define GEN9_3DSTATE_VF_SequentialDrawCutIndexEnable_start  10
   86311 
   86312 static inline uint32_t ATTRIBUTE_PURE
   86313 _3DSTATE_VF_SequentialDrawCutIndexEnable_start(const struct gen_device_info *devinfo)
   86314 {
   86315    switch (devinfo->gen) {
   86316    case 10: return 10;
   86317    case 9: return 10;
   86318    case 8: return 0;
   86319    case 7:
   86320       if (devinfo->is_haswell) {
   86321          return 0;
   86322       } else {
   86323          return 0;
   86324       }
   86325    case 6: return 0;
   86326    case 5: return 0;
   86327    case 4:
   86328       if (devinfo->is_g4x) {
   86329          return 0;
   86330       } else {
   86331          return 0;
   86332       }
   86333    default:
   86334       unreachable("Invalid hardware generation");
   86335    }
   86336 }
   86337 
   86338 
   86339 
   86340 /* 3DSTATE_VF::VertexID Offset Enable */
   86341 
   86342 
   86343 #define GEN10_3DSTATE_VF_VertexIDOffsetEnable_bits  1
   86344 
   86345 static inline uint32_t ATTRIBUTE_PURE
   86346 _3DSTATE_VF_VertexIDOffsetEnable_bits(const struct gen_device_info *devinfo)
   86347 {
   86348    switch (devinfo->gen) {
   86349    case 10: return 1;
   86350    case 9: return 0;
   86351    case 8: return 0;
   86352    case 7:
   86353       if (devinfo->is_haswell) {
   86354          return 0;
   86355       } else {
   86356          return 0;
   86357       }
   86358    case 6: return 0;
   86359    case 5: return 0;
   86360    case 4:
   86361       if (devinfo->is_g4x) {
   86362          return 0;
   86363       } else {
   86364          return 0;
   86365       }
   86366    default:
   86367       unreachable("Invalid hardware generation");
   86368    }
   86369 }
   86370 
   86371 
   86372 
   86373 #define GEN10_3DSTATE_VF_VertexIDOffsetEnable_start  11
   86374 
   86375 static inline uint32_t ATTRIBUTE_PURE
   86376 _3DSTATE_VF_VertexIDOffsetEnable_start(const struct gen_device_info *devinfo)
   86377 {
   86378    switch (devinfo->gen) {
   86379    case 10: return 11;
   86380    case 9: return 0;
   86381    case 8: return 0;
   86382    case 7:
   86383       if (devinfo->is_haswell) {
   86384          return 0;
   86385       } else {
   86386          return 0;
   86387       }
   86388    case 6: return 0;
   86389    case 5: return 0;
   86390    case 4:
   86391       if (devinfo->is_g4x) {
   86392          return 0;
   86393       } else {
   86394          return 0;
   86395       }
   86396    default:
   86397       unreachable("Invalid hardware generation");
   86398    }
   86399 }
   86400 
   86401 
   86402 
   86403 /* 3DSTATE_VF_COMPONENT_PACKING */
   86404 
   86405 
   86406 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_length  5
   86407 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_length  5
   86408 
   86409 static inline uint32_t ATTRIBUTE_PURE
   86410 _3DSTATE_VF_COMPONENT_PACKING_length(const struct gen_device_info *devinfo)
   86411 {
   86412    switch (devinfo->gen) {
   86413    case 10: return 5;
   86414    case 9: return 5;
   86415    case 8: return 0;
   86416    case 7:
   86417       if (devinfo->is_haswell) {
   86418          return 0;
   86419       } else {
   86420          return 0;
   86421       }
   86422    case 6: return 0;
   86423    case 5: return 0;
   86424    case 4:
   86425       if (devinfo->is_g4x) {
   86426          return 0;
   86427       } else {
   86428          return 0;
   86429       }
   86430    default:
   86431       unreachable("Invalid hardware generation");
   86432    }
   86433 }
   86434 
   86435 
   86436 
   86437 /* 3DSTATE_VF_COMPONENT_PACKING::3D Command Opcode */
   86438 
   86439 
   86440 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_3DCommandOpcode_bits  3
   86441 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_3DCommandOpcode_bits  3
   86442 
   86443 static inline uint32_t ATTRIBUTE_PURE
   86444 _3DSTATE_VF_COMPONENT_PACKING_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   86445 {
   86446    switch (devinfo->gen) {
   86447    case 10: return 3;
   86448    case 9: return 3;
   86449    case 8: return 0;
   86450    case 7:
   86451       if (devinfo->is_haswell) {
   86452          return 0;
   86453       } else {
   86454          return 0;
   86455       }
   86456    case 6: return 0;
   86457    case 5: return 0;
   86458    case 4:
   86459       if (devinfo->is_g4x) {
   86460          return 0;
   86461       } else {
   86462          return 0;
   86463       }
   86464    default:
   86465       unreachable("Invalid hardware generation");
   86466    }
   86467 }
   86468 
   86469 
   86470 
   86471 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_3DCommandOpcode_start  24
   86472 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_3DCommandOpcode_start  24
   86473 
   86474 static inline uint32_t ATTRIBUTE_PURE
   86475 _3DSTATE_VF_COMPONENT_PACKING_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   86476 {
   86477    switch (devinfo->gen) {
   86478    case 10: return 24;
   86479    case 9: return 24;
   86480    case 8: return 0;
   86481    case 7:
   86482       if (devinfo->is_haswell) {
   86483          return 0;
   86484       } else {
   86485          return 0;
   86486       }
   86487    case 6: return 0;
   86488    case 5: return 0;
   86489    case 4:
   86490       if (devinfo->is_g4x) {
   86491          return 0;
   86492       } else {
   86493          return 0;
   86494       }
   86495    default:
   86496       unreachable("Invalid hardware generation");
   86497    }
   86498 }
   86499 
   86500 
   86501 
   86502 /* 3DSTATE_VF_COMPONENT_PACKING::3D Command Sub Opcode */
   86503 
   86504 
   86505 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_3DCommandSubOpcode_bits  8
   86506 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_3DCommandSubOpcode_bits  8
   86507 
   86508 static inline uint32_t ATTRIBUTE_PURE
   86509 _3DSTATE_VF_COMPONENT_PACKING_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   86510 {
   86511    switch (devinfo->gen) {
   86512    case 10: return 8;
   86513    case 9: return 8;
   86514    case 8: return 0;
   86515    case 7:
   86516       if (devinfo->is_haswell) {
   86517          return 0;
   86518       } else {
   86519          return 0;
   86520       }
   86521    case 6: return 0;
   86522    case 5: return 0;
   86523    case 4:
   86524       if (devinfo->is_g4x) {
   86525          return 0;
   86526       } else {
   86527          return 0;
   86528       }
   86529    default:
   86530       unreachable("Invalid hardware generation");
   86531    }
   86532 }
   86533 
   86534 
   86535 
   86536 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_3DCommandSubOpcode_start  16
   86537 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_3DCommandSubOpcode_start  16
   86538 
   86539 static inline uint32_t ATTRIBUTE_PURE
   86540 _3DSTATE_VF_COMPONENT_PACKING_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   86541 {
   86542    switch (devinfo->gen) {
   86543    case 10: return 16;
   86544    case 9: return 16;
   86545    case 8: return 0;
   86546    case 7:
   86547       if (devinfo->is_haswell) {
   86548          return 0;
   86549       } else {
   86550          return 0;
   86551       }
   86552    case 6: return 0;
   86553    case 5: return 0;
   86554    case 4:
   86555       if (devinfo->is_g4x) {
   86556          return 0;
   86557       } else {
   86558          return 0;
   86559       }
   86560    default:
   86561       unreachable("Invalid hardware generation");
   86562    }
   86563 }
   86564 
   86565 
   86566 
   86567 /* 3DSTATE_VF_COMPONENT_PACKING::Command SubType */
   86568 
   86569 
   86570 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_CommandSubType_bits  2
   86571 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_CommandSubType_bits  2
   86572 
   86573 static inline uint32_t ATTRIBUTE_PURE
   86574 _3DSTATE_VF_COMPONENT_PACKING_CommandSubType_bits(const struct gen_device_info *devinfo)
   86575 {
   86576    switch (devinfo->gen) {
   86577    case 10: return 2;
   86578    case 9: return 2;
   86579    case 8: return 0;
   86580    case 7:
   86581       if (devinfo->is_haswell) {
   86582          return 0;
   86583       } else {
   86584          return 0;
   86585       }
   86586    case 6: return 0;
   86587    case 5: return 0;
   86588    case 4:
   86589       if (devinfo->is_g4x) {
   86590          return 0;
   86591       } else {
   86592          return 0;
   86593       }
   86594    default:
   86595       unreachable("Invalid hardware generation");
   86596    }
   86597 }
   86598 
   86599 
   86600 
   86601 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_CommandSubType_start  27
   86602 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_CommandSubType_start  27
   86603 
   86604 static inline uint32_t ATTRIBUTE_PURE
   86605 _3DSTATE_VF_COMPONENT_PACKING_CommandSubType_start(const struct gen_device_info *devinfo)
   86606 {
   86607    switch (devinfo->gen) {
   86608    case 10: return 27;
   86609    case 9: return 27;
   86610    case 8: return 0;
   86611    case 7:
   86612       if (devinfo->is_haswell) {
   86613          return 0;
   86614       } else {
   86615          return 0;
   86616       }
   86617    case 6: return 0;
   86618    case 5: return 0;
   86619    case 4:
   86620       if (devinfo->is_g4x) {
   86621          return 0;
   86622       } else {
   86623          return 0;
   86624       }
   86625    default:
   86626       unreachable("Invalid hardware generation");
   86627    }
   86628 }
   86629 
   86630 
   86631 
   86632 /* 3DSTATE_VF_COMPONENT_PACKING::Command Type */
   86633 
   86634 
   86635 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_CommandType_bits  3
   86636 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_CommandType_bits  3
   86637 
   86638 static inline uint32_t ATTRIBUTE_PURE
   86639 _3DSTATE_VF_COMPONENT_PACKING_CommandType_bits(const struct gen_device_info *devinfo)
   86640 {
   86641    switch (devinfo->gen) {
   86642    case 10: return 3;
   86643    case 9: return 3;
   86644    case 8: return 0;
   86645    case 7:
   86646       if (devinfo->is_haswell) {
   86647          return 0;
   86648       } else {
   86649          return 0;
   86650       }
   86651    case 6: return 0;
   86652    case 5: return 0;
   86653    case 4:
   86654       if (devinfo->is_g4x) {
   86655          return 0;
   86656       } else {
   86657          return 0;
   86658       }
   86659    default:
   86660       unreachable("Invalid hardware generation");
   86661    }
   86662 }
   86663 
   86664 
   86665 
   86666 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_CommandType_start  29
   86667 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_CommandType_start  29
   86668 
   86669 static inline uint32_t ATTRIBUTE_PURE
   86670 _3DSTATE_VF_COMPONENT_PACKING_CommandType_start(const struct gen_device_info *devinfo)
   86671 {
   86672    switch (devinfo->gen) {
   86673    case 10: return 29;
   86674    case 9: return 29;
   86675    case 8: return 0;
   86676    case 7:
   86677       if (devinfo->is_haswell) {
   86678          return 0;
   86679       } else {
   86680          return 0;
   86681       }
   86682    case 6: return 0;
   86683    case 5: return 0;
   86684    case 4:
   86685       if (devinfo->is_g4x) {
   86686          return 0;
   86687       } else {
   86688          return 0;
   86689       }
   86690    default:
   86691       unreachable("Invalid hardware generation");
   86692    }
   86693 }
   86694 
   86695 
   86696 
   86697 /* 3DSTATE_VF_COMPONENT_PACKING::DWord Length */
   86698 
   86699 
   86700 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_DWordLength_bits  8
   86701 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_DWordLength_bits  8
   86702 
   86703 static inline uint32_t ATTRIBUTE_PURE
   86704 _3DSTATE_VF_COMPONENT_PACKING_DWordLength_bits(const struct gen_device_info *devinfo)
   86705 {
   86706    switch (devinfo->gen) {
   86707    case 10: return 8;
   86708    case 9: return 8;
   86709    case 8: return 0;
   86710    case 7:
   86711       if (devinfo->is_haswell) {
   86712          return 0;
   86713       } else {
   86714          return 0;
   86715       }
   86716    case 6: return 0;
   86717    case 5: return 0;
   86718    case 4:
   86719       if (devinfo->is_g4x) {
   86720          return 0;
   86721       } else {
   86722          return 0;
   86723       }
   86724    default:
   86725       unreachable("Invalid hardware generation");
   86726    }
   86727 }
   86728 
   86729 
   86730 
   86731 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_DWordLength_start  0
   86732 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_DWordLength_start  0
   86733 
   86734 static inline uint32_t ATTRIBUTE_PURE
   86735 _3DSTATE_VF_COMPONENT_PACKING_DWordLength_start(const struct gen_device_info *devinfo)
   86736 {
   86737    switch (devinfo->gen) {
   86738    case 10: return 0;
   86739    case 9: return 0;
   86740    case 8: return 0;
   86741    case 7:
   86742       if (devinfo->is_haswell) {
   86743          return 0;
   86744       } else {
   86745          return 0;
   86746       }
   86747    case 6: return 0;
   86748    case 5: return 0;
   86749    case 4:
   86750       if (devinfo->is_g4x) {
   86751          return 0;
   86752       } else {
   86753          return 0;
   86754       }
   86755    default:
   86756       unreachable("Invalid hardware generation");
   86757    }
   86758 }
   86759 
   86760 
   86761 
   86762 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 00 Enables */
   86763 
   86764 
   86765 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement00Enables_bits  4
   86766 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement00Enables_bits  4
   86767 
   86768 static inline uint32_t ATTRIBUTE_PURE
   86769 _3DSTATE_VF_COMPONENT_PACKING_VertexElement00Enables_bits(const struct gen_device_info *devinfo)
   86770 {
   86771    switch (devinfo->gen) {
   86772    case 10: return 4;
   86773    case 9: return 4;
   86774    case 8: return 0;
   86775    case 7:
   86776       if (devinfo->is_haswell) {
   86777          return 0;
   86778       } else {
   86779          return 0;
   86780       }
   86781    case 6: return 0;
   86782    case 5: return 0;
   86783    case 4:
   86784       if (devinfo->is_g4x) {
   86785          return 0;
   86786       } else {
   86787          return 0;
   86788       }
   86789    default:
   86790       unreachable("Invalid hardware generation");
   86791    }
   86792 }
   86793 
   86794 
   86795 
   86796 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement00Enables_start  32
   86797 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement00Enables_start  32
   86798 
   86799 static inline uint32_t ATTRIBUTE_PURE
   86800 _3DSTATE_VF_COMPONENT_PACKING_VertexElement00Enables_start(const struct gen_device_info *devinfo)
   86801 {
   86802    switch (devinfo->gen) {
   86803    case 10: return 32;
   86804    case 9: return 32;
   86805    case 8: return 0;
   86806    case 7:
   86807       if (devinfo->is_haswell) {
   86808          return 0;
   86809       } else {
   86810          return 0;
   86811       }
   86812    case 6: return 0;
   86813    case 5: return 0;
   86814    case 4:
   86815       if (devinfo->is_g4x) {
   86816          return 0;
   86817       } else {
   86818          return 0;
   86819       }
   86820    default:
   86821       unreachable("Invalid hardware generation");
   86822    }
   86823 }
   86824 
   86825 
   86826 
   86827 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 01 Enables */
   86828 
   86829 
   86830 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement01Enables_bits  4
   86831 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement01Enables_bits  4
   86832 
   86833 static inline uint32_t ATTRIBUTE_PURE
   86834 _3DSTATE_VF_COMPONENT_PACKING_VertexElement01Enables_bits(const struct gen_device_info *devinfo)
   86835 {
   86836    switch (devinfo->gen) {
   86837    case 10: return 4;
   86838    case 9: return 4;
   86839    case 8: return 0;
   86840    case 7:
   86841       if (devinfo->is_haswell) {
   86842          return 0;
   86843       } else {
   86844          return 0;
   86845       }
   86846    case 6: return 0;
   86847    case 5: return 0;
   86848    case 4:
   86849       if (devinfo->is_g4x) {
   86850          return 0;
   86851       } else {
   86852          return 0;
   86853       }
   86854    default:
   86855       unreachable("Invalid hardware generation");
   86856    }
   86857 }
   86858 
   86859 
   86860 
   86861 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement01Enables_start  36
   86862 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement01Enables_start  36
   86863 
   86864 static inline uint32_t ATTRIBUTE_PURE
   86865 _3DSTATE_VF_COMPONENT_PACKING_VertexElement01Enables_start(const struct gen_device_info *devinfo)
   86866 {
   86867    switch (devinfo->gen) {
   86868    case 10: return 36;
   86869    case 9: return 36;
   86870    case 8: return 0;
   86871    case 7:
   86872       if (devinfo->is_haswell) {
   86873          return 0;
   86874       } else {
   86875          return 0;
   86876       }
   86877    case 6: return 0;
   86878    case 5: return 0;
   86879    case 4:
   86880       if (devinfo->is_g4x) {
   86881          return 0;
   86882       } else {
   86883          return 0;
   86884       }
   86885    default:
   86886       unreachable("Invalid hardware generation");
   86887    }
   86888 }
   86889 
   86890 
   86891 
   86892 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 02 Enables */
   86893 
   86894 
   86895 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement02Enables_bits  4
   86896 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement02Enables_bits  4
   86897 
   86898 static inline uint32_t ATTRIBUTE_PURE
   86899 _3DSTATE_VF_COMPONENT_PACKING_VertexElement02Enables_bits(const struct gen_device_info *devinfo)
   86900 {
   86901    switch (devinfo->gen) {
   86902    case 10: return 4;
   86903    case 9: return 4;
   86904    case 8: return 0;
   86905    case 7:
   86906       if (devinfo->is_haswell) {
   86907          return 0;
   86908       } else {
   86909          return 0;
   86910       }
   86911    case 6: return 0;
   86912    case 5: return 0;
   86913    case 4:
   86914       if (devinfo->is_g4x) {
   86915          return 0;
   86916       } else {
   86917          return 0;
   86918       }
   86919    default:
   86920       unreachable("Invalid hardware generation");
   86921    }
   86922 }
   86923 
   86924 
   86925 
   86926 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement02Enables_start  40
   86927 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement02Enables_start  40
   86928 
   86929 static inline uint32_t ATTRIBUTE_PURE
   86930 _3DSTATE_VF_COMPONENT_PACKING_VertexElement02Enables_start(const struct gen_device_info *devinfo)
   86931 {
   86932    switch (devinfo->gen) {
   86933    case 10: return 40;
   86934    case 9: return 40;
   86935    case 8: return 0;
   86936    case 7:
   86937       if (devinfo->is_haswell) {
   86938          return 0;
   86939       } else {
   86940          return 0;
   86941       }
   86942    case 6: return 0;
   86943    case 5: return 0;
   86944    case 4:
   86945       if (devinfo->is_g4x) {
   86946          return 0;
   86947       } else {
   86948          return 0;
   86949       }
   86950    default:
   86951       unreachable("Invalid hardware generation");
   86952    }
   86953 }
   86954 
   86955 
   86956 
   86957 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 03 Enables */
   86958 
   86959 
   86960 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement03Enables_bits  4
   86961 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement03Enables_bits  4
   86962 
   86963 static inline uint32_t ATTRIBUTE_PURE
   86964 _3DSTATE_VF_COMPONENT_PACKING_VertexElement03Enables_bits(const struct gen_device_info *devinfo)
   86965 {
   86966    switch (devinfo->gen) {
   86967    case 10: return 4;
   86968    case 9: return 4;
   86969    case 8: return 0;
   86970    case 7:
   86971       if (devinfo->is_haswell) {
   86972          return 0;
   86973       } else {
   86974          return 0;
   86975       }
   86976    case 6: return 0;
   86977    case 5: return 0;
   86978    case 4:
   86979       if (devinfo->is_g4x) {
   86980          return 0;
   86981       } else {
   86982          return 0;
   86983       }
   86984    default:
   86985       unreachable("Invalid hardware generation");
   86986    }
   86987 }
   86988 
   86989 
   86990 
   86991 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement03Enables_start  44
   86992 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement03Enables_start  44
   86993 
   86994 static inline uint32_t ATTRIBUTE_PURE
   86995 _3DSTATE_VF_COMPONENT_PACKING_VertexElement03Enables_start(const struct gen_device_info *devinfo)
   86996 {
   86997    switch (devinfo->gen) {
   86998    case 10: return 44;
   86999    case 9: return 44;
   87000    case 8: return 0;
   87001    case 7:
   87002       if (devinfo->is_haswell) {
   87003          return 0;
   87004       } else {
   87005          return 0;
   87006       }
   87007    case 6: return 0;
   87008    case 5: return 0;
   87009    case 4:
   87010       if (devinfo->is_g4x) {
   87011          return 0;
   87012       } else {
   87013          return 0;
   87014       }
   87015    default:
   87016       unreachable("Invalid hardware generation");
   87017    }
   87018 }
   87019 
   87020 
   87021 
   87022 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 04 Enables */
   87023 
   87024 
   87025 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement04Enables_bits  4
   87026 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement04Enables_bits  4
   87027 
   87028 static inline uint32_t ATTRIBUTE_PURE
   87029 _3DSTATE_VF_COMPONENT_PACKING_VertexElement04Enables_bits(const struct gen_device_info *devinfo)
   87030 {
   87031    switch (devinfo->gen) {
   87032    case 10: return 4;
   87033    case 9: return 4;
   87034    case 8: return 0;
   87035    case 7:
   87036       if (devinfo->is_haswell) {
   87037          return 0;
   87038       } else {
   87039          return 0;
   87040       }
   87041    case 6: return 0;
   87042    case 5: return 0;
   87043    case 4:
   87044       if (devinfo->is_g4x) {
   87045          return 0;
   87046       } else {
   87047          return 0;
   87048       }
   87049    default:
   87050       unreachable("Invalid hardware generation");
   87051    }
   87052 }
   87053 
   87054 
   87055 
   87056 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement04Enables_start  48
   87057 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement04Enables_start  48
   87058 
   87059 static inline uint32_t ATTRIBUTE_PURE
   87060 _3DSTATE_VF_COMPONENT_PACKING_VertexElement04Enables_start(const struct gen_device_info *devinfo)
   87061 {
   87062    switch (devinfo->gen) {
   87063    case 10: return 48;
   87064    case 9: return 48;
   87065    case 8: return 0;
   87066    case 7:
   87067       if (devinfo->is_haswell) {
   87068          return 0;
   87069       } else {
   87070          return 0;
   87071       }
   87072    case 6: return 0;
   87073    case 5: return 0;
   87074    case 4:
   87075       if (devinfo->is_g4x) {
   87076          return 0;
   87077       } else {
   87078          return 0;
   87079       }
   87080    default:
   87081       unreachable("Invalid hardware generation");
   87082    }
   87083 }
   87084 
   87085 
   87086 
   87087 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 05 Enables */
   87088 
   87089 
   87090 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement05Enables_bits  4
   87091 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement05Enables_bits  4
   87092 
   87093 static inline uint32_t ATTRIBUTE_PURE
   87094 _3DSTATE_VF_COMPONENT_PACKING_VertexElement05Enables_bits(const struct gen_device_info *devinfo)
   87095 {
   87096    switch (devinfo->gen) {
   87097    case 10: return 4;
   87098    case 9: return 4;
   87099    case 8: return 0;
   87100    case 7:
   87101       if (devinfo->is_haswell) {
   87102          return 0;
   87103       } else {
   87104          return 0;
   87105       }
   87106    case 6: return 0;
   87107    case 5: return 0;
   87108    case 4:
   87109       if (devinfo->is_g4x) {
   87110          return 0;
   87111       } else {
   87112          return 0;
   87113       }
   87114    default:
   87115       unreachable("Invalid hardware generation");
   87116    }
   87117 }
   87118 
   87119 
   87120 
   87121 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement05Enables_start  52
   87122 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement05Enables_start  52
   87123 
   87124 static inline uint32_t ATTRIBUTE_PURE
   87125 _3DSTATE_VF_COMPONENT_PACKING_VertexElement05Enables_start(const struct gen_device_info *devinfo)
   87126 {
   87127    switch (devinfo->gen) {
   87128    case 10: return 52;
   87129    case 9: return 52;
   87130    case 8: return 0;
   87131    case 7:
   87132       if (devinfo->is_haswell) {
   87133          return 0;
   87134       } else {
   87135          return 0;
   87136       }
   87137    case 6: return 0;
   87138    case 5: return 0;
   87139    case 4:
   87140       if (devinfo->is_g4x) {
   87141          return 0;
   87142       } else {
   87143          return 0;
   87144       }
   87145    default:
   87146       unreachable("Invalid hardware generation");
   87147    }
   87148 }
   87149 
   87150 
   87151 
   87152 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 06 Enables */
   87153 
   87154 
   87155 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement06Enables_bits  4
   87156 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement06Enables_bits  4
   87157 
   87158 static inline uint32_t ATTRIBUTE_PURE
   87159 _3DSTATE_VF_COMPONENT_PACKING_VertexElement06Enables_bits(const struct gen_device_info *devinfo)
   87160 {
   87161    switch (devinfo->gen) {
   87162    case 10: return 4;
   87163    case 9: return 4;
   87164    case 8: return 0;
   87165    case 7:
   87166       if (devinfo->is_haswell) {
   87167          return 0;
   87168       } else {
   87169          return 0;
   87170       }
   87171    case 6: return 0;
   87172    case 5: return 0;
   87173    case 4:
   87174       if (devinfo->is_g4x) {
   87175          return 0;
   87176       } else {
   87177          return 0;
   87178       }
   87179    default:
   87180       unreachable("Invalid hardware generation");
   87181    }
   87182 }
   87183 
   87184 
   87185 
   87186 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement06Enables_start  56
   87187 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement06Enables_start  56
   87188 
   87189 static inline uint32_t ATTRIBUTE_PURE
   87190 _3DSTATE_VF_COMPONENT_PACKING_VertexElement06Enables_start(const struct gen_device_info *devinfo)
   87191 {
   87192    switch (devinfo->gen) {
   87193    case 10: return 56;
   87194    case 9: return 56;
   87195    case 8: return 0;
   87196    case 7:
   87197       if (devinfo->is_haswell) {
   87198          return 0;
   87199       } else {
   87200          return 0;
   87201       }
   87202    case 6: return 0;
   87203    case 5: return 0;
   87204    case 4:
   87205       if (devinfo->is_g4x) {
   87206          return 0;
   87207       } else {
   87208          return 0;
   87209       }
   87210    default:
   87211       unreachable("Invalid hardware generation");
   87212    }
   87213 }
   87214 
   87215 
   87216 
   87217 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 07 Enables */
   87218 
   87219 
   87220 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement07Enables_bits  4
   87221 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement07Enables_bits  4
   87222 
   87223 static inline uint32_t ATTRIBUTE_PURE
   87224 _3DSTATE_VF_COMPONENT_PACKING_VertexElement07Enables_bits(const struct gen_device_info *devinfo)
   87225 {
   87226    switch (devinfo->gen) {
   87227    case 10: return 4;
   87228    case 9: return 4;
   87229    case 8: return 0;
   87230    case 7:
   87231       if (devinfo->is_haswell) {
   87232          return 0;
   87233       } else {
   87234          return 0;
   87235       }
   87236    case 6: return 0;
   87237    case 5: return 0;
   87238    case 4:
   87239       if (devinfo->is_g4x) {
   87240          return 0;
   87241       } else {
   87242          return 0;
   87243       }
   87244    default:
   87245       unreachable("Invalid hardware generation");
   87246    }
   87247 }
   87248 
   87249 
   87250 
   87251 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement07Enables_start  60
   87252 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement07Enables_start  60
   87253 
   87254 static inline uint32_t ATTRIBUTE_PURE
   87255 _3DSTATE_VF_COMPONENT_PACKING_VertexElement07Enables_start(const struct gen_device_info *devinfo)
   87256 {
   87257    switch (devinfo->gen) {
   87258    case 10: return 60;
   87259    case 9: return 60;
   87260    case 8: return 0;
   87261    case 7:
   87262       if (devinfo->is_haswell) {
   87263          return 0;
   87264       } else {
   87265          return 0;
   87266       }
   87267    case 6: return 0;
   87268    case 5: return 0;
   87269    case 4:
   87270       if (devinfo->is_g4x) {
   87271          return 0;
   87272       } else {
   87273          return 0;
   87274       }
   87275    default:
   87276       unreachable("Invalid hardware generation");
   87277    }
   87278 }
   87279 
   87280 
   87281 
   87282 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 08 Enables */
   87283 
   87284 
   87285 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement08Enables_bits  4
   87286 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement08Enables_bits  4
   87287 
   87288 static inline uint32_t ATTRIBUTE_PURE
   87289 _3DSTATE_VF_COMPONENT_PACKING_VertexElement08Enables_bits(const struct gen_device_info *devinfo)
   87290 {
   87291    switch (devinfo->gen) {
   87292    case 10: return 4;
   87293    case 9: return 4;
   87294    case 8: return 0;
   87295    case 7:
   87296       if (devinfo->is_haswell) {
   87297          return 0;
   87298       } else {
   87299          return 0;
   87300       }
   87301    case 6: return 0;
   87302    case 5: return 0;
   87303    case 4:
   87304       if (devinfo->is_g4x) {
   87305          return 0;
   87306       } else {
   87307          return 0;
   87308       }
   87309    default:
   87310       unreachable("Invalid hardware generation");
   87311    }
   87312 }
   87313 
   87314 
   87315 
   87316 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement08Enables_start  64
   87317 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement08Enables_start  64
   87318 
   87319 static inline uint32_t ATTRIBUTE_PURE
   87320 _3DSTATE_VF_COMPONENT_PACKING_VertexElement08Enables_start(const struct gen_device_info *devinfo)
   87321 {
   87322    switch (devinfo->gen) {
   87323    case 10: return 64;
   87324    case 9: return 64;
   87325    case 8: return 0;
   87326    case 7:
   87327       if (devinfo->is_haswell) {
   87328          return 0;
   87329       } else {
   87330          return 0;
   87331       }
   87332    case 6: return 0;
   87333    case 5: return 0;
   87334    case 4:
   87335       if (devinfo->is_g4x) {
   87336          return 0;
   87337       } else {
   87338          return 0;
   87339       }
   87340    default:
   87341       unreachable("Invalid hardware generation");
   87342    }
   87343 }
   87344 
   87345 
   87346 
   87347 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 09 Enables */
   87348 
   87349 
   87350 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement09Enables_bits  4
   87351 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement09Enables_bits  4
   87352 
   87353 static inline uint32_t ATTRIBUTE_PURE
   87354 _3DSTATE_VF_COMPONENT_PACKING_VertexElement09Enables_bits(const struct gen_device_info *devinfo)
   87355 {
   87356    switch (devinfo->gen) {
   87357    case 10: return 4;
   87358    case 9: return 4;
   87359    case 8: return 0;
   87360    case 7:
   87361       if (devinfo->is_haswell) {
   87362          return 0;
   87363       } else {
   87364          return 0;
   87365       }
   87366    case 6: return 0;
   87367    case 5: return 0;
   87368    case 4:
   87369       if (devinfo->is_g4x) {
   87370          return 0;
   87371       } else {
   87372          return 0;
   87373       }
   87374    default:
   87375       unreachable("Invalid hardware generation");
   87376    }
   87377 }
   87378 
   87379 
   87380 
   87381 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement09Enables_start  68
   87382 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement09Enables_start  68
   87383 
   87384 static inline uint32_t ATTRIBUTE_PURE
   87385 _3DSTATE_VF_COMPONENT_PACKING_VertexElement09Enables_start(const struct gen_device_info *devinfo)
   87386 {
   87387    switch (devinfo->gen) {
   87388    case 10: return 68;
   87389    case 9: return 68;
   87390    case 8: return 0;
   87391    case 7:
   87392       if (devinfo->is_haswell) {
   87393          return 0;
   87394       } else {
   87395          return 0;
   87396       }
   87397    case 6: return 0;
   87398    case 5: return 0;
   87399    case 4:
   87400       if (devinfo->is_g4x) {
   87401          return 0;
   87402       } else {
   87403          return 0;
   87404       }
   87405    default:
   87406       unreachable("Invalid hardware generation");
   87407    }
   87408 }
   87409 
   87410 
   87411 
   87412 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 10 Enables */
   87413 
   87414 
   87415 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement10Enables_bits  4
   87416 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement10Enables_bits  4
   87417 
   87418 static inline uint32_t ATTRIBUTE_PURE
   87419 _3DSTATE_VF_COMPONENT_PACKING_VertexElement10Enables_bits(const struct gen_device_info *devinfo)
   87420 {
   87421    switch (devinfo->gen) {
   87422    case 10: return 4;
   87423    case 9: return 4;
   87424    case 8: return 0;
   87425    case 7:
   87426       if (devinfo->is_haswell) {
   87427          return 0;
   87428       } else {
   87429          return 0;
   87430       }
   87431    case 6: return 0;
   87432    case 5: return 0;
   87433    case 4:
   87434       if (devinfo->is_g4x) {
   87435          return 0;
   87436       } else {
   87437          return 0;
   87438       }
   87439    default:
   87440       unreachable("Invalid hardware generation");
   87441    }
   87442 }
   87443 
   87444 
   87445 
   87446 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement10Enables_start  72
   87447 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement10Enables_start  72
   87448 
   87449 static inline uint32_t ATTRIBUTE_PURE
   87450 _3DSTATE_VF_COMPONENT_PACKING_VertexElement10Enables_start(const struct gen_device_info *devinfo)
   87451 {
   87452    switch (devinfo->gen) {
   87453    case 10: return 72;
   87454    case 9: return 72;
   87455    case 8: return 0;
   87456    case 7:
   87457       if (devinfo->is_haswell) {
   87458          return 0;
   87459       } else {
   87460          return 0;
   87461       }
   87462    case 6: return 0;
   87463    case 5: return 0;
   87464    case 4:
   87465       if (devinfo->is_g4x) {
   87466          return 0;
   87467       } else {
   87468          return 0;
   87469       }
   87470    default:
   87471       unreachable("Invalid hardware generation");
   87472    }
   87473 }
   87474 
   87475 
   87476 
   87477 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 11 Enables */
   87478 
   87479 
   87480 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement11Enables_bits  4
   87481 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement11Enables_bits  4
   87482 
   87483 static inline uint32_t ATTRIBUTE_PURE
   87484 _3DSTATE_VF_COMPONENT_PACKING_VertexElement11Enables_bits(const struct gen_device_info *devinfo)
   87485 {
   87486    switch (devinfo->gen) {
   87487    case 10: return 4;
   87488    case 9: return 4;
   87489    case 8: return 0;
   87490    case 7:
   87491       if (devinfo->is_haswell) {
   87492          return 0;
   87493       } else {
   87494          return 0;
   87495       }
   87496    case 6: return 0;
   87497    case 5: return 0;
   87498    case 4:
   87499       if (devinfo->is_g4x) {
   87500          return 0;
   87501       } else {
   87502          return 0;
   87503       }
   87504    default:
   87505       unreachable("Invalid hardware generation");
   87506    }
   87507 }
   87508 
   87509 
   87510 
   87511 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement11Enables_start  76
   87512 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement11Enables_start  76
   87513 
   87514 static inline uint32_t ATTRIBUTE_PURE
   87515 _3DSTATE_VF_COMPONENT_PACKING_VertexElement11Enables_start(const struct gen_device_info *devinfo)
   87516 {
   87517    switch (devinfo->gen) {
   87518    case 10: return 76;
   87519    case 9: return 76;
   87520    case 8: return 0;
   87521    case 7:
   87522       if (devinfo->is_haswell) {
   87523          return 0;
   87524       } else {
   87525          return 0;
   87526       }
   87527    case 6: return 0;
   87528    case 5: return 0;
   87529    case 4:
   87530       if (devinfo->is_g4x) {
   87531          return 0;
   87532       } else {
   87533          return 0;
   87534       }
   87535    default:
   87536       unreachable("Invalid hardware generation");
   87537    }
   87538 }
   87539 
   87540 
   87541 
   87542 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 12 Enables */
   87543 
   87544 
   87545 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement12Enables_bits  4
   87546 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement12Enables_bits  4
   87547 
   87548 static inline uint32_t ATTRIBUTE_PURE
   87549 _3DSTATE_VF_COMPONENT_PACKING_VertexElement12Enables_bits(const struct gen_device_info *devinfo)
   87550 {
   87551    switch (devinfo->gen) {
   87552    case 10: return 4;
   87553    case 9: return 4;
   87554    case 8: return 0;
   87555    case 7:
   87556       if (devinfo->is_haswell) {
   87557          return 0;
   87558       } else {
   87559          return 0;
   87560       }
   87561    case 6: return 0;
   87562    case 5: return 0;
   87563    case 4:
   87564       if (devinfo->is_g4x) {
   87565          return 0;
   87566       } else {
   87567          return 0;
   87568       }
   87569    default:
   87570       unreachable("Invalid hardware generation");
   87571    }
   87572 }
   87573 
   87574 
   87575 
   87576 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement12Enables_start  80
   87577 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement12Enables_start  80
   87578 
   87579 static inline uint32_t ATTRIBUTE_PURE
   87580 _3DSTATE_VF_COMPONENT_PACKING_VertexElement12Enables_start(const struct gen_device_info *devinfo)
   87581 {
   87582    switch (devinfo->gen) {
   87583    case 10: return 80;
   87584    case 9: return 80;
   87585    case 8: return 0;
   87586    case 7:
   87587       if (devinfo->is_haswell) {
   87588          return 0;
   87589       } else {
   87590          return 0;
   87591       }
   87592    case 6: return 0;
   87593    case 5: return 0;
   87594    case 4:
   87595       if (devinfo->is_g4x) {
   87596          return 0;
   87597       } else {
   87598          return 0;
   87599       }
   87600    default:
   87601       unreachable("Invalid hardware generation");
   87602    }
   87603 }
   87604 
   87605 
   87606 
   87607 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 13 Enables */
   87608 
   87609 
   87610 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement13Enables_bits  4
   87611 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement13Enables_bits  4
   87612 
   87613 static inline uint32_t ATTRIBUTE_PURE
   87614 _3DSTATE_VF_COMPONENT_PACKING_VertexElement13Enables_bits(const struct gen_device_info *devinfo)
   87615 {
   87616    switch (devinfo->gen) {
   87617    case 10: return 4;
   87618    case 9: return 4;
   87619    case 8: return 0;
   87620    case 7:
   87621       if (devinfo->is_haswell) {
   87622          return 0;
   87623       } else {
   87624          return 0;
   87625       }
   87626    case 6: return 0;
   87627    case 5: return 0;
   87628    case 4:
   87629       if (devinfo->is_g4x) {
   87630          return 0;
   87631       } else {
   87632          return 0;
   87633       }
   87634    default:
   87635       unreachable("Invalid hardware generation");
   87636    }
   87637 }
   87638 
   87639 
   87640 
   87641 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement13Enables_start  84
   87642 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement13Enables_start  84
   87643 
   87644 static inline uint32_t ATTRIBUTE_PURE
   87645 _3DSTATE_VF_COMPONENT_PACKING_VertexElement13Enables_start(const struct gen_device_info *devinfo)
   87646 {
   87647    switch (devinfo->gen) {
   87648    case 10: return 84;
   87649    case 9: return 84;
   87650    case 8: return 0;
   87651    case 7:
   87652       if (devinfo->is_haswell) {
   87653          return 0;
   87654       } else {
   87655          return 0;
   87656       }
   87657    case 6: return 0;
   87658    case 5: return 0;
   87659    case 4:
   87660       if (devinfo->is_g4x) {
   87661          return 0;
   87662       } else {
   87663          return 0;
   87664       }
   87665    default:
   87666       unreachable("Invalid hardware generation");
   87667    }
   87668 }
   87669 
   87670 
   87671 
   87672 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 14 Enables */
   87673 
   87674 
   87675 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement14Enables_bits  4
   87676 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement14Enables_bits  4
   87677 
   87678 static inline uint32_t ATTRIBUTE_PURE
   87679 _3DSTATE_VF_COMPONENT_PACKING_VertexElement14Enables_bits(const struct gen_device_info *devinfo)
   87680 {
   87681    switch (devinfo->gen) {
   87682    case 10: return 4;
   87683    case 9: return 4;
   87684    case 8: return 0;
   87685    case 7:
   87686       if (devinfo->is_haswell) {
   87687          return 0;
   87688       } else {
   87689          return 0;
   87690       }
   87691    case 6: return 0;
   87692    case 5: return 0;
   87693    case 4:
   87694       if (devinfo->is_g4x) {
   87695          return 0;
   87696       } else {
   87697          return 0;
   87698       }
   87699    default:
   87700       unreachable("Invalid hardware generation");
   87701    }
   87702 }
   87703 
   87704 
   87705 
   87706 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement14Enables_start  88
   87707 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement14Enables_start  88
   87708 
   87709 static inline uint32_t ATTRIBUTE_PURE
   87710 _3DSTATE_VF_COMPONENT_PACKING_VertexElement14Enables_start(const struct gen_device_info *devinfo)
   87711 {
   87712    switch (devinfo->gen) {
   87713    case 10: return 88;
   87714    case 9: return 88;
   87715    case 8: return 0;
   87716    case 7:
   87717       if (devinfo->is_haswell) {
   87718          return 0;
   87719       } else {
   87720          return 0;
   87721       }
   87722    case 6: return 0;
   87723    case 5: return 0;
   87724    case 4:
   87725       if (devinfo->is_g4x) {
   87726          return 0;
   87727       } else {
   87728          return 0;
   87729       }
   87730    default:
   87731       unreachable("Invalid hardware generation");
   87732    }
   87733 }
   87734 
   87735 
   87736 
   87737 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 15 Enables */
   87738 
   87739 
   87740 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement15Enables_bits  4
   87741 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement15Enables_bits  4
   87742 
   87743 static inline uint32_t ATTRIBUTE_PURE
   87744 _3DSTATE_VF_COMPONENT_PACKING_VertexElement15Enables_bits(const struct gen_device_info *devinfo)
   87745 {
   87746    switch (devinfo->gen) {
   87747    case 10: return 4;
   87748    case 9: return 4;
   87749    case 8: return 0;
   87750    case 7:
   87751       if (devinfo->is_haswell) {
   87752          return 0;
   87753       } else {
   87754          return 0;
   87755       }
   87756    case 6: return 0;
   87757    case 5: return 0;
   87758    case 4:
   87759       if (devinfo->is_g4x) {
   87760          return 0;
   87761       } else {
   87762          return 0;
   87763       }
   87764    default:
   87765       unreachable("Invalid hardware generation");
   87766    }
   87767 }
   87768 
   87769 
   87770 
   87771 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement15Enables_start  92
   87772 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement15Enables_start  92
   87773 
   87774 static inline uint32_t ATTRIBUTE_PURE
   87775 _3DSTATE_VF_COMPONENT_PACKING_VertexElement15Enables_start(const struct gen_device_info *devinfo)
   87776 {
   87777    switch (devinfo->gen) {
   87778    case 10: return 92;
   87779    case 9: return 92;
   87780    case 8: return 0;
   87781    case 7:
   87782       if (devinfo->is_haswell) {
   87783          return 0;
   87784       } else {
   87785          return 0;
   87786       }
   87787    case 6: return 0;
   87788    case 5: return 0;
   87789    case 4:
   87790       if (devinfo->is_g4x) {
   87791          return 0;
   87792       } else {
   87793          return 0;
   87794       }
   87795    default:
   87796       unreachable("Invalid hardware generation");
   87797    }
   87798 }
   87799 
   87800 
   87801 
   87802 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 16 Enables */
   87803 
   87804 
   87805 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement16Enables_bits  4
   87806 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement16Enables_bits  4
   87807 
   87808 static inline uint32_t ATTRIBUTE_PURE
   87809 _3DSTATE_VF_COMPONENT_PACKING_VertexElement16Enables_bits(const struct gen_device_info *devinfo)
   87810 {
   87811    switch (devinfo->gen) {
   87812    case 10: return 4;
   87813    case 9: return 4;
   87814    case 8: return 0;
   87815    case 7:
   87816       if (devinfo->is_haswell) {
   87817          return 0;
   87818       } else {
   87819          return 0;
   87820       }
   87821    case 6: return 0;
   87822    case 5: return 0;
   87823    case 4:
   87824       if (devinfo->is_g4x) {
   87825          return 0;
   87826       } else {
   87827          return 0;
   87828       }
   87829    default:
   87830       unreachable("Invalid hardware generation");
   87831    }
   87832 }
   87833 
   87834 
   87835 
   87836 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement16Enables_start  96
   87837 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement16Enables_start  96
   87838 
   87839 static inline uint32_t ATTRIBUTE_PURE
   87840 _3DSTATE_VF_COMPONENT_PACKING_VertexElement16Enables_start(const struct gen_device_info *devinfo)
   87841 {
   87842    switch (devinfo->gen) {
   87843    case 10: return 96;
   87844    case 9: return 96;
   87845    case 8: return 0;
   87846    case 7:
   87847       if (devinfo->is_haswell) {
   87848          return 0;
   87849       } else {
   87850          return 0;
   87851       }
   87852    case 6: return 0;
   87853    case 5: return 0;
   87854    case 4:
   87855       if (devinfo->is_g4x) {
   87856          return 0;
   87857       } else {
   87858          return 0;
   87859       }
   87860    default:
   87861       unreachable("Invalid hardware generation");
   87862    }
   87863 }
   87864 
   87865 
   87866 
   87867 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 17 Enables */
   87868 
   87869 
   87870 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement17Enables_bits  4
   87871 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement17Enables_bits  4
   87872 
   87873 static inline uint32_t ATTRIBUTE_PURE
   87874 _3DSTATE_VF_COMPONENT_PACKING_VertexElement17Enables_bits(const struct gen_device_info *devinfo)
   87875 {
   87876    switch (devinfo->gen) {
   87877    case 10: return 4;
   87878    case 9: return 4;
   87879    case 8: return 0;
   87880    case 7:
   87881       if (devinfo->is_haswell) {
   87882          return 0;
   87883       } else {
   87884          return 0;
   87885       }
   87886    case 6: return 0;
   87887    case 5: return 0;
   87888    case 4:
   87889       if (devinfo->is_g4x) {
   87890          return 0;
   87891       } else {
   87892          return 0;
   87893       }
   87894    default:
   87895       unreachable("Invalid hardware generation");
   87896    }
   87897 }
   87898 
   87899 
   87900 
   87901 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement17Enables_start  100
   87902 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement17Enables_start  100
   87903 
   87904 static inline uint32_t ATTRIBUTE_PURE
   87905 _3DSTATE_VF_COMPONENT_PACKING_VertexElement17Enables_start(const struct gen_device_info *devinfo)
   87906 {
   87907    switch (devinfo->gen) {
   87908    case 10: return 100;
   87909    case 9: return 100;
   87910    case 8: return 0;
   87911    case 7:
   87912       if (devinfo->is_haswell) {
   87913          return 0;
   87914       } else {
   87915          return 0;
   87916       }
   87917    case 6: return 0;
   87918    case 5: return 0;
   87919    case 4:
   87920       if (devinfo->is_g4x) {
   87921          return 0;
   87922       } else {
   87923          return 0;
   87924       }
   87925    default:
   87926       unreachable("Invalid hardware generation");
   87927    }
   87928 }
   87929 
   87930 
   87931 
   87932 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 18 Enables */
   87933 
   87934 
   87935 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement18Enables_bits  4
   87936 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement18Enables_bits  4
   87937 
   87938 static inline uint32_t ATTRIBUTE_PURE
   87939 _3DSTATE_VF_COMPONENT_PACKING_VertexElement18Enables_bits(const struct gen_device_info *devinfo)
   87940 {
   87941    switch (devinfo->gen) {
   87942    case 10: return 4;
   87943    case 9: return 4;
   87944    case 8: return 0;
   87945    case 7:
   87946       if (devinfo->is_haswell) {
   87947          return 0;
   87948       } else {
   87949          return 0;
   87950       }
   87951    case 6: return 0;
   87952    case 5: return 0;
   87953    case 4:
   87954       if (devinfo->is_g4x) {
   87955          return 0;
   87956       } else {
   87957          return 0;
   87958       }
   87959    default:
   87960       unreachable("Invalid hardware generation");
   87961    }
   87962 }
   87963 
   87964 
   87965 
   87966 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement18Enables_start  104
   87967 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement18Enables_start  104
   87968 
   87969 static inline uint32_t ATTRIBUTE_PURE
   87970 _3DSTATE_VF_COMPONENT_PACKING_VertexElement18Enables_start(const struct gen_device_info *devinfo)
   87971 {
   87972    switch (devinfo->gen) {
   87973    case 10: return 104;
   87974    case 9: return 104;
   87975    case 8: return 0;
   87976    case 7:
   87977       if (devinfo->is_haswell) {
   87978          return 0;
   87979       } else {
   87980          return 0;
   87981       }
   87982    case 6: return 0;
   87983    case 5: return 0;
   87984    case 4:
   87985       if (devinfo->is_g4x) {
   87986          return 0;
   87987       } else {
   87988          return 0;
   87989       }
   87990    default:
   87991       unreachable("Invalid hardware generation");
   87992    }
   87993 }
   87994 
   87995 
   87996 
   87997 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 19 Enables */
   87998 
   87999 
   88000 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement19Enables_bits  4
   88001 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement19Enables_bits  4
   88002 
   88003 static inline uint32_t ATTRIBUTE_PURE
   88004 _3DSTATE_VF_COMPONENT_PACKING_VertexElement19Enables_bits(const struct gen_device_info *devinfo)
   88005 {
   88006    switch (devinfo->gen) {
   88007    case 10: return 4;
   88008    case 9: return 4;
   88009    case 8: return 0;
   88010    case 7:
   88011       if (devinfo->is_haswell) {
   88012          return 0;
   88013       } else {
   88014          return 0;
   88015       }
   88016    case 6: return 0;
   88017    case 5: return 0;
   88018    case 4:
   88019       if (devinfo->is_g4x) {
   88020          return 0;
   88021       } else {
   88022          return 0;
   88023       }
   88024    default:
   88025       unreachable("Invalid hardware generation");
   88026    }
   88027 }
   88028 
   88029 
   88030 
   88031 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement19Enables_start  108
   88032 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement19Enables_start  108
   88033 
   88034 static inline uint32_t ATTRIBUTE_PURE
   88035 _3DSTATE_VF_COMPONENT_PACKING_VertexElement19Enables_start(const struct gen_device_info *devinfo)
   88036 {
   88037    switch (devinfo->gen) {
   88038    case 10: return 108;
   88039    case 9: return 108;
   88040    case 8: return 0;
   88041    case 7:
   88042       if (devinfo->is_haswell) {
   88043          return 0;
   88044       } else {
   88045          return 0;
   88046       }
   88047    case 6: return 0;
   88048    case 5: return 0;
   88049    case 4:
   88050       if (devinfo->is_g4x) {
   88051          return 0;
   88052       } else {
   88053          return 0;
   88054       }
   88055    default:
   88056       unreachable("Invalid hardware generation");
   88057    }
   88058 }
   88059 
   88060 
   88061 
   88062 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 20 Enables */
   88063 
   88064 
   88065 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement20Enables_bits  4
   88066 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement20Enables_bits  4
   88067 
   88068 static inline uint32_t ATTRIBUTE_PURE
   88069 _3DSTATE_VF_COMPONENT_PACKING_VertexElement20Enables_bits(const struct gen_device_info *devinfo)
   88070 {
   88071    switch (devinfo->gen) {
   88072    case 10: return 4;
   88073    case 9: return 4;
   88074    case 8: return 0;
   88075    case 7:
   88076       if (devinfo->is_haswell) {
   88077          return 0;
   88078       } else {
   88079          return 0;
   88080       }
   88081    case 6: return 0;
   88082    case 5: return 0;
   88083    case 4:
   88084       if (devinfo->is_g4x) {
   88085          return 0;
   88086       } else {
   88087          return 0;
   88088       }
   88089    default:
   88090       unreachable("Invalid hardware generation");
   88091    }
   88092 }
   88093 
   88094 
   88095 
   88096 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement20Enables_start  112
   88097 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement20Enables_start  112
   88098 
   88099 static inline uint32_t ATTRIBUTE_PURE
   88100 _3DSTATE_VF_COMPONENT_PACKING_VertexElement20Enables_start(const struct gen_device_info *devinfo)
   88101 {
   88102    switch (devinfo->gen) {
   88103    case 10: return 112;
   88104    case 9: return 112;
   88105    case 8: return 0;
   88106    case 7:
   88107       if (devinfo->is_haswell) {
   88108          return 0;
   88109       } else {
   88110          return 0;
   88111       }
   88112    case 6: return 0;
   88113    case 5: return 0;
   88114    case 4:
   88115       if (devinfo->is_g4x) {
   88116          return 0;
   88117       } else {
   88118          return 0;
   88119       }
   88120    default:
   88121       unreachable("Invalid hardware generation");
   88122    }
   88123 }
   88124 
   88125 
   88126 
   88127 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 21 Enables */
   88128 
   88129 
   88130 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement21Enables_bits  4
   88131 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement21Enables_bits  4
   88132 
   88133 static inline uint32_t ATTRIBUTE_PURE
   88134 _3DSTATE_VF_COMPONENT_PACKING_VertexElement21Enables_bits(const struct gen_device_info *devinfo)
   88135 {
   88136    switch (devinfo->gen) {
   88137    case 10: return 4;
   88138    case 9: return 4;
   88139    case 8: return 0;
   88140    case 7:
   88141       if (devinfo->is_haswell) {
   88142          return 0;
   88143       } else {
   88144          return 0;
   88145       }
   88146    case 6: return 0;
   88147    case 5: return 0;
   88148    case 4:
   88149       if (devinfo->is_g4x) {
   88150          return 0;
   88151       } else {
   88152          return 0;
   88153       }
   88154    default:
   88155       unreachable("Invalid hardware generation");
   88156    }
   88157 }
   88158 
   88159 
   88160 
   88161 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement21Enables_start  116
   88162 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement21Enables_start  116
   88163 
   88164 static inline uint32_t ATTRIBUTE_PURE
   88165 _3DSTATE_VF_COMPONENT_PACKING_VertexElement21Enables_start(const struct gen_device_info *devinfo)
   88166 {
   88167    switch (devinfo->gen) {
   88168    case 10: return 116;
   88169    case 9: return 116;
   88170    case 8: return 0;
   88171    case 7:
   88172       if (devinfo->is_haswell) {
   88173          return 0;
   88174       } else {
   88175          return 0;
   88176       }
   88177    case 6: return 0;
   88178    case 5: return 0;
   88179    case 4:
   88180       if (devinfo->is_g4x) {
   88181          return 0;
   88182       } else {
   88183          return 0;
   88184       }
   88185    default:
   88186       unreachable("Invalid hardware generation");
   88187    }
   88188 }
   88189 
   88190 
   88191 
   88192 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 22 Enables */
   88193 
   88194 
   88195 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement22Enables_bits  4
   88196 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement22Enables_bits  4
   88197 
   88198 static inline uint32_t ATTRIBUTE_PURE
   88199 _3DSTATE_VF_COMPONENT_PACKING_VertexElement22Enables_bits(const struct gen_device_info *devinfo)
   88200 {
   88201    switch (devinfo->gen) {
   88202    case 10: return 4;
   88203    case 9: return 4;
   88204    case 8: return 0;
   88205    case 7:
   88206       if (devinfo->is_haswell) {
   88207          return 0;
   88208       } else {
   88209          return 0;
   88210       }
   88211    case 6: return 0;
   88212    case 5: return 0;
   88213    case 4:
   88214       if (devinfo->is_g4x) {
   88215          return 0;
   88216       } else {
   88217          return 0;
   88218       }
   88219    default:
   88220       unreachable("Invalid hardware generation");
   88221    }
   88222 }
   88223 
   88224 
   88225 
   88226 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement22Enables_start  120
   88227 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement22Enables_start  120
   88228 
   88229 static inline uint32_t ATTRIBUTE_PURE
   88230 _3DSTATE_VF_COMPONENT_PACKING_VertexElement22Enables_start(const struct gen_device_info *devinfo)
   88231 {
   88232    switch (devinfo->gen) {
   88233    case 10: return 120;
   88234    case 9: return 120;
   88235    case 8: return 0;
   88236    case 7:
   88237       if (devinfo->is_haswell) {
   88238          return 0;
   88239       } else {
   88240          return 0;
   88241       }
   88242    case 6: return 0;
   88243    case 5: return 0;
   88244    case 4:
   88245       if (devinfo->is_g4x) {
   88246          return 0;
   88247       } else {
   88248          return 0;
   88249       }
   88250    default:
   88251       unreachable("Invalid hardware generation");
   88252    }
   88253 }
   88254 
   88255 
   88256 
   88257 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 23 Enables */
   88258 
   88259 
   88260 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement23Enables_bits  4
   88261 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement23Enables_bits  4
   88262 
   88263 static inline uint32_t ATTRIBUTE_PURE
   88264 _3DSTATE_VF_COMPONENT_PACKING_VertexElement23Enables_bits(const struct gen_device_info *devinfo)
   88265 {
   88266    switch (devinfo->gen) {
   88267    case 10: return 4;
   88268    case 9: return 4;
   88269    case 8: return 0;
   88270    case 7:
   88271       if (devinfo->is_haswell) {
   88272          return 0;
   88273       } else {
   88274          return 0;
   88275       }
   88276    case 6: return 0;
   88277    case 5: return 0;
   88278    case 4:
   88279       if (devinfo->is_g4x) {
   88280          return 0;
   88281       } else {
   88282          return 0;
   88283       }
   88284    default:
   88285       unreachable("Invalid hardware generation");
   88286    }
   88287 }
   88288 
   88289 
   88290 
   88291 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement23Enables_start  124
   88292 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement23Enables_start  124
   88293 
   88294 static inline uint32_t ATTRIBUTE_PURE
   88295 _3DSTATE_VF_COMPONENT_PACKING_VertexElement23Enables_start(const struct gen_device_info *devinfo)
   88296 {
   88297    switch (devinfo->gen) {
   88298    case 10: return 124;
   88299    case 9: return 124;
   88300    case 8: return 0;
   88301    case 7:
   88302       if (devinfo->is_haswell) {
   88303          return 0;
   88304       } else {
   88305          return 0;
   88306       }
   88307    case 6: return 0;
   88308    case 5: return 0;
   88309    case 4:
   88310       if (devinfo->is_g4x) {
   88311          return 0;
   88312       } else {
   88313          return 0;
   88314       }
   88315    default:
   88316       unreachable("Invalid hardware generation");
   88317    }
   88318 }
   88319 
   88320 
   88321 
   88322 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 24 Enables */
   88323 
   88324 
   88325 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement24Enables_bits  4
   88326 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement24Enables_bits  4
   88327 
   88328 static inline uint32_t ATTRIBUTE_PURE
   88329 _3DSTATE_VF_COMPONENT_PACKING_VertexElement24Enables_bits(const struct gen_device_info *devinfo)
   88330 {
   88331    switch (devinfo->gen) {
   88332    case 10: return 4;
   88333    case 9: return 4;
   88334    case 8: return 0;
   88335    case 7:
   88336       if (devinfo->is_haswell) {
   88337          return 0;
   88338       } else {
   88339          return 0;
   88340       }
   88341    case 6: return 0;
   88342    case 5: return 0;
   88343    case 4:
   88344       if (devinfo->is_g4x) {
   88345          return 0;
   88346       } else {
   88347          return 0;
   88348       }
   88349    default:
   88350       unreachable("Invalid hardware generation");
   88351    }
   88352 }
   88353 
   88354 
   88355 
   88356 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement24Enables_start  128
   88357 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement24Enables_start  128
   88358 
   88359 static inline uint32_t ATTRIBUTE_PURE
   88360 _3DSTATE_VF_COMPONENT_PACKING_VertexElement24Enables_start(const struct gen_device_info *devinfo)
   88361 {
   88362    switch (devinfo->gen) {
   88363    case 10: return 128;
   88364    case 9: return 128;
   88365    case 8: return 0;
   88366    case 7:
   88367       if (devinfo->is_haswell) {
   88368          return 0;
   88369       } else {
   88370          return 0;
   88371       }
   88372    case 6: return 0;
   88373    case 5: return 0;
   88374    case 4:
   88375       if (devinfo->is_g4x) {
   88376          return 0;
   88377       } else {
   88378          return 0;
   88379       }
   88380    default:
   88381       unreachable("Invalid hardware generation");
   88382    }
   88383 }
   88384 
   88385 
   88386 
   88387 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 25 Enables */
   88388 
   88389 
   88390 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement25Enables_bits  4
   88391 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement25Enables_bits  4
   88392 
   88393 static inline uint32_t ATTRIBUTE_PURE
   88394 _3DSTATE_VF_COMPONENT_PACKING_VertexElement25Enables_bits(const struct gen_device_info *devinfo)
   88395 {
   88396    switch (devinfo->gen) {
   88397    case 10: return 4;
   88398    case 9: return 4;
   88399    case 8: return 0;
   88400    case 7:
   88401       if (devinfo->is_haswell) {
   88402          return 0;
   88403       } else {
   88404          return 0;
   88405       }
   88406    case 6: return 0;
   88407    case 5: return 0;
   88408    case 4:
   88409       if (devinfo->is_g4x) {
   88410          return 0;
   88411       } else {
   88412          return 0;
   88413       }
   88414    default:
   88415       unreachable("Invalid hardware generation");
   88416    }
   88417 }
   88418 
   88419 
   88420 
   88421 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement25Enables_start  132
   88422 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement25Enables_start  132
   88423 
   88424 static inline uint32_t ATTRIBUTE_PURE
   88425 _3DSTATE_VF_COMPONENT_PACKING_VertexElement25Enables_start(const struct gen_device_info *devinfo)
   88426 {
   88427    switch (devinfo->gen) {
   88428    case 10: return 132;
   88429    case 9: return 132;
   88430    case 8: return 0;
   88431    case 7:
   88432       if (devinfo->is_haswell) {
   88433          return 0;
   88434       } else {
   88435          return 0;
   88436       }
   88437    case 6: return 0;
   88438    case 5: return 0;
   88439    case 4:
   88440       if (devinfo->is_g4x) {
   88441          return 0;
   88442       } else {
   88443          return 0;
   88444       }
   88445    default:
   88446       unreachable("Invalid hardware generation");
   88447    }
   88448 }
   88449 
   88450 
   88451 
   88452 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 26 Enables */
   88453 
   88454 
   88455 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement26Enables_bits  4
   88456 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement26Enables_bits  4
   88457 
   88458 static inline uint32_t ATTRIBUTE_PURE
   88459 _3DSTATE_VF_COMPONENT_PACKING_VertexElement26Enables_bits(const struct gen_device_info *devinfo)
   88460 {
   88461    switch (devinfo->gen) {
   88462    case 10: return 4;
   88463    case 9: return 4;
   88464    case 8: return 0;
   88465    case 7:
   88466       if (devinfo->is_haswell) {
   88467          return 0;
   88468       } else {
   88469          return 0;
   88470       }
   88471    case 6: return 0;
   88472    case 5: return 0;
   88473    case 4:
   88474       if (devinfo->is_g4x) {
   88475          return 0;
   88476       } else {
   88477          return 0;
   88478       }
   88479    default:
   88480       unreachable("Invalid hardware generation");
   88481    }
   88482 }
   88483 
   88484 
   88485 
   88486 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement26Enables_start  136
   88487 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement26Enables_start  136
   88488 
   88489 static inline uint32_t ATTRIBUTE_PURE
   88490 _3DSTATE_VF_COMPONENT_PACKING_VertexElement26Enables_start(const struct gen_device_info *devinfo)
   88491 {
   88492    switch (devinfo->gen) {
   88493    case 10: return 136;
   88494    case 9: return 136;
   88495    case 8: return 0;
   88496    case 7:
   88497       if (devinfo->is_haswell) {
   88498          return 0;
   88499       } else {
   88500          return 0;
   88501       }
   88502    case 6: return 0;
   88503    case 5: return 0;
   88504    case 4:
   88505       if (devinfo->is_g4x) {
   88506          return 0;
   88507       } else {
   88508          return 0;
   88509       }
   88510    default:
   88511       unreachable("Invalid hardware generation");
   88512    }
   88513 }
   88514 
   88515 
   88516 
   88517 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 27 Enables */
   88518 
   88519 
   88520 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement27Enables_bits  4
   88521 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement27Enables_bits  4
   88522 
   88523 static inline uint32_t ATTRIBUTE_PURE
   88524 _3DSTATE_VF_COMPONENT_PACKING_VertexElement27Enables_bits(const struct gen_device_info *devinfo)
   88525 {
   88526    switch (devinfo->gen) {
   88527    case 10: return 4;
   88528    case 9: return 4;
   88529    case 8: return 0;
   88530    case 7:
   88531       if (devinfo->is_haswell) {
   88532          return 0;
   88533       } else {
   88534          return 0;
   88535       }
   88536    case 6: return 0;
   88537    case 5: return 0;
   88538    case 4:
   88539       if (devinfo->is_g4x) {
   88540          return 0;
   88541       } else {
   88542          return 0;
   88543       }
   88544    default:
   88545       unreachable("Invalid hardware generation");
   88546    }
   88547 }
   88548 
   88549 
   88550 
   88551 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement27Enables_start  140
   88552 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement27Enables_start  140
   88553 
   88554 static inline uint32_t ATTRIBUTE_PURE
   88555 _3DSTATE_VF_COMPONENT_PACKING_VertexElement27Enables_start(const struct gen_device_info *devinfo)
   88556 {
   88557    switch (devinfo->gen) {
   88558    case 10: return 140;
   88559    case 9: return 140;
   88560    case 8: return 0;
   88561    case 7:
   88562       if (devinfo->is_haswell) {
   88563          return 0;
   88564       } else {
   88565          return 0;
   88566       }
   88567    case 6: return 0;
   88568    case 5: return 0;
   88569    case 4:
   88570       if (devinfo->is_g4x) {
   88571          return 0;
   88572       } else {
   88573          return 0;
   88574       }
   88575    default:
   88576       unreachable("Invalid hardware generation");
   88577    }
   88578 }
   88579 
   88580 
   88581 
   88582 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 28 Enables */
   88583 
   88584 
   88585 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement28Enables_bits  4
   88586 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement28Enables_bits  4
   88587 
   88588 static inline uint32_t ATTRIBUTE_PURE
   88589 _3DSTATE_VF_COMPONENT_PACKING_VertexElement28Enables_bits(const struct gen_device_info *devinfo)
   88590 {
   88591    switch (devinfo->gen) {
   88592    case 10: return 4;
   88593    case 9: return 4;
   88594    case 8: return 0;
   88595    case 7:
   88596       if (devinfo->is_haswell) {
   88597          return 0;
   88598       } else {
   88599          return 0;
   88600       }
   88601    case 6: return 0;
   88602    case 5: return 0;
   88603    case 4:
   88604       if (devinfo->is_g4x) {
   88605          return 0;
   88606       } else {
   88607          return 0;
   88608       }
   88609    default:
   88610       unreachable("Invalid hardware generation");
   88611    }
   88612 }
   88613 
   88614 
   88615 
   88616 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement28Enables_start  144
   88617 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement28Enables_start  144
   88618 
   88619 static inline uint32_t ATTRIBUTE_PURE
   88620 _3DSTATE_VF_COMPONENT_PACKING_VertexElement28Enables_start(const struct gen_device_info *devinfo)
   88621 {
   88622    switch (devinfo->gen) {
   88623    case 10: return 144;
   88624    case 9: return 144;
   88625    case 8: return 0;
   88626    case 7:
   88627       if (devinfo->is_haswell) {
   88628          return 0;
   88629       } else {
   88630          return 0;
   88631       }
   88632    case 6: return 0;
   88633    case 5: return 0;
   88634    case 4:
   88635       if (devinfo->is_g4x) {
   88636          return 0;
   88637       } else {
   88638          return 0;
   88639       }
   88640    default:
   88641       unreachable("Invalid hardware generation");
   88642    }
   88643 }
   88644 
   88645 
   88646 
   88647 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 29 Enables */
   88648 
   88649 
   88650 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement29Enables_bits  4
   88651 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement29Enables_bits  4
   88652 
   88653 static inline uint32_t ATTRIBUTE_PURE
   88654 _3DSTATE_VF_COMPONENT_PACKING_VertexElement29Enables_bits(const struct gen_device_info *devinfo)
   88655 {
   88656    switch (devinfo->gen) {
   88657    case 10: return 4;
   88658    case 9: return 4;
   88659    case 8: return 0;
   88660    case 7:
   88661       if (devinfo->is_haswell) {
   88662          return 0;
   88663       } else {
   88664          return 0;
   88665       }
   88666    case 6: return 0;
   88667    case 5: return 0;
   88668    case 4:
   88669       if (devinfo->is_g4x) {
   88670          return 0;
   88671       } else {
   88672          return 0;
   88673       }
   88674    default:
   88675       unreachable("Invalid hardware generation");
   88676    }
   88677 }
   88678 
   88679 
   88680 
   88681 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement29Enables_start  148
   88682 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement29Enables_start  148
   88683 
   88684 static inline uint32_t ATTRIBUTE_PURE
   88685 _3DSTATE_VF_COMPONENT_PACKING_VertexElement29Enables_start(const struct gen_device_info *devinfo)
   88686 {
   88687    switch (devinfo->gen) {
   88688    case 10: return 148;
   88689    case 9: return 148;
   88690    case 8: return 0;
   88691    case 7:
   88692       if (devinfo->is_haswell) {
   88693          return 0;
   88694       } else {
   88695          return 0;
   88696       }
   88697    case 6: return 0;
   88698    case 5: return 0;
   88699    case 4:
   88700       if (devinfo->is_g4x) {
   88701          return 0;
   88702       } else {
   88703          return 0;
   88704       }
   88705    default:
   88706       unreachable("Invalid hardware generation");
   88707    }
   88708 }
   88709 
   88710 
   88711 
   88712 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 30 Enables */
   88713 
   88714 
   88715 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement30Enables_bits  4
   88716 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement30Enables_bits  4
   88717 
   88718 static inline uint32_t ATTRIBUTE_PURE
   88719 _3DSTATE_VF_COMPONENT_PACKING_VertexElement30Enables_bits(const struct gen_device_info *devinfo)
   88720 {
   88721    switch (devinfo->gen) {
   88722    case 10: return 4;
   88723    case 9: return 4;
   88724    case 8: return 0;
   88725    case 7:
   88726       if (devinfo->is_haswell) {
   88727          return 0;
   88728       } else {
   88729          return 0;
   88730       }
   88731    case 6: return 0;
   88732    case 5: return 0;
   88733    case 4:
   88734       if (devinfo->is_g4x) {
   88735          return 0;
   88736       } else {
   88737          return 0;
   88738       }
   88739    default:
   88740       unreachable("Invalid hardware generation");
   88741    }
   88742 }
   88743 
   88744 
   88745 
   88746 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement30Enables_start  152
   88747 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement30Enables_start  152
   88748 
   88749 static inline uint32_t ATTRIBUTE_PURE
   88750 _3DSTATE_VF_COMPONENT_PACKING_VertexElement30Enables_start(const struct gen_device_info *devinfo)
   88751 {
   88752    switch (devinfo->gen) {
   88753    case 10: return 152;
   88754    case 9: return 152;
   88755    case 8: return 0;
   88756    case 7:
   88757       if (devinfo->is_haswell) {
   88758          return 0;
   88759       } else {
   88760          return 0;
   88761       }
   88762    case 6: return 0;
   88763    case 5: return 0;
   88764    case 4:
   88765       if (devinfo->is_g4x) {
   88766          return 0;
   88767       } else {
   88768          return 0;
   88769       }
   88770    default:
   88771       unreachable("Invalid hardware generation");
   88772    }
   88773 }
   88774 
   88775 
   88776 
   88777 /* 3DSTATE_VF_COMPONENT_PACKING::Vertex Element 31 Enables */
   88778 
   88779 
   88780 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement31Enables_bits  4
   88781 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement31Enables_bits  4
   88782 
   88783 static inline uint32_t ATTRIBUTE_PURE
   88784 _3DSTATE_VF_COMPONENT_PACKING_VertexElement31Enables_bits(const struct gen_device_info *devinfo)
   88785 {
   88786    switch (devinfo->gen) {
   88787    case 10: return 4;
   88788    case 9: return 4;
   88789    case 8: return 0;
   88790    case 7:
   88791       if (devinfo->is_haswell) {
   88792          return 0;
   88793       } else {
   88794          return 0;
   88795       }
   88796    case 6: return 0;
   88797    case 5: return 0;
   88798    case 4:
   88799       if (devinfo->is_g4x) {
   88800          return 0;
   88801       } else {
   88802          return 0;
   88803       }
   88804    default:
   88805       unreachable("Invalid hardware generation");
   88806    }
   88807 }
   88808 
   88809 
   88810 
   88811 #define GEN10_3DSTATE_VF_COMPONENT_PACKING_VertexElement31Enables_start  156
   88812 #define GEN9_3DSTATE_VF_COMPONENT_PACKING_VertexElement31Enables_start  156
   88813 
   88814 static inline uint32_t ATTRIBUTE_PURE
   88815 _3DSTATE_VF_COMPONENT_PACKING_VertexElement31Enables_start(const struct gen_device_info *devinfo)
   88816 {
   88817    switch (devinfo->gen) {
   88818    case 10: return 156;
   88819    case 9: return 156;
   88820    case 8: return 0;
   88821    case 7:
   88822       if (devinfo->is_haswell) {
   88823          return 0;
   88824       } else {
   88825          return 0;
   88826       }
   88827    case 6: return 0;
   88828    case 5: return 0;
   88829    case 4:
   88830       if (devinfo->is_g4x) {
   88831          return 0;
   88832       } else {
   88833          return 0;
   88834       }
   88835    default:
   88836       unreachable("Invalid hardware generation");
   88837    }
   88838 }
   88839 
   88840 
   88841 
   88842 /* 3DSTATE_VF_INSTANCING */
   88843 
   88844 
   88845 #define GEN10_3DSTATE_VF_INSTANCING_length  3
   88846 #define GEN9_3DSTATE_VF_INSTANCING_length  3
   88847 #define GEN8_3DSTATE_VF_INSTANCING_length  3
   88848 
   88849 static inline uint32_t ATTRIBUTE_PURE
   88850 _3DSTATE_VF_INSTANCING_length(const struct gen_device_info *devinfo)
   88851 {
   88852    switch (devinfo->gen) {
   88853    case 10: return 3;
   88854    case 9: return 3;
   88855    case 8: return 3;
   88856    case 7:
   88857       if (devinfo->is_haswell) {
   88858          return 0;
   88859       } else {
   88860          return 0;
   88861       }
   88862    case 6: return 0;
   88863    case 5: return 0;
   88864    case 4:
   88865       if (devinfo->is_g4x) {
   88866          return 0;
   88867       } else {
   88868          return 0;
   88869       }
   88870    default:
   88871       unreachable("Invalid hardware generation");
   88872    }
   88873 }
   88874 
   88875 
   88876 
   88877 /* 3DSTATE_VF_INSTANCING::3D Command Opcode */
   88878 
   88879 
   88880 #define GEN10_3DSTATE_VF_INSTANCING_3DCommandOpcode_bits  3
   88881 #define GEN9_3DSTATE_VF_INSTANCING_3DCommandOpcode_bits  3
   88882 #define GEN8_3DSTATE_VF_INSTANCING_3DCommandOpcode_bits  3
   88883 
   88884 static inline uint32_t ATTRIBUTE_PURE
   88885 _3DSTATE_VF_INSTANCING_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   88886 {
   88887    switch (devinfo->gen) {
   88888    case 10: return 3;
   88889    case 9: return 3;
   88890    case 8: return 3;
   88891    case 7:
   88892       if (devinfo->is_haswell) {
   88893          return 0;
   88894       } else {
   88895          return 0;
   88896       }
   88897    case 6: return 0;
   88898    case 5: return 0;
   88899    case 4:
   88900       if (devinfo->is_g4x) {
   88901          return 0;
   88902       } else {
   88903          return 0;
   88904       }
   88905    default:
   88906       unreachable("Invalid hardware generation");
   88907    }
   88908 }
   88909 
   88910 
   88911 
   88912 #define GEN10_3DSTATE_VF_INSTANCING_3DCommandOpcode_start  24
   88913 #define GEN9_3DSTATE_VF_INSTANCING_3DCommandOpcode_start  24
   88914 #define GEN8_3DSTATE_VF_INSTANCING_3DCommandOpcode_start  24
   88915 
   88916 static inline uint32_t ATTRIBUTE_PURE
   88917 _3DSTATE_VF_INSTANCING_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   88918 {
   88919    switch (devinfo->gen) {
   88920    case 10: return 24;
   88921    case 9: return 24;
   88922    case 8: return 24;
   88923    case 7:
   88924       if (devinfo->is_haswell) {
   88925          return 0;
   88926       } else {
   88927          return 0;
   88928       }
   88929    case 6: return 0;
   88930    case 5: return 0;
   88931    case 4:
   88932       if (devinfo->is_g4x) {
   88933          return 0;
   88934       } else {
   88935          return 0;
   88936       }
   88937    default:
   88938       unreachable("Invalid hardware generation");
   88939    }
   88940 }
   88941 
   88942 
   88943 
   88944 /* 3DSTATE_VF_INSTANCING::3D Command Sub Opcode */
   88945 
   88946 
   88947 #define GEN10_3DSTATE_VF_INSTANCING_3DCommandSubOpcode_bits  8
   88948 #define GEN9_3DSTATE_VF_INSTANCING_3DCommandSubOpcode_bits  8
   88949 #define GEN8_3DSTATE_VF_INSTANCING_3DCommandSubOpcode_bits  8
   88950 
   88951 static inline uint32_t ATTRIBUTE_PURE
   88952 _3DSTATE_VF_INSTANCING_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   88953 {
   88954    switch (devinfo->gen) {
   88955    case 10: return 8;
   88956    case 9: return 8;
   88957    case 8: return 8;
   88958    case 7:
   88959       if (devinfo->is_haswell) {
   88960          return 0;
   88961       } else {
   88962          return 0;
   88963       }
   88964    case 6: return 0;
   88965    case 5: return 0;
   88966    case 4:
   88967       if (devinfo->is_g4x) {
   88968          return 0;
   88969       } else {
   88970          return 0;
   88971       }
   88972    default:
   88973       unreachable("Invalid hardware generation");
   88974    }
   88975 }
   88976 
   88977 
   88978 
   88979 #define GEN10_3DSTATE_VF_INSTANCING_3DCommandSubOpcode_start  16
   88980 #define GEN9_3DSTATE_VF_INSTANCING_3DCommandSubOpcode_start  16
   88981 #define GEN8_3DSTATE_VF_INSTANCING_3DCommandSubOpcode_start  16
   88982 
   88983 static inline uint32_t ATTRIBUTE_PURE
   88984 _3DSTATE_VF_INSTANCING_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   88985 {
   88986    switch (devinfo->gen) {
   88987    case 10: return 16;
   88988    case 9: return 16;
   88989    case 8: return 16;
   88990    case 7:
   88991       if (devinfo->is_haswell) {
   88992          return 0;
   88993       } else {
   88994          return 0;
   88995       }
   88996    case 6: return 0;
   88997    case 5: return 0;
   88998    case 4:
   88999       if (devinfo->is_g4x) {
   89000          return 0;
   89001       } else {
   89002          return 0;
   89003       }
   89004    default:
   89005       unreachable("Invalid hardware generation");
   89006    }
   89007 }
   89008 
   89009 
   89010 
   89011 /* 3DSTATE_VF_INSTANCING::Command SubType */
   89012 
   89013 
   89014 #define GEN10_3DSTATE_VF_INSTANCING_CommandSubType_bits  2
   89015 #define GEN9_3DSTATE_VF_INSTANCING_CommandSubType_bits  2
   89016 #define GEN8_3DSTATE_VF_INSTANCING_CommandSubType_bits  2
   89017 
   89018 static inline uint32_t ATTRIBUTE_PURE
   89019 _3DSTATE_VF_INSTANCING_CommandSubType_bits(const struct gen_device_info *devinfo)
   89020 {
   89021    switch (devinfo->gen) {
   89022    case 10: return 2;
   89023    case 9: return 2;
   89024    case 8: return 2;
   89025    case 7:
   89026       if (devinfo->is_haswell) {
   89027          return 0;
   89028       } else {
   89029          return 0;
   89030       }
   89031    case 6: return 0;
   89032    case 5: return 0;
   89033    case 4:
   89034       if (devinfo->is_g4x) {
   89035          return 0;
   89036       } else {
   89037          return 0;
   89038       }
   89039    default:
   89040       unreachable("Invalid hardware generation");
   89041    }
   89042 }
   89043 
   89044 
   89045 
   89046 #define GEN10_3DSTATE_VF_INSTANCING_CommandSubType_start  27
   89047 #define GEN9_3DSTATE_VF_INSTANCING_CommandSubType_start  27
   89048 #define GEN8_3DSTATE_VF_INSTANCING_CommandSubType_start  27
   89049 
   89050 static inline uint32_t ATTRIBUTE_PURE
   89051 _3DSTATE_VF_INSTANCING_CommandSubType_start(const struct gen_device_info *devinfo)
   89052 {
   89053    switch (devinfo->gen) {
   89054    case 10: return 27;
   89055    case 9: return 27;
   89056    case 8: return 27;
   89057    case 7:
   89058       if (devinfo->is_haswell) {
   89059          return 0;
   89060       } else {
   89061          return 0;
   89062       }
   89063    case 6: return 0;
   89064    case 5: return 0;
   89065    case 4:
   89066       if (devinfo->is_g4x) {
   89067          return 0;
   89068       } else {
   89069          return 0;
   89070       }
   89071    default:
   89072       unreachable("Invalid hardware generation");
   89073    }
   89074 }
   89075 
   89076 
   89077 
   89078 /* 3DSTATE_VF_INSTANCING::Command Type */
   89079 
   89080 
   89081 #define GEN10_3DSTATE_VF_INSTANCING_CommandType_bits  3
   89082 #define GEN9_3DSTATE_VF_INSTANCING_CommandType_bits  3
   89083 #define GEN8_3DSTATE_VF_INSTANCING_CommandType_bits  3
   89084 
   89085 static inline uint32_t ATTRIBUTE_PURE
   89086 _3DSTATE_VF_INSTANCING_CommandType_bits(const struct gen_device_info *devinfo)
   89087 {
   89088    switch (devinfo->gen) {
   89089    case 10: return 3;
   89090    case 9: return 3;
   89091    case 8: return 3;
   89092    case 7:
   89093       if (devinfo->is_haswell) {
   89094          return 0;
   89095       } else {
   89096          return 0;
   89097       }
   89098    case 6: return 0;
   89099    case 5: return 0;
   89100    case 4:
   89101       if (devinfo->is_g4x) {
   89102          return 0;
   89103       } else {
   89104          return 0;
   89105       }
   89106    default:
   89107       unreachable("Invalid hardware generation");
   89108    }
   89109 }
   89110 
   89111 
   89112 
   89113 #define GEN10_3DSTATE_VF_INSTANCING_CommandType_start  29
   89114 #define GEN9_3DSTATE_VF_INSTANCING_CommandType_start  29
   89115 #define GEN8_3DSTATE_VF_INSTANCING_CommandType_start  29
   89116 
   89117 static inline uint32_t ATTRIBUTE_PURE
   89118 _3DSTATE_VF_INSTANCING_CommandType_start(const struct gen_device_info *devinfo)
   89119 {
   89120    switch (devinfo->gen) {
   89121    case 10: return 29;
   89122    case 9: return 29;
   89123    case 8: return 29;
   89124    case 7:
   89125       if (devinfo->is_haswell) {
   89126          return 0;
   89127       } else {
   89128          return 0;
   89129       }
   89130    case 6: return 0;
   89131    case 5: return 0;
   89132    case 4:
   89133       if (devinfo->is_g4x) {
   89134          return 0;
   89135       } else {
   89136          return 0;
   89137       }
   89138    default:
   89139       unreachable("Invalid hardware generation");
   89140    }
   89141 }
   89142 
   89143 
   89144 
   89145 /* 3DSTATE_VF_INSTANCING::DWord Length */
   89146 
   89147 
   89148 #define GEN10_3DSTATE_VF_INSTANCING_DWordLength_bits  8
   89149 #define GEN9_3DSTATE_VF_INSTANCING_DWordLength_bits  8
   89150 #define GEN8_3DSTATE_VF_INSTANCING_DWordLength_bits  8
   89151 
   89152 static inline uint32_t ATTRIBUTE_PURE
   89153 _3DSTATE_VF_INSTANCING_DWordLength_bits(const struct gen_device_info *devinfo)
   89154 {
   89155    switch (devinfo->gen) {
   89156    case 10: return 8;
   89157    case 9: return 8;
   89158    case 8: return 8;
   89159    case 7:
   89160       if (devinfo->is_haswell) {
   89161          return 0;
   89162       } else {
   89163          return 0;
   89164       }
   89165    case 6: return 0;
   89166    case 5: return 0;
   89167    case 4:
   89168       if (devinfo->is_g4x) {
   89169          return 0;
   89170       } else {
   89171          return 0;
   89172       }
   89173    default:
   89174       unreachable("Invalid hardware generation");
   89175    }
   89176 }
   89177 
   89178 
   89179 
   89180 #define GEN10_3DSTATE_VF_INSTANCING_DWordLength_start  0
   89181 #define GEN9_3DSTATE_VF_INSTANCING_DWordLength_start  0
   89182 #define GEN8_3DSTATE_VF_INSTANCING_DWordLength_start  0
   89183 
   89184 static inline uint32_t ATTRIBUTE_PURE
   89185 _3DSTATE_VF_INSTANCING_DWordLength_start(const struct gen_device_info *devinfo)
   89186 {
   89187    switch (devinfo->gen) {
   89188    case 10: return 0;
   89189    case 9: return 0;
   89190    case 8: return 0;
   89191    case 7:
   89192       if (devinfo->is_haswell) {
   89193          return 0;
   89194       } else {
   89195          return 0;
   89196       }
   89197    case 6: return 0;
   89198    case 5: return 0;
   89199    case 4:
   89200       if (devinfo->is_g4x) {
   89201          return 0;
   89202       } else {
   89203          return 0;
   89204       }
   89205    default:
   89206       unreachable("Invalid hardware generation");
   89207    }
   89208 }
   89209 
   89210 
   89211 
   89212 /* 3DSTATE_VF_INSTANCING::Instance Data Step Rate */
   89213 
   89214 
   89215 #define GEN10_3DSTATE_VF_INSTANCING_InstanceDataStepRate_bits  32
   89216 #define GEN9_3DSTATE_VF_INSTANCING_InstanceDataStepRate_bits  32
   89217 #define GEN8_3DSTATE_VF_INSTANCING_InstanceDataStepRate_bits  32
   89218 
   89219 static inline uint32_t ATTRIBUTE_PURE
   89220 _3DSTATE_VF_INSTANCING_InstanceDataStepRate_bits(const struct gen_device_info *devinfo)
   89221 {
   89222    switch (devinfo->gen) {
   89223    case 10: return 32;
   89224    case 9: return 32;
   89225    case 8: return 32;
   89226    case 7:
   89227       if (devinfo->is_haswell) {
   89228          return 0;
   89229       } else {
   89230          return 0;
   89231       }
   89232    case 6: return 0;
   89233    case 5: return 0;
   89234    case 4:
   89235       if (devinfo->is_g4x) {
   89236          return 0;
   89237       } else {
   89238          return 0;
   89239       }
   89240    default:
   89241       unreachable("Invalid hardware generation");
   89242    }
   89243 }
   89244 
   89245 
   89246 
   89247 #define GEN10_3DSTATE_VF_INSTANCING_InstanceDataStepRate_start  64
   89248 #define GEN9_3DSTATE_VF_INSTANCING_InstanceDataStepRate_start  64
   89249 #define GEN8_3DSTATE_VF_INSTANCING_InstanceDataStepRate_start  64
   89250 
   89251 static inline uint32_t ATTRIBUTE_PURE
   89252 _3DSTATE_VF_INSTANCING_InstanceDataStepRate_start(const struct gen_device_info *devinfo)
   89253 {
   89254    switch (devinfo->gen) {
   89255    case 10: return 64;
   89256    case 9: return 64;
   89257    case 8: return 64;
   89258    case 7:
   89259       if (devinfo->is_haswell) {
   89260          return 0;
   89261       } else {
   89262          return 0;
   89263       }
   89264    case 6: return 0;
   89265    case 5: return 0;
   89266    case 4:
   89267       if (devinfo->is_g4x) {
   89268          return 0;
   89269       } else {
   89270          return 0;
   89271       }
   89272    default:
   89273       unreachable("Invalid hardware generation");
   89274    }
   89275 }
   89276 
   89277 
   89278 
   89279 /* 3DSTATE_VF_INSTANCING::Instancing Enable */
   89280 
   89281 
   89282 #define GEN10_3DSTATE_VF_INSTANCING_InstancingEnable_bits  1
   89283 #define GEN9_3DSTATE_VF_INSTANCING_InstancingEnable_bits  1
   89284 #define GEN8_3DSTATE_VF_INSTANCING_InstancingEnable_bits  1
   89285 
   89286 static inline uint32_t ATTRIBUTE_PURE
   89287 _3DSTATE_VF_INSTANCING_InstancingEnable_bits(const struct gen_device_info *devinfo)
   89288 {
   89289    switch (devinfo->gen) {
   89290    case 10: return 1;
   89291    case 9: return 1;
   89292    case 8: return 1;
   89293    case 7:
   89294       if (devinfo->is_haswell) {
   89295          return 0;
   89296       } else {
   89297          return 0;
   89298       }
   89299    case 6: return 0;
   89300    case 5: return 0;
   89301    case 4:
   89302       if (devinfo->is_g4x) {
   89303          return 0;
   89304       } else {
   89305          return 0;
   89306       }
   89307    default:
   89308       unreachable("Invalid hardware generation");
   89309    }
   89310 }
   89311 
   89312 
   89313 
   89314 #define GEN10_3DSTATE_VF_INSTANCING_InstancingEnable_start  40
   89315 #define GEN9_3DSTATE_VF_INSTANCING_InstancingEnable_start  40
   89316 #define GEN8_3DSTATE_VF_INSTANCING_InstancingEnable_start  40
   89317 
   89318 static inline uint32_t ATTRIBUTE_PURE
   89319 _3DSTATE_VF_INSTANCING_InstancingEnable_start(const struct gen_device_info *devinfo)
   89320 {
   89321    switch (devinfo->gen) {
   89322    case 10: return 40;
   89323    case 9: return 40;
   89324    case 8: return 40;
   89325    case 7:
   89326       if (devinfo->is_haswell) {
   89327          return 0;
   89328       } else {
   89329          return 0;
   89330       }
   89331    case 6: return 0;
   89332    case 5: return 0;
   89333    case 4:
   89334       if (devinfo->is_g4x) {
   89335          return 0;
   89336       } else {
   89337          return 0;
   89338       }
   89339    default:
   89340       unreachable("Invalid hardware generation");
   89341    }
   89342 }
   89343 
   89344 
   89345 
   89346 /* 3DSTATE_VF_INSTANCING::Vertex Element Index */
   89347 
   89348 
   89349 #define GEN10_3DSTATE_VF_INSTANCING_VertexElementIndex_bits  6
   89350 #define GEN9_3DSTATE_VF_INSTANCING_VertexElementIndex_bits  6
   89351 #define GEN8_3DSTATE_VF_INSTANCING_VertexElementIndex_bits  6
   89352 
   89353 static inline uint32_t ATTRIBUTE_PURE
   89354 _3DSTATE_VF_INSTANCING_VertexElementIndex_bits(const struct gen_device_info *devinfo)
   89355 {
   89356    switch (devinfo->gen) {
   89357    case 10: return 6;
   89358    case 9: return 6;
   89359    case 8: return 6;
   89360    case 7:
   89361       if (devinfo->is_haswell) {
   89362          return 0;
   89363       } else {
   89364          return 0;
   89365       }
   89366    case 6: return 0;
   89367    case 5: return 0;
   89368    case 4:
   89369       if (devinfo->is_g4x) {
   89370          return 0;
   89371       } else {
   89372          return 0;
   89373       }
   89374    default:
   89375       unreachable("Invalid hardware generation");
   89376    }
   89377 }
   89378 
   89379 
   89380 
   89381 #define GEN10_3DSTATE_VF_INSTANCING_VertexElementIndex_start  32
   89382 #define GEN9_3DSTATE_VF_INSTANCING_VertexElementIndex_start  32
   89383 #define GEN8_3DSTATE_VF_INSTANCING_VertexElementIndex_start  32
   89384 
   89385 static inline uint32_t ATTRIBUTE_PURE
   89386 _3DSTATE_VF_INSTANCING_VertexElementIndex_start(const struct gen_device_info *devinfo)
   89387 {
   89388    switch (devinfo->gen) {
   89389    case 10: return 32;
   89390    case 9: return 32;
   89391    case 8: return 32;
   89392    case 7:
   89393       if (devinfo->is_haswell) {
   89394          return 0;
   89395       } else {
   89396          return 0;
   89397       }
   89398    case 6: return 0;
   89399    case 5: return 0;
   89400    case 4:
   89401       if (devinfo->is_g4x) {
   89402          return 0;
   89403       } else {
   89404          return 0;
   89405       }
   89406    default:
   89407       unreachable("Invalid hardware generation");
   89408    }
   89409 }
   89410 
   89411 
   89412 
   89413 /* 3DSTATE_VF_SGVS */
   89414 
   89415 
   89416 #define GEN10_3DSTATE_VF_SGVS_length  2
   89417 #define GEN9_3DSTATE_VF_SGVS_length  2
   89418 #define GEN8_3DSTATE_VF_SGVS_length  2
   89419 
   89420 static inline uint32_t ATTRIBUTE_PURE
   89421 _3DSTATE_VF_SGVS_length(const struct gen_device_info *devinfo)
   89422 {
   89423    switch (devinfo->gen) {
   89424    case 10: return 2;
   89425    case 9: return 2;
   89426    case 8: return 2;
   89427    case 7:
   89428       if (devinfo->is_haswell) {
   89429          return 0;
   89430       } else {
   89431          return 0;
   89432       }
   89433    case 6: return 0;
   89434    case 5: return 0;
   89435    case 4:
   89436       if (devinfo->is_g4x) {
   89437          return 0;
   89438       } else {
   89439          return 0;
   89440       }
   89441    default:
   89442       unreachable("Invalid hardware generation");
   89443    }
   89444 }
   89445 
   89446 
   89447 
   89448 /* 3DSTATE_VF_SGVS::3D Command Opcode */
   89449 
   89450 
   89451 #define GEN10_3DSTATE_VF_SGVS_3DCommandOpcode_bits  3
   89452 #define GEN9_3DSTATE_VF_SGVS_3DCommandOpcode_bits  3
   89453 #define GEN8_3DSTATE_VF_SGVS_3DCommandOpcode_bits  3
   89454 
   89455 static inline uint32_t ATTRIBUTE_PURE
   89456 _3DSTATE_VF_SGVS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   89457 {
   89458    switch (devinfo->gen) {
   89459    case 10: return 3;
   89460    case 9: return 3;
   89461    case 8: return 3;
   89462    case 7:
   89463       if (devinfo->is_haswell) {
   89464          return 0;
   89465       } else {
   89466          return 0;
   89467       }
   89468    case 6: return 0;
   89469    case 5: return 0;
   89470    case 4:
   89471       if (devinfo->is_g4x) {
   89472          return 0;
   89473       } else {
   89474          return 0;
   89475       }
   89476    default:
   89477       unreachable("Invalid hardware generation");
   89478    }
   89479 }
   89480 
   89481 
   89482 
   89483 #define GEN10_3DSTATE_VF_SGVS_3DCommandOpcode_start  24
   89484 #define GEN9_3DSTATE_VF_SGVS_3DCommandOpcode_start  24
   89485 #define GEN8_3DSTATE_VF_SGVS_3DCommandOpcode_start  24
   89486 
   89487 static inline uint32_t ATTRIBUTE_PURE
   89488 _3DSTATE_VF_SGVS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   89489 {
   89490    switch (devinfo->gen) {
   89491    case 10: return 24;
   89492    case 9: return 24;
   89493    case 8: return 24;
   89494    case 7:
   89495       if (devinfo->is_haswell) {
   89496          return 0;
   89497       } else {
   89498          return 0;
   89499       }
   89500    case 6: return 0;
   89501    case 5: return 0;
   89502    case 4:
   89503       if (devinfo->is_g4x) {
   89504          return 0;
   89505       } else {
   89506          return 0;
   89507       }
   89508    default:
   89509       unreachable("Invalid hardware generation");
   89510    }
   89511 }
   89512 
   89513 
   89514 
   89515 /* 3DSTATE_VF_SGVS::3D Command Sub Opcode */
   89516 
   89517 
   89518 #define GEN10_3DSTATE_VF_SGVS_3DCommandSubOpcode_bits  8
   89519 #define GEN9_3DSTATE_VF_SGVS_3DCommandSubOpcode_bits  8
   89520 #define GEN8_3DSTATE_VF_SGVS_3DCommandSubOpcode_bits  8
   89521 
   89522 static inline uint32_t ATTRIBUTE_PURE
   89523 _3DSTATE_VF_SGVS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   89524 {
   89525    switch (devinfo->gen) {
   89526    case 10: return 8;
   89527    case 9: return 8;
   89528    case 8: return 8;
   89529    case 7:
   89530       if (devinfo->is_haswell) {
   89531          return 0;
   89532       } else {
   89533          return 0;
   89534       }
   89535    case 6: return 0;
   89536    case 5: return 0;
   89537    case 4:
   89538       if (devinfo->is_g4x) {
   89539          return 0;
   89540       } else {
   89541          return 0;
   89542       }
   89543    default:
   89544       unreachable("Invalid hardware generation");
   89545    }
   89546 }
   89547 
   89548 
   89549 
   89550 #define GEN10_3DSTATE_VF_SGVS_3DCommandSubOpcode_start  16
   89551 #define GEN9_3DSTATE_VF_SGVS_3DCommandSubOpcode_start  16
   89552 #define GEN8_3DSTATE_VF_SGVS_3DCommandSubOpcode_start  16
   89553 
   89554 static inline uint32_t ATTRIBUTE_PURE
   89555 _3DSTATE_VF_SGVS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   89556 {
   89557    switch (devinfo->gen) {
   89558    case 10: return 16;
   89559    case 9: return 16;
   89560    case 8: return 16;
   89561    case 7:
   89562       if (devinfo->is_haswell) {
   89563          return 0;
   89564       } else {
   89565          return 0;
   89566       }
   89567    case 6: return 0;
   89568    case 5: return 0;
   89569    case 4:
   89570       if (devinfo->is_g4x) {
   89571          return 0;
   89572       } else {
   89573          return 0;
   89574       }
   89575    default:
   89576       unreachable("Invalid hardware generation");
   89577    }
   89578 }
   89579 
   89580 
   89581 
   89582 /* 3DSTATE_VF_SGVS::Command SubType */
   89583 
   89584 
   89585 #define GEN10_3DSTATE_VF_SGVS_CommandSubType_bits  2
   89586 #define GEN9_3DSTATE_VF_SGVS_CommandSubType_bits  2
   89587 #define GEN8_3DSTATE_VF_SGVS_CommandSubType_bits  2
   89588 
   89589 static inline uint32_t ATTRIBUTE_PURE
   89590 _3DSTATE_VF_SGVS_CommandSubType_bits(const struct gen_device_info *devinfo)
   89591 {
   89592    switch (devinfo->gen) {
   89593    case 10: return 2;
   89594    case 9: return 2;
   89595    case 8: return 2;
   89596    case 7:
   89597       if (devinfo->is_haswell) {
   89598          return 0;
   89599       } else {
   89600          return 0;
   89601       }
   89602    case 6: return 0;
   89603    case 5: return 0;
   89604    case 4:
   89605       if (devinfo->is_g4x) {
   89606          return 0;
   89607       } else {
   89608          return 0;
   89609       }
   89610    default:
   89611       unreachable("Invalid hardware generation");
   89612    }
   89613 }
   89614 
   89615 
   89616 
   89617 #define GEN10_3DSTATE_VF_SGVS_CommandSubType_start  27
   89618 #define GEN9_3DSTATE_VF_SGVS_CommandSubType_start  27
   89619 #define GEN8_3DSTATE_VF_SGVS_CommandSubType_start  27
   89620 
   89621 static inline uint32_t ATTRIBUTE_PURE
   89622 _3DSTATE_VF_SGVS_CommandSubType_start(const struct gen_device_info *devinfo)
   89623 {
   89624    switch (devinfo->gen) {
   89625    case 10: return 27;
   89626    case 9: return 27;
   89627    case 8: return 27;
   89628    case 7:
   89629       if (devinfo->is_haswell) {
   89630          return 0;
   89631       } else {
   89632          return 0;
   89633       }
   89634    case 6: return 0;
   89635    case 5: return 0;
   89636    case 4:
   89637       if (devinfo->is_g4x) {
   89638          return 0;
   89639       } else {
   89640          return 0;
   89641       }
   89642    default:
   89643       unreachable("Invalid hardware generation");
   89644    }
   89645 }
   89646 
   89647 
   89648 
   89649 /* 3DSTATE_VF_SGVS::Command Type */
   89650 
   89651 
   89652 #define GEN10_3DSTATE_VF_SGVS_CommandType_bits  3
   89653 #define GEN9_3DSTATE_VF_SGVS_CommandType_bits  3
   89654 #define GEN8_3DSTATE_VF_SGVS_CommandType_bits  3
   89655 
   89656 static inline uint32_t ATTRIBUTE_PURE
   89657 _3DSTATE_VF_SGVS_CommandType_bits(const struct gen_device_info *devinfo)
   89658 {
   89659    switch (devinfo->gen) {
   89660    case 10: return 3;
   89661    case 9: return 3;
   89662    case 8: return 3;
   89663    case 7:
   89664       if (devinfo->is_haswell) {
   89665          return 0;
   89666       } else {
   89667          return 0;
   89668       }
   89669    case 6: return 0;
   89670    case 5: return 0;
   89671    case 4:
   89672       if (devinfo->is_g4x) {
   89673          return 0;
   89674       } else {
   89675          return 0;
   89676       }
   89677    default:
   89678       unreachable("Invalid hardware generation");
   89679    }
   89680 }
   89681 
   89682 
   89683 
   89684 #define GEN10_3DSTATE_VF_SGVS_CommandType_start  29
   89685 #define GEN9_3DSTATE_VF_SGVS_CommandType_start  29
   89686 #define GEN8_3DSTATE_VF_SGVS_CommandType_start  29
   89687 
   89688 static inline uint32_t ATTRIBUTE_PURE
   89689 _3DSTATE_VF_SGVS_CommandType_start(const struct gen_device_info *devinfo)
   89690 {
   89691    switch (devinfo->gen) {
   89692    case 10: return 29;
   89693    case 9: return 29;
   89694    case 8: return 29;
   89695    case 7:
   89696       if (devinfo->is_haswell) {
   89697          return 0;
   89698       } else {
   89699          return 0;
   89700       }
   89701    case 6: return 0;
   89702    case 5: return 0;
   89703    case 4:
   89704       if (devinfo->is_g4x) {
   89705          return 0;
   89706       } else {
   89707          return 0;
   89708       }
   89709    default:
   89710       unreachable("Invalid hardware generation");
   89711    }
   89712 }
   89713 
   89714 
   89715 
   89716 /* 3DSTATE_VF_SGVS::DWord Length */
   89717 
   89718 
   89719 #define GEN10_3DSTATE_VF_SGVS_DWordLength_bits  8
   89720 #define GEN9_3DSTATE_VF_SGVS_DWordLength_bits  8
   89721 #define GEN8_3DSTATE_VF_SGVS_DWordLength_bits  8
   89722 
   89723 static inline uint32_t ATTRIBUTE_PURE
   89724 _3DSTATE_VF_SGVS_DWordLength_bits(const struct gen_device_info *devinfo)
   89725 {
   89726    switch (devinfo->gen) {
   89727    case 10: return 8;
   89728    case 9: return 8;
   89729    case 8: return 8;
   89730    case 7:
   89731       if (devinfo->is_haswell) {
   89732          return 0;
   89733       } else {
   89734          return 0;
   89735       }
   89736    case 6: return 0;
   89737    case 5: return 0;
   89738    case 4:
   89739       if (devinfo->is_g4x) {
   89740          return 0;
   89741       } else {
   89742          return 0;
   89743       }
   89744    default:
   89745       unreachable("Invalid hardware generation");
   89746    }
   89747 }
   89748 
   89749 
   89750 
   89751 #define GEN10_3DSTATE_VF_SGVS_DWordLength_start  0
   89752 #define GEN9_3DSTATE_VF_SGVS_DWordLength_start  0
   89753 #define GEN8_3DSTATE_VF_SGVS_DWordLength_start  0
   89754 
   89755 static inline uint32_t ATTRIBUTE_PURE
   89756 _3DSTATE_VF_SGVS_DWordLength_start(const struct gen_device_info *devinfo)
   89757 {
   89758    switch (devinfo->gen) {
   89759    case 10: return 0;
   89760    case 9: return 0;
   89761    case 8: return 0;
   89762    case 7:
   89763       if (devinfo->is_haswell) {
   89764          return 0;
   89765       } else {
   89766          return 0;
   89767       }
   89768    case 6: return 0;
   89769    case 5: return 0;
   89770    case 4:
   89771       if (devinfo->is_g4x) {
   89772          return 0;
   89773       } else {
   89774          return 0;
   89775       }
   89776    default:
   89777       unreachable("Invalid hardware generation");
   89778    }
   89779 }
   89780 
   89781 
   89782 
   89783 /* 3DSTATE_VF_SGVS::InstanceID Component Number */
   89784 
   89785 
   89786 #define GEN10_3DSTATE_VF_SGVS_InstanceIDComponentNumber_bits  2
   89787 #define GEN9_3DSTATE_VF_SGVS_InstanceIDComponentNumber_bits  2
   89788 #define GEN8_3DSTATE_VF_SGVS_InstanceIDComponentNumber_bits  2
   89789 
   89790 static inline uint32_t ATTRIBUTE_PURE
   89791 _3DSTATE_VF_SGVS_InstanceIDComponentNumber_bits(const struct gen_device_info *devinfo)
   89792 {
   89793    switch (devinfo->gen) {
   89794    case 10: return 2;
   89795    case 9: return 2;
   89796    case 8: return 2;
   89797    case 7:
   89798       if (devinfo->is_haswell) {
   89799          return 0;
   89800       } else {
   89801          return 0;
   89802       }
   89803    case 6: return 0;
   89804    case 5: return 0;
   89805    case 4:
   89806       if (devinfo->is_g4x) {
   89807          return 0;
   89808       } else {
   89809          return 0;
   89810       }
   89811    default:
   89812       unreachable("Invalid hardware generation");
   89813    }
   89814 }
   89815 
   89816 
   89817 
   89818 #define GEN10_3DSTATE_VF_SGVS_InstanceIDComponentNumber_start  61
   89819 #define GEN9_3DSTATE_VF_SGVS_InstanceIDComponentNumber_start  61
   89820 #define GEN8_3DSTATE_VF_SGVS_InstanceIDComponentNumber_start  61
   89821 
   89822 static inline uint32_t ATTRIBUTE_PURE
   89823 _3DSTATE_VF_SGVS_InstanceIDComponentNumber_start(const struct gen_device_info *devinfo)
   89824 {
   89825    switch (devinfo->gen) {
   89826    case 10: return 61;
   89827    case 9: return 61;
   89828    case 8: return 61;
   89829    case 7:
   89830       if (devinfo->is_haswell) {
   89831          return 0;
   89832       } else {
   89833          return 0;
   89834       }
   89835    case 6: return 0;
   89836    case 5: return 0;
   89837    case 4:
   89838       if (devinfo->is_g4x) {
   89839          return 0;
   89840       } else {
   89841          return 0;
   89842       }
   89843    default:
   89844       unreachable("Invalid hardware generation");
   89845    }
   89846 }
   89847 
   89848 
   89849 
   89850 /* 3DSTATE_VF_SGVS::InstanceID Element Offset */
   89851 
   89852 
   89853 #define GEN10_3DSTATE_VF_SGVS_InstanceIDElementOffset_bits  6
   89854 #define GEN9_3DSTATE_VF_SGVS_InstanceIDElementOffset_bits  6
   89855 #define GEN8_3DSTATE_VF_SGVS_InstanceIDElementOffset_bits  6
   89856 
   89857 static inline uint32_t ATTRIBUTE_PURE
   89858 _3DSTATE_VF_SGVS_InstanceIDElementOffset_bits(const struct gen_device_info *devinfo)
   89859 {
   89860    switch (devinfo->gen) {
   89861    case 10: return 6;
   89862    case 9: return 6;
   89863    case 8: return 6;
   89864    case 7:
   89865       if (devinfo->is_haswell) {
   89866          return 0;
   89867       } else {
   89868          return 0;
   89869       }
   89870    case 6: return 0;
   89871    case 5: return 0;
   89872    case 4:
   89873       if (devinfo->is_g4x) {
   89874          return 0;
   89875       } else {
   89876          return 0;
   89877       }
   89878    default:
   89879       unreachable("Invalid hardware generation");
   89880    }
   89881 }
   89882 
   89883 
   89884 
   89885 #define GEN10_3DSTATE_VF_SGVS_InstanceIDElementOffset_start  48
   89886 #define GEN9_3DSTATE_VF_SGVS_InstanceIDElementOffset_start  48
   89887 #define GEN8_3DSTATE_VF_SGVS_InstanceIDElementOffset_start  48
   89888 
   89889 static inline uint32_t ATTRIBUTE_PURE
   89890 _3DSTATE_VF_SGVS_InstanceIDElementOffset_start(const struct gen_device_info *devinfo)
   89891 {
   89892    switch (devinfo->gen) {
   89893    case 10: return 48;
   89894    case 9: return 48;
   89895    case 8: return 48;
   89896    case 7:
   89897       if (devinfo->is_haswell) {
   89898          return 0;
   89899       } else {
   89900          return 0;
   89901       }
   89902    case 6: return 0;
   89903    case 5: return 0;
   89904    case 4:
   89905       if (devinfo->is_g4x) {
   89906          return 0;
   89907       } else {
   89908          return 0;
   89909       }
   89910    default:
   89911       unreachable("Invalid hardware generation");
   89912    }
   89913 }
   89914 
   89915 
   89916 
   89917 /* 3DSTATE_VF_SGVS::InstanceID Enable */
   89918 
   89919 
   89920 #define GEN10_3DSTATE_VF_SGVS_InstanceIDEnable_bits  1
   89921 #define GEN9_3DSTATE_VF_SGVS_InstanceIDEnable_bits  1
   89922 #define GEN8_3DSTATE_VF_SGVS_InstanceIDEnable_bits  1
   89923 
   89924 static inline uint32_t ATTRIBUTE_PURE
   89925 _3DSTATE_VF_SGVS_InstanceIDEnable_bits(const struct gen_device_info *devinfo)
   89926 {
   89927    switch (devinfo->gen) {
   89928    case 10: return 1;
   89929    case 9: return 1;
   89930    case 8: return 1;
   89931    case 7:
   89932       if (devinfo->is_haswell) {
   89933          return 0;
   89934       } else {
   89935          return 0;
   89936       }
   89937    case 6: return 0;
   89938    case 5: return 0;
   89939    case 4:
   89940       if (devinfo->is_g4x) {
   89941          return 0;
   89942       } else {
   89943          return 0;
   89944       }
   89945    default:
   89946       unreachable("Invalid hardware generation");
   89947    }
   89948 }
   89949 
   89950 
   89951 
   89952 #define GEN10_3DSTATE_VF_SGVS_InstanceIDEnable_start  63
   89953 #define GEN9_3DSTATE_VF_SGVS_InstanceIDEnable_start  63
   89954 #define GEN8_3DSTATE_VF_SGVS_InstanceIDEnable_start  63
   89955 
   89956 static inline uint32_t ATTRIBUTE_PURE
   89957 _3DSTATE_VF_SGVS_InstanceIDEnable_start(const struct gen_device_info *devinfo)
   89958 {
   89959    switch (devinfo->gen) {
   89960    case 10: return 63;
   89961    case 9: return 63;
   89962    case 8: return 63;
   89963    case 7:
   89964       if (devinfo->is_haswell) {
   89965          return 0;
   89966       } else {
   89967          return 0;
   89968       }
   89969    case 6: return 0;
   89970    case 5: return 0;
   89971    case 4:
   89972       if (devinfo->is_g4x) {
   89973          return 0;
   89974       } else {
   89975          return 0;
   89976       }
   89977    default:
   89978       unreachable("Invalid hardware generation");
   89979    }
   89980 }
   89981 
   89982 
   89983 
   89984 /* 3DSTATE_VF_SGVS::VertexID Component Number */
   89985 
   89986 
   89987 #define GEN10_3DSTATE_VF_SGVS_VertexIDComponentNumber_bits  2
   89988 #define GEN9_3DSTATE_VF_SGVS_VertexIDComponentNumber_bits  2
   89989 #define GEN8_3DSTATE_VF_SGVS_VertexIDComponentNumber_bits  2
   89990 
   89991 static inline uint32_t ATTRIBUTE_PURE
   89992 _3DSTATE_VF_SGVS_VertexIDComponentNumber_bits(const struct gen_device_info *devinfo)
   89993 {
   89994    switch (devinfo->gen) {
   89995    case 10: return 2;
   89996    case 9: return 2;
   89997    case 8: return 2;
   89998    case 7:
   89999       if (devinfo->is_haswell) {
   90000          return 0;
   90001       } else {
   90002          return 0;
   90003       }
   90004    case 6: return 0;
   90005    case 5: return 0;
   90006    case 4:
   90007       if (devinfo->is_g4x) {
   90008          return 0;
   90009       } else {
   90010          return 0;
   90011       }
   90012    default:
   90013       unreachable("Invalid hardware generation");
   90014    }
   90015 }
   90016 
   90017 
   90018 
   90019 #define GEN10_3DSTATE_VF_SGVS_VertexIDComponentNumber_start  45
   90020 #define GEN9_3DSTATE_VF_SGVS_VertexIDComponentNumber_start  45
   90021 #define GEN8_3DSTATE_VF_SGVS_VertexIDComponentNumber_start  45
   90022 
   90023 static inline uint32_t ATTRIBUTE_PURE
   90024 _3DSTATE_VF_SGVS_VertexIDComponentNumber_start(const struct gen_device_info *devinfo)
   90025 {
   90026    switch (devinfo->gen) {
   90027    case 10: return 45;
   90028    case 9: return 45;
   90029    case 8: return 45;
   90030    case 7:
   90031       if (devinfo->is_haswell) {
   90032          return 0;
   90033       } else {
   90034          return 0;
   90035       }
   90036    case 6: return 0;
   90037    case 5: return 0;
   90038    case 4:
   90039       if (devinfo->is_g4x) {
   90040          return 0;
   90041       } else {
   90042          return 0;
   90043       }
   90044    default:
   90045       unreachable("Invalid hardware generation");
   90046    }
   90047 }
   90048 
   90049 
   90050 
   90051 /* 3DSTATE_VF_SGVS::VertexID Element Offset */
   90052 
   90053 
   90054 #define GEN10_3DSTATE_VF_SGVS_VertexIDElementOffset_bits  6
   90055 #define GEN9_3DSTATE_VF_SGVS_VertexIDElementOffset_bits  6
   90056 #define GEN8_3DSTATE_VF_SGVS_VertexIDElementOffset_bits  6
   90057 
   90058 static inline uint32_t ATTRIBUTE_PURE
   90059 _3DSTATE_VF_SGVS_VertexIDElementOffset_bits(const struct gen_device_info *devinfo)
   90060 {
   90061    switch (devinfo->gen) {
   90062    case 10: return 6;
   90063    case 9: return 6;
   90064    case 8: return 6;
   90065    case 7:
   90066       if (devinfo->is_haswell) {
   90067          return 0;
   90068       } else {
   90069          return 0;
   90070       }
   90071    case 6: return 0;
   90072    case 5: return 0;
   90073    case 4:
   90074       if (devinfo->is_g4x) {
   90075          return 0;
   90076       } else {
   90077          return 0;
   90078       }
   90079    default:
   90080       unreachable("Invalid hardware generation");
   90081    }
   90082 }
   90083 
   90084 
   90085 
   90086 #define GEN10_3DSTATE_VF_SGVS_VertexIDElementOffset_start  32
   90087 #define GEN9_3DSTATE_VF_SGVS_VertexIDElementOffset_start  32
   90088 #define GEN8_3DSTATE_VF_SGVS_VertexIDElementOffset_start  32
   90089 
   90090 static inline uint32_t ATTRIBUTE_PURE
   90091 _3DSTATE_VF_SGVS_VertexIDElementOffset_start(const struct gen_device_info *devinfo)
   90092 {
   90093    switch (devinfo->gen) {
   90094    case 10: return 32;
   90095    case 9: return 32;
   90096    case 8: return 32;
   90097    case 7:
   90098       if (devinfo->is_haswell) {
   90099          return 0;
   90100       } else {
   90101          return 0;
   90102       }
   90103    case 6: return 0;
   90104    case 5: return 0;
   90105    case 4:
   90106       if (devinfo->is_g4x) {
   90107          return 0;
   90108       } else {
   90109          return 0;
   90110       }
   90111    default:
   90112       unreachable("Invalid hardware generation");
   90113    }
   90114 }
   90115 
   90116 
   90117 
   90118 /* 3DSTATE_VF_SGVS::VertexID Enable */
   90119 
   90120 
   90121 #define GEN10_3DSTATE_VF_SGVS_VertexIDEnable_bits  1
   90122 #define GEN9_3DSTATE_VF_SGVS_VertexIDEnable_bits  1
   90123 #define GEN8_3DSTATE_VF_SGVS_VertexIDEnable_bits  1
   90124 
   90125 static inline uint32_t ATTRIBUTE_PURE
   90126 _3DSTATE_VF_SGVS_VertexIDEnable_bits(const struct gen_device_info *devinfo)
   90127 {
   90128    switch (devinfo->gen) {
   90129    case 10: return 1;
   90130    case 9: return 1;
   90131    case 8: return 1;
   90132    case 7:
   90133       if (devinfo->is_haswell) {
   90134          return 0;
   90135       } else {
   90136          return 0;
   90137       }
   90138    case 6: return 0;
   90139    case 5: return 0;
   90140    case 4:
   90141       if (devinfo->is_g4x) {
   90142          return 0;
   90143       } else {
   90144          return 0;
   90145       }
   90146    default:
   90147       unreachable("Invalid hardware generation");
   90148    }
   90149 }
   90150 
   90151 
   90152 
   90153 #define GEN10_3DSTATE_VF_SGVS_VertexIDEnable_start  47
   90154 #define GEN9_3DSTATE_VF_SGVS_VertexIDEnable_start  47
   90155 #define GEN8_3DSTATE_VF_SGVS_VertexIDEnable_start  47
   90156 
   90157 static inline uint32_t ATTRIBUTE_PURE
   90158 _3DSTATE_VF_SGVS_VertexIDEnable_start(const struct gen_device_info *devinfo)
   90159 {
   90160    switch (devinfo->gen) {
   90161    case 10: return 47;
   90162    case 9: return 47;
   90163    case 8: return 47;
   90164    case 7:
   90165       if (devinfo->is_haswell) {
   90166          return 0;
   90167       } else {
   90168          return 0;
   90169       }
   90170    case 6: return 0;
   90171    case 5: return 0;
   90172    case 4:
   90173       if (devinfo->is_g4x) {
   90174          return 0;
   90175       } else {
   90176          return 0;
   90177       }
   90178    default:
   90179       unreachable("Invalid hardware generation");
   90180    }
   90181 }
   90182 
   90183 
   90184 
   90185 /* 3DSTATE_VF_SGVS_2 */
   90186 
   90187 
   90188 #define GEN10_3DSTATE_VF_SGVS_2_length  3
   90189 
   90190 static inline uint32_t ATTRIBUTE_PURE
   90191 _3DSTATE_VF_SGVS_2_length(const struct gen_device_info *devinfo)
   90192 {
   90193    switch (devinfo->gen) {
   90194    case 10: return 3;
   90195    case 9: return 0;
   90196    case 8: return 0;
   90197    case 7:
   90198       if (devinfo->is_haswell) {
   90199          return 0;
   90200       } else {
   90201          return 0;
   90202       }
   90203    case 6: return 0;
   90204    case 5: return 0;
   90205    case 4:
   90206       if (devinfo->is_g4x) {
   90207          return 0;
   90208       } else {
   90209          return 0;
   90210       }
   90211    default:
   90212       unreachable("Invalid hardware generation");
   90213    }
   90214 }
   90215 
   90216 
   90217 
   90218 /* 3DSTATE_VF_SGVS_2::3D Command Opcode */
   90219 
   90220 
   90221 #define GEN10_3DSTATE_VF_SGVS_2_3DCommandOpcode_bits  3
   90222 
   90223 static inline uint32_t ATTRIBUTE_PURE
   90224 _3DSTATE_VF_SGVS_2_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   90225 {
   90226    switch (devinfo->gen) {
   90227    case 10: return 3;
   90228    case 9: return 0;
   90229    case 8: return 0;
   90230    case 7:
   90231       if (devinfo->is_haswell) {
   90232          return 0;
   90233       } else {
   90234          return 0;
   90235       }
   90236    case 6: return 0;
   90237    case 5: return 0;
   90238    case 4:
   90239       if (devinfo->is_g4x) {
   90240          return 0;
   90241       } else {
   90242          return 0;
   90243       }
   90244    default:
   90245       unreachable("Invalid hardware generation");
   90246    }
   90247 }
   90248 
   90249 
   90250 
   90251 #define GEN10_3DSTATE_VF_SGVS_2_3DCommandOpcode_start  24
   90252 
   90253 static inline uint32_t ATTRIBUTE_PURE
   90254 _3DSTATE_VF_SGVS_2_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   90255 {
   90256    switch (devinfo->gen) {
   90257    case 10: return 24;
   90258    case 9: return 0;
   90259    case 8: return 0;
   90260    case 7:
   90261       if (devinfo->is_haswell) {
   90262          return 0;
   90263       } else {
   90264          return 0;
   90265       }
   90266    case 6: return 0;
   90267    case 5: return 0;
   90268    case 4:
   90269       if (devinfo->is_g4x) {
   90270          return 0;
   90271       } else {
   90272          return 0;
   90273       }
   90274    default:
   90275       unreachable("Invalid hardware generation");
   90276    }
   90277 }
   90278 
   90279 
   90280 
   90281 /* 3DSTATE_VF_SGVS_2::3D Command Sub Opcode */
   90282 
   90283 
   90284 #define GEN10_3DSTATE_VF_SGVS_2_3DCommandSubOpcode_bits  8
   90285 
   90286 static inline uint32_t ATTRIBUTE_PURE
   90287 _3DSTATE_VF_SGVS_2_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   90288 {
   90289    switch (devinfo->gen) {
   90290    case 10: return 8;
   90291    case 9: return 0;
   90292    case 8: return 0;
   90293    case 7:
   90294       if (devinfo->is_haswell) {
   90295          return 0;
   90296       } else {
   90297          return 0;
   90298       }
   90299    case 6: return 0;
   90300    case 5: return 0;
   90301    case 4:
   90302       if (devinfo->is_g4x) {
   90303          return 0;
   90304       } else {
   90305          return 0;
   90306       }
   90307    default:
   90308       unreachable("Invalid hardware generation");
   90309    }
   90310 }
   90311 
   90312 
   90313 
   90314 #define GEN10_3DSTATE_VF_SGVS_2_3DCommandSubOpcode_start  16
   90315 
   90316 static inline uint32_t ATTRIBUTE_PURE
   90317 _3DSTATE_VF_SGVS_2_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   90318 {
   90319    switch (devinfo->gen) {
   90320    case 10: return 16;
   90321    case 9: return 0;
   90322    case 8: return 0;
   90323    case 7:
   90324       if (devinfo->is_haswell) {
   90325          return 0;
   90326       } else {
   90327          return 0;
   90328       }
   90329    case 6: return 0;
   90330    case 5: return 0;
   90331    case 4:
   90332       if (devinfo->is_g4x) {
   90333          return 0;
   90334       } else {
   90335          return 0;
   90336       }
   90337    default:
   90338       unreachable("Invalid hardware generation");
   90339    }
   90340 }
   90341 
   90342 
   90343 
   90344 /* 3DSTATE_VF_SGVS_2::Command SubType */
   90345 
   90346 
   90347 #define GEN10_3DSTATE_VF_SGVS_2_CommandSubType_bits  2
   90348 
   90349 static inline uint32_t ATTRIBUTE_PURE
   90350 _3DSTATE_VF_SGVS_2_CommandSubType_bits(const struct gen_device_info *devinfo)
   90351 {
   90352    switch (devinfo->gen) {
   90353    case 10: return 2;
   90354    case 9: return 0;
   90355    case 8: return 0;
   90356    case 7:
   90357       if (devinfo->is_haswell) {
   90358          return 0;
   90359       } else {
   90360          return 0;
   90361       }
   90362    case 6: return 0;
   90363    case 5: return 0;
   90364    case 4:
   90365       if (devinfo->is_g4x) {
   90366          return 0;
   90367       } else {
   90368          return 0;
   90369       }
   90370    default:
   90371       unreachable("Invalid hardware generation");
   90372    }
   90373 }
   90374 
   90375 
   90376 
   90377 #define GEN10_3DSTATE_VF_SGVS_2_CommandSubType_start  27
   90378 
   90379 static inline uint32_t ATTRIBUTE_PURE
   90380 _3DSTATE_VF_SGVS_2_CommandSubType_start(const struct gen_device_info *devinfo)
   90381 {
   90382    switch (devinfo->gen) {
   90383    case 10: return 27;
   90384    case 9: return 0;
   90385    case 8: return 0;
   90386    case 7:
   90387       if (devinfo->is_haswell) {
   90388          return 0;
   90389       } else {
   90390          return 0;
   90391       }
   90392    case 6: return 0;
   90393    case 5: return 0;
   90394    case 4:
   90395       if (devinfo->is_g4x) {
   90396          return 0;
   90397       } else {
   90398          return 0;
   90399       }
   90400    default:
   90401       unreachable("Invalid hardware generation");
   90402    }
   90403 }
   90404 
   90405 
   90406 
   90407 /* 3DSTATE_VF_SGVS_2::Command Type */
   90408 
   90409 
   90410 #define GEN10_3DSTATE_VF_SGVS_2_CommandType_bits  3
   90411 
   90412 static inline uint32_t ATTRIBUTE_PURE
   90413 _3DSTATE_VF_SGVS_2_CommandType_bits(const struct gen_device_info *devinfo)
   90414 {
   90415    switch (devinfo->gen) {
   90416    case 10: return 3;
   90417    case 9: return 0;
   90418    case 8: return 0;
   90419    case 7:
   90420       if (devinfo->is_haswell) {
   90421          return 0;
   90422       } else {
   90423          return 0;
   90424       }
   90425    case 6: return 0;
   90426    case 5: return 0;
   90427    case 4:
   90428       if (devinfo->is_g4x) {
   90429          return 0;
   90430       } else {
   90431          return 0;
   90432       }
   90433    default:
   90434       unreachable("Invalid hardware generation");
   90435    }
   90436 }
   90437 
   90438 
   90439 
   90440 #define GEN10_3DSTATE_VF_SGVS_2_CommandType_start  29
   90441 
   90442 static inline uint32_t ATTRIBUTE_PURE
   90443 _3DSTATE_VF_SGVS_2_CommandType_start(const struct gen_device_info *devinfo)
   90444 {
   90445    switch (devinfo->gen) {
   90446    case 10: return 29;
   90447    case 9: return 0;
   90448    case 8: return 0;
   90449    case 7:
   90450       if (devinfo->is_haswell) {
   90451          return 0;
   90452       } else {
   90453          return 0;
   90454       }
   90455    case 6: return 0;
   90456    case 5: return 0;
   90457    case 4:
   90458       if (devinfo->is_g4x) {
   90459          return 0;
   90460       } else {
   90461          return 0;
   90462       }
   90463    default:
   90464       unreachable("Invalid hardware generation");
   90465    }
   90466 }
   90467 
   90468 
   90469 
   90470 /* 3DSTATE_VF_SGVS_2::DWord Length */
   90471 
   90472 
   90473 #define GEN10_3DSTATE_VF_SGVS_2_DWordLength_bits  8
   90474 
   90475 static inline uint32_t ATTRIBUTE_PURE
   90476 _3DSTATE_VF_SGVS_2_DWordLength_bits(const struct gen_device_info *devinfo)
   90477 {
   90478    switch (devinfo->gen) {
   90479    case 10: return 8;
   90480    case 9: return 0;
   90481    case 8: return 0;
   90482    case 7:
   90483       if (devinfo->is_haswell) {
   90484          return 0;
   90485       } else {
   90486          return 0;
   90487       }
   90488    case 6: return 0;
   90489    case 5: return 0;
   90490    case 4:
   90491       if (devinfo->is_g4x) {
   90492          return 0;
   90493       } else {
   90494          return 0;
   90495       }
   90496    default:
   90497       unreachable("Invalid hardware generation");
   90498    }
   90499 }
   90500 
   90501 
   90502 
   90503 #define GEN10_3DSTATE_VF_SGVS_2_DWordLength_start  0
   90504 
   90505 static inline uint32_t ATTRIBUTE_PURE
   90506 _3DSTATE_VF_SGVS_2_DWordLength_start(const struct gen_device_info *devinfo)
   90507 {
   90508    switch (devinfo->gen) {
   90509    case 10: return 0;
   90510    case 9: return 0;
   90511    case 8: return 0;
   90512    case 7:
   90513       if (devinfo->is_haswell) {
   90514          return 0;
   90515       } else {
   90516          return 0;
   90517       }
   90518    case 6: return 0;
   90519    case 5: return 0;
   90520    case 4:
   90521       if (devinfo->is_g4x) {
   90522          return 0;
   90523       } else {
   90524          return 0;
   90525       }
   90526    default:
   90527       unreachable("Invalid hardware generation");
   90528    }
   90529 }
   90530 
   90531 
   90532 
   90533 /* 3DSTATE_VF_SGVS_2::XP0 Component Number */
   90534 
   90535 
   90536 #define GEN10_3DSTATE_VF_SGVS_2_XP0ComponentNumber_bits  2
   90537 
   90538 static inline uint32_t ATTRIBUTE_PURE
   90539 _3DSTATE_VF_SGVS_2_XP0ComponentNumber_bits(const struct gen_device_info *devinfo)
   90540 {
   90541    switch (devinfo->gen) {
   90542    case 10: return 2;
   90543    case 9: return 0;
   90544    case 8: return 0;
   90545    case 7:
   90546       if (devinfo->is_haswell) {
   90547          return 0;
   90548       } else {
   90549          return 0;
   90550       }
   90551    case 6: return 0;
   90552    case 5: return 0;
   90553    case 4:
   90554       if (devinfo->is_g4x) {
   90555          return 0;
   90556       } else {
   90557          return 0;
   90558       }
   90559    default:
   90560       unreachable("Invalid hardware generation");
   90561    }
   90562 }
   90563 
   90564 
   90565 
   90566 #define GEN10_3DSTATE_VF_SGVS_2_XP0ComponentNumber_start  45
   90567 
   90568 static inline uint32_t ATTRIBUTE_PURE
   90569 _3DSTATE_VF_SGVS_2_XP0ComponentNumber_start(const struct gen_device_info *devinfo)
   90570 {
   90571    switch (devinfo->gen) {
   90572    case 10: return 45;
   90573    case 9: return 0;
   90574    case 8: return 0;
   90575    case 7:
   90576       if (devinfo->is_haswell) {
   90577          return 0;
   90578       } else {
   90579          return 0;
   90580       }
   90581    case 6: return 0;
   90582    case 5: return 0;
   90583    case 4:
   90584       if (devinfo->is_g4x) {
   90585          return 0;
   90586       } else {
   90587          return 0;
   90588       }
   90589    default:
   90590       unreachable("Invalid hardware generation");
   90591    }
   90592 }
   90593 
   90594 
   90595 
   90596 /* 3DSTATE_VF_SGVS_2::XP0 Element Offset */
   90597 
   90598 
   90599 #define GEN10_3DSTATE_VF_SGVS_2_XP0ElementOffset_bits  6
   90600 
   90601 static inline uint32_t ATTRIBUTE_PURE
   90602 _3DSTATE_VF_SGVS_2_XP0ElementOffset_bits(const struct gen_device_info *devinfo)
   90603 {
   90604    switch (devinfo->gen) {
   90605    case 10: return 6;
   90606    case 9: return 0;
   90607    case 8: return 0;
   90608    case 7:
   90609       if (devinfo->is_haswell) {
   90610          return 0;
   90611       } else {
   90612          return 0;
   90613       }
   90614    case 6: return 0;
   90615    case 5: return 0;
   90616    case 4:
   90617       if (devinfo->is_g4x) {
   90618          return 0;
   90619       } else {
   90620          return 0;
   90621       }
   90622    default:
   90623       unreachable("Invalid hardware generation");
   90624    }
   90625 }
   90626 
   90627 
   90628 
   90629 #define GEN10_3DSTATE_VF_SGVS_2_XP0ElementOffset_start  32
   90630 
   90631 static inline uint32_t ATTRIBUTE_PURE
   90632 _3DSTATE_VF_SGVS_2_XP0ElementOffset_start(const struct gen_device_info *devinfo)
   90633 {
   90634    switch (devinfo->gen) {
   90635    case 10: return 32;
   90636    case 9: return 0;
   90637    case 8: return 0;
   90638    case 7:
   90639       if (devinfo->is_haswell) {
   90640          return 0;
   90641       } else {
   90642          return 0;
   90643       }
   90644    case 6: return 0;
   90645    case 5: return 0;
   90646    case 4:
   90647       if (devinfo->is_g4x) {
   90648          return 0;
   90649       } else {
   90650          return 0;
   90651       }
   90652    default:
   90653       unreachable("Invalid hardware generation");
   90654    }
   90655 }
   90656 
   90657 
   90658 
   90659 /* 3DSTATE_VF_SGVS_2::XP0 Enable */
   90660 
   90661 
   90662 #define GEN10_3DSTATE_VF_SGVS_2_XP0Enable_bits  1
   90663 
   90664 static inline uint32_t ATTRIBUTE_PURE
   90665 _3DSTATE_VF_SGVS_2_XP0Enable_bits(const struct gen_device_info *devinfo)
   90666 {
   90667    switch (devinfo->gen) {
   90668    case 10: return 1;
   90669    case 9: return 0;
   90670    case 8: return 0;
   90671    case 7:
   90672       if (devinfo->is_haswell) {
   90673          return 0;
   90674       } else {
   90675          return 0;
   90676       }
   90677    case 6: return 0;
   90678    case 5: return 0;
   90679    case 4:
   90680       if (devinfo->is_g4x) {
   90681          return 0;
   90682       } else {
   90683          return 0;
   90684       }
   90685    default:
   90686       unreachable("Invalid hardware generation");
   90687    }
   90688 }
   90689 
   90690 
   90691 
   90692 #define GEN10_3DSTATE_VF_SGVS_2_XP0Enable_start  47
   90693 
   90694 static inline uint32_t ATTRIBUTE_PURE
   90695 _3DSTATE_VF_SGVS_2_XP0Enable_start(const struct gen_device_info *devinfo)
   90696 {
   90697    switch (devinfo->gen) {
   90698    case 10: return 47;
   90699    case 9: return 0;
   90700    case 8: return 0;
   90701    case 7:
   90702       if (devinfo->is_haswell) {
   90703          return 0;
   90704       } else {
   90705          return 0;
   90706       }
   90707    case 6: return 0;
   90708    case 5: return 0;
   90709    case 4:
   90710       if (devinfo->is_g4x) {
   90711          return 0;
   90712       } else {
   90713          return 0;
   90714       }
   90715    default:
   90716       unreachable("Invalid hardware generation");
   90717    }
   90718 }
   90719 
   90720 
   90721 
   90722 /* 3DSTATE_VF_SGVS_2::XP0 Source Select */
   90723 
   90724 
   90725 #define GEN10_3DSTATE_VF_SGVS_2_XP0SourceSelect_bits  1
   90726 
   90727 static inline uint32_t ATTRIBUTE_PURE
   90728 _3DSTATE_VF_SGVS_2_XP0SourceSelect_bits(const struct gen_device_info *devinfo)
   90729 {
   90730    switch (devinfo->gen) {
   90731    case 10: return 1;
   90732    case 9: return 0;
   90733    case 8: return 0;
   90734    case 7:
   90735       if (devinfo->is_haswell) {
   90736          return 0;
   90737       } else {
   90738          return 0;
   90739       }
   90740    case 6: return 0;
   90741    case 5: return 0;
   90742    case 4:
   90743       if (devinfo->is_g4x) {
   90744          return 0;
   90745       } else {
   90746          return 0;
   90747       }
   90748    default:
   90749       unreachable("Invalid hardware generation");
   90750    }
   90751 }
   90752 
   90753 
   90754 
   90755 #define GEN10_3DSTATE_VF_SGVS_2_XP0SourceSelect_start  44
   90756 
   90757 static inline uint32_t ATTRIBUTE_PURE
   90758 _3DSTATE_VF_SGVS_2_XP0SourceSelect_start(const struct gen_device_info *devinfo)
   90759 {
   90760    switch (devinfo->gen) {
   90761    case 10: return 44;
   90762    case 9: return 0;
   90763    case 8: return 0;
   90764    case 7:
   90765       if (devinfo->is_haswell) {
   90766          return 0;
   90767       } else {
   90768          return 0;
   90769       }
   90770    case 6: return 0;
   90771    case 5: return 0;
   90772    case 4:
   90773       if (devinfo->is_g4x) {
   90774          return 0;
   90775       } else {
   90776          return 0;
   90777       }
   90778    default:
   90779       unreachable("Invalid hardware generation");
   90780    }
   90781 }
   90782 
   90783 
   90784 
   90785 /* 3DSTATE_VF_SGVS_2::XP1 Component Number */
   90786 
   90787 
   90788 #define GEN10_3DSTATE_VF_SGVS_2_XP1ComponentNumber_bits  2
   90789 
   90790 static inline uint32_t ATTRIBUTE_PURE
   90791 _3DSTATE_VF_SGVS_2_XP1ComponentNumber_bits(const struct gen_device_info *devinfo)
   90792 {
   90793    switch (devinfo->gen) {
   90794    case 10: return 2;
   90795    case 9: return 0;
   90796    case 8: return 0;
   90797    case 7:
   90798       if (devinfo->is_haswell) {
   90799          return 0;
   90800       } else {
   90801          return 0;
   90802       }
   90803    case 6: return 0;
   90804    case 5: return 0;
   90805    case 4:
   90806       if (devinfo->is_g4x) {
   90807          return 0;
   90808       } else {
   90809          return 0;
   90810       }
   90811    default:
   90812       unreachable("Invalid hardware generation");
   90813    }
   90814 }
   90815 
   90816 
   90817 
   90818 #define GEN10_3DSTATE_VF_SGVS_2_XP1ComponentNumber_start  61
   90819 
   90820 static inline uint32_t ATTRIBUTE_PURE
   90821 _3DSTATE_VF_SGVS_2_XP1ComponentNumber_start(const struct gen_device_info *devinfo)
   90822 {
   90823    switch (devinfo->gen) {
   90824    case 10: return 61;
   90825    case 9: return 0;
   90826    case 8: return 0;
   90827    case 7:
   90828       if (devinfo->is_haswell) {
   90829          return 0;
   90830       } else {
   90831          return 0;
   90832       }
   90833    case 6: return 0;
   90834    case 5: return 0;
   90835    case 4:
   90836       if (devinfo->is_g4x) {
   90837          return 0;
   90838       } else {
   90839          return 0;
   90840       }
   90841    default:
   90842       unreachable("Invalid hardware generation");
   90843    }
   90844 }
   90845 
   90846 
   90847 
   90848 /* 3DSTATE_VF_SGVS_2::XP1 Element Offset */
   90849 
   90850 
   90851 #define GEN10_3DSTATE_VF_SGVS_2_XP1ElementOffset_bits  6
   90852 
   90853 static inline uint32_t ATTRIBUTE_PURE
   90854 _3DSTATE_VF_SGVS_2_XP1ElementOffset_bits(const struct gen_device_info *devinfo)
   90855 {
   90856    switch (devinfo->gen) {
   90857    case 10: return 6;
   90858    case 9: return 0;
   90859    case 8: return 0;
   90860    case 7:
   90861       if (devinfo->is_haswell) {
   90862          return 0;
   90863       } else {
   90864          return 0;
   90865       }
   90866    case 6: return 0;
   90867    case 5: return 0;
   90868    case 4:
   90869       if (devinfo->is_g4x) {
   90870          return 0;
   90871       } else {
   90872          return 0;
   90873       }
   90874    default:
   90875       unreachable("Invalid hardware generation");
   90876    }
   90877 }
   90878 
   90879 
   90880 
   90881 #define GEN10_3DSTATE_VF_SGVS_2_XP1ElementOffset_start  48
   90882 
   90883 static inline uint32_t ATTRIBUTE_PURE
   90884 _3DSTATE_VF_SGVS_2_XP1ElementOffset_start(const struct gen_device_info *devinfo)
   90885 {
   90886    switch (devinfo->gen) {
   90887    case 10: return 48;
   90888    case 9: return 0;
   90889    case 8: return 0;
   90890    case 7:
   90891       if (devinfo->is_haswell) {
   90892          return 0;
   90893       } else {
   90894          return 0;
   90895       }
   90896    case 6: return 0;
   90897    case 5: return 0;
   90898    case 4:
   90899       if (devinfo->is_g4x) {
   90900          return 0;
   90901       } else {
   90902          return 0;
   90903       }
   90904    default:
   90905       unreachable("Invalid hardware generation");
   90906    }
   90907 }
   90908 
   90909 
   90910 
   90911 /* 3DSTATE_VF_SGVS_2::XP1 Enable */
   90912 
   90913 
   90914 #define GEN10_3DSTATE_VF_SGVS_2_XP1Enable_bits  1
   90915 
   90916 static inline uint32_t ATTRIBUTE_PURE
   90917 _3DSTATE_VF_SGVS_2_XP1Enable_bits(const struct gen_device_info *devinfo)
   90918 {
   90919    switch (devinfo->gen) {
   90920    case 10: return 1;
   90921    case 9: return 0;
   90922    case 8: return 0;
   90923    case 7:
   90924       if (devinfo->is_haswell) {
   90925          return 0;
   90926       } else {
   90927          return 0;
   90928       }
   90929    case 6: return 0;
   90930    case 5: return 0;
   90931    case 4:
   90932       if (devinfo->is_g4x) {
   90933          return 0;
   90934       } else {
   90935          return 0;
   90936       }
   90937    default:
   90938       unreachable("Invalid hardware generation");
   90939    }
   90940 }
   90941 
   90942 
   90943 
   90944 #define GEN10_3DSTATE_VF_SGVS_2_XP1Enable_start  63
   90945 
   90946 static inline uint32_t ATTRIBUTE_PURE
   90947 _3DSTATE_VF_SGVS_2_XP1Enable_start(const struct gen_device_info *devinfo)
   90948 {
   90949    switch (devinfo->gen) {
   90950    case 10: return 63;
   90951    case 9: return 0;
   90952    case 8: return 0;
   90953    case 7:
   90954       if (devinfo->is_haswell) {
   90955          return 0;
   90956       } else {
   90957          return 0;
   90958       }
   90959    case 6: return 0;
   90960    case 5: return 0;
   90961    case 4:
   90962       if (devinfo->is_g4x) {
   90963          return 0;
   90964       } else {
   90965          return 0;
   90966       }
   90967    default:
   90968       unreachable("Invalid hardware generation");
   90969    }
   90970 }
   90971 
   90972 
   90973 
   90974 /* 3DSTATE_VF_SGVS_2::XP1 Source Select */
   90975 
   90976 
   90977 #define GEN10_3DSTATE_VF_SGVS_2_XP1SourceSelect_bits  1
   90978 
   90979 static inline uint32_t ATTRIBUTE_PURE
   90980 _3DSTATE_VF_SGVS_2_XP1SourceSelect_bits(const struct gen_device_info *devinfo)
   90981 {
   90982    switch (devinfo->gen) {
   90983    case 10: return 1;
   90984    case 9: return 0;
   90985    case 8: return 0;
   90986    case 7:
   90987       if (devinfo->is_haswell) {
   90988          return 0;
   90989       } else {
   90990          return 0;
   90991       }
   90992    case 6: return 0;
   90993    case 5: return 0;
   90994    case 4:
   90995       if (devinfo->is_g4x) {
   90996          return 0;
   90997       } else {
   90998          return 0;
   90999       }
   91000    default:
   91001       unreachable("Invalid hardware generation");
   91002    }
   91003 }
   91004 
   91005 
   91006 
   91007 #define GEN10_3DSTATE_VF_SGVS_2_XP1SourceSelect_start  60
   91008 
   91009 static inline uint32_t ATTRIBUTE_PURE
   91010 _3DSTATE_VF_SGVS_2_XP1SourceSelect_start(const struct gen_device_info *devinfo)
   91011 {
   91012    switch (devinfo->gen) {
   91013    case 10: return 60;
   91014    case 9: return 0;
   91015    case 8: return 0;
   91016    case 7:
   91017       if (devinfo->is_haswell) {
   91018          return 0;
   91019       } else {
   91020          return 0;
   91021       }
   91022    case 6: return 0;
   91023    case 5: return 0;
   91024    case 4:
   91025       if (devinfo->is_g4x) {
   91026          return 0;
   91027       } else {
   91028          return 0;
   91029       }
   91030    default:
   91031       unreachable("Invalid hardware generation");
   91032    }
   91033 }
   91034 
   91035 
   91036 
   91037 /* 3DSTATE_VF_SGVS_2::XP2 Component Number */
   91038 
   91039 
   91040 #define GEN10_3DSTATE_VF_SGVS_2_XP2ComponentNumber_bits  2
   91041 
   91042 static inline uint32_t ATTRIBUTE_PURE
   91043 _3DSTATE_VF_SGVS_2_XP2ComponentNumber_bits(const struct gen_device_info *devinfo)
   91044 {
   91045    switch (devinfo->gen) {
   91046    case 10: return 2;
   91047    case 9: return 0;
   91048    case 8: return 0;
   91049    case 7:
   91050       if (devinfo->is_haswell) {
   91051          return 0;
   91052       } else {
   91053          return 0;
   91054       }
   91055    case 6: return 0;
   91056    case 5: return 0;
   91057    case 4:
   91058       if (devinfo->is_g4x) {
   91059          return 0;
   91060       } else {
   91061          return 0;
   91062       }
   91063    default:
   91064       unreachable("Invalid hardware generation");
   91065    }
   91066 }
   91067 
   91068 
   91069 
   91070 #define GEN10_3DSTATE_VF_SGVS_2_XP2ComponentNumber_start  77
   91071 
   91072 static inline uint32_t ATTRIBUTE_PURE
   91073 _3DSTATE_VF_SGVS_2_XP2ComponentNumber_start(const struct gen_device_info *devinfo)
   91074 {
   91075    switch (devinfo->gen) {
   91076    case 10: return 77;
   91077    case 9: return 0;
   91078    case 8: return 0;
   91079    case 7:
   91080       if (devinfo->is_haswell) {
   91081          return 0;
   91082       } else {
   91083          return 0;
   91084       }
   91085    case 6: return 0;
   91086    case 5: return 0;
   91087    case 4:
   91088       if (devinfo->is_g4x) {
   91089          return 0;
   91090       } else {
   91091          return 0;
   91092       }
   91093    default:
   91094       unreachable("Invalid hardware generation");
   91095    }
   91096 }
   91097 
   91098 
   91099 
   91100 /* 3DSTATE_VF_SGVS_2::XP2 Element Offset */
   91101 
   91102 
   91103 #define GEN10_3DSTATE_VF_SGVS_2_XP2ElementOffset_bits  6
   91104 
   91105 static inline uint32_t ATTRIBUTE_PURE
   91106 _3DSTATE_VF_SGVS_2_XP2ElementOffset_bits(const struct gen_device_info *devinfo)
   91107 {
   91108    switch (devinfo->gen) {
   91109    case 10: return 6;
   91110    case 9: return 0;
   91111    case 8: return 0;
   91112    case 7:
   91113       if (devinfo->is_haswell) {
   91114          return 0;
   91115       } else {
   91116          return 0;
   91117       }
   91118    case 6: return 0;
   91119    case 5: return 0;
   91120    case 4:
   91121       if (devinfo->is_g4x) {
   91122          return 0;
   91123       } else {
   91124          return 0;
   91125       }
   91126    default:
   91127       unreachable("Invalid hardware generation");
   91128    }
   91129 }
   91130 
   91131 
   91132 
   91133 #define GEN10_3DSTATE_VF_SGVS_2_XP2ElementOffset_start  64
   91134 
   91135 static inline uint32_t ATTRIBUTE_PURE
   91136 _3DSTATE_VF_SGVS_2_XP2ElementOffset_start(const struct gen_device_info *devinfo)
   91137 {
   91138    switch (devinfo->gen) {
   91139    case 10: return 64;
   91140    case 9: return 0;
   91141    case 8: return 0;
   91142    case 7:
   91143       if (devinfo->is_haswell) {
   91144          return 0;
   91145       } else {
   91146          return 0;
   91147       }
   91148    case 6: return 0;
   91149    case 5: return 0;
   91150    case 4:
   91151       if (devinfo->is_g4x) {
   91152          return 0;
   91153       } else {
   91154          return 0;
   91155       }
   91156    default:
   91157       unreachable("Invalid hardware generation");
   91158    }
   91159 }
   91160 
   91161 
   91162 
   91163 /* 3DSTATE_VF_SGVS_2::XP2 Enable */
   91164 
   91165 
   91166 #define GEN10_3DSTATE_VF_SGVS_2_XP2Enable_bits  1
   91167 
   91168 static inline uint32_t ATTRIBUTE_PURE
   91169 _3DSTATE_VF_SGVS_2_XP2Enable_bits(const struct gen_device_info *devinfo)
   91170 {
   91171    switch (devinfo->gen) {
   91172    case 10: return 1;
   91173    case 9: return 0;
   91174    case 8: return 0;
   91175    case 7:
   91176       if (devinfo->is_haswell) {
   91177          return 0;
   91178       } else {
   91179          return 0;
   91180       }
   91181    case 6: return 0;
   91182    case 5: return 0;
   91183    case 4:
   91184       if (devinfo->is_g4x) {
   91185          return 0;
   91186       } else {
   91187          return 0;
   91188       }
   91189    default:
   91190       unreachable("Invalid hardware generation");
   91191    }
   91192 }
   91193 
   91194 
   91195 
   91196 #define GEN10_3DSTATE_VF_SGVS_2_XP2Enable_start  79
   91197 
   91198 static inline uint32_t ATTRIBUTE_PURE
   91199 _3DSTATE_VF_SGVS_2_XP2Enable_start(const struct gen_device_info *devinfo)
   91200 {
   91201    switch (devinfo->gen) {
   91202    case 10: return 79;
   91203    case 9: return 0;
   91204    case 8: return 0;
   91205    case 7:
   91206       if (devinfo->is_haswell) {
   91207          return 0;
   91208       } else {
   91209          return 0;
   91210       }
   91211    case 6: return 0;
   91212    case 5: return 0;
   91213    case 4:
   91214       if (devinfo->is_g4x) {
   91215          return 0;
   91216       } else {
   91217          return 0;
   91218       }
   91219    default:
   91220       unreachable("Invalid hardware generation");
   91221    }
   91222 }
   91223 
   91224 
   91225 
   91226 /* 3DSTATE_VF_STATISTICS */
   91227 
   91228 
   91229 #define GEN10_3DSTATE_VF_STATISTICS_length  1
   91230 #define GEN9_3DSTATE_VF_STATISTICS_length  1
   91231 #define GEN8_3DSTATE_VF_STATISTICS_length  1
   91232 #define GEN75_3DSTATE_VF_STATISTICS_length  1
   91233 #define GEN7_3DSTATE_VF_STATISTICS_length  1
   91234 #define GEN6_3DSTATE_VF_STATISTICS_length  1
   91235 #define GEN5_3DSTATE_VF_STATISTICS_length  1
   91236 #define GEN45_3DSTATE_VF_STATISTICS_length  1
   91237 #define GEN4_3DSTATE_VF_STATISTICS_length  1
   91238 
   91239 static inline uint32_t ATTRIBUTE_PURE
   91240 _3DSTATE_VF_STATISTICS_length(const struct gen_device_info *devinfo)
   91241 {
   91242    switch (devinfo->gen) {
   91243    case 10: return 1;
   91244    case 9: return 1;
   91245    case 8: return 1;
   91246    case 7:
   91247       if (devinfo->is_haswell) {
   91248          return 1;
   91249       } else {
   91250          return 1;
   91251       }
   91252    case 6: return 1;
   91253    case 5: return 1;
   91254    case 4:
   91255       if (devinfo->is_g4x) {
   91256          return 1;
   91257       } else {
   91258          return 1;
   91259       }
   91260    default:
   91261       unreachable("Invalid hardware generation");
   91262    }
   91263 }
   91264 
   91265 
   91266 
   91267 /* 3DSTATE_VF_STATISTICS::3D Command Opcode */
   91268 
   91269 
   91270 #define GEN10_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91271 #define GEN9_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91272 #define GEN8_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91273 #define GEN75_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91274 #define GEN7_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91275 #define GEN6_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91276 #define GEN5_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91277 #define GEN45_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91278 #define GEN4_3DSTATE_VF_STATISTICS_3DCommandOpcode_bits  3
   91279 
   91280 static inline uint32_t ATTRIBUTE_PURE
   91281 _3DSTATE_VF_STATISTICS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   91282 {
   91283    switch (devinfo->gen) {
   91284    case 10: return 3;
   91285    case 9: return 3;
   91286    case 8: return 3;
   91287    case 7:
   91288       if (devinfo->is_haswell) {
   91289          return 3;
   91290       } else {
   91291          return 3;
   91292       }
   91293    case 6: return 3;
   91294    case 5: return 3;
   91295    case 4:
   91296       if (devinfo->is_g4x) {
   91297          return 3;
   91298       } else {
   91299          return 3;
   91300       }
   91301    default:
   91302       unreachable("Invalid hardware generation");
   91303    }
   91304 }
   91305 
   91306 
   91307 
   91308 #define GEN10_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91309 #define GEN9_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91310 #define GEN8_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91311 #define GEN75_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91312 #define GEN7_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91313 #define GEN6_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91314 #define GEN5_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91315 #define GEN45_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91316 #define GEN4_3DSTATE_VF_STATISTICS_3DCommandOpcode_start  24
   91317 
   91318 static inline uint32_t ATTRIBUTE_PURE
   91319 _3DSTATE_VF_STATISTICS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   91320 {
   91321    switch (devinfo->gen) {
   91322    case 10: return 24;
   91323    case 9: return 24;
   91324    case 8: return 24;
   91325    case 7:
   91326       if (devinfo->is_haswell) {
   91327          return 24;
   91328       } else {
   91329          return 24;
   91330       }
   91331    case 6: return 24;
   91332    case 5: return 24;
   91333    case 4:
   91334       if (devinfo->is_g4x) {
   91335          return 24;
   91336       } else {
   91337          return 24;
   91338       }
   91339    default:
   91340       unreachable("Invalid hardware generation");
   91341    }
   91342 }
   91343 
   91344 
   91345 
   91346 /* 3DSTATE_VF_STATISTICS::3D Command Sub Opcode */
   91347 
   91348 
   91349 #define GEN10_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91350 #define GEN9_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91351 #define GEN8_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91352 #define GEN75_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91353 #define GEN7_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91354 #define GEN6_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91355 #define GEN5_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91356 #define GEN45_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91357 #define GEN4_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits  8
   91358 
   91359 static inline uint32_t ATTRIBUTE_PURE
   91360 _3DSTATE_VF_STATISTICS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   91361 {
   91362    switch (devinfo->gen) {
   91363    case 10: return 8;
   91364    case 9: return 8;
   91365    case 8: return 8;
   91366    case 7:
   91367       if (devinfo->is_haswell) {
   91368          return 8;
   91369       } else {
   91370          return 8;
   91371       }
   91372    case 6: return 8;
   91373    case 5: return 8;
   91374    case 4:
   91375       if (devinfo->is_g4x) {
   91376          return 8;
   91377       } else {
   91378          return 8;
   91379       }
   91380    default:
   91381       unreachable("Invalid hardware generation");
   91382    }
   91383 }
   91384 
   91385 
   91386 
   91387 #define GEN10_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91388 #define GEN9_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91389 #define GEN8_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91390 #define GEN75_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91391 #define GEN7_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91392 #define GEN6_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91393 #define GEN5_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91394 #define GEN45_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91395 #define GEN4_3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start  16
   91396 
   91397 static inline uint32_t ATTRIBUTE_PURE
   91398 _3DSTATE_VF_STATISTICS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   91399 {
   91400    switch (devinfo->gen) {
   91401    case 10: return 16;
   91402    case 9: return 16;
   91403    case 8: return 16;
   91404    case 7:
   91405       if (devinfo->is_haswell) {
   91406          return 16;
   91407       } else {
   91408          return 16;
   91409       }
   91410    case 6: return 16;
   91411    case 5: return 16;
   91412    case 4:
   91413       if (devinfo->is_g4x) {
   91414          return 16;
   91415       } else {
   91416          return 16;
   91417       }
   91418    default:
   91419       unreachable("Invalid hardware generation");
   91420    }
   91421 }
   91422 
   91423 
   91424 
   91425 /* 3DSTATE_VF_STATISTICS::Command SubType */
   91426 
   91427 
   91428 #define GEN10_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91429 #define GEN9_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91430 #define GEN8_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91431 #define GEN75_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91432 #define GEN7_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91433 #define GEN6_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91434 #define GEN5_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91435 #define GEN45_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91436 #define GEN4_3DSTATE_VF_STATISTICS_CommandSubType_bits  2
   91437 
   91438 static inline uint32_t ATTRIBUTE_PURE
   91439 _3DSTATE_VF_STATISTICS_CommandSubType_bits(const struct gen_device_info *devinfo)
   91440 {
   91441    switch (devinfo->gen) {
   91442    case 10: return 2;
   91443    case 9: return 2;
   91444    case 8: return 2;
   91445    case 7:
   91446       if (devinfo->is_haswell) {
   91447          return 2;
   91448       } else {
   91449          return 2;
   91450       }
   91451    case 6: return 2;
   91452    case 5: return 2;
   91453    case 4:
   91454       if (devinfo->is_g4x) {
   91455          return 2;
   91456       } else {
   91457          return 2;
   91458       }
   91459    default:
   91460       unreachable("Invalid hardware generation");
   91461    }
   91462 }
   91463 
   91464 
   91465 
   91466 #define GEN10_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91467 #define GEN9_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91468 #define GEN8_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91469 #define GEN75_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91470 #define GEN7_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91471 #define GEN6_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91472 #define GEN5_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91473 #define GEN45_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91474 #define GEN4_3DSTATE_VF_STATISTICS_CommandSubType_start  27
   91475 
   91476 static inline uint32_t ATTRIBUTE_PURE
   91477 _3DSTATE_VF_STATISTICS_CommandSubType_start(const struct gen_device_info *devinfo)
   91478 {
   91479    switch (devinfo->gen) {
   91480    case 10: return 27;
   91481    case 9: return 27;
   91482    case 8: return 27;
   91483    case 7:
   91484       if (devinfo->is_haswell) {
   91485          return 27;
   91486       } else {
   91487          return 27;
   91488       }
   91489    case 6: return 27;
   91490    case 5: return 27;
   91491    case 4:
   91492       if (devinfo->is_g4x) {
   91493          return 27;
   91494       } else {
   91495          return 27;
   91496       }
   91497    default:
   91498       unreachable("Invalid hardware generation");
   91499    }
   91500 }
   91501 
   91502 
   91503 
   91504 /* 3DSTATE_VF_STATISTICS::Command Type */
   91505 
   91506 
   91507 #define GEN10_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91508 #define GEN9_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91509 #define GEN8_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91510 #define GEN75_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91511 #define GEN7_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91512 #define GEN6_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91513 #define GEN5_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91514 #define GEN45_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91515 #define GEN4_3DSTATE_VF_STATISTICS_CommandType_bits  3
   91516 
   91517 static inline uint32_t ATTRIBUTE_PURE
   91518 _3DSTATE_VF_STATISTICS_CommandType_bits(const struct gen_device_info *devinfo)
   91519 {
   91520    switch (devinfo->gen) {
   91521    case 10: return 3;
   91522    case 9: return 3;
   91523    case 8: return 3;
   91524    case 7:
   91525       if (devinfo->is_haswell) {
   91526          return 3;
   91527       } else {
   91528          return 3;
   91529       }
   91530    case 6: return 3;
   91531    case 5: return 3;
   91532    case 4:
   91533       if (devinfo->is_g4x) {
   91534          return 3;
   91535       } else {
   91536          return 3;
   91537       }
   91538    default:
   91539       unreachable("Invalid hardware generation");
   91540    }
   91541 }
   91542 
   91543 
   91544 
   91545 #define GEN10_3DSTATE_VF_STATISTICS_CommandType_start  29
   91546 #define GEN9_3DSTATE_VF_STATISTICS_CommandType_start  29
   91547 #define GEN8_3DSTATE_VF_STATISTICS_CommandType_start  29
   91548 #define GEN75_3DSTATE_VF_STATISTICS_CommandType_start  29
   91549 #define GEN7_3DSTATE_VF_STATISTICS_CommandType_start  29
   91550 #define GEN6_3DSTATE_VF_STATISTICS_CommandType_start  29
   91551 #define GEN5_3DSTATE_VF_STATISTICS_CommandType_start  29
   91552 #define GEN45_3DSTATE_VF_STATISTICS_CommandType_start  29
   91553 #define GEN4_3DSTATE_VF_STATISTICS_CommandType_start  29
   91554 
   91555 static inline uint32_t ATTRIBUTE_PURE
   91556 _3DSTATE_VF_STATISTICS_CommandType_start(const struct gen_device_info *devinfo)
   91557 {
   91558    switch (devinfo->gen) {
   91559    case 10: return 29;
   91560    case 9: return 29;
   91561    case 8: return 29;
   91562    case 7:
   91563       if (devinfo->is_haswell) {
   91564          return 29;
   91565       } else {
   91566          return 29;
   91567       }
   91568    case 6: return 29;
   91569    case 5: return 29;
   91570    case 4:
   91571       if (devinfo->is_g4x) {
   91572          return 29;
   91573       } else {
   91574          return 29;
   91575       }
   91576    default:
   91577       unreachable("Invalid hardware generation");
   91578    }
   91579 }
   91580 
   91581 
   91582 
   91583 /* 3DSTATE_VF_STATISTICS::Statistics Enable */
   91584 
   91585 
   91586 #define GEN10_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91587 #define GEN9_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91588 #define GEN8_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91589 #define GEN75_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91590 #define GEN7_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91591 #define GEN6_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91592 #define GEN5_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91593 #define GEN45_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91594 #define GEN4_3DSTATE_VF_STATISTICS_StatisticsEnable_bits  1
   91595 
   91596 static inline uint32_t ATTRIBUTE_PURE
   91597 _3DSTATE_VF_STATISTICS_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   91598 {
   91599    switch (devinfo->gen) {
   91600    case 10: return 1;
   91601    case 9: return 1;
   91602    case 8: return 1;
   91603    case 7:
   91604       if (devinfo->is_haswell) {
   91605          return 1;
   91606       } else {
   91607          return 1;
   91608       }
   91609    case 6: return 1;
   91610    case 5: return 1;
   91611    case 4:
   91612       if (devinfo->is_g4x) {
   91613          return 1;
   91614       } else {
   91615          return 1;
   91616       }
   91617    default:
   91618       unreachable("Invalid hardware generation");
   91619    }
   91620 }
   91621 
   91622 
   91623 
   91624 #define GEN10_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91625 #define GEN9_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91626 #define GEN8_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91627 #define GEN75_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91628 #define GEN7_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91629 #define GEN6_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91630 #define GEN5_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91631 #define GEN45_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91632 #define GEN4_3DSTATE_VF_STATISTICS_StatisticsEnable_start  0
   91633 
   91634 static inline uint32_t ATTRIBUTE_PURE
   91635 _3DSTATE_VF_STATISTICS_StatisticsEnable_start(const struct gen_device_info *devinfo)
   91636 {
   91637    switch (devinfo->gen) {
   91638    case 10: return 0;
   91639    case 9: return 0;
   91640    case 8: return 0;
   91641    case 7:
   91642       if (devinfo->is_haswell) {
   91643          return 0;
   91644       } else {
   91645          return 0;
   91646       }
   91647    case 6: return 0;
   91648    case 5: return 0;
   91649    case 4:
   91650       if (devinfo->is_g4x) {
   91651          return 0;
   91652       } else {
   91653          return 0;
   91654       }
   91655    default:
   91656       unreachable("Invalid hardware generation");
   91657    }
   91658 }
   91659 
   91660 
   91661 
   91662 /* 3DSTATE_VF_TOPOLOGY */
   91663 
   91664 
   91665 #define GEN10_3DSTATE_VF_TOPOLOGY_length  2
   91666 #define GEN9_3DSTATE_VF_TOPOLOGY_length  2
   91667 #define GEN8_3DSTATE_VF_TOPOLOGY_length  2
   91668 
   91669 static inline uint32_t ATTRIBUTE_PURE
   91670 _3DSTATE_VF_TOPOLOGY_length(const struct gen_device_info *devinfo)
   91671 {
   91672    switch (devinfo->gen) {
   91673    case 10: return 2;
   91674    case 9: return 2;
   91675    case 8: return 2;
   91676    case 7:
   91677       if (devinfo->is_haswell) {
   91678          return 0;
   91679       } else {
   91680          return 0;
   91681       }
   91682    case 6: return 0;
   91683    case 5: return 0;
   91684    case 4:
   91685       if (devinfo->is_g4x) {
   91686          return 0;
   91687       } else {
   91688          return 0;
   91689       }
   91690    default:
   91691       unreachable("Invalid hardware generation");
   91692    }
   91693 }
   91694 
   91695 
   91696 
   91697 /* 3DSTATE_VF_TOPOLOGY::3D Command Opcode */
   91698 
   91699 
   91700 #define GEN10_3DSTATE_VF_TOPOLOGY_3DCommandOpcode_bits  3
   91701 #define GEN9_3DSTATE_VF_TOPOLOGY_3DCommandOpcode_bits  3
   91702 #define GEN8_3DSTATE_VF_TOPOLOGY_3DCommandOpcode_bits  3
   91703 
   91704 static inline uint32_t ATTRIBUTE_PURE
   91705 _3DSTATE_VF_TOPOLOGY_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   91706 {
   91707    switch (devinfo->gen) {
   91708    case 10: return 3;
   91709    case 9: return 3;
   91710    case 8: return 3;
   91711    case 7:
   91712       if (devinfo->is_haswell) {
   91713          return 0;
   91714       } else {
   91715          return 0;
   91716       }
   91717    case 6: return 0;
   91718    case 5: return 0;
   91719    case 4:
   91720       if (devinfo->is_g4x) {
   91721          return 0;
   91722       } else {
   91723          return 0;
   91724       }
   91725    default:
   91726       unreachable("Invalid hardware generation");
   91727    }
   91728 }
   91729 
   91730 
   91731 
   91732 #define GEN10_3DSTATE_VF_TOPOLOGY_3DCommandOpcode_start  24
   91733 #define GEN9_3DSTATE_VF_TOPOLOGY_3DCommandOpcode_start  24
   91734 #define GEN8_3DSTATE_VF_TOPOLOGY_3DCommandOpcode_start  24
   91735 
   91736 static inline uint32_t ATTRIBUTE_PURE
   91737 _3DSTATE_VF_TOPOLOGY_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   91738 {
   91739    switch (devinfo->gen) {
   91740    case 10: return 24;
   91741    case 9: return 24;
   91742    case 8: return 24;
   91743    case 7:
   91744       if (devinfo->is_haswell) {
   91745          return 0;
   91746       } else {
   91747          return 0;
   91748       }
   91749    case 6: return 0;
   91750    case 5: return 0;
   91751    case 4:
   91752       if (devinfo->is_g4x) {
   91753          return 0;
   91754       } else {
   91755          return 0;
   91756       }
   91757    default:
   91758       unreachable("Invalid hardware generation");
   91759    }
   91760 }
   91761 
   91762 
   91763 
   91764 /* 3DSTATE_VF_TOPOLOGY::3D Command Sub Opcode */
   91765 
   91766 
   91767 #define GEN10_3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_bits  8
   91768 #define GEN9_3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_bits  8
   91769 #define GEN8_3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_bits  8
   91770 
   91771 static inline uint32_t ATTRIBUTE_PURE
   91772 _3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   91773 {
   91774    switch (devinfo->gen) {
   91775    case 10: return 8;
   91776    case 9: return 8;
   91777    case 8: return 8;
   91778    case 7:
   91779       if (devinfo->is_haswell) {
   91780          return 0;
   91781       } else {
   91782          return 0;
   91783       }
   91784    case 6: return 0;
   91785    case 5: return 0;
   91786    case 4:
   91787       if (devinfo->is_g4x) {
   91788          return 0;
   91789       } else {
   91790          return 0;
   91791       }
   91792    default:
   91793       unreachable("Invalid hardware generation");
   91794    }
   91795 }
   91796 
   91797 
   91798 
   91799 #define GEN10_3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_start  16
   91800 #define GEN9_3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_start  16
   91801 #define GEN8_3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_start  16
   91802 
   91803 static inline uint32_t ATTRIBUTE_PURE
   91804 _3DSTATE_VF_TOPOLOGY_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   91805 {
   91806    switch (devinfo->gen) {
   91807    case 10: return 16;
   91808    case 9: return 16;
   91809    case 8: return 16;
   91810    case 7:
   91811       if (devinfo->is_haswell) {
   91812          return 0;
   91813       } else {
   91814          return 0;
   91815       }
   91816    case 6: return 0;
   91817    case 5: return 0;
   91818    case 4:
   91819       if (devinfo->is_g4x) {
   91820          return 0;
   91821       } else {
   91822          return 0;
   91823       }
   91824    default:
   91825       unreachable("Invalid hardware generation");
   91826    }
   91827 }
   91828 
   91829 
   91830 
   91831 /* 3DSTATE_VF_TOPOLOGY::Command SubType */
   91832 
   91833 
   91834 #define GEN10_3DSTATE_VF_TOPOLOGY_CommandSubType_bits  2
   91835 #define GEN9_3DSTATE_VF_TOPOLOGY_CommandSubType_bits  2
   91836 #define GEN8_3DSTATE_VF_TOPOLOGY_CommandSubType_bits  2
   91837 
   91838 static inline uint32_t ATTRIBUTE_PURE
   91839 _3DSTATE_VF_TOPOLOGY_CommandSubType_bits(const struct gen_device_info *devinfo)
   91840 {
   91841    switch (devinfo->gen) {
   91842    case 10: return 2;
   91843    case 9: return 2;
   91844    case 8: return 2;
   91845    case 7:
   91846       if (devinfo->is_haswell) {
   91847          return 0;
   91848       } else {
   91849          return 0;
   91850       }
   91851    case 6: return 0;
   91852    case 5: return 0;
   91853    case 4:
   91854       if (devinfo->is_g4x) {
   91855          return 0;
   91856       } else {
   91857          return 0;
   91858       }
   91859    default:
   91860       unreachable("Invalid hardware generation");
   91861    }
   91862 }
   91863 
   91864 
   91865 
   91866 #define GEN10_3DSTATE_VF_TOPOLOGY_CommandSubType_start  27
   91867 #define GEN9_3DSTATE_VF_TOPOLOGY_CommandSubType_start  27
   91868 #define GEN8_3DSTATE_VF_TOPOLOGY_CommandSubType_start  27
   91869 
   91870 static inline uint32_t ATTRIBUTE_PURE
   91871 _3DSTATE_VF_TOPOLOGY_CommandSubType_start(const struct gen_device_info *devinfo)
   91872 {
   91873    switch (devinfo->gen) {
   91874    case 10: return 27;
   91875    case 9: return 27;
   91876    case 8: return 27;
   91877    case 7:
   91878       if (devinfo->is_haswell) {
   91879          return 0;
   91880       } else {
   91881          return 0;
   91882       }
   91883    case 6: return 0;
   91884    case 5: return 0;
   91885    case 4:
   91886       if (devinfo->is_g4x) {
   91887          return 0;
   91888       } else {
   91889          return 0;
   91890       }
   91891    default:
   91892       unreachable("Invalid hardware generation");
   91893    }
   91894 }
   91895 
   91896 
   91897 
   91898 /* 3DSTATE_VF_TOPOLOGY::Command Type */
   91899 
   91900 
   91901 #define GEN10_3DSTATE_VF_TOPOLOGY_CommandType_bits  3
   91902 #define GEN9_3DSTATE_VF_TOPOLOGY_CommandType_bits  3
   91903 #define GEN8_3DSTATE_VF_TOPOLOGY_CommandType_bits  3
   91904 
   91905 static inline uint32_t ATTRIBUTE_PURE
   91906 _3DSTATE_VF_TOPOLOGY_CommandType_bits(const struct gen_device_info *devinfo)
   91907 {
   91908    switch (devinfo->gen) {
   91909    case 10: return 3;
   91910    case 9: return 3;
   91911    case 8: return 3;
   91912    case 7:
   91913       if (devinfo->is_haswell) {
   91914          return 0;
   91915       } else {
   91916          return 0;
   91917       }
   91918    case 6: return 0;
   91919    case 5: return 0;
   91920    case 4:
   91921       if (devinfo->is_g4x) {
   91922          return 0;
   91923       } else {
   91924          return 0;
   91925       }
   91926    default:
   91927       unreachable("Invalid hardware generation");
   91928    }
   91929 }
   91930 
   91931 
   91932 
   91933 #define GEN10_3DSTATE_VF_TOPOLOGY_CommandType_start  29
   91934 #define GEN9_3DSTATE_VF_TOPOLOGY_CommandType_start  29
   91935 #define GEN8_3DSTATE_VF_TOPOLOGY_CommandType_start  29
   91936 
   91937 static inline uint32_t ATTRIBUTE_PURE
   91938 _3DSTATE_VF_TOPOLOGY_CommandType_start(const struct gen_device_info *devinfo)
   91939 {
   91940    switch (devinfo->gen) {
   91941    case 10: return 29;
   91942    case 9: return 29;
   91943    case 8: return 29;
   91944    case 7:
   91945       if (devinfo->is_haswell) {
   91946          return 0;
   91947       } else {
   91948          return 0;
   91949       }
   91950    case 6: return 0;
   91951    case 5: return 0;
   91952    case 4:
   91953       if (devinfo->is_g4x) {
   91954          return 0;
   91955       } else {
   91956          return 0;
   91957       }
   91958    default:
   91959       unreachable("Invalid hardware generation");
   91960    }
   91961 }
   91962 
   91963 
   91964 
   91965 /* 3DSTATE_VF_TOPOLOGY::DWord Length */
   91966 
   91967 
   91968 #define GEN10_3DSTATE_VF_TOPOLOGY_DWordLength_bits  8
   91969 #define GEN9_3DSTATE_VF_TOPOLOGY_DWordLength_bits  8
   91970 #define GEN8_3DSTATE_VF_TOPOLOGY_DWordLength_bits  8
   91971 
   91972 static inline uint32_t ATTRIBUTE_PURE
   91973 _3DSTATE_VF_TOPOLOGY_DWordLength_bits(const struct gen_device_info *devinfo)
   91974 {
   91975    switch (devinfo->gen) {
   91976    case 10: return 8;
   91977    case 9: return 8;
   91978    case 8: return 8;
   91979    case 7:
   91980       if (devinfo->is_haswell) {
   91981          return 0;
   91982       } else {
   91983          return 0;
   91984       }
   91985    case 6: return 0;
   91986    case 5: return 0;
   91987    case 4:
   91988       if (devinfo->is_g4x) {
   91989          return 0;
   91990       } else {
   91991          return 0;
   91992       }
   91993    default:
   91994       unreachable("Invalid hardware generation");
   91995    }
   91996 }
   91997 
   91998 
   91999 
   92000 #define GEN10_3DSTATE_VF_TOPOLOGY_DWordLength_start  0
   92001 #define GEN9_3DSTATE_VF_TOPOLOGY_DWordLength_start  0
   92002 #define GEN8_3DSTATE_VF_TOPOLOGY_DWordLength_start  0
   92003 
   92004 static inline uint32_t ATTRIBUTE_PURE
   92005 _3DSTATE_VF_TOPOLOGY_DWordLength_start(const struct gen_device_info *devinfo)
   92006 {
   92007    switch (devinfo->gen) {
   92008    case 10: return 0;
   92009    case 9: return 0;
   92010    case 8: return 0;
   92011    case 7:
   92012       if (devinfo->is_haswell) {
   92013          return 0;
   92014       } else {
   92015          return 0;
   92016       }
   92017    case 6: return 0;
   92018    case 5: return 0;
   92019    case 4:
   92020       if (devinfo->is_g4x) {
   92021          return 0;
   92022       } else {
   92023          return 0;
   92024       }
   92025    default:
   92026       unreachable("Invalid hardware generation");
   92027    }
   92028 }
   92029 
   92030 
   92031 
   92032 /* 3DSTATE_VF_TOPOLOGY::Primitive Topology Type */
   92033 
   92034 
   92035 #define GEN10_3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_bits  6
   92036 #define GEN9_3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_bits  6
   92037 #define GEN8_3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_bits  6
   92038 
   92039 static inline uint32_t ATTRIBUTE_PURE
   92040 _3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_bits(const struct gen_device_info *devinfo)
   92041 {
   92042    switch (devinfo->gen) {
   92043    case 10: return 6;
   92044    case 9: return 6;
   92045    case 8: return 6;
   92046    case 7:
   92047       if (devinfo->is_haswell) {
   92048          return 0;
   92049       } else {
   92050          return 0;
   92051       }
   92052    case 6: return 0;
   92053    case 5: return 0;
   92054    case 4:
   92055       if (devinfo->is_g4x) {
   92056          return 0;
   92057       } else {
   92058          return 0;
   92059       }
   92060    default:
   92061       unreachable("Invalid hardware generation");
   92062    }
   92063 }
   92064 
   92065 
   92066 
   92067 #define GEN10_3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_start  32
   92068 #define GEN9_3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_start  32
   92069 #define GEN8_3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_start  32
   92070 
   92071 static inline uint32_t ATTRIBUTE_PURE
   92072 _3DSTATE_VF_TOPOLOGY_PrimitiveTopologyType_start(const struct gen_device_info *devinfo)
   92073 {
   92074    switch (devinfo->gen) {
   92075    case 10: return 32;
   92076    case 9: return 32;
   92077    case 8: return 32;
   92078    case 7:
   92079       if (devinfo->is_haswell) {
   92080          return 0;
   92081       } else {
   92082          return 0;
   92083       }
   92084    case 6: return 0;
   92085    case 5: return 0;
   92086    case 4:
   92087       if (devinfo->is_g4x) {
   92088          return 0;
   92089       } else {
   92090          return 0;
   92091       }
   92092    default:
   92093       unreachable("Invalid hardware generation");
   92094    }
   92095 }
   92096 
   92097 
   92098 
   92099 /* 3DSTATE_VIEWPORT_STATE_POINTERS */
   92100 
   92101 
   92102 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_length  4
   92103 
   92104 static inline uint32_t ATTRIBUTE_PURE
   92105 _3DSTATE_VIEWPORT_STATE_POINTERS_length(const struct gen_device_info *devinfo)
   92106 {
   92107    switch (devinfo->gen) {
   92108    case 10: return 0;
   92109    case 9: return 0;
   92110    case 8: return 0;
   92111    case 7:
   92112       if (devinfo->is_haswell) {
   92113          return 0;
   92114       } else {
   92115          return 0;
   92116       }
   92117    case 6: return 4;
   92118    case 5: return 0;
   92119    case 4:
   92120       if (devinfo->is_g4x) {
   92121          return 0;
   92122       } else {
   92123          return 0;
   92124       }
   92125    default:
   92126       unreachable("Invalid hardware generation");
   92127    }
   92128 }
   92129 
   92130 
   92131 
   92132 /* 3DSTATE_VIEWPORT_STATE_POINTERS::3D Command Opcode */
   92133 
   92134 
   92135 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandOpcode_bits  3
   92136 
   92137 static inline uint32_t ATTRIBUTE_PURE
   92138 _3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   92139 {
   92140    switch (devinfo->gen) {
   92141    case 10: return 0;
   92142    case 9: return 0;
   92143    case 8: return 0;
   92144    case 7:
   92145       if (devinfo->is_haswell) {
   92146          return 0;
   92147       } else {
   92148          return 0;
   92149       }
   92150    case 6: return 3;
   92151    case 5: return 0;
   92152    case 4:
   92153       if (devinfo->is_g4x) {
   92154          return 0;
   92155       } else {
   92156          return 0;
   92157       }
   92158    default:
   92159       unreachable("Invalid hardware generation");
   92160    }
   92161 }
   92162 
   92163 
   92164 
   92165 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandOpcode_start  24
   92166 
   92167 static inline uint32_t ATTRIBUTE_PURE
   92168 _3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   92169 {
   92170    switch (devinfo->gen) {
   92171    case 10: return 0;
   92172    case 9: return 0;
   92173    case 8: return 0;
   92174    case 7:
   92175       if (devinfo->is_haswell) {
   92176          return 0;
   92177       } else {
   92178          return 0;
   92179       }
   92180    case 6: return 24;
   92181    case 5: return 0;
   92182    case 4:
   92183       if (devinfo->is_g4x) {
   92184          return 0;
   92185       } else {
   92186          return 0;
   92187       }
   92188    default:
   92189       unreachable("Invalid hardware generation");
   92190    }
   92191 }
   92192 
   92193 
   92194 
   92195 /* 3DSTATE_VIEWPORT_STATE_POINTERS::3D Command Sub Opcode */
   92196 
   92197 
   92198 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandSubOpcode_bits  8
   92199 
   92200 static inline uint32_t ATTRIBUTE_PURE
   92201 _3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   92202 {
   92203    switch (devinfo->gen) {
   92204    case 10: return 0;
   92205    case 9: return 0;
   92206    case 8: return 0;
   92207    case 7:
   92208       if (devinfo->is_haswell) {
   92209          return 0;
   92210       } else {
   92211          return 0;
   92212       }
   92213    case 6: return 8;
   92214    case 5: return 0;
   92215    case 4:
   92216       if (devinfo->is_g4x) {
   92217          return 0;
   92218       } else {
   92219          return 0;
   92220       }
   92221    default:
   92222       unreachable("Invalid hardware generation");
   92223    }
   92224 }
   92225 
   92226 
   92227 
   92228 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandSubOpcode_start  16
   92229 
   92230 static inline uint32_t ATTRIBUTE_PURE
   92231 _3DSTATE_VIEWPORT_STATE_POINTERS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   92232 {
   92233    switch (devinfo->gen) {
   92234    case 10: return 0;
   92235    case 9: return 0;
   92236    case 8: return 0;
   92237    case 7:
   92238       if (devinfo->is_haswell) {
   92239          return 0;
   92240       } else {
   92241          return 0;
   92242       }
   92243    case 6: return 16;
   92244    case 5: return 0;
   92245    case 4:
   92246       if (devinfo->is_g4x) {
   92247          return 0;
   92248       } else {
   92249          return 0;
   92250       }
   92251    default:
   92252       unreachable("Invalid hardware generation");
   92253    }
   92254 }
   92255 
   92256 
   92257 
   92258 /* 3DSTATE_VIEWPORT_STATE_POINTERS::CC Viewport State Change */
   92259 
   92260 
   92261 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CCViewportStateChange_bits  1
   92262 
   92263 static inline uint32_t ATTRIBUTE_PURE
   92264 _3DSTATE_VIEWPORT_STATE_POINTERS_CCViewportStateChange_bits(const struct gen_device_info *devinfo)
   92265 {
   92266    switch (devinfo->gen) {
   92267    case 10: return 0;
   92268    case 9: return 0;
   92269    case 8: return 0;
   92270    case 7:
   92271       if (devinfo->is_haswell) {
   92272          return 0;
   92273       } else {
   92274          return 0;
   92275       }
   92276    case 6: return 1;
   92277    case 5: return 0;
   92278    case 4:
   92279       if (devinfo->is_g4x) {
   92280          return 0;
   92281       } else {
   92282          return 0;
   92283       }
   92284    default:
   92285       unreachable("Invalid hardware generation");
   92286    }
   92287 }
   92288 
   92289 
   92290 
   92291 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CCViewportStateChange_start  12
   92292 
   92293 static inline uint32_t ATTRIBUTE_PURE
   92294 _3DSTATE_VIEWPORT_STATE_POINTERS_CCViewportStateChange_start(const struct gen_device_info *devinfo)
   92295 {
   92296    switch (devinfo->gen) {
   92297    case 10: return 0;
   92298    case 9: return 0;
   92299    case 8: return 0;
   92300    case 7:
   92301       if (devinfo->is_haswell) {
   92302          return 0;
   92303       } else {
   92304          return 0;
   92305       }
   92306    case 6: return 12;
   92307    case 5: return 0;
   92308    case 4:
   92309       if (devinfo->is_g4x) {
   92310          return 0;
   92311       } else {
   92312          return 0;
   92313       }
   92314    default:
   92315       unreachable("Invalid hardware generation");
   92316    }
   92317 }
   92318 
   92319 
   92320 
   92321 /* 3DSTATE_VIEWPORT_STATE_POINTERS::CLIP Viewport State Change */
   92322 
   92323 
   92324 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CLIPViewportStateChange_bits  1
   92325 
   92326 static inline uint32_t ATTRIBUTE_PURE
   92327 _3DSTATE_VIEWPORT_STATE_POINTERS_CLIPViewportStateChange_bits(const struct gen_device_info *devinfo)
   92328 {
   92329    switch (devinfo->gen) {
   92330    case 10: return 0;
   92331    case 9: return 0;
   92332    case 8: return 0;
   92333    case 7:
   92334       if (devinfo->is_haswell) {
   92335          return 0;
   92336       } else {
   92337          return 0;
   92338       }
   92339    case 6: return 1;
   92340    case 5: return 0;
   92341    case 4:
   92342       if (devinfo->is_g4x) {
   92343          return 0;
   92344       } else {
   92345          return 0;
   92346       }
   92347    default:
   92348       unreachable("Invalid hardware generation");
   92349    }
   92350 }
   92351 
   92352 
   92353 
   92354 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CLIPViewportStateChange_start  10
   92355 
   92356 static inline uint32_t ATTRIBUTE_PURE
   92357 _3DSTATE_VIEWPORT_STATE_POINTERS_CLIPViewportStateChange_start(const struct gen_device_info *devinfo)
   92358 {
   92359    switch (devinfo->gen) {
   92360    case 10: return 0;
   92361    case 9: return 0;
   92362    case 8: return 0;
   92363    case 7:
   92364       if (devinfo->is_haswell) {
   92365          return 0;
   92366       } else {
   92367          return 0;
   92368       }
   92369    case 6: return 10;
   92370    case 5: return 0;
   92371    case 4:
   92372       if (devinfo->is_g4x) {
   92373          return 0;
   92374       } else {
   92375          return 0;
   92376       }
   92377    default:
   92378       unreachable("Invalid hardware generation");
   92379    }
   92380 }
   92381 
   92382 
   92383 
   92384 /* 3DSTATE_VIEWPORT_STATE_POINTERS::Command SubType */
   92385 
   92386 
   92387 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CommandSubType_bits  2
   92388 
   92389 static inline uint32_t ATTRIBUTE_PURE
   92390 _3DSTATE_VIEWPORT_STATE_POINTERS_CommandSubType_bits(const struct gen_device_info *devinfo)
   92391 {
   92392    switch (devinfo->gen) {
   92393    case 10: return 0;
   92394    case 9: return 0;
   92395    case 8: return 0;
   92396    case 7:
   92397       if (devinfo->is_haswell) {
   92398          return 0;
   92399       } else {
   92400          return 0;
   92401       }
   92402    case 6: return 2;
   92403    case 5: return 0;
   92404    case 4:
   92405       if (devinfo->is_g4x) {
   92406          return 0;
   92407       } else {
   92408          return 0;
   92409       }
   92410    default:
   92411       unreachable("Invalid hardware generation");
   92412    }
   92413 }
   92414 
   92415 
   92416 
   92417 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CommandSubType_start  27
   92418 
   92419 static inline uint32_t ATTRIBUTE_PURE
   92420 _3DSTATE_VIEWPORT_STATE_POINTERS_CommandSubType_start(const struct gen_device_info *devinfo)
   92421 {
   92422    switch (devinfo->gen) {
   92423    case 10: return 0;
   92424    case 9: return 0;
   92425    case 8: return 0;
   92426    case 7:
   92427       if (devinfo->is_haswell) {
   92428          return 0;
   92429       } else {
   92430          return 0;
   92431       }
   92432    case 6: return 27;
   92433    case 5: return 0;
   92434    case 4:
   92435       if (devinfo->is_g4x) {
   92436          return 0;
   92437       } else {
   92438          return 0;
   92439       }
   92440    default:
   92441       unreachable("Invalid hardware generation");
   92442    }
   92443 }
   92444 
   92445 
   92446 
   92447 /* 3DSTATE_VIEWPORT_STATE_POINTERS::Command Type */
   92448 
   92449 
   92450 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CommandType_bits  3
   92451 
   92452 static inline uint32_t ATTRIBUTE_PURE
   92453 _3DSTATE_VIEWPORT_STATE_POINTERS_CommandType_bits(const struct gen_device_info *devinfo)
   92454 {
   92455    switch (devinfo->gen) {
   92456    case 10: return 0;
   92457    case 9: return 0;
   92458    case 8: return 0;
   92459    case 7:
   92460       if (devinfo->is_haswell) {
   92461          return 0;
   92462       } else {
   92463          return 0;
   92464       }
   92465    case 6: return 3;
   92466    case 5: return 0;
   92467    case 4:
   92468       if (devinfo->is_g4x) {
   92469          return 0;
   92470       } else {
   92471          return 0;
   92472       }
   92473    default:
   92474       unreachable("Invalid hardware generation");
   92475    }
   92476 }
   92477 
   92478 
   92479 
   92480 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_CommandType_start  29
   92481 
   92482 static inline uint32_t ATTRIBUTE_PURE
   92483 _3DSTATE_VIEWPORT_STATE_POINTERS_CommandType_start(const struct gen_device_info *devinfo)
   92484 {
   92485    switch (devinfo->gen) {
   92486    case 10: return 0;
   92487    case 9: return 0;
   92488    case 8: return 0;
   92489    case 7:
   92490       if (devinfo->is_haswell) {
   92491          return 0;
   92492       } else {
   92493          return 0;
   92494       }
   92495    case 6: return 29;
   92496    case 5: return 0;
   92497    case 4:
   92498       if (devinfo->is_g4x) {
   92499          return 0;
   92500       } else {
   92501          return 0;
   92502       }
   92503    default:
   92504       unreachable("Invalid hardware generation");
   92505    }
   92506 }
   92507 
   92508 
   92509 
   92510 /* 3DSTATE_VIEWPORT_STATE_POINTERS::DWord Length */
   92511 
   92512 
   92513 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_DWordLength_bits  8
   92514 
   92515 static inline uint32_t ATTRIBUTE_PURE
   92516 _3DSTATE_VIEWPORT_STATE_POINTERS_DWordLength_bits(const struct gen_device_info *devinfo)
   92517 {
   92518    switch (devinfo->gen) {
   92519    case 10: return 0;
   92520    case 9: return 0;
   92521    case 8: return 0;
   92522    case 7:
   92523       if (devinfo->is_haswell) {
   92524          return 0;
   92525       } else {
   92526          return 0;
   92527       }
   92528    case 6: return 8;
   92529    case 5: return 0;
   92530    case 4:
   92531       if (devinfo->is_g4x) {
   92532          return 0;
   92533       } else {
   92534          return 0;
   92535       }
   92536    default:
   92537       unreachable("Invalid hardware generation");
   92538    }
   92539 }
   92540 
   92541 
   92542 
   92543 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_DWordLength_start  0
   92544 
   92545 static inline uint32_t ATTRIBUTE_PURE
   92546 _3DSTATE_VIEWPORT_STATE_POINTERS_DWordLength_start(const struct gen_device_info *devinfo)
   92547 {
   92548    switch (devinfo->gen) {
   92549    case 10: return 0;
   92550    case 9: return 0;
   92551    case 8: return 0;
   92552    case 7:
   92553       if (devinfo->is_haswell) {
   92554          return 0;
   92555       } else {
   92556          return 0;
   92557       }
   92558    case 6: return 0;
   92559    case 5: return 0;
   92560    case 4:
   92561       if (devinfo->is_g4x) {
   92562          return 0;
   92563       } else {
   92564          return 0;
   92565       }
   92566    default:
   92567       unreachable("Invalid hardware generation");
   92568    }
   92569 }
   92570 
   92571 
   92572 
   92573 /* 3DSTATE_VIEWPORT_STATE_POINTERS::Pointer to CC_VIEWPORT */
   92574 
   92575 
   92576 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCC_VIEWPORT_bits  27
   92577 
   92578 static inline uint32_t ATTRIBUTE_PURE
   92579 _3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCC_VIEWPORT_bits(const struct gen_device_info *devinfo)
   92580 {
   92581    switch (devinfo->gen) {
   92582    case 10: return 0;
   92583    case 9: return 0;
   92584    case 8: return 0;
   92585    case 7:
   92586       if (devinfo->is_haswell) {
   92587          return 0;
   92588       } else {
   92589          return 0;
   92590       }
   92591    case 6: return 27;
   92592    case 5: return 0;
   92593    case 4:
   92594       if (devinfo->is_g4x) {
   92595          return 0;
   92596       } else {
   92597          return 0;
   92598       }
   92599    default:
   92600       unreachable("Invalid hardware generation");
   92601    }
   92602 }
   92603 
   92604 
   92605 
   92606 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCC_VIEWPORT_start  101
   92607 
   92608 static inline uint32_t ATTRIBUTE_PURE
   92609 _3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCC_VIEWPORT_start(const struct gen_device_info *devinfo)
   92610 {
   92611    switch (devinfo->gen) {
   92612    case 10: return 0;
   92613    case 9: return 0;
   92614    case 8: return 0;
   92615    case 7:
   92616       if (devinfo->is_haswell) {
   92617          return 0;
   92618       } else {
   92619          return 0;
   92620       }
   92621    case 6: return 101;
   92622    case 5: return 0;
   92623    case 4:
   92624       if (devinfo->is_g4x) {
   92625          return 0;
   92626       } else {
   92627          return 0;
   92628       }
   92629    default:
   92630       unreachable("Invalid hardware generation");
   92631    }
   92632 }
   92633 
   92634 
   92635 
   92636 /* 3DSTATE_VIEWPORT_STATE_POINTERS::Pointer to CLIP_VIEWPORT */
   92637 
   92638 
   92639 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCLIP_VIEWPORT_bits  27
   92640 
   92641 static inline uint32_t ATTRIBUTE_PURE
   92642 _3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCLIP_VIEWPORT_bits(const struct gen_device_info *devinfo)
   92643 {
   92644    switch (devinfo->gen) {
   92645    case 10: return 0;
   92646    case 9: return 0;
   92647    case 8: return 0;
   92648    case 7:
   92649       if (devinfo->is_haswell) {
   92650          return 0;
   92651       } else {
   92652          return 0;
   92653       }
   92654    case 6: return 27;
   92655    case 5: return 0;
   92656    case 4:
   92657       if (devinfo->is_g4x) {
   92658          return 0;
   92659       } else {
   92660          return 0;
   92661       }
   92662    default:
   92663       unreachable("Invalid hardware generation");
   92664    }
   92665 }
   92666 
   92667 
   92668 
   92669 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCLIP_VIEWPORT_start  37
   92670 
   92671 static inline uint32_t ATTRIBUTE_PURE
   92672 _3DSTATE_VIEWPORT_STATE_POINTERS_PointertoCLIP_VIEWPORT_start(const struct gen_device_info *devinfo)
   92673 {
   92674    switch (devinfo->gen) {
   92675    case 10: return 0;
   92676    case 9: return 0;
   92677    case 8: return 0;
   92678    case 7:
   92679       if (devinfo->is_haswell) {
   92680          return 0;
   92681       } else {
   92682          return 0;
   92683       }
   92684    case 6: return 37;
   92685    case 5: return 0;
   92686    case 4:
   92687       if (devinfo->is_g4x) {
   92688          return 0;
   92689       } else {
   92690          return 0;
   92691       }
   92692    default:
   92693       unreachable("Invalid hardware generation");
   92694    }
   92695 }
   92696 
   92697 
   92698 
   92699 /* 3DSTATE_VIEWPORT_STATE_POINTERS::Pointer to SF_VIEWPORT */
   92700 
   92701 
   92702 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_PointertoSF_VIEWPORT_bits  27
   92703 
   92704 static inline uint32_t ATTRIBUTE_PURE
   92705 _3DSTATE_VIEWPORT_STATE_POINTERS_PointertoSF_VIEWPORT_bits(const struct gen_device_info *devinfo)
   92706 {
   92707    switch (devinfo->gen) {
   92708    case 10: return 0;
   92709    case 9: return 0;
   92710    case 8: return 0;
   92711    case 7:
   92712       if (devinfo->is_haswell) {
   92713          return 0;
   92714       } else {
   92715          return 0;
   92716       }
   92717    case 6: return 27;
   92718    case 5: return 0;
   92719    case 4:
   92720       if (devinfo->is_g4x) {
   92721          return 0;
   92722       } else {
   92723          return 0;
   92724       }
   92725    default:
   92726       unreachable("Invalid hardware generation");
   92727    }
   92728 }
   92729 
   92730 
   92731 
   92732 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_PointertoSF_VIEWPORT_start  69
   92733 
   92734 static inline uint32_t ATTRIBUTE_PURE
   92735 _3DSTATE_VIEWPORT_STATE_POINTERS_PointertoSF_VIEWPORT_start(const struct gen_device_info *devinfo)
   92736 {
   92737    switch (devinfo->gen) {
   92738    case 10: return 0;
   92739    case 9: return 0;
   92740    case 8: return 0;
   92741    case 7:
   92742       if (devinfo->is_haswell) {
   92743          return 0;
   92744       } else {
   92745          return 0;
   92746       }
   92747    case 6: return 69;
   92748    case 5: return 0;
   92749    case 4:
   92750       if (devinfo->is_g4x) {
   92751          return 0;
   92752       } else {
   92753          return 0;
   92754       }
   92755    default:
   92756       unreachable("Invalid hardware generation");
   92757    }
   92758 }
   92759 
   92760 
   92761 
   92762 /* 3DSTATE_VIEWPORT_STATE_POINTERS::SF Viewport State Change */
   92763 
   92764 
   92765 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_SFViewportStateChange_bits  1
   92766 
   92767 static inline uint32_t ATTRIBUTE_PURE
   92768 _3DSTATE_VIEWPORT_STATE_POINTERS_SFViewportStateChange_bits(const struct gen_device_info *devinfo)
   92769 {
   92770    switch (devinfo->gen) {
   92771    case 10: return 0;
   92772    case 9: return 0;
   92773    case 8: return 0;
   92774    case 7:
   92775       if (devinfo->is_haswell) {
   92776          return 0;
   92777       } else {
   92778          return 0;
   92779       }
   92780    case 6: return 1;
   92781    case 5: return 0;
   92782    case 4:
   92783       if (devinfo->is_g4x) {
   92784          return 0;
   92785       } else {
   92786          return 0;
   92787       }
   92788    default:
   92789       unreachable("Invalid hardware generation");
   92790    }
   92791 }
   92792 
   92793 
   92794 
   92795 #define GEN6_3DSTATE_VIEWPORT_STATE_POINTERS_SFViewportStateChange_start  11
   92796 
   92797 static inline uint32_t ATTRIBUTE_PURE
   92798 _3DSTATE_VIEWPORT_STATE_POINTERS_SFViewportStateChange_start(const struct gen_device_info *devinfo)
   92799 {
   92800    switch (devinfo->gen) {
   92801    case 10: return 0;
   92802    case 9: return 0;
   92803    case 8: return 0;
   92804    case 7:
   92805       if (devinfo->is_haswell) {
   92806          return 0;
   92807       } else {
   92808          return 0;
   92809       }
   92810    case 6: return 11;
   92811    case 5: return 0;
   92812    case 4:
   92813       if (devinfo->is_g4x) {
   92814          return 0;
   92815       } else {
   92816          return 0;
   92817       }
   92818    default:
   92819       unreachable("Invalid hardware generation");
   92820    }
   92821 }
   92822 
   92823 
   92824 
   92825 /* 3DSTATE_VIEWPORT_STATE_POINTERS_CC */
   92826 
   92827 
   92828 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length  2
   92829 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length  2
   92830 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length  2
   92831 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length  2
   92832 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length  2
   92833 
   92834 static inline uint32_t ATTRIBUTE_PURE
   92835 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_length(const struct gen_device_info *devinfo)
   92836 {
   92837    switch (devinfo->gen) {
   92838    case 10: return 2;
   92839    case 9: return 2;
   92840    case 8: return 2;
   92841    case 7:
   92842       if (devinfo->is_haswell) {
   92843          return 2;
   92844       } else {
   92845          return 2;
   92846       }
   92847    case 6: return 0;
   92848    case 5: return 0;
   92849    case 4:
   92850       if (devinfo->is_g4x) {
   92851          return 0;
   92852       } else {
   92853          return 0;
   92854       }
   92855    default:
   92856       unreachable("Invalid hardware generation");
   92857    }
   92858 }
   92859 
   92860 
   92861 
   92862 /* 3DSTATE_VIEWPORT_STATE_POINTERS_CC::3D Command Opcode */
   92863 
   92864 
   92865 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_bits  3
   92866 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_bits  3
   92867 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_bits  3
   92868 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_bits  3
   92869 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_bits  3
   92870 
   92871 static inline uint32_t ATTRIBUTE_PURE
   92872 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   92873 {
   92874    switch (devinfo->gen) {
   92875    case 10: return 3;
   92876    case 9: return 3;
   92877    case 8: return 3;
   92878    case 7:
   92879       if (devinfo->is_haswell) {
   92880          return 3;
   92881       } else {
   92882          return 3;
   92883       }
   92884    case 6: return 0;
   92885    case 5: return 0;
   92886    case 4:
   92887       if (devinfo->is_g4x) {
   92888          return 0;
   92889       } else {
   92890          return 0;
   92891       }
   92892    default:
   92893       unreachable("Invalid hardware generation");
   92894    }
   92895 }
   92896 
   92897 
   92898 
   92899 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_start  24
   92900 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_start  24
   92901 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_start  24
   92902 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_start  24
   92903 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_start  24
   92904 
   92905 static inline uint32_t ATTRIBUTE_PURE
   92906 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   92907 {
   92908    switch (devinfo->gen) {
   92909    case 10: return 24;
   92910    case 9: return 24;
   92911    case 8: return 24;
   92912    case 7:
   92913       if (devinfo->is_haswell) {
   92914          return 24;
   92915       } else {
   92916          return 24;
   92917       }
   92918    case 6: return 0;
   92919    case 5: return 0;
   92920    case 4:
   92921       if (devinfo->is_g4x) {
   92922          return 0;
   92923       } else {
   92924          return 0;
   92925       }
   92926    default:
   92927       unreachable("Invalid hardware generation");
   92928    }
   92929 }
   92930 
   92931 
   92932 
   92933 /* 3DSTATE_VIEWPORT_STATE_POINTERS_CC::3D Command Sub Opcode */
   92934 
   92935 
   92936 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_bits  8
   92937 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_bits  8
   92938 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_bits  8
   92939 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_bits  8
   92940 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_bits  8
   92941 
   92942 static inline uint32_t ATTRIBUTE_PURE
   92943 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   92944 {
   92945    switch (devinfo->gen) {
   92946    case 10: return 8;
   92947    case 9: return 8;
   92948    case 8: return 8;
   92949    case 7:
   92950       if (devinfo->is_haswell) {
   92951          return 8;
   92952       } else {
   92953          return 8;
   92954       }
   92955    case 6: return 0;
   92956    case 5: return 0;
   92957    case 4:
   92958       if (devinfo->is_g4x) {
   92959          return 0;
   92960       } else {
   92961          return 0;
   92962       }
   92963    default:
   92964       unreachable("Invalid hardware generation");
   92965    }
   92966 }
   92967 
   92968 
   92969 
   92970 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_start  16
   92971 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_start  16
   92972 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_start  16
   92973 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_start  16
   92974 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_start  16
   92975 
   92976 static inline uint32_t ATTRIBUTE_PURE
   92977 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   92978 {
   92979    switch (devinfo->gen) {
   92980    case 10: return 16;
   92981    case 9: return 16;
   92982    case 8: return 16;
   92983    case 7:
   92984       if (devinfo->is_haswell) {
   92985          return 16;
   92986       } else {
   92987          return 16;
   92988       }
   92989    case 6: return 0;
   92990    case 5: return 0;
   92991    case 4:
   92992       if (devinfo->is_g4x) {
   92993          return 0;
   92994       } else {
   92995          return 0;
   92996       }
   92997    default:
   92998       unreachable("Invalid hardware generation");
   92999    }
   93000 }
   93001 
   93002 
   93003 
   93004 /* 3DSTATE_VIEWPORT_STATE_POINTERS_CC::CC Viewport Pointer */
   93005 
   93006 
   93007 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_bits  27
   93008 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_bits  27
   93009 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_bits  27
   93010 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_bits  27
   93011 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_bits  27
   93012 
   93013 static inline uint32_t ATTRIBUTE_PURE
   93014 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_bits(const struct gen_device_info *devinfo)
   93015 {
   93016    switch (devinfo->gen) {
   93017    case 10: return 27;
   93018    case 9: return 27;
   93019    case 8: return 27;
   93020    case 7:
   93021       if (devinfo->is_haswell) {
   93022          return 27;
   93023       } else {
   93024          return 27;
   93025       }
   93026    case 6: return 0;
   93027    case 5: return 0;
   93028    case 4:
   93029       if (devinfo->is_g4x) {
   93030          return 0;
   93031       } else {
   93032          return 0;
   93033       }
   93034    default:
   93035       unreachable("Invalid hardware generation");
   93036    }
   93037 }
   93038 
   93039 
   93040 
   93041 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_start  37
   93042 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_start  37
   93043 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_start  37
   93044 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_start  37
   93045 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_start  37
   93046 
   93047 static inline uint32_t ATTRIBUTE_PURE
   93048 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_CCViewportPointer_start(const struct gen_device_info *devinfo)
   93049 {
   93050    switch (devinfo->gen) {
   93051    case 10: return 37;
   93052    case 9: return 37;
   93053    case 8: return 37;
   93054    case 7:
   93055       if (devinfo->is_haswell) {
   93056          return 37;
   93057       } else {
   93058          return 37;
   93059       }
   93060    case 6: return 0;
   93061    case 5: return 0;
   93062    case 4:
   93063       if (devinfo->is_g4x) {
   93064          return 0;
   93065       } else {
   93066          return 0;
   93067       }
   93068    default:
   93069       unreachable("Invalid hardware generation");
   93070    }
   93071 }
   93072 
   93073 
   93074 
   93075 /* 3DSTATE_VIEWPORT_STATE_POINTERS_CC::Command SubType */
   93076 
   93077 
   93078 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_bits  2
   93079 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_bits  2
   93080 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_bits  2
   93081 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_bits  2
   93082 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_bits  2
   93083 
   93084 static inline uint32_t ATTRIBUTE_PURE
   93085 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_bits(const struct gen_device_info *devinfo)
   93086 {
   93087    switch (devinfo->gen) {
   93088    case 10: return 2;
   93089    case 9: return 2;
   93090    case 8: return 2;
   93091    case 7:
   93092       if (devinfo->is_haswell) {
   93093          return 2;
   93094       } else {
   93095          return 2;
   93096       }
   93097    case 6: return 0;
   93098    case 5: return 0;
   93099    case 4:
   93100       if (devinfo->is_g4x) {
   93101          return 0;
   93102       } else {
   93103          return 0;
   93104       }
   93105    default:
   93106       unreachable("Invalid hardware generation");
   93107    }
   93108 }
   93109 
   93110 
   93111 
   93112 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_start  27
   93113 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_start  27
   93114 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_start  27
   93115 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_start  27
   93116 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_start  27
   93117 
   93118 static inline uint32_t ATTRIBUTE_PURE
   93119 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandSubType_start(const struct gen_device_info *devinfo)
   93120 {
   93121    switch (devinfo->gen) {
   93122    case 10: return 27;
   93123    case 9: return 27;
   93124    case 8: return 27;
   93125    case 7:
   93126       if (devinfo->is_haswell) {
   93127          return 27;
   93128       } else {
   93129          return 27;
   93130       }
   93131    case 6: return 0;
   93132    case 5: return 0;
   93133    case 4:
   93134       if (devinfo->is_g4x) {
   93135          return 0;
   93136       } else {
   93137          return 0;
   93138       }
   93139    default:
   93140       unreachable("Invalid hardware generation");
   93141    }
   93142 }
   93143 
   93144 
   93145 
   93146 /* 3DSTATE_VIEWPORT_STATE_POINTERS_CC::Command Type */
   93147 
   93148 
   93149 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_bits  3
   93150 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_bits  3
   93151 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_bits  3
   93152 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_bits  3
   93153 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_bits  3
   93154 
   93155 static inline uint32_t ATTRIBUTE_PURE
   93156 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_bits(const struct gen_device_info *devinfo)
   93157 {
   93158    switch (devinfo->gen) {
   93159    case 10: return 3;
   93160    case 9: return 3;
   93161    case 8: return 3;
   93162    case 7:
   93163       if (devinfo->is_haswell) {
   93164          return 3;
   93165       } else {
   93166          return 3;
   93167       }
   93168    case 6: return 0;
   93169    case 5: return 0;
   93170    case 4:
   93171       if (devinfo->is_g4x) {
   93172          return 0;
   93173       } else {
   93174          return 0;
   93175       }
   93176    default:
   93177       unreachable("Invalid hardware generation");
   93178    }
   93179 }
   93180 
   93181 
   93182 
   93183 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_start  29
   93184 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_start  29
   93185 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_start  29
   93186 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_start  29
   93187 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_start  29
   93188 
   93189 static inline uint32_t ATTRIBUTE_PURE
   93190 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_CommandType_start(const struct gen_device_info *devinfo)
   93191 {
   93192    switch (devinfo->gen) {
   93193    case 10: return 29;
   93194    case 9: return 29;
   93195    case 8: return 29;
   93196    case 7:
   93197       if (devinfo->is_haswell) {
   93198          return 29;
   93199       } else {
   93200          return 29;
   93201       }
   93202    case 6: return 0;
   93203    case 5: return 0;
   93204    case 4:
   93205       if (devinfo->is_g4x) {
   93206          return 0;
   93207       } else {
   93208          return 0;
   93209       }
   93210    default:
   93211       unreachable("Invalid hardware generation");
   93212    }
   93213 }
   93214 
   93215 
   93216 
   93217 /* 3DSTATE_VIEWPORT_STATE_POINTERS_CC::DWord Length */
   93218 
   93219 
   93220 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_bits  8
   93221 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_bits  8
   93222 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_bits  8
   93223 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_bits  8
   93224 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_bits  8
   93225 
   93226 static inline uint32_t ATTRIBUTE_PURE
   93227 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_bits(const struct gen_device_info *devinfo)
   93228 {
   93229    switch (devinfo->gen) {
   93230    case 10: return 8;
   93231    case 9: return 8;
   93232    case 8: return 8;
   93233    case 7:
   93234       if (devinfo->is_haswell) {
   93235          return 8;
   93236       } else {
   93237          return 8;
   93238       }
   93239    case 6: return 0;
   93240    case 5: return 0;
   93241    case 4:
   93242       if (devinfo->is_g4x) {
   93243          return 0;
   93244       } else {
   93245          return 0;
   93246       }
   93247    default:
   93248       unreachable("Invalid hardware generation");
   93249    }
   93250 }
   93251 
   93252 
   93253 
   93254 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_start  0
   93255 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_start  0
   93256 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_start  0
   93257 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_start  0
   93258 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_start  0
   93259 
   93260 static inline uint32_t ATTRIBUTE_PURE
   93261 _3DSTATE_VIEWPORT_STATE_POINTERS_CC_DWordLength_start(const struct gen_device_info *devinfo)
   93262 {
   93263    switch (devinfo->gen) {
   93264    case 10: return 0;
   93265    case 9: return 0;
   93266    case 8: return 0;
   93267    case 7:
   93268       if (devinfo->is_haswell) {
   93269          return 0;
   93270       } else {
   93271          return 0;
   93272       }
   93273    case 6: return 0;
   93274    case 5: return 0;
   93275    case 4:
   93276       if (devinfo->is_g4x) {
   93277          return 0;
   93278       } else {
   93279          return 0;
   93280       }
   93281    default:
   93282       unreachable("Invalid hardware generation");
   93283    }
   93284 }
   93285 
   93286 
   93287 
   93288 /* 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP */
   93289 
   93290 
   93291 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length  2
   93292 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length  2
   93293 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length  2
   93294 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length  2
   93295 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length  2
   93296 
   93297 static inline uint32_t ATTRIBUTE_PURE
   93298 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length(const struct gen_device_info *devinfo)
   93299 {
   93300    switch (devinfo->gen) {
   93301    case 10: return 2;
   93302    case 9: return 2;
   93303    case 8: return 2;
   93304    case 7:
   93305       if (devinfo->is_haswell) {
   93306          return 2;
   93307       } else {
   93308          return 2;
   93309       }
   93310    case 6: return 0;
   93311    case 5: return 0;
   93312    case 4:
   93313       if (devinfo->is_g4x) {
   93314          return 0;
   93315       } else {
   93316          return 0;
   93317       }
   93318    default:
   93319       unreachable("Invalid hardware generation");
   93320    }
   93321 }
   93322 
   93323 
   93324 
   93325 /* 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP::3D Command Opcode */
   93326 
   93327 
   93328 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_bits  3
   93329 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_bits  3
   93330 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_bits  3
   93331 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_bits  3
   93332 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_bits  3
   93333 
   93334 static inline uint32_t ATTRIBUTE_PURE
   93335 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   93336 {
   93337    switch (devinfo->gen) {
   93338    case 10: return 3;
   93339    case 9: return 3;
   93340    case 8: return 3;
   93341    case 7:
   93342       if (devinfo->is_haswell) {
   93343          return 3;
   93344       } else {
   93345          return 3;
   93346       }
   93347    case 6: return 0;
   93348    case 5: return 0;
   93349    case 4:
   93350       if (devinfo->is_g4x) {
   93351          return 0;
   93352       } else {
   93353          return 0;
   93354       }
   93355    default:
   93356       unreachable("Invalid hardware generation");
   93357    }
   93358 }
   93359 
   93360 
   93361 
   93362 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_start  24
   93363 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_start  24
   93364 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_start  24
   93365 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_start  24
   93366 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_start  24
   93367 
   93368 static inline uint32_t ATTRIBUTE_PURE
   93369 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   93370 {
   93371    switch (devinfo->gen) {
   93372    case 10: return 24;
   93373    case 9: return 24;
   93374    case 8: return 24;
   93375    case 7:
   93376       if (devinfo->is_haswell) {
   93377          return 24;
   93378       } else {
   93379          return 24;
   93380       }
   93381    case 6: return 0;
   93382    case 5: return 0;
   93383    case 4:
   93384       if (devinfo->is_g4x) {
   93385          return 0;
   93386       } else {
   93387          return 0;
   93388       }
   93389    default:
   93390       unreachable("Invalid hardware generation");
   93391    }
   93392 }
   93393 
   93394 
   93395 
   93396 /* 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP::3D Command Sub Opcode */
   93397 
   93398 
   93399 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_bits  8
   93400 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_bits  8
   93401 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_bits  8
   93402 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_bits  8
   93403 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_bits  8
   93404 
   93405 static inline uint32_t ATTRIBUTE_PURE
   93406 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   93407 {
   93408    switch (devinfo->gen) {
   93409    case 10: return 8;
   93410    case 9: return 8;
   93411    case 8: return 8;
   93412    case 7:
   93413       if (devinfo->is_haswell) {
   93414          return 8;
   93415       } else {
   93416          return 8;
   93417       }
   93418    case 6: return 0;
   93419    case 5: return 0;
   93420    case 4:
   93421       if (devinfo->is_g4x) {
   93422          return 0;
   93423       } else {
   93424          return 0;
   93425       }
   93426    default:
   93427       unreachable("Invalid hardware generation");
   93428    }
   93429 }
   93430 
   93431 
   93432 
   93433 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_start  16
   93434 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_start  16
   93435 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_start  16
   93436 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_start  16
   93437 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_start  16
   93438 
   93439 static inline uint32_t ATTRIBUTE_PURE
   93440 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   93441 {
   93442    switch (devinfo->gen) {
   93443    case 10: return 16;
   93444    case 9: return 16;
   93445    case 8: return 16;
   93446    case 7:
   93447       if (devinfo->is_haswell) {
   93448          return 16;
   93449       } else {
   93450          return 16;
   93451       }
   93452    case 6: return 0;
   93453    case 5: return 0;
   93454    case 4:
   93455       if (devinfo->is_g4x) {
   93456          return 0;
   93457       } else {
   93458          return 0;
   93459       }
   93460    default:
   93461       unreachable("Invalid hardware generation");
   93462    }
   93463 }
   93464 
   93465 
   93466 
   93467 /* 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP::Command SubType */
   93468 
   93469 
   93470 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_bits  2
   93471 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_bits  2
   93472 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_bits  2
   93473 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_bits  2
   93474 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_bits  2
   93475 
   93476 static inline uint32_t ATTRIBUTE_PURE
   93477 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_bits(const struct gen_device_info *devinfo)
   93478 {
   93479    switch (devinfo->gen) {
   93480    case 10: return 2;
   93481    case 9: return 2;
   93482    case 8: return 2;
   93483    case 7:
   93484       if (devinfo->is_haswell) {
   93485          return 2;
   93486       } else {
   93487          return 2;
   93488       }
   93489    case 6: return 0;
   93490    case 5: return 0;
   93491    case 4:
   93492       if (devinfo->is_g4x) {
   93493          return 0;
   93494       } else {
   93495          return 0;
   93496       }
   93497    default:
   93498       unreachable("Invalid hardware generation");
   93499    }
   93500 }
   93501 
   93502 
   93503 
   93504 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_start  27
   93505 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_start  27
   93506 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_start  27
   93507 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_start  27
   93508 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_start  27
   93509 
   93510 static inline uint32_t ATTRIBUTE_PURE
   93511 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandSubType_start(const struct gen_device_info *devinfo)
   93512 {
   93513    switch (devinfo->gen) {
   93514    case 10: return 27;
   93515    case 9: return 27;
   93516    case 8: return 27;
   93517    case 7:
   93518       if (devinfo->is_haswell) {
   93519          return 27;
   93520       } else {
   93521          return 27;
   93522       }
   93523    case 6: return 0;
   93524    case 5: return 0;
   93525    case 4:
   93526       if (devinfo->is_g4x) {
   93527          return 0;
   93528       } else {
   93529          return 0;
   93530       }
   93531    default:
   93532       unreachable("Invalid hardware generation");
   93533    }
   93534 }
   93535 
   93536 
   93537 
   93538 /* 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP::Command Type */
   93539 
   93540 
   93541 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_bits  3
   93542 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_bits  3
   93543 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_bits  3
   93544 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_bits  3
   93545 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_bits  3
   93546 
   93547 static inline uint32_t ATTRIBUTE_PURE
   93548 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_bits(const struct gen_device_info *devinfo)
   93549 {
   93550    switch (devinfo->gen) {
   93551    case 10: return 3;
   93552    case 9: return 3;
   93553    case 8: return 3;
   93554    case 7:
   93555       if (devinfo->is_haswell) {
   93556          return 3;
   93557       } else {
   93558          return 3;
   93559       }
   93560    case 6: return 0;
   93561    case 5: return 0;
   93562    case 4:
   93563       if (devinfo->is_g4x) {
   93564          return 0;
   93565       } else {
   93566          return 0;
   93567       }
   93568    default:
   93569       unreachable("Invalid hardware generation");
   93570    }
   93571 }
   93572 
   93573 
   93574 
   93575 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_start  29
   93576 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_start  29
   93577 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_start  29
   93578 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_start  29
   93579 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_start  29
   93580 
   93581 static inline uint32_t ATTRIBUTE_PURE
   93582 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_CommandType_start(const struct gen_device_info *devinfo)
   93583 {
   93584    switch (devinfo->gen) {
   93585    case 10: return 29;
   93586    case 9: return 29;
   93587    case 8: return 29;
   93588    case 7:
   93589       if (devinfo->is_haswell) {
   93590          return 29;
   93591       } else {
   93592          return 29;
   93593       }
   93594    case 6: return 0;
   93595    case 5: return 0;
   93596    case 4:
   93597       if (devinfo->is_g4x) {
   93598          return 0;
   93599       } else {
   93600          return 0;
   93601       }
   93602    default:
   93603       unreachable("Invalid hardware generation");
   93604    }
   93605 }
   93606 
   93607 
   93608 
   93609 /* 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP::DWord Length */
   93610 
   93611 
   93612 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_bits  8
   93613 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_bits  8
   93614 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_bits  8
   93615 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_bits  8
   93616 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_bits  8
   93617 
   93618 static inline uint32_t ATTRIBUTE_PURE
   93619 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_bits(const struct gen_device_info *devinfo)
   93620 {
   93621    switch (devinfo->gen) {
   93622    case 10: return 8;
   93623    case 9: return 8;
   93624    case 8: return 8;
   93625    case 7:
   93626       if (devinfo->is_haswell) {
   93627          return 8;
   93628       } else {
   93629          return 8;
   93630       }
   93631    case 6: return 0;
   93632    case 5: return 0;
   93633    case 4:
   93634       if (devinfo->is_g4x) {
   93635          return 0;
   93636       } else {
   93637          return 0;
   93638       }
   93639    default:
   93640       unreachable("Invalid hardware generation");
   93641    }
   93642 }
   93643 
   93644 
   93645 
   93646 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_start  0
   93647 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_start  0
   93648 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_start  0
   93649 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_start  0
   93650 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_start  0
   93651 
   93652 static inline uint32_t ATTRIBUTE_PURE
   93653 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_DWordLength_start(const struct gen_device_info *devinfo)
   93654 {
   93655    switch (devinfo->gen) {
   93656    case 10: return 0;
   93657    case 9: return 0;
   93658    case 8: return 0;
   93659    case 7:
   93660       if (devinfo->is_haswell) {
   93661          return 0;
   93662       } else {
   93663          return 0;
   93664       }
   93665    case 6: return 0;
   93666    case 5: return 0;
   93667    case 4:
   93668       if (devinfo->is_g4x) {
   93669          return 0;
   93670       } else {
   93671          return 0;
   93672       }
   93673    default:
   93674       unreachable("Invalid hardware generation");
   93675    }
   93676 }
   93677 
   93678 
   93679 
   93680 /* 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP::SF Clip Viewport Pointer */
   93681 
   93682 
   93683 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_bits  26
   93684 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_bits  26
   93685 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_bits  26
   93686 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_bits  26
   93687 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_bits  26
   93688 
   93689 static inline uint32_t ATTRIBUTE_PURE
   93690 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_bits(const struct gen_device_info *devinfo)
   93691 {
   93692    switch (devinfo->gen) {
   93693    case 10: return 26;
   93694    case 9: return 26;
   93695    case 8: return 26;
   93696    case 7:
   93697       if (devinfo->is_haswell) {
   93698          return 26;
   93699       } else {
   93700          return 26;
   93701       }
   93702    case 6: return 0;
   93703    case 5: return 0;
   93704    case 4:
   93705       if (devinfo->is_g4x) {
   93706          return 0;
   93707       } else {
   93708          return 0;
   93709       }
   93710    default:
   93711       unreachable("Invalid hardware generation");
   93712    }
   93713 }
   93714 
   93715 
   93716 
   93717 #define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_start  38
   93718 #define GEN9_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_start  38
   93719 #define GEN8_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_start  38
   93720 #define GEN75_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_start  38
   93721 #define GEN7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_start  38
   93722 
   93723 static inline uint32_t ATTRIBUTE_PURE
   93724 _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_SFClipViewportPointer_start(const struct gen_device_info *devinfo)
   93725 {
   93726    switch (devinfo->gen) {
   93727    case 10: return 38;
   93728    case 9: return 38;
   93729    case 8: return 38;
   93730    case 7:
   93731       if (devinfo->is_haswell) {
   93732          return 38;
   93733       } else {
   93734          return 38;
   93735       }
   93736    case 6: return 0;
   93737    case 5: return 0;
   93738    case 4:
   93739       if (devinfo->is_g4x) {
   93740          return 0;
   93741       } else {
   93742          return 0;
   93743       }
   93744    default:
   93745       unreachable("Invalid hardware generation");
   93746    }
   93747 }
   93748 
   93749 
   93750 
   93751 /* 3DSTATE_VS */
   93752 
   93753 
   93754 #define GEN10_3DSTATE_VS_length  9
   93755 #define GEN9_3DSTATE_VS_length  9
   93756 #define GEN8_3DSTATE_VS_length  9
   93757 #define GEN75_3DSTATE_VS_length  6
   93758 #define GEN7_3DSTATE_VS_length  6
   93759 #define GEN6_3DSTATE_VS_length  6
   93760 
   93761 static inline uint32_t ATTRIBUTE_PURE
   93762 _3DSTATE_VS_length(const struct gen_device_info *devinfo)
   93763 {
   93764    switch (devinfo->gen) {
   93765    case 10: return 9;
   93766    case 9: return 9;
   93767    case 8: return 9;
   93768    case 7:
   93769       if (devinfo->is_haswell) {
   93770          return 6;
   93771       } else {
   93772          return 6;
   93773       }
   93774    case 6: return 6;
   93775    case 5: return 0;
   93776    case 4:
   93777       if (devinfo->is_g4x) {
   93778          return 0;
   93779       } else {
   93780          return 0;
   93781       }
   93782    default:
   93783       unreachable("Invalid hardware generation");
   93784    }
   93785 }
   93786 
   93787 
   93788 
   93789 /* 3DSTATE_VS::3D Command Opcode */
   93790 
   93791 
   93792 #define GEN10_3DSTATE_VS_3DCommandOpcode_bits  3
   93793 #define GEN9_3DSTATE_VS_3DCommandOpcode_bits  3
   93794 #define GEN8_3DSTATE_VS_3DCommandOpcode_bits  3
   93795 #define GEN75_3DSTATE_VS_3DCommandOpcode_bits  3
   93796 #define GEN7_3DSTATE_VS_3DCommandOpcode_bits  3
   93797 #define GEN6_3DSTATE_VS_3DCommandOpcode_bits  3
   93798 
   93799 static inline uint32_t ATTRIBUTE_PURE
   93800 _3DSTATE_VS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   93801 {
   93802    switch (devinfo->gen) {
   93803    case 10: return 3;
   93804    case 9: return 3;
   93805    case 8: return 3;
   93806    case 7:
   93807       if (devinfo->is_haswell) {
   93808          return 3;
   93809       } else {
   93810          return 3;
   93811       }
   93812    case 6: return 3;
   93813    case 5: return 0;
   93814    case 4:
   93815       if (devinfo->is_g4x) {
   93816          return 0;
   93817       } else {
   93818          return 0;
   93819       }
   93820    default:
   93821       unreachable("Invalid hardware generation");
   93822    }
   93823 }
   93824 
   93825 
   93826 
   93827 #define GEN10_3DSTATE_VS_3DCommandOpcode_start  24
   93828 #define GEN9_3DSTATE_VS_3DCommandOpcode_start  24
   93829 #define GEN8_3DSTATE_VS_3DCommandOpcode_start  24
   93830 #define GEN75_3DSTATE_VS_3DCommandOpcode_start  24
   93831 #define GEN7_3DSTATE_VS_3DCommandOpcode_start  24
   93832 #define GEN6_3DSTATE_VS_3DCommandOpcode_start  24
   93833 
   93834 static inline uint32_t ATTRIBUTE_PURE
   93835 _3DSTATE_VS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   93836 {
   93837    switch (devinfo->gen) {
   93838    case 10: return 24;
   93839    case 9: return 24;
   93840    case 8: return 24;
   93841    case 7:
   93842       if (devinfo->is_haswell) {
   93843          return 24;
   93844       } else {
   93845          return 24;
   93846       }
   93847    case 6: return 24;
   93848    case 5: return 0;
   93849    case 4:
   93850       if (devinfo->is_g4x) {
   93851          return 0;
   93852       } else {
   93853          return 0;
   93854       }
   93855    default:
   93856       unreachable("Invalid hardware generation");
   93857    }
   93858 }
   93859 
   93860 
   93861 
   93862 /* 3DSTATE_VS::3D Command Sub Opcode */
   93863 
   93864 
   93865 #define GEN10_3DSTATE_VS_3DCommandSubOpcode_bits  8
   93866 #define GEN9_3DSTATE_VS_3DCommandSubOpcode_bits  8
   93867 #define GEN8_3DSTATE_VS_3DCommandSubOpcode_bits  8
   93868 #define GEN75_3DSTATE_VS_3DCommandSubOpcode_bits  8
   93869 #define GEN7_3DSTATE_VS_3DCommandSubOpcode_bits  8
   93870 #define GEN6_3DSTATE_VS_3DCommandSubOpcode_bits  8
   93871 
   93872 static inline uint32_t ATTRIBUTE_PURE
   93873 _3DSTATE_VS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   93874 {
   93875    switch (devinfo->gen) {
   93876    case 10: return 8;
   93877    case 9: return 8;
   93878    case 8: return 8;
   93879    case 7:
   93880       if (devinfo->is_haswell) {
   93881          return 8;
   93882       } else {
   93883          return 8;
   93884       }
   93885    case 6: return 8;
   93886    case 5: return 0;
   93887    case 4:
   93888       if (devinfo->is_g4x) {
   93889          return 0;
   93890       } else {
   93891          return 0;
   93892       }
   93893    default:
   93894       unreachable("Invalid hardware generation");
   93895    }
   93896 }
   93897 
   93898 
   93899 
   93900 #define GEN10_3DSTATE_VS_3DCommandSubOpcode_start  16
   93901 #define GEN9_3DSTATE_VS_3DCommandSubOpcode_start  16
   93902 #define GEN8_3DSTATE_VS_3DCommandSubOpcode_start  16
   93903 #define GEN75_3DSTATE_VS_3DCommandSubOpcode_start  16
   93904 #define GEN7_3DSTATE_VS_3DCommandSubOpcode_start  16
   93905 #define GEN6_3DSTATE_VS_3DCommandSubOpcode_start  16
   93906 
   93907 static inline uint32_t ATTRIBUTE_PURE
   93908 _3DSTATE_VS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   93909 {
   93910    switch (devinfo->gen) {
   93911    case 10: return 16;
   93912    case 9: return 16;
   93913    case 8: return 16;
   93914    case 7:
   93915       if (devinfo->is_haswell) {
   93916          return 16;
   93917       } else {
   93918          return 16;
   93919       }
   93920    case 6: return 16;
   93921    case 5: return 0;
   93922    case 4:
   93923       if (devinfo->is_g4x) {
   93924          return 0;
   93925       } else {
   93926          return 0;
   93927       }
   93928    default:
   93929       unreachable("Invalid hardware generation");
   93930    }
   93931 }
   93932 
   93933 
   93934 
   93935 /* 3DSTATE_VS::Accesses UAV */
   93936 
   93937 
   93938 #define GEN10_3DSTATE_VS_AccessesUAV_bits  1
   93939 #define GEN9_3DSTATE_VS_AccessesUAV_bits  1
   93940 #define GEN8_3DSTATE_VS_AccessesUAV_bits  1
   93941 
   93942 static inline uint32_t ATTRIBUTE_PURE
   93943 _3DSTATE_VS_AccessesUAV_bits(const struct gen_device_info *devinfo)
   93944 {
   93945    switch (devinfo->gen) {
   93946    case 10: return 1;
   93947    case 9: return 1;
   93948    case 8: return 1;
   93949    case 7:
   93950       if (devinfo->is_haswell) {
   93951          return 0;
   93952       } else {
   93953          return 0;
   93954       }
   93955    case 6: return 0;
   93956    case 5: return 0;
   93957    case 4:
   93958       if (devinfo->is_g4x) {
   93959          return 0;
   93960       } else {
   93961          return 0;
   93962       }
   93963    default:
   93964       unreachable("Invalid hardware generation");
   93965    }
   93966 }
   93967 
   93968 
   93969 
   93970 #define GEN10_3DSTATE_VS_AccessesUAV_start  108
   93971 #define GEN9_3DSTATE_VS_AccessesUAV_start  108
   93972 #define GEN8_3DSTATE_VS_AccessesUAV_start  108
   93973 
   93974 static inline uint32_t ATTRIBUTE_PURE
   93975 _3DSTATE_VS_AccessesUAV_start(const struct gen_device_info *devinfo)
   93976 {
   93977    switch (devinfo->gen) {
   93978    case 10: return 108;
   93979    case 9: return 108;
   93980    case 8: return 108;
   93981    case 7:
   93982       if (devinfo->is_haswell) {
   93983          return 0;
   93984       } else {
   93985          return 0;
   93986       }
   93987    case 6: return 0;
   93988    case 5: return 0;
   93989    case 4:
   93990       if (devinfo->is_g4x) {
   93991          return 0;
   93992       } else {
   93993          return 0;
   93994       }
   93995    default:
   93996       unreachable("Invalid hardware generation");
   93997    }
   93998 }
   93999 
   94000 
   94001 
   94002 /* 3DSTATE_VS::Binding Table Entry Count */
   94003 
   94004 
   94005 #define GEN10_3DSTATE_VS_BindingTableEntryCount_bits  8
   94006 #define GEN9_3DSTATE_VS_BindingTableEntryCount_bits  8
   94007 #define GEN8_3DSTATE_VS_BindingTableEntryCount_bits  8
   94008 #define GEN75_3DSTATE_VS_BindingTableEntryCount_bits  8
   94009 #define GEN7_3DSTATE_VS_BindingTableEntryCount_bits  8
   94010 #define GEN6_3DSTATE_VS_BindingTableEntryCount_bits  8
   94011 
   94012 static inline uint32_t ATTRIBUTE_PURE
   94013 _3DSTATE_VS_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   94014 {
   94015    switch (devinfo->gen) {
   94016    case 10: return 8;
   94017    case 9: return 8;
   94018    case 8: return 8;
   94019    case 7:
   94020       if (devinfo->is_haswell) {
   94021          return 8;
   94022       } else {
   94023          return 8;
   94024       }
   94025    case 6: return 8;
   94026    case 5: return 0;
   94027    case 4:
   94028       if (devinfo->is_g4x) {
   94029          return 0;
   94030       } else {
   94031          return 0;
   94032       }
   94033    default:
   94034       unreachable("Invalid hardware generation");
   94035    }
   94036 }
   94037 
   94038 
   94039 
   94040 #define GEN10_3DSTATE_VS_BindingTableEntryCount_start  114
   94041 #define GEN9_3DSTATE_VS_BindingTableEntryCount_start  114
   94042 #define GEN8_3DSTATE_VS_BindingTableEntryCount_start  114
   94043 #define GEN75_3DSTATE_VS_BindingTableEntryCount_start  82
   94044 #define GEN7_3DSTATE_VS_BindingTableEntryCount_start  82
   94045 #define GEN6_3DSTATE_VS_BindingTableEntryCount_start  82
   94046 
   94047 static inline uint32_t ATTRIBUTE_PURE
   94048 _3DSTATE_VS_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   94049 {
   94050    switch (devinfo->gen) {
   94051    case 10: return 114;
   94052    case 9: return 114;
   94053    case 8: return 114;
   94054    case 7:
   94055       if (devinfo->is_haswell) {
   94056          return 82;
   94057       } else {
   94058          return 82;
   94059       }
   94060    case 6: return 82;
   94061    case 5: return 0;
   94062    case 4:
   94063       if (devinfo->is_g4x) {
   94064          return 0;
   94065       } else {
   94066          return 0;
   94067       }
   94068    default:
   94069       unreachable("Invalid hardware generation");
   94070    }
   94071 }
   94072 
   94073 
   94074 
   94075 /* 3DSTATE_VS::Command SubType */
   94076 
   94077 
   94078 #define GEN10_3DSTATE_VS_CommandSubType_bits  2
   94079 #define GEN9_3DSTATE_VS_CommandSubType_bits  2
   94080 #define GEN8_3DSTATE_VS_CommandSubType_bits  2
   94081 #define GEN75_3DSTATE_VS_CommandSubType_bits  2
   94082 #define GEN7_3DSTATE_VS_CommandSubType_bits  2
   94083 #define GEN6_3DSTATE_VS_CommandSubType_bits  2
   94084 
   94085 static inline uint32_t ATTRIBUTE_PURE
   94086 _3DSTATE_VS_CommandSubType_bits(const struct gen_device_info *devinfo)
   94087 {
   94088    switch (devinfo->gen) {
   94089    case 10: return 2;
   94090    case 9: return 2;
   94091    case 8: return 2;
   94092    case 7:
   94093       if (devinfo->is_haswell) {
   94094          return 2;
   94095       } else {
   94096          return 2;
   94097       }
   94098    case 6: return 2;
   94099    case 5: return 0;
   94100    case 4:
   94101       if (devinfo->is_g4x) {
   94102          return 0;
   94103       } else {
   94104          return 0;
   94105       }
   94106    default:
   94107       unreachable("Invalid hardware generation");
   94108    }
   94109 }
   94110 
   94111 
   94112 
   94113 #define GEN10_3DSTATE_VS_CommandSubType_start  27
   94114 #define GEN9_3DSTATE_VS_CommandSubType_start  27
   94115 #define GEN8_3DSTATE_VS_CommandSubType_start  27
   94116 #define GEN75_3DSTATE_VS_CommandSubType_start  27
   94117 #define GEN7_3DSTATE_VS_CommandSubType_start  27
   94118 #define GEN6_3DSTATE_VS_CommandSubType_start  27
   94119 
   94120 static inline uint32_t ATTRIBUTE_PURE
   94121 _3DSTATE_VS_CommandSubType_start(const struct gen_device_info *devinfo)
   94122 {
   94123    switch (devinfo->gen) {
   94124    case 10: return 27;
   94125    case 9: return 27;
   94126    case 8: return 27;
   94127    case 7:
   94128       if (devinfo->is_haswell) {
   94129          return 27;
   94130       } else {
   94131          return 27;
   94132       }
   94133    case 6: return 27;
   94134    case 5: return 0;
   94135    case 4:
   94136       if (devinfo->is_g4x) {
   94137          return 0;
   94138       } else {
   94139          return 0;
   94140       }
   94141    default:
   94142       unreachable("Invalid hardware generation");
   94143    }
   94144 }
   94145 
   94146 
   94147 
   94148 /* 3DSTATE_VS::Command Type */
   94149 
   94150 
   94151 #define GEN10_3DSTATE_VS_CommandType_bits  3
   94152 #define GEN9_3DSTATE_VS_CommandType_bits  3
   94153 #define GEN8_3DSTATE_VS_CommandType_bits  3
   94154 #define GEN75_3DSTATE_VS_CommandType_bits  3
   94155 #define GEN7_3DSTATE_VS_CommandType_bits  3
   94156 #define GEN6_3DSTATE_VS_CommandType_bits  3
   94157 
   94158 static inline uint32_t ATTRIBUTE_PURE
   94159 _3DSTATE_VS_CommandType_bits(const struct gen_device_info *devinfo)
   94160 {
   94161    switch (devinfo->gen) {
   94162    case 10: return 3;
   94163    case 9: return 3;
   94164    case 8: return 3;
   94165    case 7:
   94166       if (devinfo->is_haswell) {
   94167          return 3;
   94168       } else {
   94169          return 3;
   94170       }
   94171    case 6: return 3;
   94172    case 5: return 0;
   94173    case 4:
   94174       if (devinfo->is_g4x) {
   94175          return 0;
   94176       } else {
   94177          return 0;
   94178       }
   94179    default:
   94180       unreachable("Invalid hardware generation");
   94181    }
   94182 }
   94183 
   94184 
   94185 
   94186 #define GEN10_3DSTATE_VS_CommandType_start  29
   94187 #define GEN9_3DSTATE_VS_CommandType_start  29
   94188 #define GEN8_3DSTATE_VS_CommandType_start  29
   94189 #define GEN75_3DSTATE_VS_CommandType_start  29
   94190 #define GEN7_3DSTATE_VS_CommandType_start  29
   94191 #define GEN6_3DSTATE_VS_CommandType_start  29
   94192 
   94193 static inline uint32_t ATTRIBUTE_PURE
   94194 _3DSTATE_VS_CommandType_start(const struct gen_device_info *devinfo)
   94195 {
   94196    switch (devinfo->gen) {
   94197    case 10: return 29;
   94198    case 9: return 29;
   94199    case 8: return 29;
   94200    case 7:
   94201       if (devinfo->is_haswell) {
   94202          return 29;
   94203       } else {
   94204          return 29;
   94205       }
   94206    case 6: return 29;
   94207    case 5: return 0;
   94208    case 4:
   94209       if (devinfo->is_g4x) {
   94210          return 0;
   94211       } else {
   94212          return 0;
   94213       }
   94214    default:
   94215       unreachable("Invalid hardware generation");
   94216    }
   94217 }
   94218 
   94219 
   94220 
   94221 /* 3DSTATE_VS::DWord Length */
   94222 
   94223 
   94224 #define GEN10_3DSTATE_VS_DWordLength_bits  8
   94225 #define GEN9_3DSTATE_VS_DWordLength_bits  8
   94226 #define GEN8_3DSTATE_VS_DWordLength_bits  8
   94227 #define GEN75_3DSTATE_VS_DWordLength_bits  8
   94228 #define GEN7_3DSTATE_VS_DWordLength_bits  8
   94229 #define GEN6_3DSTATE_VS_DWordLength_bits  8
   94230 
   94231 static inline uint32_t ATTRIBUTE_PURE
   94232 _3DSTATE_VS_DWordLength_bits(const struct gen_device_info *devinfo)
   94233 {
   94234    switch (devinfo->gen) {
   94235    case 10: return 8;
   94236    case 9: return 8;
   94237    case 8: return 8;
   94238    case 7:
   94239       if (devinfo->is_haswell) {
   94240          return 8;
   94241       } else {
   94242          return 8;
   94243       }
   94244    case 6: return 8;
   94245    case 5: return 0;
   94246    case 4:
   94247       if (devinfo->is_g4x) {
   94248          return 0;
   94249       } else {
   94250          return 0;
   94251       }
   94252    default:
   94253       unreachable("Invalid hardware generation");
   94254    }
   94255 }
   94256 
   94257 
   94258 
   94259 #define GEN10_3DSTATE_VS_DWordLength_start  0
   94260 #define GEN9_3DSTATE_VS_DWordLength_start  0
   94261 #define GEN8_3DSTATE_VS_DWordLength_start  0
   94262 #define GEN75_3DSTATE_VS_DWordLength_start  0
   94263 #define GEN7_3DSTATE_VS_DWordLength_start  0
   94264 #define GEN6_3DSTATE_VS_DWordLength_start  0
   94265 
   94266 static inline uint32_t ATTRIBUTE_PURE
   94267 _3DSTATE_VS_DWordLength_start(const struct gen_device_info *devinfo)
   94268 {
   94269    switch (devinfo->gen) {
   94270    case 10: return 0;
   94271    case 9: return 0;
   94272    case 8: return 0;
   94273    case 7:
   94274       if (devinfo->is_haswell) {
   94275          return 0;
   94276       } else {
   94277          return 0;
   94278       }
   94279    case 6: return 0;
   94280    case 5: return 0;
   94281    case 4:
   94282       if (devinfo->is_g4x) {
   94283          return 0;
   94284       } else {
   94285          return 0;
   94286       }
   94287    default:
   94288       unreachable("Invalid hardware generation");
   94289    }
   94290 }
   94291 
   94292 
   94293 
   94294 /* 3DSTATE_VS::Dispatch GRF Start Register For URB Data */
   94295 
   94296 
   94297 #define GEN10_3DSTATE_VS_DispatchGRFStartRegisterForURBData_bits  5
   94298 #define GEN9_3DSTATE_VS_DispatchGRFStartRegisterForURBData_bits  5
   94299 #define GEN8_3DSTATE_VS_DispatchGRFStartRegisterForURBData_bits  5
   94300 #define GEN75_3DSTATE_VS_DispatchGRFStartRegisterForURBData_bits  5
   94301 #define GEN7_3DSTATE_VS_DispatchGRFStartRegisterForURBData_bits  5
   94302 #define GEN6_3DSTATE_VS_DispatchGRFStartRegisterForURBData_bits  5
   94303 
   94304 static inline uint32_t ATTRIBUTE_PURE
   94305 _3DSTATE_VS_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   94306 {
   94307    switch (devinfo->gen) {
   94308    case 10: return 5;
   94309    case 9: return 5;
   94310    case 8: return 5;
   94311    case 7:
   94312       if (devinfo->is_haswell) {
   94313          return 5;
   94314       } else {
   94315          return 5;
   94316       }
   94317    case 6: return 5;
   94318    case 5: return 0;
   94319    case 4:
   94320       if (devinfo->is_g4x) {
   94321          return 0;
   94322       } else {
   94323          return 0;
   94324       }
   94325    default:
   94326       unreachable("Invalid hardware generation");
   94327    }
   94328 }
   94329 
   94330 
   94331 
   94332 #define GEN10_3DSTATE_VS_DispatchGRFStartRegisterForURBData_start  212
   94333 #define GEN9_3DSTATE_VS_DispatchGRFStartRegisterForURBData_start  212
   94334 #define GEN8_3DSTATE_VS_DispatchGRFStartRegisterForURBData_start  212
   94335 #define GEN75_3DSTATE_VS_DispatchGRFStartRegisterForURBData_start  148
   94336 #define GEN7_3DSTATE_VS_DispatchGRFStartRegisterForURBData_start  148
   94337 #define GEN6_3DSTATE_VS_DispatchGRFStartRegisterForURBData_start  148
   94338 
   94339 static inline uint32_t ATTRIBUTE_PURE
   94340 _3DSTATE_VS_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   94341 {
   94342    switch (devinfo->gen) {
   94343    case 10: return 212;
   94344    case 9: return 212;
   94345    case 8: return 212;
   94346    case 7:
   94347       if (devinfo->is_haswell) {
   94348          return 148;
   94349       } else {
   94350          return 148;
   94351       }
   94352    case 6: return 148;
   94353    case 5: return 0;
   94354    case 4:
   94355       if (devinfo->is_g4x) {
   94356          return 0;
   94357       } else {
   94358          return 0;
   94359       }
   94360    default:
   94361       unreachable("Invalid hardware generation");
   94362    }
   94363 }
   94364 
   94365 
   94366 
   94367 /* 3DSTATE_VS::Enable */
   94368 
   94369 
   94370 #define GEN10_3DSTATE_VS_Enable_bits  1
   94371 #define GEN9_3DSTATE_VS_Enable_bits  1
   94372 #define GEN8_3DSTATE_VS_Enable_bits  1
   94373 #define GEN75_3DSTATE_VS_Enable_bits  1
   94374 #define GEN7_3DSTATE_VS_Enable_bits  1
   94375 #define GEN6_3DSTATE_VS_Enable_bits  1
   94376 
   94377 static inline uint32_t ATTRIBUTE_PURE
   94378 _3DSTATE_VS_Enable_bits(const struct gen_device_info *devinfo)
   94379 {
   94380    switch (devinfo->gen) {
   94381    case 10: return 1;
   94382    case 9: return 1;
   94383    case 8: return 1;
   94384    case 7:
   94385       if (devinfo->is_haswell) {
   94386          return 1;
   94387       } else {
   94388          return 1;
   94389       }
   94390    case 6: return 1;
   94391    case 5: return 0;
   94392    case 4:
   94393       if (devinfo->is_g4x) {
   94394          return 0;
   94395       } else {
   94396          return 0;
   94397       }
   94398    default:
   94399       unreachable("Invalid hardware generation");
   94400    }
   94401 }
   94402 
   94403 
   94404 
   94405 #define GEN10_3DSTATE_VS_Enable_start  224
   94406 #define GEN9_3DSTATE_VS_Enable_start  224
   94407 #define GEN8_3DSTATE_VS_Enable_start  224
   94408 #define GEN75_3DSTATE_VS_Enable_start  160
   94409 #define GEN7_3DSTATE_VS_Enable_start  160
   94410 #define GEN6_3DSTATE_VS_Enable_start  160
   94411 
   94412 static inline uint32_t ATTRIBUTE_PURE
   94413 _3DSTATE_VS_Enable_start(const struct gen_device_info *devinfo)
   94414 {
   94415    switch (devinfo->gen) {
   94416    case 10: return 224;
   94417    case 9: return 224;
   94418    case 8: return 224;
   94419    case 7:
   94420       if (devinfo->is_haswell) {
   94421          return 160;
   94422       } else {
   94423          return 160;
   94424       }
   94425    case 6: return 160;
   94426    case 5: return 0;
   94427    case 4:
   94428       if (devinfo->is_g4x) {
   94429          return 0;
   94430       } else {
   94431          return 0;
   94432       }
   94433    default:
   94434       unreachable("Invalid hardware generation");
   94435    }
   94436 }
   94437 
   94438 
   94439 
   94440 /* 3DSTATE_VS::Floating Point Mode */
   94441 
   94442 
   94443 #define GEN10_3DSTATE_VS_FloatingPointMode_bits  1
   94444 #define GEN9_3DSTATE_VS_FloatingPointMode_bits  1
   94445 #define GEN8_3DSTATE_VS_FloatingPointMode_bits  1
   94446 #define GEN75_3DSTATE_VS_FloatingPointMode_bits  1
   94447 #define GEN7_3DSTATE_VS_FloatingPointMode_bits  1
   94448 #define GEN6_3DSTATE_VS_FloatingPointMode_bits  1
   94449 
   94450 static inline uint32_t ATTRIBUTE_PURE
   94451 _3DSTATE_VS_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   94452 {
   94453    switch (devinfo->gen) {
   94454    case 10: return 1;
   94455    case 9: return 1;
   94456    case 8: return 1;
   94457    case 7:
   94458       if (devinfo->is_haswell) {
   94459          return 1;
   94460       } else {
   94461          return 1;
   94462       }
   94463    case 6: return 1;
   94464    case 5: return 0;
   94465    case 4:
   94466       if (devinfo->is_g4x) {
   94467          return 0;
   94468       } else {
   94469          return 0;
   94470       }
   94471    default:
   94472       unreachable("Invalid hardware generation");
   94473    }
   94474 }
   94475 
   94476 
   94477 
   94478 #define GEN10_3DSTATE_VS_FloatingPointMode_start  112
   94479 #define GEN9_3DSTATE_VS_FloatingPointMode_start  112
   94480 #define GEN8_3DSTATE_VS_FloatingPointMode_start  112
   94481 #define GEN75_3DSTATE_VS_FloatingPointMode_start  80
   94482 #define GEN7_3DSTATE_VS_FloatingPointMode_start  80
   94483 #define GEN6_3DSTATE_VS_FloatingPointMode_start  80
   94484 
   94485 static inline uint32_t ATTRIBUTE_PURE
   94486 _3DSTATE_VS_FloatingPointMode_start(const struct gen_device_info *devinfo)
   94487 {
   94488    switch (devinfo->gen) {
   94489    case 10: return 112;
   94490    case 9: return 112;
   94491    case 8: return 112;
   94492    case 7:
   94493       if (devinfo->is_haswell) {
   94494          return 80;
   94495       } else {
   94496          return 80;
   94497       }
   94498    case 6: return 80;
   94499    case 5: return 0;
   94500    case 4:
   94501       if (devinfo->is_g4x) {
   94502          return 0;
   94503       } else {
   94504          return 0;
   94505       }
   94506    default:
   94507       unreachable("Invalid hardware generation");
   94508    }
   94509 }
   94510 
   94511 
   94512 
   94513 /* 3DSTATE_VS::Illegal Opcode Exception Enable */
   94514 
   94515 
   94516 #define GEN10_3DSTATE_VS_IllegalOpcodeExceptionEnable_bits  1
   94517 #define GEN9_3DSTATE_VS_IllegalOpcodeExceptionEnable_bits  1
   94518 #define GEN8_3DSTATE_VS_IllegalOpcodeExceptionEnable_bits  1
   94519 #define GEN75_3DSTATE_VS_IllegalOpcodeExceptionEnable_bits  1
   94520 #define GEN7_3DSTATE_VS_IllegalOpcodeExceptionEnable_bits  1
   94521 #define GEN6_3DSTATE_VS_IllegalOpcodeExceptionEnable_bits  1
   94522 
   94523 static inline uint32_t ATTRIBUTE_PURE
   94524 _3DSTATE_VS_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   94525 {
   94526    switch (devinfo->gen) {
   94527    case 10: return 1;
   94528    case 9: return 1;
   94529    case 8: return 1;
   94530    case 7:
   94531       if (devinfo->is_haswell) {
   94532          return 1;
   94533       } else {
   94534          return 1;
   94535       }
   94536    case 6: return 1;
   94537    case 5: return 0;
   94538    case 4:
   94539       if (devinfo->is_g4x) {
   94540          return 0;
   94541       } else {
   94542          return 0;
   94543       }
   94544    default:
   94545       unreachable("Invalid hardware generation");
   94546    }
   94547 }
   94548 
   94549 
   94550 
   94551 #define GEN10_3DSTATE_VS_IllegalOpcodeExceptionEnable_start  109
   94552 #define GEN9_3DSTATE_VS_IllegalOpcodeExceptionEnable_start  109
   94553 #define GEN8_3DSTATE_VS_IllegalOpcodeExceptionEnable_start  109
   94554 #define GEN75_3DSTATE_VS_IllegalOpcodeExceptionEnable_start  77
   94555 #define GEN7_3DSTATE_VS_IllegalOpcodeExceptionEnable_start  77
   94556 #define GEN6_3DSTATE_VS_IllegalOpcodeExceptionEnable_start  77
   94557 
   94558 static inline uint32_t ATTRIBUTE_PURE
   94559 _3DSTATE_VS_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   94560 {
   94561    switch (devinfo->gen) {
   94562    case 10: return 109;
   94563    case 9: return 109;
   94564    case 8: return 109;
   94565    case 7:
   94566       if (devinfo->is_haswell) {
   94567          return 77;
   94568       } else {
   94569          return 77;
   94570       }
   94571    case 6: return 77;
   94572    case 5: return 0;
   94573    case 4:
   94574       if (devinfo->is_g4x) {
   94575          return 0;
   94576       } else {
   94577          return 0;
   94578       }
   94579    default:
   94580       unreachable("Invalid hardware generation");
   94581    }
   94582 }
   94583 
   94584 
   94585 
   94586 /* 3DSTATE_VS::Kernel Start Pointer */
   94587 
   94588 
   94589 #define GEN10_3DSTATE_VS_KernelStartPointer_bits  58
   94590 #define GEN9_3DSTATE_VS_KernelStartPointer_bits  58
   94591 #define GEN8_3DSTATE_VS_KernelStartPointer_bits  58
   94592 #define GEN75_3DSTATE_VS_KernelStartPointer_bits  26
   94593 #define GEN7_3DSTATE_VS_KernelStartPointer_bits  26
   94594 #define GEN6_3DSTATE_VS_KernelStartPointer_bits  26
   94595 
   94596 static inline uint32_t ATTRIBUTE_PURE
   94597 _3DSTATE_VS_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   94598 {
   94599    switch (devinfo->gen) {
   94600    case 10: return 58;
   94601    case 9: return 58;
   94602    case 8: return 58;
   94603    case 7:
   94604       if (devinfo->is_haswell) {
   94605          return 26;
   94606       } else {
   94607          return 26;
   94608       }
   94609    case 6: return 26;
   94610    case 5: return 0;
   94611    case 4:
   94612       if (devinfo->is_g4x) {
   94613          return 0;
   94614       } else {
   94615          return 0;
   94616       }
   94617    default:
   94618       unreachable("Invalid hardware generation");
   94619    }
   94620 }
   94621 
   94622 
   94623 
   94624 #define GEN10_3DSTATE_VS_KernelStartPointer_start  38
   94625 #define GEN9_3DSTATE_VS_KernelStartPointer_start  38
   94626 #define GEN8_3DSTATE_VS_KernelStartPointer_start  38
   94627 #define GEN75_3DSTATE_VS_KernelStartPointer_start  38
   94628 #define GEN7_3DSTATE_VS_KernelStartPointer_start  38
   94629 #define GEN6_3DSTATE_VS_KernelStartPointer_start  38
   94630 
   94631 static inline uint32_t ATTRIBUTE_PURE
   94632 _3DSTATE_VS_KernelStartPointer_start(const struct gen_device_info *devinfo)
   94633 {
   94634    switch (devinfo->gen) {
   94635    case 10: return 38;
   94636    case 9: return 38;
   94637    case 8: return 38;
   94638    case 7:
   94639       if (devinfo->is_haswell) {
   94640          return 38;
   94641       } else {
   94642          return 38;
   94643       }
   94644    case 6: return 38;
   94645    case 5: return 0;
   94646    case 4:
   94647       if (devinfo->is_g4x) {
   94648          return 0;
   94649       } else {
   94650          return 0;
   94651       }
   94652    default:
   94653       unreachable("Invalid hardware generation");
   94654    }
   94655 }
   94656 
   94657 
   94658 
   94659 /* 3DSTATE_VS::Maximum Number of Threads */
   94660 
   94661 
   94662 #define GEN10_3DSTATE_VS_MaximumNumberofThreads_bits  10
   94663 #define GEN9_3DSTATE_VS_MaximumNumberofThreads_bits  9
   94664 #define GEN8_3DSTATE_VS_MaximumNumberofThreads_bits  9
   94665 #define GEN75_3DSTATE_VS_MaximumNumberofThreads_bits  9
   94666 #define GEN7_3DSTATE_VS_MaximumNumberofThreads_bits  7
   94667 #define GEN6_3DSTATE_VS_MaximumNumberofThreads_bits  7
   94668 
   94669 static inline uint32_t ATTRIBUTE_PURE
   94670 _3DSTATE_VS_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   94671 {
   94672    switch (devinfo->gen) {
   94673    case 10: return 10;
   94674    case 9: return 9;
   94675    case 8: return 9;
   94676    case 7:
   94677       if (devinfo->is_haswell) {
   94678          return 9;
   94679       } else {
   94680          return 7;
   94681       }
   94682    case 6: return 7;
   94683    case 5: return 0;
   94684    case 4:
   94685       if (devinfo->is_g4x) {
   94686          return 0;
   94687       } else {
   94688          return 0;
   94689       }
   94690    default:
   94691       unreachable("Invalid hardware generation");
   94692    }
   94693 }
   94694 
   94695 
   94696 
   94697 #define GEN10_3DSTATE_VS_MaximumNumberofThreads_start  246
   94698 #define GEN9_3DSTATE_VS_MaximumNumberofThreads_start  247
   94699 #define GEN8_3DSTATE_VS_MaximumNumberofThreads_start  247
   94700 #define GEN75_3DSTATE_VS_MaximumNumberofThreads_start  183
   94701 #define GEN7_3DSTATE_VS_MaximumNumberofThreads_start  185
   94702 #define GEN6_3DSTATE_VS_MaximumNumberofThreads_start  185
   94703 
   94704 static inline uint32_t ATTRIBUTE_PURE
   94705 _3DSTATE_VS_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   94706 {
   94707    switch (devinfo->gen) {
   94708    case 10: return 246;
   94709    case 9: return 247;
   94710    case 8: return 247;
   94711    case 7:
   94712       if (devinfo->is_haswell) {
   94713          return 183;
   94714       } else {
   94715          return 185;
   94716       }
   94717    case 6: return 185;
   94718    case 5: return 0;
   94719    case 4:
   94720       if (devinfo->is_g4x) {
   94721          return 0;
   94722       } else {
   94723          return 0;
   94724       }
   94725    default:
   94726       unreachable("Invalid hardware generation");
   94727    }
   94728 }
   94729 
   94730 
   94731 
   94732 /* 3DSTATE_VS::Per-Thread Scratch Space */
   94733 
   94734 
   94735 #define GEN10_3DSTATE_VS_PerThreadScratchSpace_bits  4
   94736 #define GEN9_3DSTATE_VS_PerThreadScratchSpace_bits  4
   94737 #define GEN8_3DSTATE_VS_PerThreadScratchSpace_bits  4
   94738 #define GEN75_3DSTATE_VS_PerThreadScratchSpace_bits  4
   94739 #define GEN7_3DSTATE_VS_PerThreadScratchSpace_bits  4
   94740 #define GEN6_3DSTATE_VS_PerThreadScratchSpace_bits  4
   94741 
   94742 static inline uint32_t ATTRIBUTE_PURE
   94743 _3DSTATE_VS_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   94744 {
   94745    switch (devinfo->gen) {
   94746    case 10: return 4;
   94747    case 9: return 4;
   94748    case 8: return 4;
   94749    case 7:
   94750       if (devinfo->is_haswell) {
   94751          return 4;
   94752       } else {
   94753          return 4;
   94754       }
   94755    case 6: return 4;
   94756    case 5: return 0;
   94757    case 4:
   94758       if (devinfo->is_g4x) {
   94759          return 0;
   94760       } else {
   94761          return 0;
   94762       }
   94763    default:
   94764       unreachable("Invalid hardware generation");
   94765    }
   94766 }
   94767 
   94768 
   94769 
   94770 #define GEN10_3DSTATE_VS_PerThreadScratchSpace_start  128
   94771 #define GEN9_3DSTATE_VS_PerThreadScratchSpace_start  128
   94772 #define GEN8_3DSTATE_VS_PerThreadScratchSpace_start  128
   94773 #define GEN75_3DSTATE_VS_PerThreadScratchSpace_start  96
   94774 #define GEN7_3DSTATE_VS_PerThreadScratchSpace_start  96
   94775 #define GEN6_3DSTATE_VS_PerThreadScratchSpace_start  96
   94776 
   94777 static inline uint32_t ATTRIBUTE_PURE
   94778 _3DSTATE_VS_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   94779 {
   94780    switch (devinfo->gen) {
   94781    case 10: return 128;
   94782    case 9: return 128;
   94783    case 8: return 128;
   94784    case 7:
   94785       if (devinfo->is_haswell) {
   94786          return 96;
   94787       } else {
   94788          return 96;
   94789       }
   94790    case 6: return 96;
   94791    case 5: return 0;
   94792    case 4:
   94793       if (devinfo->is_g4x) {
   94794          return 0;
   94795       } else {
   94796          return 0;
   94797       }
   94798    default:
   94799       unreachable("Invalid hardware generation");
   94800    }
   94801 }
   94802 
   94803 
   94804 
   94805 /* 3DSTATE_VS::SIMD8 Dispatch Enable */
   94806 
   94807 
   94808 #define GEN10_3DSTATE_VS_SIMD8DispatchEnable_bits  1
   94809 #define GEN9_3DSTATE_VS_SIMD8DispatchEnable_bits  1
   94810 #define GEN8_3DSTATE_VS_SIMD8DispatchEnable_bits  1
   94811 
   94812 static inline uint32_t ATTRIBUTE_PURE
   94813 _3DSTATE_VS_SIMD8DispatchEnable_bits(const struct gen_device_info *devinfo)
   94814 {
   94815    switch (devinfo->gen) {
   94816    case 10: return 1;
   94817    case 9: return 1;
   94818    case 8: return 1;
   94819    case 7:
   94820       if (devinfo->is_haswell) {
   94821          return 0;
   94822       } else {
   94823          return 0;
   94824       }
   94825    case 6: return 0;
   94826    case 5: return 0;
   94827    case 4:
   94828       if (devinfo->is_g4x) {
   94829          return 0;
   94830       } else {
   94831          return 0;
   94832       }
   94833    default:
   94834       unreachable("Invalid hardware generation");
   94835    }
   94836 }
   94837 
   94838 
   94839 
   94840 #define GEN10_3DSTATE_VS_SIMD8DispatchEnable_start  226
   94841 #define GEN9_3DSTATE_VS_SIMD8DispatchEnable_start  226
   94842 #define GEN8_3DSTATE_VS_SIMD8DispatchEnable_start  226
   94843 
   94844 static inline uint32_t ATTRIBUTE_PURE
   94845 _3DSTATE_VS_SIMD8DispatchEnable_start(const struct gen_device_info *devinfo)
   94846 {
   94847    switch (devinfo->gen) {
   94848    case 10: return 226;
   94849    case 9: return 226;
   94850    case 8: return 226;
   94851    case 7:
   94852       if (devinfo->is_haswell) {
   94853          return 0;
   94854       } else {
   94855          return 0;
   94856       }
   94857    case 6: return 0;
   94858    case 5: return 0;
   94859    case 4:
   94860       if (devinfo->is_g4x) {
   94861          return 0;
   94862       } else {
   94863          return 0;
   94864       }
   94865    default:
   94866       unreachable("Invalid hardware generation");
   94867    }
   94868 }
   94869 
   94870 
   94871 
   94872 /* 3DSTATE_VS::SIMD8 Single Instance Dispatch Enable */
   94873 
   94874 
   94875 #define GEN10_3DSTATE_VS_SIMD8SingleInstanceDispatchEnable_bits  1
   94876 
   94877 static inline uint32_t ATTRIBUTE_PURE
   94878 _3DSTATE_VS_SIMD8SingleInstanceDispatchEnable_bits(const struct gen_device_info *devinfo)
   94879 {
   94880    switch (devinfo->gen) {
   94881    case 10: return 1;
   94882    case 9: return 0;
   94883    case 8: return 0;
   94884    case 7:
   94885       if (devinfo->is_haswell) {
   94886          return 0;
   94887       } else {
   94888          return 0;
   94889       }
   94890    case 6: return 0;
   94891    case 5: return 0;
   94892    case 4:
   94893       if (devinfo->is_g4x) {
   94894          return 0;
   94895       } else {
   94896          return 0;
   94897       }
   94898    default:
   94899       unreachable("Invalid hardware generation");
   94900    }
   94901 }
   94902 
   94903 
   94904 
   94905 #define GEN10_3DSTATE_VS_SIMD8SingleInstanceDispatchEnable_start  233
   94906 
   94907 static inline uint32_t ATTRIBUTE_PURE
   94908 _3DSTATE_VS_SIMD8SingleInstanceDispatchEnable_start(const struct gen_device_info *devinfo)
   94909 {
   94910    switch (devinfo->gen) {
   94911    case 10: return 233;
   94912    case 9: return 0;
   94913    case 8: return 0;
   94914    case 7:
   94915       if (devinfo->is_haswell) {
   94916          return 0;
   94917       } else {
   94918          return 0;
   94919       }
   94920    case 6: return 0;
   94921    case 5: return 0;
   94922    case 4:
   94923       if (devinfo->is_g4x) {
   94924          return 0;
   94925       } else {
   94926          return 0;
   94927       }
   94928    default:
   94929       unreachable("Invalid hardware generation");
   94930    }
   94931 }
   94932 
   94933 
   94934 
   94935 /* 3DSTATE_VS::Sampler Count */
   94936 
   94937 
   94938 #define GEN10_3DSTATE_VS_SamplerCount_bits  3
   94939 #define GEN9_3DSTATE_VS_SamplerCount_bits  3
   94940 #define GEN8_3DSTATE_VS_SamplerCount_bits  3
   94941 #define GEN75_3DSTATE_VS_SamplerCount_bits  3
   94942 #define GEN7_3DSTATE_VS_SamplerCount_bits  3
   94943 #define GEN6_3DSTATE_VS_SamplerCount_bits  3
   94944 
   94945 static inline uint32_t ATTRIBUTE_PURE
   94946 _3DSTATE_VS_SamplerCount_bits(const struct gen_device_info *devinfo)
   94947 {
   94948    switch (devinfo->gen) {
   94949    case 10: return 3;
   94950    case 9: return 3;
   94951    case 8: return 3;
   94952    case 7:
   94953       if (devinfo->is_haswell) {
   94954          return 3;
   94955       } else {
   94956          return 3;
   94957       }
   94958    case 6: return 3;
   94959    case 5: return 0;
   94960    case 4:
   94961       if (devinfo->is_g4x) {
   94962          return 0;
   94963       } else {
   94964          return 0;
   94965       }
   94966    default:
   94967       unreachable("Invalid hardware generation");
   94968    }
   94969 }
   94970 
   94971 
   94972 
   94973 #define GEN10_3DSTATE_VS_SamplerCount_start  123
   94974 #define GEN9_3DSTATE_VS_SamplerCount_start  123
   94975 #define GEN8_3DSTATE_VS_SamplerCount_start  123
   94976 #define GEN75_3DSTATE_VS_SamplerCount_start  91
   94977 #define GEN7_3DSTATE_VS_SamplerCount_start  91
   94978 #define GEN6_3DSTATE_VS_SamplerCount_start  91
   94979 
   94980 static inline uint32_t ATTRIBUTE_PURE
   94981 _3DSTATE_VS_SamplerCount_start(const struct gen_device_info *devinfo)
   94982 {
   94983    switch (devinfo->gen) {
   94984    case 10: return 123;
   94985    case 9: return 123;
   94986    case 8: return 123;
   94987    case 7:
   94988       if (devinfo->is_haswell) {
   94989          return 91;
   94990       } else {
   94991          return 91;
   94992       }
   94993    case 6: return 91;
   94994    case 5: return 0;
   94995    case 4:
   94996       if (devinfo->is_g4x) {
   94997          return 0;
   94998       } else {
   94999          return 0;
   95000       }
   95001    default:
   95002       unreachable("Invalid hardware generation");
   95003    }
   95004 }
   95005 
   95006 
   95007 
   95008 /* 3DSTATE_VS::Scratch Space Base Pointer */
   95009 
   95010 
   95011 #define GEN10_3DSTATE_VS_ScratchSpaceBasePointer_bits  54
   95012 #define GEN9_3DSTATE_VS_ScratchSpaceBasePointer_bits  54
   95013 #define GEN8_3DSTATE_VS_ScratchSpaceBasePointer_bits  54
   95014 #define GEN75_3DSTATE_VS_ScratchSpaceBasePointer_bits  22
   95015 #define GEN7_3DSTATE_VS_ScratchSpaceBasePointer_bits  22
   95016 #define GEN6_3DSTATE_VS_ScratchSpaceBasePointer_bits  22
   95017 
   95018 static inline uint32_t ATTRIBUTE_PURE
   95019 _3DSTATE_VS_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   95020 {
   95021    switch (devinfo->gen) {
   95022    case 10: return 54;
   95023    case 9: return 54;
   95024    case 8: return 54;
   95025    case 7:
   95026       if (devinfo->is_haswell) {
   95027          return 22;
   95028       } else {
   95029          return 22;
   95030       }
   95031    case 6: return 22;
   95032    case 5: return 0;
   95033    case 4:
   95034       if (devinfo->is_g4x) {
   95035          return 0;
   95036       } else {
   95037          return 0;
   95038       }
   95039    default:
   95040       unreachable("Invalid hardware generation");
   95041    }
   95042 }
   95043 
   95044 
   95045 
   95046 #define GEN10_3DSTATE_VS_ScratchSpaceBasePointer_start  138
   95047 #define GEN9_3DSTATE_VS_ScratchSpaceBasePointer_start  138
   95048 #define GEN8_3DSTATE_VS_ScratchSpaceBasePointer_start  138
   95049 #define GEN75_3DSTATE_VS_ScratchSpaceBasePointer_start  106
   95050 #define GEN7_3DSTATE_VS_ScratchSpaceBasePointer_start  106
   95051 #define GEN6_3DSTATE_VS_ScratchSpaceBasePointer_start  106
   95052 
   95053 static inline uint32_t ATTRIBUTE_PURE
   95054 _3DSTATE_VS_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   95055 {
   95056    switch (devinfo->gen) {
   95057    case 10: return 138;
   95058    case 9: return 138;
   95059    case 8: return 138;
   95060    case 7:
   95061       if (devinfo->is_haswell) {
   95062          return 106;
   95063       } else {
   95064          return 106;
   95065       }
   95066    case 6: return 106;
   95067    case 5: return 0;
   95068    case 4:
   95069       if (devinfo->is_g4x) {
   95070          return 0;
   95071       } else {
   95072          return 0;
   95073       }
   95074    default:
   95075       unreachable("Invalid hardware generation");
   95076    }
   95077 }
   95078 
   95079 
   95080 
   95081 /* 3DSTATE_VS::Single Vertex Dispatch */
   95082 
   95083 
   95084 #define GEN10_3DSTATE_VS_SingleVertexDispatch_bits  1
   95085 #define GEN9_3DSTATE_VS_SingleVertexDispatch_bits  1
   95086 #define GEN8_3DSTATE_VS_SingleVertexDispatch_bits  1
   95087 #define GEN75_3DSTATE_VS_SingleVertexDispatch_bits  1
   95088 #define GEN7_3DSTATE_VS_SingleVertexDispatch_bits  1
   95089 #define GEN6_3DSTATE_VS_SingleVertexDispatch_bits  1
   95090 
   95091 static inline uint32_t ATTRIBUTE_PURE
   95092 _3DSTATE_VS_SingleVertexDispatch_bits(const struct gen_device_info *devinfo)
   95093 {
   95094    switch (devinfo->gen) {
   95095    case 10: return 1;
   95096    case 9: return 1;
   95097    case 8: return 1;
   95098    case 7:
   95099       if (devinfo->is_haswell) {
   95100          return 1;
   95101       } else {
   95102          return 1;
   95103       }
   95104    case 6: return 1;
   95105    case 5: return 0;
   95106    case 4:
   95107       if (devinfo->is_g4x) {
   95108          return 0;
   95109       } else {
   95110          return 0;
   95111       }
   95112    default:
   95113       unreachable("Invalid hardware generation");
   95114    }
   95115 }
   95116 
   95117 
   95118 
   95119 #define GEN10_3DSTATE_VS_SingleVertexDispatch_start  127
   95120 #define GEN9_3DSTATE_VS_SingleVertexDispatch_start  127
   95121 #define GEN8_3DSTATE_VS_SingleVertexDispatch_start  127
   95122 #define GEN75_3DSTATE_VS_SingleVertexDispatch_start  95
   95123 #define GEN7_3DSTATE_VS_SingleVertexDispatch_start  95
   95124 #define GEN6_3DSTATE_VS_SingleVertexDispatch_start  95
   95125 
   95126 static inline uint32_t ATTRIBUTE_PURE
   95127 _3DSTATE_VS_SingleVertexDispatch_start(const struct gen_device_info *devinfo)
   95128 {
   95129    switch (devinfo->gen) {
   95130    case 10: return 127;
   95131    case 9: return 127;
   95132    case 8: return 127;
   95133    case 7:
   95134       if (devinfo->is_haswell) {
   95135          return 95;
   95136       } else {
   95137          return 95;
   95138       }
   95139    case 6: return 95;
   95140    case 5: return 0;
   95141    case 4:
   95142       if (devinfo->is_g4x) {
   95143          return 0;
   95144       } else {
   95145          return 0;
   95146       }
   95147    default:
   95148       unreachable("Invalid hardware generation");
   95149    }
   95150 }
   95151 
   95152 
   95153 
   95154 /* 3DSTATE_VS::Software Exception Enable */
   95155 
   95156 
   95157 #define GEN10_3DSTATE_VS_SoftwareExceptionEnable_bits  1
   95158 #define GEN9_3DSTATE_VS_SoftwareExceptionEnable_bits  1
   95159 #define GEN8_3DSTATE_VS_SoftwareExceptionEnable_bits  1
   95160 #define GEN75_3DSTATE_VS_SoftwareExceptionEnable_bits  1
   95161 #define GEN7_3DSTATE_VS_SoftwareExceptionEnable_bits  1
   95162 #define GEN6_3DSTATE_VS_SoftwareExceptionEnable_bits  1
   95163 
   95164 static inline uint32_t ATTRIBUTE_PURE
   95165 _3DSTATE_VS_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   95166 {
   95167    switch (devinfo->gen) {
   95168    case 10: return 1;
   95169    case 9: return 1;
   95170    case 8: return 1;
   95171    case 7:
   95172       if (devinfo->is_haswell) {
   95173          return 1;
   95174       } else {
   95175          return 1;
   95176       }
   95177    case 6: return 1;
   95178    case 5: return 0;
   95179    case 4:
   95180       if (devinfo->is_g4x) {
   95181          return 0;
   95182       } else {
   95183          return 0;
   95184       }
   95185    default:
   95186       unreachable("Invalid hardware generation");
   95187    }
   95188 }
   95189 
   95190 
   95191 
   95192 #define GEN10_3DSTATE_VS_SoftwareExceptionEnable_start  103
   95193 #define GEN9_3DSTATE_VS_SoftwareExceptionEnable_start  103
   95194 #define GEN8_3DSTATE_VS_SoftwareExceptionEnable_start  103
   95195 #define GEN75_3DSTATE_VS_SoftwareExceptionEnable_start  71
   95196 #define GEN7_3DSTATE_VS_SoftwareExceptionEnable_start  71
   95197 #define GEN6_3DSTATE_VS_SoftwareExceptionEnable_start  71
   95198 
   95199 static inline uint32_t ATTRIBUTE_PURE
   95200 _3DSTATE_VS_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   95201 {
   95202    switch (devinfo->gen) {
   95203    case 10: return 103;
   95204    case 9: return 103;
   95205    case 8: return 103;
   95206    case 7:
   95207       if (devinfo->is_haswell) {
   95208          return 71;
   95209       } else {
   95210          return 71;
   95211       }
   95212    case 6: return 71;
   95213    case 5: return 0;
   95214    case 4:
   95215       if (devinfo->is_g4x) {
   95216          return 0;
   95217       } else {
   95218          return 0;
   95219       }
   95220    default:
   95221       unreachable("Invalid hardware generation");
   95222    }
   95223 }
   95224 
   95225 
   95226 
   95227 /* 3DSTATE_VS::Statistics Enable */
   95228 
   95229 
   95230 #define GEN10_3DSTATE_VS_StatisticsEnable_bits  1
   95231 #define GEN9_3DSTATE_VS_StatisticsEnable_bits  1
   95232 #define GEN8_3DSTATE_VS_StatisticsEnable_bits  1
   95233 #define GEN75_3DSTATE_VS_StatisticsEnable_bits  1
   95234 #define GEN7_3DSTATE_VS_StatisticsEnable_bits  1
   95235 #define GEN6_3DSTATE_VS_StatisticsEnable_bits  1
   95236 
   95237 static inline uint32_t ATTRIBUTE_PURE
   95238 _3DSTATE_VS_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   95239 {
   95240    switch (devinfo->gen) {
   95241    case 10: return 1;
   95242    case 9: return 1;
   95243    case 8: return 1;
   95244    case 7:
   95245       if (devinfo->is_haswell) {
   95246          return 1;
   95247       } else {
   95248          return 1;
   95249       }
   95250    case 6: return 1;
   95251    case 5: return 0;
   95252    case 4:
   95253       if (devinfo->is_g4x) {
   95254          return 0;
   95255       } else {
   95256          return 0;
   95257       }
   95258    default:
   95259       unreachable("Invalid hardware generation");
   95260    }
   95261 }
   95262 
   95263 
   95264 
   95265 #define GEN10_3DSTATE_VS_StatisticsEnable_start  234
   95266 #define GEN9_3DSTATE_VS_StatisticsEnable_start  234
   95267 #define GEN8_3DSTATE_VS_StatisticsEnable_start  234
   95268 #define GEN75_3DSTATE_VS_StatisticsEnable_start  170
   95269 #define GEN7_3DSTATE_VS_StatisticsEnable_start  170
   95270 #define GEN6_3DSTATE_VS_StatisticsEnable_start  170
   95271 
   95272 static inline uint32_t ATTRIBUTE_PURE
   95273 _3DSTATE_VS_StatisticsEnable_start(const struct gen_device_info *devinfo)
   95274 {
   95275    switch (devinfo->gen) {
   95276    case 10: return 234;
   95277    case 9: return 234;
   95278    case 8: return 234;
   95279    case 7:
   95280       if (devinfo->is_haswell) {
   95281          return 170;
   95282       } else {
   95283          return 170;
   95284       }
   95285    case 6: return 170;
   95286    case 5: return 0;
   95287    case 4:
   95288       if (devinfo->is_g4x) {
   95289          return 0;
   95290       } else {
   95291          return 0;
   95292       }
   95293    default:
   95294       unreachable("Invalid hardware generation");
   95295    }
   95296 }
   95297 
   95298 
   95299 
   95300 /* 3DSTATE_VS::Thread Dispatch Priority */
   95301 
   95302 
   95303 #define GEN10_3DSTATE_VS_ThreadDispatchPriority_bits  1
   95304 #define GEN9_3DSTATE_VS_ThreadDispatchPriority_bits  1
   95305 #define GEN8_3DSTATE_VS_ThreadDispatchPriority_bits  1
   95306 
   95307 static inline uint32_t ATTRIBUTE_PURE
   95308 _3DSTATE_VS_ThreadDispatchPriority_bits(const struct gen_device_info *devinfo)
   95309 {
   95310    switch (devinfo->gen) {
   95311    case 10: return 1;
   95312    case 9: return 1;
   95313    case 8: return 1;
   95314    case 7:
   95315       if (devinfo->is_haswell) {
   95316          return 0;
   95317       } else {
   95318          return 0;
   95319       }
   95320    case 6: return 0;
   95321    case 5: return 0;
   95322    case 4:
   95323       if (devinfo->is_g4x) {
   95324          return 0;
   95325       } else {
   95326          return 0;
   95327       }
   95328    default:
   95329       unreachable("Invalid hardware generation");
   95330    }
   95331 }
   95332 
   95333 
   95334 
   95335 #define GEN10_3DSTATE_VS_ThreadDispatchPriority_start  113
   95336 #define GEN9_3DSTATE_VS_ThreadDispatchPriority_start  113
   95337 #define GEN8_3DSTATE_VS_ThreadDispatchPriority_start  113
   95338 
   95339 static inline uint32_t ATTRIBUTE_PURE
   95340 _3DSTATE_VS_ThreadDispatchPriority_start(const struct gen_device_info *devinfo)
   95341 {
   95342    switch (devinfo->gen) {
   95343    case 10: return 113;
   95344    case 9: return 113;
   95345    case 8: return 113;
   95346    case 7:
   95347       if (devinfo->is_haswell) {
   95348          return 0;
   95349       } else {
   95350          return 0;
   95351       }
   95352    case 6: return 0;
   95353    case 5: return 0;
   95354    case 4:
   95355       if (devinfo->is_g4x) {
   95356          return 0;
   95357       } else {
   95358          return 0;
   95359       }
   95360    default:
   95361       unreachable("Invalid hardware generation");
   95362    }
   95363 }
   95364 
   95365 
   95366 
   95367 /* 3DSTATE_VS::Thread Priority */
   95368 
   95369 
   95370 #define GEN75_3DSTATE_VS_ThreadPriority_bits  1
   95371 
   95372 static inline uint32_t ATTRIBUTE_PURE
   95373 _3DSTATE_VS_ThreadPriority_bits(const struct gen_device_info *devinfo)
   95374 {
   95375    switch (devinfo->gen) {
   95376    case 10: return 0;
   95377    case 9: return 0;
   95378    case 8: return 0;
   95379    case 7:
   95380       if (devinfo->is_haswell) {
   95381          return 1;
   95382       } else {
   95383          return 0;
   95384       }
   95385    case 6: return 0;
   95386    case 5: return 0;
   95387    case 4:
   95388       if (devinfo->is_g4x) {
   95389          return 0;
   95390       } else {
   95391          return 0;
   95392       }
   95393    default:
   95394       unreachable("Invalid hardware generation");
   95395    }
   95396 }
   95397 
   95398 
   95399 
   95400 #define GEN75_3DSTATE_VS_ThreadPriority_start  81
   95401 
   95402 static inline uint32_t ATTRIBUTE_PURE
   95403 _3DSTATE_VS_ThreadPriority_start(const struct gen_device_info *devinfo)
   95404 {
   95405    switch (devinfo->gen) {
   95406    case 10: return 0;
   95407    case 9: return 0;
   95408    case 8: return 0;
   95409    case 7:
   95410       if (devinfo->is_haswell) {
   95411          return 81;
   95412       } else {
   95413          return 0;
   95414       }
   95415    case 6: return 0;
   95416    case 5: return 0;
   95417    case 4:
   95418       if (devinfo->is_g4x) {
   95419          return 0;
   95420       } else {
   95421          return 0;
   95422       }
   95423    default:
   95424       unreachable("Invalid hardware generation");
   95425    }
   95426 }
   95427 
   95428 
   95429 
   95430 /* 3DSTATE_VS::User Clip Distance Clip Test Enable Bitmask */
   95431 
   95432 
   95433 #define GEN10_3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_bits  8
   95434 #define GEN9_3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_bits  8
   95435 #define GEN8_3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_bits  8
   95436 
   95437 static inline uint32_t ATTRIBUTE_PURE
   95438 _3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   95439 {
   95440    switch (devinfo->gen) {
   95441    case 10: return 8;
   95442    case 9: return 8;
   95443    case 8: return 8;
   95444    case 7:
   95445       if (devinfo->is_haswell) {
   95446          return 0;
   95447       } else {
   95448          return 0;
   95449       }
   95450    case 6: return 0;
   95451    case 5: return 0;
   95452    case 4:
   95453       if (devinfo->is_g4x) {
   95454          return 0;
   95455       } else {
   95456          return 0;
   95457       }
   95458    default:
   95459       unreachable("Invalid hardware generation");
   95460    }
   95461 }
   95462 
   95463 
   95464 
   95465 #define GEN10_3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_start  264
   95466 #define GEN9_3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_start  264
   95467 #define GEN8_3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_start  264
   95468 
   95469 static inline uint32_t ATTRIBUTE_PURE
   95470 _3DSTATE_VS_UserClipDistanceClipTestEnableBitmask_start(const struct gen_device_info *devinfo)
   95471 {
   95472    switch (devinfo->gen) {
   95473    case 10: return 264;
   95474    case 9: return 264;
   95475    case 8: return 264;
   95476    case 7:
   95477       if (devinfo->is_haswell) {
   95478          return 0;
   95479       } else {
   95480          return 0;
   95481       }
   95482    case 6: return 0;
   95483    case 5: return 0;
   95484    case 4:
   95485       if (devinfo->is_g4x) {
   95486          return 0;
   95487       } else {
   95488          return 0;
   95489       }
   95490    default:
   95491       unreachable("Invalid hardware generation");
   95492    }
   95493 }
   95494 
   95495 
   95496 
   95497 /* 3DSTATE_VS::User Clip Distance Cull Test Enable Bitmask */
   95498 
   95499 
   95500 #define GEN10_3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_bits  8
   95501 #define GEN9_3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_bits  8
   95502 #define GEN8_3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_bits  8
   95503 
   95504 static inline uint32_t ATTRIBUTE_PURE
   95505 _3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   95506 {
   95507    switch (devinfo->gen) {
   95508    case 10: return 8;
   95509    case 9: return 8;
   95510    case 8: return 8;
   95511    case 7:
   95512       if (devinfo->is_haswell) {
   95513          return 0;
   95514       } else {
   95515          return 0;
   95516       }
   95517    case 6: return 0;
   95518    case 5: return 0;
   95519    case 4:
   95520       if (devinfo->is_g4x) {
   95521          return 0;
   95522       } else {
   95523          return 0;
   95524       }
   95525    default:
   95526       unreachable("Invalid hardware generation");
   95527    }
   95528 }
   95529 
   95530 
   95531 
   95532 #define GEN10_3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_start  256
   95533 #define GEN9_3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_start  256
   95534 #define GEN8_3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_start  256
   95535 
   95536 static inline uint32_t ATTRIBUTE_PURE
   95537 _3DSTATE_VS_UserClipDistanceCullTestEnableBitmask_start(const struct gen_device_info *devinfo)
   95538 {
   95539    switch (devinfo->gen) {
   95540    case 10: return 256;
   95541    case 9: return 256;
   95542    case 8: return 256;
   95543    case 7:
   95544       if (devinfo->is_haswell) {
   95545          return 0;
   95546       } else {
   95547          return 0;
   95548       }
   95549    case 6: return 0;
   95550    case 5: return 0;
   95551    case 4:
   95552       if (devinfo->is_g4x) {
   95553          return 0;
   95554       } else {
   95555          return 0;
   95556       }
   95557    default:
   95558       unreachable("Invalid hardware generation");
   95559    }
   95560 }
   95561 
   95562 
   95563 
   95564 /* 3DSTATE_VS::VS accesses UAV */
   95565 
   95566 
   95567 #define GEN75_3DSTATE_VS_VSaccessesUAV_bits  1
   95568 
   95569 static inline uint32_t ATTRIBUTE_PURE
   95570 _3DSTATE_VS_VSaccessesUAV_bits(const struct gen_device_info *devinfo)
   95571 {
   95572    switch (devinfo->gen) {
   95573    case 10: return 0;
   95574    case 9: return 0;
   95575    case 8: return 0;
   95576    case 7:
   95577       if (devinfo->is_haswell) {
   95578          return 1;
   95579       } else {
   95580          return 0;
   95581       }
   95582    case 6: return 0;
   95583    case 5: return 0;
   95584    case 4:
   95585       if (devinfo->is_g4x) {
   95586          return 0;
   95587       } else {
   95588          return 0;
   95589       }
   95590    default:
   95591       unreachable("Invalid hardware generation");
   95592    }
   95593 }
   95594 
   95595 
   95596 
   95597 #define GEN75_3DSTATE_VS_VSaccessesUAV_start  76
   95598 
   95599 static inline uint32_t ATTRIBUTE_PURE
   95600 _3DSTATE_VS_VSaccessesUAV_start(const struct gen_device_info *devinfo)
   95601 {
   95602    switch (devinfo->gen) {
   95603    case 10: return 0;
   95604    case 9: return 0;
   95605    case 8: return 0;
   95606    case 7:
   95607       if (devinfo->is_haswell) {
   95608          return 76;
   95609       } else {
   95610          return 0;
   95611       }
   95612    case 6: return 0;
   95613    case 5: return 0;
   95614    case 4:
   95615       if (devinfo->is_g4x) {
   95616          return 0;
   95617       } else {
   95618          return 0;
   95619       }
   95620    default:
   95621       unreachable("Invalid hardware generation");
   95622    }
   95623 }
   95624 
   95625 
   95626 
   95627 /* 3DSTATE_VS::Vector Mask Enable */
   95628 
   95629 
   95630 #define GEN10_3DSTATE_VS_VectorMaskEnable_bits  1
   95631 #define GEN9_3DSTATE_VS_VectorMaskEnable_bits  1
   95632 #define GEN8_3DSTATE_VS_VectorMaskEnable_bits  1
   95633 #define GEN75_3DSTATE_VS_VectorMaskEnable_bits  1
   95634 #define GEN7_3DSTATE_VS_VectorMaskEnable_bits  1
   95635 #define GEN6_3DSTATE_VS_VectorMaskEnable_bits  1
   95636 
   95637 static inline uint32_t ATTRIBUTE_PURE
   95638 _3DSTATE_VS_VectorMaskEnable_bits(const struct gen_device_info *devinfo)
   95639 {
   95640    switch (devinfo->gen) {
   95641    case 10: return 1;
   95642    case 9: return 1;
   95643    case 8: return 1;
   95644    case 7:
   95645       if (devinfo->is_haswell) {
   95646          return 1;
   95647       } else {
   95648          return 1;
   95649       }
   95650    case 6: return 1;
   95651    case 5: return 0;
   95652    case 4:
   95653       if (devinfo->is_g4x) {
   95654          return 0;
   95655       } else {
   95656          return 0;
   95657       }
   95658    default:
   95659       unreachable("Invalid hardware generation");
   95660    }
   95661 }
   95662 
   95663 
   95664 
   95665 #define GEN10_3DSTATE_VS_VectorMaskEnable_start  126
   95666 #define GEN9_3DSTATE_VS_VectorMaskEnable_start  126
   95667 #define GEN8_3DSTATE_VS_VectorMaskEnable_start  126
   95668 #define GEN75_3DSTATE_VS_VectorMaskEnable_start  94
   95669 #define GEN7_3DSTATE_VS_VectorMaskEnable_start  94
   95670 #define GEN6_3DSTATE_VS_VectorMaskEnable_start  94
   95671 
   95672 static inline uint32_t ATTRIBUTE_PURE
   95673 _3DSTATE_VS_VectorMaskEnable_start(const struct gen_device_info *devinfo)
   95674 {
   95675    switch (devinfo->gen) {
   95676    case 10: return 126;
   95677    case 9: return 126;
   95678    case 8: return 126;
   95679    case 7:
   95680       if (devinfo->is_haswell) {
   95681          return 94;
   95682       } else {
   95683          return 94;
   95684       }
   95685    case 6: return 94;
   95686    case 5: return 0;
   95687    case 4:
   95688       if (devinfo->is_g4x) {
   95689          return 0;
   95690       } else {
   95691          return 0;
   95692       }
   95693    default:
   95694       unreachable("Invalid hardware generation");
   95695    }
   95696 }
   95697 
   95698 
   95699 
   95700 /* 3DSTATE_VS::Vertex Cache Disable */
   95701 
   95702 
   95703 #define GEN10_3DSTATE_VS_VertexCacheDisable_bits  1
   95704 #define GEN9_3DSTATE_VS_VertexCacheDisable_bits  1
   95705 #define GEN8_3DSTATE_VS_VertexCacheDisable_bits  1
   95706 #define GEN75_3DSTATE_VS_VertexCacheDisable_bits  1
   95707 #define GEN7_3DSTATE_VS_VertexCacheDisable_bits  1
   95708 #define GEN6_3DSTATE_VS_VertexCacheDisable_bits  1
   95709 
   95710 static inline uint32_t ATTRIBUTE_PURE
   95711 _3DSTATE_VS_VertexCacheDisable_bits(const struct gen_device_info *devinfo)
   95712 {
   95713    switch (devinfo->gen) {
   95714    case 10: return 1;
   95715    case 9: return 1;
   95716    case 8: return 1;
   95717    case 7:
   95718       if (devinfo->is_haswell) {
   95719          return 1;
   95720       } else {
   95721          return 1;
   95722       }
   95723    case 6: return 1;
   95724    case 5: return 0;
   95725    case 4:
   95726       if (devinfo->is_g4x) {
   95727          return 0;
   95728       } else {
   95729          return 0;
   95730       }
   95731    default:
   95732       unreachable("Invalid hardware generation");
   95733    }
   95734 }
   95735 
   95736 
   95737 
   95738 #define GEN10_3DSTATE_VS_VertexCacheDisable_start  225
   95739 #define GEN9_3DSTATE_VS_VertexCacheDisable_start  225
   95740 #define GEN8_3DSTATE_VS_VertexCacheDisable_start  225
   95741 #define GEN75_3DSTATE_VS_VertexCacheDisable_start  161
   95742 #define GEN7_3DSTATE_VS_VertexCacheDisable_start  161
   95743 #define GEN6_3DSTATE_VS_VertexCacheDisable_start  161
   95744 
   95745 static inline uint32_t ATTRIBUTE_PURE
   95746 _3DSTATE_VS_VertexCacheDisable_start(const struct gen_device_info *devinfo)
   95747 {
   95748    switch (devinfo->gen) {
   95749    case 10: return 225;
   95750    case 9: return 225;
   95751    case 8: return 225;
   95752    case 7:
   95753       if (devinfo->is_haswell) {
   95754          return 161;
   95755       } else {
   95756          return 161;
   95757       }
   95758    case 6: return 161;
   95759    case 5: return 0;
   95760    case 4:
   95761       if (devinfo->is_g4x) {
   95762          return 0;
   95763       } else {
   95764          return 0;
   95765       }
   95766    default:
   95767       unreachable("Invalid hardware generation");
   95768    }
   95769 }
   95770 
   95771 
   95772 
   95773 /* 3DSTATE_VS::Vertex URB Entry Output Length */
   95774 
   95775 
   95776 #define GEN10_3DSTATE_VS_VertexURBEntryOutputLength_bits  5
   95777 #define GEN9_3DSTATE_VS_VertexURBEntryOutputLength_bits  5
   95778 #define GEN8_3DSTATE_VS_VertexURBEntryOutputLength_bits  5
   95779 
   95780 static inline uint32_t ATTRIBUTE_PURE
   95781 _3DSTATE_VS_VertexURBEntryOutputLength_bits(const struct gen_device_info *devinfo)
   95782 {
   95783    switch (devinfo->gen) {
   95784    case 10: return 5;
   95785    case 9: return 5;
   95786    case 8: return 5;
   95787    case 7:
   95788       if (devinfo->is_haswell) {
   95789          return 0;
   95790       } else {
   95791          return 0;
   95792       }
   95793    case 6: return 0;
   95794    case 5: return 0;
   95795    case 4:
   95796       if (devinfo->is_g4x) {
   95797          return 0;
   95798       } else {
   95799          return 0;
   95800       }
   95801    default:
   95802       unreachable("Invalid hardware generation");
   95803    }
   95804 }
   95805 
   95806 
   95807 
   95808 #define GEN10_3DSTATE_VS_VertexURBEntryOutputLength_start  272
   95809 #define GEN9_3DSTATE_VS_VertexURBEntryOutputLength_start  272
   95810 #define GEN8_3DSTATE_VS_VertexURBEntryOutputLength_start  272
   95811 
   95812 static inline uint32_t ATTRIBUTE_PURE
   95813 _3DSTATE_VS_VertexURBEntryOutputLength_start(const struct gen_device_info *devinfo)
   95814 {
   95815    switch (devinfo->gen) {
   95816    case 10: return 272;
   95817    case 9: return 272;
   95818    case 8: return 272;
   95819    case 7:
   95820       if (devinfo->is_haswell) {
   95821          return 0;
   95822       } else {
   95823          return 0;
   95824       }
   95825    case 6: return 0;
   95826    case 5: return 0;
   95827    case 4:
   95828       if (devinfo->is_g4x) {
   95829          return 0;
   95830       } else {
   95831          return 0;
   95832       }
   95833    default:
   95834       unreachable("Invalid hardware generation");
   95835    }
   95836 }
   95837 
   95838 
   95839 
   95840 /* 3DSTATE_VS::Vertex URB Entry Output Read Offset */
   95841 
   95842 
   95843 #define GEN10_3DSTATE_VS_VertexURBEntryOutputReadOffset_bits  6
   95844 #define GEN9_3DSTATE_VS_VertexURBEntryOutputReadOffset_bits  6
   95845 #define GEN8_3DSTATE_VS_VertexURBEntryOutputReadOffset_bits  6
   95846 
   95847 static inline uint32_t ATTRIBUTE_PURE
   95848 _3DSTATE_VS_VertexURBEntryOutputReadOffset_bits(const struct gen_device_info *devinfo)
   95849 {
   95850    switch (devinfo->gen) {
   95851    case 10: return 6;
   95852    case 9: return 6;
   95853    case 8: return 6;
   95854    case 7:
   95855       if (devinfo->is_haswell) {
   95856          return 0;
   95857       } else {
   95858          return 0;
   95859       }
   95860    case 6: return 0;
   95861    case 5: return 0;
   95862    case 4:
   95863       if (devinfo->is_g4x) {
   95864          return 0;
   95865       } else {
   95866          return 0;
   95867       }
   95868    default:
   95869       unreachable("Invalid hardware generation");
   95870    }
   95871 }
   95872 
   95873 
   95874 
   95875 #define GEN10_3DSTATE_VS_VertexURBEntryOutputReadOffset_start  277
   95876 #define GEN9_3DSTATE_VS_VertexURBEntryOutputReadOffset_start  277
   95877 #define GEN8_3DSTATE_VS_VertexURBEntryOutputReadOffset_start  277
   95878 
   95879 static inline uint32_t ATTRIBUTE_PURE
   95880 _3DSTATE_VS_VertexURBEntryOutputReadOffset_start(const struct gen_device_info *devinfo)
   95881 {
   95882    switch (devinfo->gen) {
   95883    case 10: return 277;
   95884    case 9: return 277;
   95885    case 8: return 277;
   95886    case 7:
   95887       if (devinfo->is_haswell) {
   95888          return 0;
   95889       } else {
   95890          return 0;
   95891       }
   95892    case 6: return 0;
   95893    case 5: return 0;
   95894    case 4:
   95895       if (devinfo->is_g4x) {
   95896          return 0;
   95897       } else {
   95898          return 0;
   95899       }
   95900    default:
   95901       unreachable("Invalid hardware generation");
   95902    }
   95903 }
   95904 
   95905 
   95906 
   95907 /* 3DSTATE_VS::Vertex URB Entry Read Length */
   95908 
   95909 
   95910 #define GEN10_3DSTATE_VS_VertexURBEntryReadLength_bits  6
   95911 #define GEN9_3DSTATE_VS_VertexURBEntryReadLength_bits  6
   95912 #define GEN8_3DSTATE_VS_VertexURBEntryReadLength_bits  6
   95913 #define GEN75_3DSTATE_VS_VertexURBEntryReadLength_bits  6
   95914 #define GEN7_3DSTATE_VS_VertexURBEntryReadLength_bits  6
   95915 #define GEN6_3DSTATE_VS_VertexURBEntryReadLength_bits  6
   95916 
   95917 static inline uint32_t ATTRIBUTE_PURE
   95918 _3DSTATE_VS_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   95919 {
   95920    switch (devinfo->gen) {
   95921    case 10: return 6;
   95922    case 9: return 6;
   95923    case 8: return 6;
   95924    case 7:
   95925       if (devinfo->is_haswell) {
   95926          return 6;
   95927       } else {
   95928          return 6;
   95929       }
   95930    case 6: return 6;
   95931    case 5: return 0;
   95932    case 4:
   95933       if (devinfo->is_g4x) {
   95934          return 0;
   95935       } else {
   95936          return 0;
   95937       }
   95938    default:
   95939       unreachable("Invalid hardware generation");
   95940    }
   95941 }
   95942 
   95943 
   95944 
   95945 #define GEN10_3DSTATE_VS_VertexURBEntryReadLength_start  203
   95946 #define GEN9_3DSTATE_VS_VertexURBEntryReadLength_start  203
   95947 #define GEN8_3DSTATE_VS_VertexURBEntryReadLength_start  203
   95948 #define GEN75_3DSTATE_VS_VertexURBEntryReadLength_start  139
   95949 #define GEN7_3DSTATE_VS_VertexURBEntryReadLength_start  139
   95950 #define GEN6_3DSTATE_VS_VertexURBEntryReadLength_start  139
   95951 
   95952 static inline uint32_t ATTRIBUTE_PURE
   95953 _3DSTATE_VS_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   95954 {
   95955    switch (devinfo->gen) {
   95956    case 10: return 203;
   95957    case 9: return 203;
   95958    case 8: return 203;
   95959    case 7:
   95960       if (devinfo->is_haswell) {
   95961          return 139;
   95962       } else {
   95963          return 139;
   95964       }
   95965    case 6: return 139;
   95966    case 5: return 0;
   95967    case 4:
   95968       if (devinfo->is_g4x) {
   95969          return 0;
   95970       } else {
   95971          return 0;
   95972       }
   95973    default:
   95974       unreachable("Invalid hardware generation");
   95975    }
   95976 }
   95977 
   95978 
   95979 
   95980 /* 3DSTATE_VS::Vertex URB Entry Read Offset */
   95981 
   95982 
   95983 #define GEN10_3DSTATE_VS_VertexURBEntryReadOffset_bits  6
   95984 #define GEN9_3DSTATE_VS_VertexURBEntryReadOffset_bits  6
   95985 #define GEN8_3DSTATE_VS_VertexURBEntryReadOffset_bits  6
   95986 #define GEN75_3DSTATE_VS_VertexURBEntryReadOffset_bits  6
   95987 #define GEN7_3DSTATE_VS_VertexURBEntryReadOffset_bits  6
   95988 #define GEN6_3DSTATE_VS_VertexURBEntryReadOffset_bits  6
   95989 
   95990 static inline uint32_t ATTRIBUTE_PURE
   95991 _3DSTATE_VS_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   95992 {
   95993    switch (devinfo->gen) {
   95994    case 10: return 6;
   95995    case 9: return 6;
   95996    case 8: return 6;
   95997    case 7:
   95998       if (devinfo->is_haswell) {
   95999          return 6;
   96000       } else {
   96001          return 6;
   96002       }
   96003    case 6: return 6;
   96004    case 5: return 0;
   96005    case 4:
   96006       if (devinfo->is_g4x) {
   96007          return 0;
   96008       } else {
   96009          return 0;
   96010       }
   96011    default:
   96012       unreachable("Invalid hardware generation");
   96013    }
   96014 }
   96015 
   96016 
   96017 
   96018 #define GEN10_3DSTATE_VS_VertexURBEntryReadOffset_start  196
   96019 #define GEN9_3DSTATE_VS_VertexURBEntryReadOffset_start  196
   96020 #define GEN8_3DSTATE_VS_VertexURBEntryReadOffset_start  196
   96021 #define GEN75_3DSTATE_VS_VertexURBEntryReadOffset_start  132
   96022 #define GEN7_3DSTATE_VS_VertexURBEntryReadOffset_start  132
   96023 #define GEN6_3DSTATE_VS_VertexURBEntryReadOffset_start  132
   96024 
   96025 static inline uint32_t ATTRIBUTE_PURE
   96026 _3DSTATE_VS_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   96027 {
   96028    switch (devinfo->gen) {
   96029    case 10: return 196;
   96030    case 9: return 196;
   96031    case 8: return 196;
   96032    case 7:
   96033       if (devinfo->is_haswell) {
   96034          return 132;
   96035       } else {
   96036          return 132;
   96037       }
   96038    case 6: return 132;
   96039    case 5: return 0;
   96040    case 4:
   96041       if (devinfo->is_g4x) {
   96042          return 0;
   96043       } else {
   96044          return 0;
   96045       }
   96046    default:
   96047       unreachable("Invalid hardware generation");
   96048    }
   96049 }
   96050 
   96051 
   96052 
   96053 /* 3DSTATE_WM */
   96054 
   96055 
   96056 #define GEN10_3DSTATE_WM_length  2
   96057 #define GEN9_3DSTATE_WM_length  2
   96058 #define GEN8_3DSTATE_WM_length  2
   96059 #define GEN75_3DSTATE_WM_length  3
   96060 #define GEN7_3DSTATE_WM_length  3
   96061 #define GEN6_3DSTATE_WM_length  9
   96062 
   96063 static inline uint32_t ATTRIBUTE_PURE
   96064 _3DSTATE_WM_length(const struct gen_device_info *devinfo)
   96065 {
   96066    switch (devinfo->gen) {
   96067    case 10: return 2;
   96068    case 9: return 2;
   96069    case 8: return 2;
   96070    case 7:
   96071       if (devinfo->is_haswell) {
   96072          return 3;
   96073       } else {
   96074          return 3;
   96075       }
   96076    case 6: return 9;
   96077    case 5: return 0;
   96078    case 4:
   96079       if (devinfo->is_g4x) {
   96080          return 0;
   96081       } else {
   96082          return 0;
   96083       }
   96084    default:
   96085       unreachable("Invalid hardware generation");
   96086    }
   96087 }
   96088 
   96089 
   96090 
   96091 /* 3DSTATE_WM::16 Pixel Dispatch Enable */
   96092 
   96093 
   96094 #define GEN6_3DSTATE_WM_16PixelDispatchEnable_bits  1
   96095 
   96096 static inline uint32_t ATTRIBUTE_PURE
   96097 _3DSTATE_WM_16PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   96098 {
   96099    switch (devinfo->gen) {
   96100    case 10: return 0;
   96101    case 9: return 0;
   96102    case 8: return 0;
   96103    case 7:
   96104       if (devinfo->is_haswell) {
   96105          return 0;
   96106       } else {
   96107          return 0;
   96108       }
   96109    case 6: return 1;
   96110    case 5: return 0;
   96111    case 4:
   96112       if (devinfo->is_g4x) {
   96113          return 0;
   96114       } else {
   96115          return 0;
   96116       }
   96117    default:
   96118       unreachable("Invalid hardware generation");
   96119    }
   96120 }
   96121 
   96122 
   96123 
   96124 #define GEN6_3DSTATE_WM_16PixelDispatchEnable_start  161
   96125 
   96126 static inline uint32_t ATTRIBUTE_PURE
   96127 _3DSTATE_WM_16PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   96128 {
   96129    switch (devinfo->gen) {
   96130    case 10: return 0;
   96131    case 9: return 0;
   96132    case 8: return 0;
   96133    case 7:
   96134       if (devinfo->is_haswell) {
   96135          return 0;
   96136       } else {
   96137          return 0;
   96138       }
   96139    case 6: return 161;
   96140    case 5: return 0;
   96141    case 4:
   96142       if (devinfo->is_g4x) {
   96143          return 0;
   96144       } else {
   96145          return 0;
   96146       }
   96147    default:
   96148       unreachable("Invalid hardware generation");
   96149    }
   96150 }
   96151 
   96152 
   96153 
   96154 /* 3DSTATE_WM::32 Pixel Dispatch Enable */
   96155 
   96156 
   96157 #define GEN6_3DSTATE_WM_32PixelDispatchEnable_bits  1
   96158 
   96159 static inline uint32_t ATTRIBUTE_PURE
   96160 _3DSTATE_WM_32PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   96161 {
   96162    switch (devinfo->gen) {
   96163    case 10: return 0;
   96164    case 9: return 0;
   96165    case 8: return 0;
   96166    case 7:
   96167       if (devinfo->is_haswell) {
   96168          return 0;
   96169       } else {
   96170          return 0;
   96171       }
   96172    case 6: return 1;
   96173    case 5: return 0;
   96174    case 4:
   96175       if (devinfo->is_g4x) {
   96176          return 0;
   96177       } else {
   96178          return 0;
   96179       }
   96180    default:
   96181       unreachable("Invalid hardware generation");
   96182    }
   96183 }
   96184 
   96185 
   96186 
   96187 #define GEN6_3DSTATE_WM_32PixelDispatchEnable_start  162
   96188 
   96189 static inline uint32_t ATTRIBUTE_PURE
   96190 _3DSTATE_WM_32PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   96191 {
   96192    switch (devinfo->gen) {
   96193    case 10: return 0;
   96194    case 9: return 0;
   96195    case 8: return 0;
   96196    case 7:
   96197       if (devinfo->is_haswell) {
   96198          return 0;
   96199       } else {
   96200          return 0;
   96201       }
   96202    case 6: return 162;
   96203    case 5: return 0;
   96204    case 4:
   96205       if (devinfo->is_g4x) {
   96206          return 0;
   96207       } else {
   96208          return 0;
   96209       }
   96210    default:
   96211       unreachable("Invalid hardware generation");
   96212    }
   96213 }
   96214 
   96215 
   96216 
   96217 /* 3DSTATE_WM::3D Command Opcode */
   96218 
   96219 
   96220 #define GEN10_3DSTATE_WM_3DCommandOpcode_bits  3
   96221 #define GEN9_3DSTATE_WM_3DCommandOpcode_bits  3
   96222 #define GEN8_3DSTATE_WM_3DCommandOpcode_bits  3
   96223 #define GEN75_3DSTATE_WM_3DCommandOpcode_bits  3
   96224 #define GEN7_3DSTATE_WM_3DCommandOpcode_bits  3
   96225 #define GEN6_3DSTATE_WM_3DCommandOpcode_bits  3
   96226 
   96227 static inline uint32_t ATTRIBUTE_PURE
   96228 _3DSTATE_WM_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   96229 {
   96230    switch (devinfo->gen) {
   96231    case 10: return 3;
   96232    case 9: return 3;
   96233    case 8: return 3;
   96234    case 7:
   96235       if (devinfo->is_haswell) {
   96236          return 3;
   96237       } else {
   96238          return 3;
   96239       }
   96240    case 6: return 3;
   96241    case 5: return 0;
   96242    case 4:
   96243       if (devinfo->is_g4x) {
   96244          return 0;
   96245       } else {
   96246          return 0;
   96247       }
   96248    default:
   96249       unreachable("Invalid hardware generation");
   96250    }
   96251 }
   96252 
   96253 
   96254 
   96255 #define GEN10_3DSTATE_WM_3DCommandOpcode_start  24
   96256 #define GEN9_3DSTATE_WM_3DCommandOpcode_start  24
   96257 #define GEN8_3DSTATE_WM_3DCommandOpcode_start  24
   96258 #define GEN75_3DSTATE_WM_3DCommandOpcode_start  24
   96259 #define GEN7_3DSTATE_WM_3DCommandOpcode_start  24
   96260 #define GEN6_3DSTATE_WM_3DCommandOpcode_start  24
   96261 
   96262 static inline uint32_t ATTRIBUTE_PURE
   96263 _3DSTATE_WM_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   96264 {
   96265    switch (devinfo->gen) {
   96266    case 10: return 24;
   96267    case 9: return 24;
   96268    case 8: return 24;
   96269    case 7:
   96270       if (devinfo->is_haswell) {
   96271          return 24;
   96272       } else {
   96273          return 24;
   96274       }
   96275    case 6: return 24;
   96276    case 5: return 0;
   96277    case 4:
   96278       if (devinfo->is_g4x) {
   96279          return 0;
   96280       } else {
   96281          return 0;
   96282       }
   96283    default:
   96284       unreachable("Invalid hardware generation");
   96285    }
   96286 }
   96287 
   96288 
   96289 
   96290 /* 3DSTATE_WM::3D Command Sub Opcode */
   96291 
   96292 
   96293 #define GEN10_3DSTATE_WM_3DCommandSubOpcode_bits  8
   96294 #define GEN9_3DSTATE_WM_3DCommandSubOpcode_bits  8
   96295 #define GEN8_3DSTATE_WM_3DCommandSubOpcode_bits  8
   96296 #define GEN75_3DSTATE_WM_3DCommandSubOpcode_bits  8
   96297 #define GEN7_3DSTATE_WM_3DCommandSubOpcode_bits  8
   96298 #define GEN6_3DSTATE_WM_3DCommandSubOpcode_bits  8
   96299 
   96300 static inline uint32_t ATTRIBUTE_PURE
   96301 _3DSTATE_WM_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   96302 {
   96303    switch (devinfo->gen) {
   96304    case 10: return 8;
   96305    case 9: return 8;
   96306    case 8: return 8;
   96307    case 7:
   96308       if (devinfo->is_haswell) {
   96309          return 8;
   96310       } else {
   96311          return 8;
   96312       }
   96313    case 6: return 8;
   96314    case 5: return 0;
   96315    case 4:
   96316       if (devinfo->is_g4x) {
   96317          return 0;
   96318       } else {
   96319          return 0;
   96320       }
   96321    default:
   96322       unreachable("Invalid hardware generation");
   96323    }
   96324 }
   96325 
   96326 
   96327 
   96328 #define GEN10_3DSTATE_WM_3DCommandSubOpcode_start  16
   96329 #define GEN9_3DSTATE_WM_3DCommandSubOpcode_start  16
   96330 #define GEN8_3DSTATE_WM_3DCommandSubOpcode_start  16
   96331 #define GEN75_3DSTATE_WM_3DCommandSubOpcode_start  16
   96332 #define GEN7_3DSTATE_WM_3DCommandSubOpcode_start  16
   96333 #define GEN6_3DSTATE_WM_3DCommandSubOpcode_start  16
   96334 
   96335 static inline uint32_t ATTRIBUTE_PURE
   96336 _3DSTATE_WM_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   96337 {
   96338    switch (devinfo->gen) {
   96339    case 10: return 16;
   96340    case 9: return 16;
   96341    case 8: return 16;
   96342    case 7:
   96343       if (devinfo->is_haswell) {
   96344          return 16;
   96345       } else {
   96346          return 16;
   96347       }
   96348    case 6: return 16;
   96349    case 5: return 0;
   96350    case 4:
   96351       if (devinfo->is_g4x) {
   96352          return 0;
   96353       } else {
   96354          return 0;
   96355       }
   96356    default:
   96357       unreachable("Invalid hardware generation");
   96358    }
   96359 }
   96360 
   96361 
   96362 
   96363 /* 3DSTATE_WM::8 Pixel Dispatch Enable */
   96364 
   96365 
   96366 #define GEN6_3DSTATE_WM_8PixelDispatchEnable_bits  1
   96367 
   96368 static inline uint32_t ATTRIBUTE_PURE
   96369 _3DSTATE_WM_8PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   96370 {
   96371    switch (devinfo->gen) {
   96372    case 10: return 0;
   96373    case 9: return 0;
   96374    case 8: return 0;
   96375    case 7:
   96376       if (devinfo->is_haswell) {
   96377          return 0;
   96378       } else {
   96379          return 0;
   96380       }
   96381    case 6: return 1;
   96382    case 5: return 0;
   96383    case 4:
   96384       if (devinfo->is_g4x) {
   96385          return 0;
   96386       } else {
   96387          return 0;
   96388       }
   96389    default:
   96390       unreachable("Invalid hardware generation");
   96391    }
   96392 }
   96393 
   96394 
   96395 
   96396 #define GEN6_3DSTATE_WM_8PixelDispatchEnable_start  160
   96397 
   96398 static inline uint32_t ATTRIBUTE_PURE
   96399 _3DSTATE_WM_8PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   96400 {
   96401    switch (devinfo->gen) {
   96402    case 10: return 0;
   96403    case 9: return 0;
   96404    case 8: return 0;
   96405    case 7:
   96406       if (devinfo->is_haswell) {
   96407          return 0;
   96408       } else {
   96409          return 0;
   96410       }
   96411    case 6: return 160;
   96412    case 5: return 0;
   96413    case 4:
   96414       if (devinfo->is_g4x) {
   96415          return 0;
   96416       } else {
   96417          return 0;
   96418       }
   96419    default:
   96420       unreachable("Invalid hardware generation");
   96421    }
   96422 }
   96423 
   96424 
   96425 
   96426 /* 3DSTATE_WM::Barycentric Interpolation Mode */
   96427 
   96428 
   96429 #define GEN10_3DSTATE_WM_BarycentricInterpolationMode_bits  6
   96430 #define GEN9_3DSTATE_WM_BarycentricInterpolationMode_bits  6
   96431 #define GEN8_3DSTATE_WM_BarycentricInterpolationMode_bits  6
   96432 #define GEN75_3DSTATE_WM_BarycentricInterpolationMode_bits  6
   96433 #define GEN7_3DSTATE_WM_BarycentricInterpolationMode_bits  6
   96434 #define GEN6_3DSTATE_WM_BarycentricInterpolationMode_bits  6
   96435 
   96436 static inline uint32_t ATTRIBUTE_PURE
   96437 _3DSTATE_WM_BarycentricInterpolationMode_bits(const struct gen_device_info *devinfo)
   96438 {
   96439    switch (devinfo->gen) {
   96440    case 10: return 6;
   96441    case 9: return 6;
   96442    case 8: return 6;
   96443    case 7:
   96444       if (devinfo->is_haswell) {
   96445          return 6;
   96446       } else {
   96447          return 6;
   96448       }
   96449    case 6: return 6;
   96450    case 5: return 0;
   96451    case 4:
   96452       if (devinfo->is_g4x) {
   96453          return 0;
   96454       } else {
   96455          return 0;
   96456       }
   96457    default:
   96458       unreachable("Invalid hardware generation");
   96459    }
   96460 }
   96461 
   96462 
   96463 
   96464 #define GEN10_3DSTATE_WM_BarycentricInterpolationMode_start  43
   96465 #define GEN9_3DSTATE_WM_BarycentricInterpolationMode_start  43
   96466 #define GEN8_3DSTATE_WM_BarycentricInterpolationMode_start  43
   96467 #define GEN75_3DSTATE_WM_BarycentricInterpolationMode_start  43
   96468 #define GEN7_3DSTATE_WM_BarycentricInterpolationMode_start  43
   96469 #define GEN6_3DSTATE_WM_BarycentricInterpolationMode_start  202
   96470 
   96471 static inline uint32_t ATTRIBUTE_PURE
   96472 _3DSTATE_WM_BarycentricInterpolationMode_start(const struct gen_device_info *devinfo)
   96473 {
   96474    switch (devinfo->gen) {
   96475    case 10: return 43;
   96476    case 9: return 43;
   96477    case 8: return 43;
   96478    case 7:
   96479       if (devinfo->is_haswell) {
   96480          return 43;
   96481       } else {
   96482          return 43;
   96483       }
   96484    case 6: return 202;
   96485    case 5: return 0;
   96486    case 4:
   96487       if (devinfo->is_g4x) {
   96488          return 0;
   96489       } else {
   96490          return 0;
   96491       }
   96492    default:
   96493       unreachable("Invalid hardware generation");
   96494    }
   96495 }
   96496 
   96497 
   96498 
   96499 /* 3DSTATE_WM::Binding Table Entry Count */
   96500 
   96501 
   96502 #define GEN6_3DSTATE_WM_BindingTableEntryCount_bits  8
   96503 
   96504 static inline uint32_t ATTRIBUTE_PURE
   96505 _3DSTATE_WM_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   96506 {
   96507    switch (devinfo->gen) {
   96508    case 10: return 0;
   96509    case 9: return 0;
   96510    case 8: return 0;
   96511    case 7:
   96512       if (devinfo->is_haswell) {
   96513          return 0;
   96514       } else {
   96515          return 0;
   96516       }
   96517    case 6: return 8;
   96518    case 5: return 0;
   96519    case 4:
   96520       if (devinfo->is_g4x) {
   96521          return 0;
   96522       } else {
   96523          return 0;
   96524       }
   96525    default:
   96526       unreachable("Invalid hardware generation");
   96527    }
   96528 }
   96529 
   96530 
   96531 
   96532 #define GEN6_3DSTATE_WM_BindingTableEntryCount_start  82
   96533 
   96534 static inline uint32_t ATTRIBUTE_PURE
   96535 _3DSTATE_WM_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   96536 {
   96537    switch (devinfo->gen) {
   96538    case 10: return 0;
   96539    case 9: return 0;
   96540    case 8: return 0;
   96541    case 7:
   96542       if (devinfo->is_haswell) {
   96543          return 0;
   96544       } else {
   96545          return 0;
   96546       }
   96547    case 6: return 82;
   96548    case 5: return 0;
   96549    case 4:
   96550       if (devinfo->is_g4x) {
   96551          return 0;
   96552       } else {
   96553          return 0;
   96554       }
   96555    default:
   96556       unreachable("Invalid hardware generation");
   96557    }
   96558 }
   96559 
   96560 
   96561 
   96562 /* 3DSTATE_WM::Command SubType */
   96563 
   96564 
   96565 #define GEN10_3DSTATE_WM_CommandSubType_bits  2
   96566 #define GEN9_3DSTATE_WM_CommandSubType_bits  2
   96567 #define GEN8_3DSTATE_WM_CommandSubType_bits  2
   96568 #define GEN75_3DSTATE_WM_CommandSubType_bits  2
   96569 #define GEN7_3DSTATE_WM_CommandSubType_bits  2
   96570 #define GEN6_3DSTATE_WM_CommandSubType_bits  2
   96571 
   96572 static inline uint32_t ATTRIBUTE_PURE
   96573 _3DSTATE_WM_CommandSubType_bits(const struct gen_device_info *devinfo)
   96574 {
   96575    switch (devinfo->gen) {
   96576    case 10: return 2;
   96577    case 9: return 2;
   96578    case 8: return 2;
   96579    case 7:
   96580       if (devinfo->is_haswell) {
   96581          return 2;
   96582       } else {
   96583          return 2;
   96584       }
   96585    case 6: return 2;
   96586    case 5: return 0;
   96587    case 4:
   96588       if (devinfo->is_g4x) {
   96589          return 0;
   96590       } else {
   96591          return 0;
   96592       }
   96593    default:
   96594       unreachable("Invalid hardware generation");
   96595    }
   96596 }
   96597 
   96598 
   96599 
   96600 #define GEN10_3DSTATE_WM_CommandSubType_start  27
   96601 #define GEN9_3DSTATE_WM_CommandSubType_start  27
   96602 #define GEN8_3DSTATE_WM_CommandSubType_start  27
   96603 #define GEN75_3DSTATE_WM_CommandSubType_start  27
   96604 #define GEN7_3DSTATE_WM_CommandSubType_start  27
   96605 #define GEN6_3DSTATE_WM_CommandSubType_start  27
   96606 
   96607 static inline uint32_t ATTRIBUTE_PURE
   96608 _3DSTATE_WM_CommandSubType_start(const struct gen_device_info *devinfo)
   96609 {
   96610    switch (devinfo->gen) {
   96611    case 10: return 27;
   96612    case 9: return 27;
   96613    case 8: return 27;
   96614    case 7:
   96615       if (devinfo->is_haswell) {
   96616          return 27;
   96617       } else {
   96618          return 27;
   96619       }
   96620    case 6: return 27;
   96621    case 5: return 0;
   96622    case 4:
   96623       if (devinfo->is_g4x) {
   96624          return 0;
   96625       } else {
   96626          return 0;
   96627       }
   96628    default:
   96629       unreachable("Invalid hardware generation");
   96630    }
   96631 }
   96632 
   96633 
   96634 
   96635 /* 3DSTATE_WM::Command Type */
   96636 
   96637 
   96638 #define GEN10_3DSTATE_WM_CommandType_bits  3
   96639 #define GEN9_3DSTATE_WM_CommandType_bits  3
   96640 #define GEN8_3DSTATE_WM_CommandType_bits  3
   96641 #define GEN75_3DSTATE_WM_CommandType_bits  3
   96642 #define GEN7_3DSTATE_WM_CommandType_bits  3
   96643 #define GEN6_3DSTATE_WM_CommandType_bits  3
   96644 
   96645 static inline uint32_t ATTRIBUTE_PURE
   96646 _3DSTATE_WM_CommandType_bits(const struct gen_device_info *devinfo)
   96647 {
   96648    switch (devinfo->gen) {
   96649    case 10: return 3;
   96650    case 9: return 3;
   96651    case 8: return 3;
   96652    case 7:
   96653       if (devinfo->is_haswell) {
   96654          return 3;
   96655       } else {
   96656          return 3;
   96657       }
   96658    case 6: return 3;
   96659    case 5: return 0;
   96660    case 4:
   96661       if (devinfo->is_g4x) {
   96662          return 0;
   96663       } else {
   96664          return 0;
   96665       }
   96666    default:
   96667       unreachable("Invalid hardware generation");
   96668    }
   96669 }
   96670 
   96671 
   96672 
   96673 #define GEN10_3DSTATE_WM_CommandType_start  29
   96674 #define GEN9_3DSTATE_WM_CommandType_start  29
   96675 #define GEN8_3DSTATE_WM_CommandType_start  29
   96676 #define GEN75_3DSTATE_WM_CommandType_start  29
   96677 #define GEN7_3DSTATE_WM_CommandType_start  29
   96678 #define GEN6_3DSTATE_WM_CommandType_start  29
   96679 
   96680 static inline uint32_t ATTRIBUTE_PURE
   96681 _3DSTATE_WM_CommandType_start(const struct gen_device_info *devinfo)
   96682 {
   96683    switch (devinfo->gen) {
   96684    case 10: return 29;
   96685    case 9: return 29;
   96686    case 8: return 29;
   96687    case 7:
   96688       if (devinfo->is_haswell) {
   96689          return 29;
   96690       } else {
   96691          return 29;
   96692       }
   96693    case 6: return 29;
   96694    case 5: return 0;
   96695    case 4:
   96696       if (devinfo->is_g4x) {
   96697          return 0;
   96698       } else {
   96699          return 0;
   96700       }
   96701    default:
   96702       unreachable("Invalid hardware generation");
   96703    }
   96704 }
   96705 
   96706 
   96707 
   96708 /* 3DSTATE_WM::DWord Length */
   96709 
   96710 
   96711 #define GEN10_3DSTATE_WM_DWordLength_bits  8
   96712 #define GEN9_3DSTATE_WM_DWordLength_bits  8
   96713 #define GEN8_3DSTATE_WM_DWordLength_bits  8
   96714 #define GEN75_3DSTATE_WM_DWordLength_bits  8
   96715 #define GEN7_3DSTATE_WM_DWordLength_bits  8
   96716 #define GEN6_3DSTATE_WM_DWordLength_bits  8
   96717 
   96718 static inline uint32_t ATTRIBUTE_PURE
   96719 _3DSTATE_WM_DWordLength_bits(const struct gen_device_info *devinfo)
   96720 {
   96721    switch (devinfo->gen) {
   96722    case 10: return 8;
   96723    case 9: return 8;
   96724    case 8: return 8;
   96725    case 7:
   96726       if (devinfo->is_haswell) {
   96727          return 8;
   96728       } else {
   96729          return 8;
   96730       }
   96731    case 6: return 8;
   96732    case 5: return 0;
   96733    case 4:
   96734       if (devinfo->is_g4x) {
   96735          return 0;
   96736       } else {
   96737          return 0;
   96738       }
   96739    default:
   96740       unreachable("Invalid hardware generation");
   96741    }
   96742 }
   96743 
   96744 
   96745 
   96746 #define GEN10_3DSTATE_WM_DWordLength_start  0
   96747 #define GEN9_3DSTATE_WM_DWordLength_start  0
   96748 #define GEN8_3DSTATE_WM_DWordLength_start  0
   96749 #define GEN75_3DSTATE_WM_DWordLength_start  0
   96750 #define GEN7_3DSTATE_WM_DWordLength_start  0
   96751 #define GEN6_3DSTATE_WM_DWordLength_start  0
   96752 
   96753 static inline uint32_t ATTRIBUTE_PURE
   96754 _3DSTATE_WM_DWordLength_start(const struct gen_device_info *devinfo)
   96755 {
   96756    switch (devinfo->gen) {
   96757    case 10: return 0;
   96758    case 9: return 0;
   96759    case 8: return 0;
   96760    case 7:
   96761       if (devinfo->is_haswell) {
   96762          return 0;
   96763       } else {
   96764          return 0;
   96765       }
   96766    case 6: return 0;
   96767    case 5: return 0;
   96768    case 4:
   96769       if (devinfo->is_g4x) {
   96770          return 0;
   96771       } else {
   96772          return 0;
   96773       }
   96774    default:
   96775       unreachable("Invalid hardware generation");
   96776    }
   96777 }
   96778 
   96779 
   96780 
   96781 /* 3DSTATE_WM::Depth Buffer Clear */
   96782 
   96783 
   96784 #define GEN75_3DSTATE_WM_DepthBufferClear_bits  1
   96785 #define GEN7_3DSTATE_WM_DepthBufferClear_bits  1
   96786 #define GEN6_3DSTATE_WM_DepthBufferClear_bits  1
   96787 
   96788 static inline uint32_t ATTRIBUTE_PURE
   96789 _3DSTATE_WM_DepthBufferClear_bits(const struct gen_device_info *devinfo)
   96790 {
   96791    switch (devinfo->gen) {
   96792    case 10: return 0;
   96793    case 9: return 0;
   96794    case 8: return 0;
   96795    case 7:
   96796       if (devinfo->is_haswell) {
   96797          return 1;
   96798       } else {
   96799          return 1;
   96800       }
   96801    case 6: return 1;
   96802    case 5: return 0;
   96803    case 4:
   96804       if (devinfo->is_g4x) {
   96805          return 0;
   96806       } else {
   96807          return 0;
   96808       }
   96809    default:
   96810       unreachable("Invalid hardware generation");
   96811    }
   96812 }
   96813 
   96814 
   96815 
   96816 #define GEN75_3DSTATE_WM_DepthBufferClear_start  62
   96817 #define GEN7_3DSTATE_WM_DepthBufferClear_start  62
   96818 #define GEN6_3DSTATE_WM_DepthBufferClear_start  158
   96819 
   96820 static inline uint32_t ATTRIBUTE_PURE
   96821 _3DSTATE_WM_DepthBufferClear_start(const struct gen_device_info *devinfo)
   96822 {
   96823    switch (devinfo->gen) {
   96824    case 10: return 0;
   96825    case 9: return 0;
   96826    case 8: return 0;
   96827    case 7:
   96828       if (devinfo->is_haswell) {
   96829          return 62;
   96830       } else {
   96831          return 62;
   96832       }
   96833    case 6: return 158;
   96834    case 5: return 0;
   96835    case 4:
   96836       if (devinfo->is_g4x) {
   96837          return 0;
   96838       } else {
   96839          return 0;
   96840       }
   96841    default:
   96842       unreachable("Invalid hardware generation");
   96843    }
   96844 }
   96845 
   96846 
   96847 
   96848 /* 3DSTATE_WM::Depth Buffer Resolve Enable */
   96849 
   96850 
   96851 #define GEN75_3DSTATE_WM_DepthBufferResolveEnable_bits  1
   96852 #define GEN7_3DSTATE_WM_DepthBufferResolveEnable_bits  1
   96853 #define GEN6_3DSTATE_WM_DepthBufferResolveEnable_bits  1
   96854 
   96855 static inline uint32_t ATTRIBUTE_PURE
   96856 _3DSTATE_WM_DepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   96857 {
   96858    switch (devinfo->gen) {
   96859    case 10: return 0;
   96860    case 9: return 0;
   96861    case 8: return 0;
   96862    case 7:
   96863       if (devinfo->is_haswell) {
   96864          return 1;
   96865       } else {
   96866          return 1;
   96867       }
   96868    case 6: return 1;
   96869    case 5: return 0;
   96870    case 4:
   96871       if (devinfo->is_g4x) {
   96872          return 0;
   96873       } else {
   96874          return 0;
   96875       }
   96876    default:
   96877       unreachable("Invalid hardware generation");
   96878    }
   96879 }
   96880 
   96881 
   96882 
   96883 #define GEN75_3DSTATE_WM_DepthBufferResolveEnable_start  60
   96884 #define GEN7_3DSTATE_WM_DepthBufferResolveEnable_start  60
   96885 #define GEN6_3DSTATE_WM_DepthBufferResolveEnable_start  156
   96886 
   96887 static inline uint32_t ATTRIBUTE_PURE
   96888 _3DSTATE_WM_DepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   96889 {
   96890    switch (devinfo->gen) {
   96891    case 10: return 0;
   96892    case 9: return 0;
   96893    case 8: return 0;
   96894    case 7:
   96895       if (devinfo->is_haswell) {
   96896          return 60;
   96897       } else {
   96898          return 60;
   96899       }
   96900    case 6: return 156;
   96901    case 5: return 0;
   96902    case 4:
   96903       if (devinfo->is_g4x) {
   96904          return 0;
   96905       } else {
   96906          return 0;
   96907       }
   96908    default:
   96909       unreachable("Invalid hardware generation");
   96910    }
   96911 }
   96912 
   96913 
   96914 
   96915 /* 3DSTATE_WM::Dispatch GRF Start Register For Constant/Setup Data 0 */
   96916 
   96917 
   96918 #define GEN6_3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData0_bits  7
   96919 
   96920 static inline uint32_t ATTRIBUTE_PURE
   96921 _3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData0_bits(const struct gen_device_info *devinfo)
   96922 {
   96923    switch (devinfo->gen) {
   96924    case 10: return 0;
   96925    case 9: return 0;
   96926    case 8: return 0;
   96927    case 7:
   96928       if (devinfo->is_haswell) {
   96929          return 0;
   96930       } else {
   96931          return 0;
   96932       }
   96933    case 6: return 7;
   96934    case 5: return 0;
   96935    case 4:
   96936       if (devinfo->is_g4x) {
   96937          return 0;
   96938       } else {
   96939          return 0;
   96940       }
   96941    default:
   96942       unreachable("Invalid hardware generation");
   96943    }
   96944 }
   96945 
   96946 
   96947 
   96948 #define GEN6_3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData0_start  144
   96949 
   96950 static inline uint32_t ATTRIBUTE_PURE
   96951 _3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData0_start(const struct gen_device_info *devinfo)
   96952 {
   96953    switch (devinfo->gen) {
   96954    case 10: return 0;
   96955    case 9: return 0;
   96956    case 8: return 0;
   96957    case 7:
   96958       if (devinfo->is_haswell) {
   96959          return 0;
   96960       } else {
   96961          return 0;
   96962       }
   96963    case 6: return 144;
   96964    case 5: return 0;
   96965    case 4:
   96966       if (devinfo->is_g4x) {
   96967          return 0;
   96968       } else {
   96969          return 0;
   96970       }
   96971    default:
   96972       unreachable("Invalid hardware generation");
   96973    }
   96974 }
   96975 
   96976 
   96977 
   96978 /* 3DSTATE_WM::Dispatch GRF Start Register For Constant/Setup Data 1 */
   96979 
   96980 
   96981 #define GEN6_3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData1_bits  7
   96982 
   96983 static inline uint32_t ATTRIBUTE_PURE
   96984 _3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData1_bits(const struct gen_device_info *devinfo)
   96985 {
   96986    switch (devinfo->gen) {
   96987    case 10: return 0;
   96988    case 9: return 0;
   96989    case 8: return 0;
   96990    case 7:
   96991       if (devinfo->is_haswell) {
   96992          return 0;
   96993       } else {
   96994          return 0;
   96995       }
   96996    case 6: return 7;
   96997    case 5: return 0;
   96998    case 4:
   96999       if (devinfo->is_g4x) {
   97000          return 0;
   97001       } else {
   97002          return 0;
   97003       }
   97004    default:
   97005       unreachable("Invalid hardware generation");
   97006    }
   97007 }
   97008 
   97009 
   97010 
   97011 #define GEN6_3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData1_start  136
   97012 
   97013 static inline uint32_t ATTRIBUTE_PURE
   97014 _3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData1_start(const struct gen_device_info *devinfo)
   97015 {
   97016    switch (devinfo->gen) {
   97017    case 10: return 0;
   97018    case 9: return 0;
   97019    case 8: return 0;
   97020    case 7:
   97021       if (devinfo->is_haswell) {
   97022          return 0;
   97023       } else {
   97024          return 0;
   97025       }
   97026    case 6: return 136;
   97027    case 5: return 0;
   97028    case 4:
   97029       if (devinfo->is_g4x) {
   97030          return 0;
   97031       } else {
   97032          return 0;
   97033       }
   97034    default:
   97035       unreachable("Invalid hardware generation");
   97036    }
   97037 }
   97038 
   97039 
   97040 
   97041 /* 3DSTATE_WM::Dispatch GRF Start Register For Constant/Setup Data 2 */
   97042 
   97043 
   97044 #define GEN6_3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData2_bits  7
   97045 
   97046 static inline uint32_t ATTRIBUTE_PURE
   97047 _3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData2_bits(const struct gen_device_info *devinfo)
   97048 {
   97049    switch (devinfo->gen) {
   97050    case 10: return 0;
   97051    case 9: return 0;
   97052    case 8: return 0;
   97053    case 7:
   97054       if (devinfo->is_haswell) {
   97055          return 0;
   97056       } else {
   97057          return 0;
   97058       }
   97059    case 6: return 7;
   97060    case 5: return 0;
   97061    case 4:
   97062       if (devinfo->is_g4x) {
   97063          return 0;
   97064       } else {
   97065          return 0;
   97066       }
   97067    default:
   97068       unreachable("Invalid hardware generation");
   97069    }
   97070 }
   97071 
   97072 
   97073 
   97074 #define GEN6_3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData2_start  128
   97075 
   97076 static inline uint32_t ATTRIBUTE_PURE
   97077 _3DSTATE_WM_DispatchGRFStartRegisterForConstantSetupData2_start(const struct gen_device_info *devinfo)
   97078 {
   97079    switch (devinfo->gen) {
   97080    case 10: return 0;
   97081    case 9: return 0;
   97082    case 8: return 0;
   97083    case 7:
   97084       if (devinfo->is_haswell) {
   97085          return 0;
   97086       } else {
   97087          return 0;
   97088       }
   97089    case 6: return 128;
   97090    case 5: return 0;
   97091    case 4:
   97092       if (devinfo->is_g4x) {
   97093          return 0;
   97094       } else {
   97095          return 0;
   97096       }
   97097    default:
   97098       unreachable("Invalid hardware generation");
   97099    }
   97100 }
   97101 
   97102 
   97103 
   97104 /* 3DSTATE_WM::Dual Source Blend Enable */
   97105 
   97106 
   97107 #define GEN6_3DSTATE_WM_DualSourceBlendEnable_bits  1
   97108 
   97109 static inline uint32_t ATTRIBUTE_PURE
   97110 _3DSTATE_WM_DualSourceBlendEnable_bits(const struct gen_device_info *devinfo)
   97111 {
   97112    switch (devinfo->gen) {
   97113    case 10: return 0;
   97114    case 9: return 0;
   97115    case 8: return 0;
   97116    case 7:
   97117       if (devinfo->is_haswell) {
   97118          return 0;
   97119       } else {
   97120          return 0;
   97121       }
   97122    case 6: return 1;
   97123    case 5: return 0;
   97124    case 4:
   97125       if (devinfo->is_g4x) {
   97126          return 0;
   97127       } else {
   97128          return 0;
   97129       }
   97130    default:
   97131       unreachable("Invalid hardware generation");
   97132    }
   97133 }
   97134 
   97135 
   97136 
   97137 #define GEN6_3DSTATE_WM_DualSourceBlendEnable_start  167
   97138 
   97139 static inline uint32_t ATTRIBUTE_PURE
   97140 _3DSTATE_WM_DualSourceBlendEnable_start(const struct gen_device_info *devinfo)
   97141 {
   97142    switch (devinfo->gen) {
   97143    case 10: return 0;
   97144    case 9: return 0;
   97145    case 8: return 0;
   97146    case 7:
   97147       if (devinfo->is_haswell) {
   97148          return 0;
   97149       } else {
   97150          return 0;
   97151       }
   97152    case 6: return 167;
   97153    case 5: return 0;
   97154    case 4:
   97155       if (devinfo->is_g4x) {
   97156          return 0;
   97157       } else {
   97158          return 0;
   97159       }
   97160    default:
   97161       unreachable("Invalid hardware generation");
   97162    }
   97163 }
   97164 
   97165 
   97166 
   97167 /* 3DSTATE_WM::Early Depth/Stencil Control */
   97168 
   97169 
   97170 #define GEN10_3DSTATE_WM_EarlyDepthStencilControl_bits  2
   97171 #define GEN9_3DSTATE_WM_EarlyDepthStencilControl_bits  2
   97172 #define GEN8_3DSTATE_WM_EarlyDepthStencilControl_bits  2
   97173 #define GEN75_3DSTATE_WM_EarlyDepthStencilControl_bits  2
   97174 #define GEN7_3DSTATE_WM_EarlyDepthStencilControl_bits  2
   97175 
   97176 static inline uint32_t ATTRIBUTE_PURE
   97177 _3DSTATE_WM_EarlyDepthStencilControl_bits(const struct gen_device_info *devinfo)
   97178 {
   97179    switch (devinfo->gen) {
   97180    case 10: return 2;
   97181    case 9: return 2;
   97182    case 8: return 2;
   97183    case 7:
   97184       if (devinfo->is_haswell) {
   97185          return 2;
   97186       } else {
   97187          return 2;
   97188       }
   97189    case 6: return 0;
   97190    case 5: return 0;
   97191    case 4:
   97192       if (devinfo->is_g4x) {
   97193          return 0;
   97194       } else {
   97195          return 0;
   97196       }
   97197    default:
   97198       unreachable("Invalid hardware generation");
   97199    }
   97200 }
   97201 
   97202 
   97203 
   97204 #define GEN10_3DSTATE_WM_EarlyDepthStencilControl_start  53
   97205 #define GEN9_3DSTATE_WM_EarlyDepthStencilControl_start  53
   97206 #define GEN8_3DSTATE_WM_EarlyDepthStencilControl_start  53
   97207 #define GEN75_3DSTATE_WM_EarlyDepthStencilControl_start  53
   97208 #define GEN7_3DSTATE_WM_EarlyDepthStencilControl_start  53
   97209 
   97210 static inline uint32_t ATTRIBUTE_PURE
   97211 _3DSTATE_WM_EarlyDepthStencilControl_start(const struct gen_device_info *devinfo)
   97212 {
   97213    switch (devinfo->gen) {
   97214    case 10: return 53;
   97215    case 9: return 53;
   97216    case 8: return 53;
   97217    case 7:
   97218       if (devinfo->is_haswell) {
   97219          return 53;
   97220       } else {
   97221          return 53;
   97222       }
   97223    case 6: return 0;
   97224    case 5: return 0;
   97225    case 4:
   97226       if (devinfo->is_g4x) {
   97227          return 0;
   97228       } else {
   97229          return 0;
   97230       }
   97231    default:
   97232       unreachable("Invalid hardware generation");
   97233    }
   97234 }
   97235 
   97236 
   97237 
   97238 /* 3DSTATE_WM::Floating Point Mode */
   97239 
   97240 
   97241 #define GEN6_3DSTATE_WM_FloatingPointMode_bits  1
   97242 
   97243 static inline uint32_t ATTRIBUTE_PURE
   97244 _3DSTATE_WM_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   97245 {
   97246    switch (devinfo->gen) {
   97247    case 10: return 0;
   97248    case 9: return 0;
   97249    case 8: return 0;
   97250    case 7:
   97251       if (devinfo->is_haswell) {
   97252          return 0;
   97253       } else {
   97254          return 0;
   97255       }
   97256    case 6: return 1;
   97257    case 5: return 0;
   97258    case 4:
   97259       if (devinfo->is_g4x) {
   97260          return 0;
   97261       } else {
   97262          return 0;
   97263       }
   97264    default:
   97265       unreachable("Invalid hardware generation");
   97266    }
   97267 }
   97268 
   97269 
   97270 
   97271 #define GEN6_3DSTATE_WM_FloatingPointMode_start  80
   97272 
   97273 static inline uint32_t ATTRIBUTE_PURE
   97274 _3DSTATE_WM_FloatingPointMode_start(const struct gen_device_info *devinfo)
   97275 {
   97276    switch (devinfo->gen) {
   97277    case 10: return 0;
   97278    case 9: return 0;
   97279    case 8: return 0;
   97280    case 7:
   97281       if (devinfo->is_haswell) {
   97282          return 0;
   97283       } else {
   97284          return 0;
   97285       }
   97286    case 6: return 80;
   97287    case 5: return 0;
   97288    case 4:
   97289       if (devinfo->is_g4x) {
   97290          return 0;
   97291       } else {
   97292          return 0;
   97293       }
   97294    default:
   97295       unreachable("Invalid hardware generation");
   97296    }
   97297 }
   97298 
   97299 
   97300 
   97301 /* 3DSTATE_WM::Force Kill Pixel Enable */
   97302 
   97303 
   97304 #define GEN10_3DSTATE_WM_ForceKillPixelEnable_bits  2
   97305 #define GEN9_3DSTATE_WM_ForceKillPixelEnable_bits  2
   97306 #define GEN8_3DSTATE_WM_ForceKillPixelEnable_bits  2
   97307 
   97308 static inline uint32_t ATTRIBUTE_PURE
   97309 _3DSTATE_WM_ForceKillPixelEnable_bits(const struct gen_device_info *devinfo)
   97310 {
   97311    switch (devinfo->gen) {
   97312    case 10: return 2;
   97313    case 9: return 2;
   97314    case 8: return 2;
   97315    case 7:
   97316       if (devinfo->is_haswell) {
   97317          return 0;
   97318       } else {
   97319          return 0;
   97320       }
   97321    case 6: return 0;
   97322    case 5: return 0;
   97323    case 4:
   97324       if (devinfo->is_g4x) {
   97325          return 0;
   97326       } else {
   97327          return 0;
   97328       }
   97329    default:
   97330       unreachable("Invalid hardware generation");
   97331    }
   97332 }
   97333 
   97334 
   97335 
   97336 #define GEN10_3DSTATE_WM_ForceKillPixelEnable_start  32
   97337 #define GEN9_3DSTATE_WM_ForceKillPixelEnable_start  32
   97338 #define GEN8_3DSTATE_WM_ForceKillPixelEnable_start  32
   97339 
   97340 static inline uint32_t ATTRIBUTE_PURE
   97341 _3DSTATE_WM_ForceKillPixelEnable_start(const struct gen_device_info *devinfo)
   97342 {
   97343    switch (devinfo->gen) {
   97344    case 10: return 32;
   97345    case 9: return 32;
   97346    case 8: return 32;
   97347    case 7:
   97348       if (devinfo->is_haswell) {
   97349          return 0;
   97350       } else {
   97351          return 0;
   97352       }
   97353    case 6: return 0;
   97354    case 5: return 0;
   97355    case 4:
   97356       if (devinfo->is_g4x) {
   97357          return 0;
   97358       } else {
   97359          return 0;
   97360       }
   97361    default:
   97362       unreachable("Invalid hardware generation");
   97363    }
   97364 }
   97365 
   97366 
   97367 
   97368 /* 3DSTATE_WM::Force Thread Dispatch Enable */
   97369 
   97370 
   97371 #define GEN10_3DSTATE_WM_ForceThreadDispatchEnable_bits  2
   97372 #define GEN9_3DSTATE_WM_ForceThreadDispatchEnable_bits  2
   97373 #define GEN8_3DSTATE_WM_ForceThreadDispatchEnable_bits  2
   97374 
   97375 static inline uint32_t ATTRIBUTE_PURE
   97376 _3DSTATE_WM_ForceThreadDispatchEnable_bits(const struct gen_device_info *devinfo)
   97377 {
   97378    switch (devinfo->gen) {
   97379    case 10: return 2;
   97380    case 9: return 2;
   97381    case 8: return 2;
   97382    case 7:
   97383       if (devinfo->is_haswell) {
   97384          return 0;
   97385       } else {
   97386          return 0;
   97387       }
   97388    case 6: return 0;
   97389    case 5: return 0;
   97390    case 4:
   97391       if (devinfo->is_g4x) {
   97392          return 0;
   97393       } else {
   97394          return 0;
   97395       }
   97396    default:
   97397       unreachable("Invalid hardware generation");
   97398    }
   97399 }
   97400 
   97401 
   97402 
   97403 #define GEN10_3DSTATE_WM_ForceThreadDispatchEnable_start  51
   97404 #define GEN9_3DSTATE_WM_ForceThreadDispatchEnable_start  51
   97405 #define GEN8_3DSTATE_WM_ForceThreadDispatchEnable_start  51
   97406 
   97407 static inline uint32_t ATTRIBUTE_PURE
   97408 _3DSTATE_WM_ForceThreadDispatchEnable_start(const struct gen_device_info *devinfo)
   97409 {
   97410    switch (devinfo->gen) {
   97411    case 10: return 51;
   97412    case 9: return 51;
   97413    case 8: return 51;
   97414    case 7:
   97415       if (devinfo->is_haswell) {
   97416          return 0;
   97417       } else {
   97418          return 0;
   97419       }
   97420    case 6: return 0;
   97421    case 5: return 0;
   97422    case 4:
   97423       if (devinfo->is_g4x) {
   97424          return 0;
   97425       } else {
   97426          return 0;
   97427       }
   97428    default:
   97429       unreachable("Invalid hardware generation");
   97430    }
   97431 }
   97432 
   97433 
   97434 
   97435 /* 3DSTATE_WM::Hierarchical Depth Buffer Resolve Enable */
   97436 
   97437 
   97438 #define GEN75_3DSTATE_WM_HierarchicalDepthBufferResolveEnable_bits  1
   97439 #define GEN7_3DSTATE_WM_HierarchicalDepthBufferResolveEnable_bits  1
   97440 #define GEN6_3DSTATE_WM_HierarchicalDepthBufferResolveEnable_bits  1
   97441 
   97442 static inline uint32_t ATTRIBUTE_PURE
   97443 _3DSTATE_WM_HierarchicalDepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   97444 {
   97445    switch (devinfo->gen) {
   97446    case 10: return 0;
   97447    case 9: return 0;
   97448    case 8: return 0;
   97449    case 7:
   97450       if (devinfo->is_haswell) {
   97451          return 1;
   97452       } else {
   97453          return 1;
   97454       }
   97455    case 6: return 1;
   97456    case 5: return 0;
   97457    case 4:
   97458       if (devinfo->is_g4x) {
   97459          return 0;
   97460       } else {
   97461          return 0;
   97462       }
   97463    default:
   97464       unreachable("Invalid hardware generation");
   97465    }
   97466 }
   97467 
   97468 
   97469 
   97470 #define GEN75_3DSTATE_WM_HierarchicalDepthBufferResolveEnable_start  59
   97471 #define GEN7_3DSTATE_WM_HierarchicalDepthBufferResolveEnable_start  59
   97472 #define GEN6_3DSTATE_WM_HierarchicalDepthBufferResolveEnable_start  155
   97473 
   97474 static inline uint32_t ATTRIBUTE_PURE
   97475 _3DSTATE_WM_HierarchicalDepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   97476 {
   97477    switch (devinfo->gen) {
   97478    case 10: return 0;
   97479    case 9: return 0;
   97480    case 8: return 0;
   97481    case 7:
   97482       if (devinfo->is_haswell) {
   97483          return 59;
   97484       } else {
   97485          return 59;
   97486       }
   97487    case 6: return 155;
   97488    case 5: return 0;
   97489    case 4:
   97490       if (devinfo->is_g4x) {
   97491          return 0;
   97492       } else {
   97493          return 0;
   97494       }
   97495    default:
   97496       unreachable("Invalid hardware generation");
   97497    }
   97498 }
   97499 
   97500 
   97501 
   97502 /* 3DSTATE_WM::Illegal Opcode Exception Enable */
   97503 
   97504 
   97505 #define GEN6_3DSTATE_WM_IllegalOpcodeExceptionEnable_bits  1
   97506 
   97507 static inline uint32_t ATTRIBUTE_PURE
   97508 _3DSTATE_WM_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   97509 {
   97510    switch (devinfo->gen) {
   97511    case 10: return 0;
   97512    case 9: return 0;
   97513    case 8: return 0;
   97514    case 7:
   97515       if (devinfo->is_haswell) {
   97516          return 0;
   97517       } else {
   97518          return 0;
   97519       }
   97520    case 6: return 1;
   97521    case 5: return 0;
   97522    case 4:
   97523       if (devinfo->is_g4x) {
   97524          return 0;
   97525       } else {
   97526          return 0;
   97527       }
   97528    default:
   97529       unreachable("Invalid hardware generation");
   97530    }
   97531 }
   97532 
   97533 
   97534 
   97535 #define GEN6_3DSTATE_WM_IllegalOpcodeExceptionEnable_start  77
   97536 
   97537 static inline uint32_t ATTRIBUTE_PURE
   97538 _3DSTATE_WM_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   97539 {
   97540    switch (devinfo->gen) {
   97541    case 10: return 0;
   97542    case 9: return 0;
   97543    case 8: return 0;
   97544    case 7:
   97545       if (devinfo->is_haswell) {
   97546          return 0;
   97547       } else {
   97548          return 0;
   97549       }
   97550    case 6: return 77;
   97551    case 5: return 0;
   97552    case 4:
   97553       if (devinfo->is_g4x) {
   97554          return 0;
   97555       } else {
   97556          return 0;
   97557       }
   97558    default:
   97559       unreachable("Invalid hardware generation");
   97560    }
   97561 }
   97562 
   97563 
   97564 
   97565 /* 3DSTATE_WM::Kernel Start Pointer 0 */
   97566 
   97567 
   97568 #define GEN6_3DSTATE_WM_KernelStartPointer0_bits  26
   97569 
   97570 static inline uint32_t ATTRIBUTE_PURE
   97571 _3DSTATE_WM_KernelStartPointer0_bits(const struct gen_device_info *devinfo)
   97572 {
   97573    switch (devinfo->gen) {
   97574    case 10: return 0;
   97575    case 9: return 0;
   97576    case 8: return 0;
   97577    case 7:
   97578       if (devinfo->is_haswell) {
   97579          return 0;
   97580       } else {
   97581          return 0;
   97582       }
   97583    case 6: return 26;
   97584    case 5: return 0;
   97585    case 4:
   97586       if (devinfo->is_g4x) {
   97587          return 0;
   97588       } else {
   97589          return 0;
   97590       }
   97591    default:
   97592       unreachable("Invalid hardware generation");
   97593    }
   97594 }
   97595 
   97596 
   97597 
   97598 #define GEN6_3DSTATE_WM_KernelStartPointer0_start  38
   97599 
   97600 static inline uint32_t ATTRIBUTE_PURE
   97601 _3DSTATE_WM_KernelStartPointer0_start(const struct gen_device_info *devinfo)
   97602 {
   97603    switch (devinfo->gen) {
   97604    case 10: return 0;
   97605    case 9: return 0;
   97606    case 8: return 0;
   97607    case 7:
   97608       if (devinfo->is_haswell) {
   97609          return 0;
   97610       } else {
   97611          return 0;
   97612       }
   97613    case 6: return 38;
   97614    case 5: return 0;
   97615    case 4:
   97616       if (devinfo->is_g4x) {
   97617          return 0;
   97618       } else {
   97619          return 0;
   97620       }
   97621    default:
   97622       unreachable("Invalid hardware generation");
   97623    }
   97624 }
   97625 
   97626 
   97627 
   97628 /* 3DSTATE_WM::Kernel Start Pointer 1 */
   97629 
   97630 
   97631 #define GEN6_3DSTATE_WM_KernelStartPointer1_bits  26
   97632 
   97633 static inline uint32_t ATTRIBUTE_PURE
   97634 _3DSTATE_WM_KernelStartPointer1_bits(const struct gen_device_info *devinfo)
   97635 {
   97636    switch (devinfo->gen) {
   97637    case 10: return 0;
   97638    case 9: return 0;
   97639    case 8: return 0;
   97640    case 7:
   97641       if (devinfo->is_haswell) {
   97642          return 0;
   97643       } else {
   97644          return 0;
   97645       }
   97646    case 6: return 26;
   97647    case 5: return 0;
   97648    case 4:
   97649       if (devinfo->is_g4x) {
   97650          return 0;
   97651       } else {
   97652          return 0;
   97653       }
   97654    default:
   97655       unreachable("Invalid hardware generation");
   97656    }
   97657 }
   97658 
   97659 
   97660 
   97661 #define GEN6_3DSTATE_WM_KernelStartPointer1_start  230
   97662 
   97663 static inline uint32_t ATTRIBUTE_PURE
   97664 _3DSTATE_WM_KernelStartPointer1_start(const struct gen_device_info *devinfo)
   97665 {
   97666    switch (devinfo->gen) {
   97667    case 10: return 0;
   97668    case 9: return 0;
   97669    case 8: return 0;
   97670    case 7:
   97671       if (devinfo->is_haswell) {
   97672          return 0;
   97673       } else {
   97674          return 0;
   97675       }
   97676    case 6: return 230;
   97677    case 5: return 0;
   97678    case 4:
   97679       if (devinfo->is_g4x) {
   97680          return 0;
   97681       } else {
   97682          return 0;
   97683       }
   97684    default:
   97685       unreachable("Invalid hardware generation");
   97686    }
   97687 }
   97688 
   97689 
   97690 
   97691 /* 3DSTATE_WM::Kernel Start Pointer 2 */
   97692 
   97693 
   97694 #define GEN6_3DSTATE_WM_KernelStartPointer2_bits  26
   97695 
   97696 static inline uint32_t ATTRIBUTE_PURE
   97697 _3DSTATE_WM_KernelStartPointer2_bits(const struct gen_device_info *devinfo)
   97698 {
   97699    switch (devinfo->gen) {
   97700    case 10: return 0;
   97701    case 9: return 0;
   97702    case 8: return 0;
   97703    case 7:
   97704       if (devinfo->is_haswell) {
   97705          return 0;
   97706       } else {
   97707          return 0;
   97708       }
   97709    case 6: return 26;
   97710    case 5: return 0;
   97711    case 4:
   97712       if (devinfo->is_g4x) {
   97713          return 0;
   97714       } else {
   97715          return 0;
   97716       }
   97717    default:
   97718       unreachable("Invalid hardware generation");
   97719    }
   97720 }
   97721 
   97722 
   97723 
   97724 #define GEN6_3DSTATE_WM_KernelStartPointer2_start  262
   97725 
   97726 static inline uint32_t ATTRIBUTE_PURE
   97727 _3DSTATE_WM_KernelStartPointer2_start(const struct gen_device_info *devinfo)
   97728 {
   97729    switch (devinfo->gen) {
   97730    case 10: return 0;
   97731    case 9: return 0;
   97732    case 8: return 0;
   97733    case 7:
   97734       if (devinfo->is_haswell) {
   97735          return 0;
   97736       } else {
   97737          return 0;
   97738       }
   97739    case 6: return 262;
   97740    case 5: return 0;
   97741    case 4:
   97742       if (devinfo->is_g4x) {
   97743          return 0;
   97744       } else {
   97745          return 0;
   97746       }
   97747    default:
   97748       unreachable("Invalid hardware generation");
   97749    }
   97750 }
   97751 
   97752 
   97753 
   97754 /* 3DSTATE_WM::Legacy Depth Buffer Clear Enable */
   97755 
   97756 
   97757 #define GEN10_3DSTATE_WM_LegacyDepthBufferClearEnable_bits  1
   97758 #define GEN9_3DSTATE_WM_LegacyDepthBufferClearEnable_bits  1
   97759 #define GEN8_3DSTATE_WM_LegacyDepthBufferClearEnable_bits  1
   97760 
   97761 static inline uint32_t ATTRIBUTE_PURE
   97762 _3DSTATE_WM_LegacyDepthBufferClearEnable_bits(const struct gen_device_info *devinfo)
   97763 {
   97764    switch (devinfo->gen) {
   97765    case 10: return 1;
   97766    case 9: return 1;
   97767    case 8: return 1;
   97768    case 7:
   97769       if (devinfo->is_haswell) {
   97770          return 0;
   97771       } else {
   97772          return 0;
   97773       }
   97774    case 6: return 0;
   97775    case 5: return 0;
   97776    case 4:
   97777       if (devinfo->is_g4x) {
   97778          return 0;
   97779       } else {
   97780          return 0;
   97781       }
   97782    default:
   97783       unreachable("Invalid hardware generation");
   97784    }
   97785 }
   97786 
   97787 
   97788 
   97789 #define GEN10_3DSTATE_WM_LegacyDepthBufferClearEnable_start  62
   97790 #define GEN9_3DSTATE_WM_LegacyDepthBufferClearEnable_start  62
   97791 #define GEN8_3DSTATE_WM_LegacyDepthBufferClearEnable_start  62
   97792 
   97793 static inline uint32_t ATTRIBUTE_PURE
   97794 _3DSTATE_WM_LegacyDepthBufferClearEnable_start(const struct gen_device_info *devinfo)
   97795 {
   97796    switch (devinfo->gen) {
   97797    case 10: return 62;
   97798    case 9: return 62;
   97799    case 8: return 62;
   97800    case 7:
   97801       if (devinfo->is_haswell) {
   97802          return 0;
   97803       } else {
   97804          return 0;
   97805       }
   97806    case 6: return 0;
   97807    case 5: return 0;
   97808    case 4:
   97809       if (devinfo->is_g4x) {
   97810          return 0;
   97811       } else {
   97812          return 0;
   97813       }
   97814    default:
   97815       unreachable("Invalid hardware generation");
   97816    }
   97817 }
   97818 
   97819 
   97820 
   97821 /* 3DSTATE_WM::Legacy Depth Buffer Resolve Enable */
   97822 
   97823 
   97824 #define GEN10_3DSTATE_WM_LegacyDepthBufferResolveEnable_bits  1
   97825 #define GEN9_3DSTATE_WM_LegacyDepthBufferResolveEnable_bits  1
   97826 #define GEN8_3DSTATE_WM_LegacyDepthBufferResolveEnable_bits  1
   97827 
   97828 static inline uint32_t ATTRIBUTE_PURE
   97829 _3DSTATE_WM_LegacyDepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   97830 {
   97831    switch (devinfo->gen) {
   97832    case 10: return 1;
   97833    case 9: return 1;
   97834    case 8: return 1;
   97835    case 7:
   97836       if (devinfo->is_haswell) {
   97837          return 0;
   97838       } else {
   97839          return 0;
   97840       }
   97841    case 6: return 0;
   97842    case 5: return 0;
   97843    case 4:
   97844       if (devinfo->is_g4x) {
   97845          return 0;
   97846       } else {
   97847          return 0;
   97848       }
   97849    default:
   97850       unreachable("Invalid hardware generation");
   97851    }
   97852 }
   97853 
   97854 
   97855 
   97856 #define GEN10_3DSTATE_WM_LegacyDepthBufferResolveEnable_start  60
   97857 #define GEN9_3DSTATE_WM_LegacyDepthBufferResolveEnable_start  60
   97858 #define GEN8_3DSTATE_WM_LegacyDepthBufferResolveEnable_start  60
   97859 
   97860 static inline uint32_t ATTRIBUTE_PURE
   97861 _3DSTATE_WM_LegacyDepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   97862 {
   97863    switch (devinfo->gen) {
   97864    case 10: return 60;
   97865    case 9: return 60;
   97866    case 8: return 60;
   97867    case 7:
   97868       if (devinfo->is_haswell) {
   97869          return 0;
   97870       } else {
   97871          return 0;
   97872       }
   97873    case 6: return 0;
   97874    case 5: return 0;
   97875    case 4:
   97876       if (devinfo->is_g4x) {
   97877          return 0;
   97878       } else {
   97879          return 0;
   97880       }
   97881    default:
   97882       unreachable("Invalid hardware generation");
   97883    }
   97884 }
   97885 
   97886 
   97887 
   97888 /* 3DSTATE_WM::Legacy Diamond Line Rasterization */
   97889 
   97890 
   97891 #define GEN10_3DSTATE_WM_LegacyDiamondLineRasterization_bits  1
   97892 #define GEN9_3DSTATE_WM_LegacyDiamondLineRasterization_bits  1
   97893 #define GEN8_3DSTATE_WM_LegacyDiamondLineRasterization_bits  1
   97894 #define GEN75_3DSTATE_WM_LegacyDiamondLineRasterization_bits  1
   97895 #define GEN7_3DSTATE_WM_LegacyDiamondLineRasterization_bits  1
   97896 #define GEN6_3DSTATE_WM_LegacyDiamondLineRasterization_bits  1
   97897 
   97898 static inline uint32_t ATTRIBUTE_PURE
   97899 _3DSTATE_WM_LegacyDiamondLineRasterization_bits(const struct gen_device_info *devinfo)
   97900 {
   97901    switch (devinfo->gen) {
   97902    case 10: return 1;
   97903    case 9: return 1;
   97904    case 8: return 1;
   97905    case 7:
   97906       if (devinfo->is_haswell) {
   97907          return 1;
   97908       } else {
   97909          return 1;
   97910       }
   97911    case 6: return 1;
   97912    case 5: return 0;
   97913    case 4:
   97914       if (devinfo->is_g4x) {
   97915          return 0;
   97916       } else {
   97917          return 0;
   97918       }
   97919    default:
   97920       unreachable("Invalid hardware generation");
   97921    }
   97922 }
   97923 
   97924 
   97925 
   97926 #define GEN10_3DSTATE_WM_LegacyDiamondLineRasterization_start  58
   97927 #define GEN9_3DSTATE_WM_LegacyDiamondLineRasterization_start  58
   97928 #define GEN8_3DSTATE_WM_LegacyDiamondLineRasterization_start  58
   97929 #define GEN75_3DSTATE_WM_LegacyDiamondLineRasterization_start  58
   97930 #define GEN7_3DSTATE_WM_LegacyDiamondLineRasterization_start  58
   97931 #define GEN6_3DSTATE_WM_LegacyDiamondLineRasterization_start  183
   97932 
   97933 static inline uint32_t ATTRIBUTE_PURE
   97934 _3DSTATE_WM_LegacyDiamondLineRasterization_start(const struct gen_device_info *devinfo)
   97935 {
   97936    switch (devinfo->gen) {
   97937    case 10: return 58;
   97938    case 9: return 58;
   97939    case 8: return 58;
   97940    case 7:
   97941       if (devinfo->is_haswell) {
   97942          return 58;
   97943       } else {
   97944          return 58;
   97945       }
   97946    case 6: return 183;
   97947    case 5: return 0;
   97948    case 4:
   97949       if (devinfo->is_g4x) {
   97950          return 0;
   97951       } else {
   97952          return 0;
   97953       }
   97954    default:
   97955       unreachable("Invalid hardware generation");
   97956    }
   97957 }
   97958 
   97959 
   97960 
   97961 /* 3DSTATE_WM::Legacy Hierarchical Depth Buffer Resolve Enable */
   97962 
   97963 
   97964 #define GEN10_3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_bits  1
   97965 #define GEN9_3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_bits  1
   97966 #define GEN8_3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_bits  1
   97967 
   97968 static inline uint32_t ATTRIBUTE_PURE
   97969 _3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   97970 {
   97971    switch (devinfo->gen) {
   97972    case 10: return 1;
   97973    case 9: return 1;
   97974    case 8: return 1;
   97975    case 7:
   97976       if (devinfo->is_haswell) {
   97977          return 0;
   97978       } else {
   97979          return 0;
   97980       }
   97981    case 6: return 0;
   97982    case 5: return 0;
   97983    case 4:
   97984       if (devinfo->is_g4x) {
   97985          return 0;
   97986       } else {
   97987          return 0;
   97988       }
   97989    default:
   97990       unreachable("Invalid hardware generation");
   97991    }
   97992 }
   97993 
   97994 
   97995 
   97996 #define GEN10_3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_start  59
   97997 #define GEN9_3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_start  59
   97998 #define GEN8_3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_start  59
   97999 
   98000 static inline uint32_t ATTRIBUTE_PURE
   98001 _3DSTATE_WM_LegacyHierarchicalDepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   98002 {
   98003    switch (devinfo->gen) {
   98004    case 10: return 59;
   98005    case 9: return 59;
   98006    case 8: return 59;
   98007    case 7:
   98008       if (devinfo->is_haswell) {
   98009          return 0;
   98010       } else {
   98011          return 0;
   98012       }
   98013    case 6: return 0;
   98014    case 5: return 0;
   98015    case 4:
   98016       if (devinfo->is_g4x) {
   98017          return 0;
   98018       } else {
   98019          return 0;
   98020       }
   98021    default:
   98022       unreachable("Invalid hardware generation");
   98023    }
   98024 }
   98025 
   98026 
   98027 
   98028 /* 3DSTATE_WM::Line Antialiasing Region Width */
   98029 
   98030 
   98031 #define GEN10_3DSTATE_WM_LineAntialiasingRegionWidth_bits  2
   98032 #define GEN9_3DSTATE_WM_LineAntialiasingRegionWidth_bits  2
   98033 #define GEN8_3DSTATE_WM_LineAntialiasingRegionWidth_bits  2
   98034 #define GEN75_3DSTATE_WM_LineAntialiasingRegionWidth_bits  2
   98035 #define GEN7_3DSTATE_WM_LineAntialiasingRegionWidth_bits  2
   98036 #define GEN6_3DSTATE_WM_LineAntialiasingRegionWidth_bits  2
   98037 
   98038 static inline uint32_t ATTRIBUTE_PURE
   98039 _3DSTATE_WM_LineAntialiasingRegionWidth_bits(const struct gen_device_info *devinfo)
   98040 {
   98041    switch (devinfo->gen) {
   98042    case 10: return 2;
   98043    case 9: return 2;
   98044    case 8: return 2;
   98045    case 7:
   98046       if (devinfo->is_haswell) {
   98047          return 2;
   98048       } else {
   98049          return 2;
   98050       }
   98051    case 6: return 2;
   98052    case 5: return 0;
   98053    case 4:
   98054       if (devinfo->is_g4x) {
   98055          return 0;
   98056       } else {
   98057          return 0;
   98058       }
   98059    default:
   98060       unreachable("Invalid hardware generation");
   98061    }
   98062 }
   98063 
   98064 
   98065 
   98066 #define GEN10_3DSTATE_WM_LineAntialiasingRegionWidth_start  38
   98067 #define GEN9_3DSTATE_WM_LineAntialiasingRegionWidth_start  38
   98068 #define GEN8_3DSTATE_WM_LineAntialiasingRegionWidth_start  38
   98069 #define GEN75_3DSTATE_WM_LineAntialiasingRegionWidth_start  38
   98070 #define GEN7_3DSTATE_WM_LineAntialiasingRegionWidth_start  38
   98071 #define GEN6_3DSTATE_WM_LineAntialiasingRegionWidth_start  174
   98072 
   98073 static inline uint32_t ATTRIBUTE_PURE
   98074 _3DSTATE_WM_LineAntialiasingRegionWidth_start(const struct gen_device_info *devinfo)
   98075 {
   98076    switch (devinfo->gen) {
   98077    case 10: return 38;
   98078    case 9: return 38;
   98079    case 8: return 38;
   98080    case 7:
   98081       if (devinfo->is_haswell) {
   98082          return 38;
   98083       } else {
   98084          return 38;
   98085       }
   98086    case 6: return 174;
   98087    case 5: return 0;
   98088    case 4:
   98089       if (devinfo->is_g4x) {
   98090          return 0;
   98091       } else {
   98092          return 0;
   98093       }
   98094    default:
   98095       unreachable("Invalid hardware generation");
   98096    }
   98097 }
   98098 
   98099 
   98100 
   98101 /* 3DSTATE_WM::Line End Cap Antialiasing Region Width */
   98102 
   98103 
   98104 #define GEN10_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_bits  2
   98105 #define GEN9_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_bits  2
   98106 #define GEN8_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_bits  2
   98107 #define GEN75_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_bits  2
   98108 #define GEN7_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_bits  2
   98109 #define GEN6_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_bits  2
   98110 
   98111 static inline uint32_t ATTRIBUTE_PURE
   98112 _3DSTATE_WM_LineEndCapAntialiasingRegionWidth_bits(const struct gen_device_info *devinfo)
   98113 {
   98114    switch (devinfo->gen) {
   98115    case 10: return 2;
   98116    case 9: return 2;
   98117    case 8: return 2;
   98118    case 7:
   98119       if (devinfo->is_haswell) {
   98120          return 2;
   98121       } else {
   98122          return 2;
   98123       }
   98124    case 6: return 2;
   98125    case 5: return 0;
   98126    case 4:
   98127       if (devinfo->is_g4x) {
   98128          return 0;
   98129       } else {
   98130          return 0;
   98131       }
   98132    default:
   98133       unreachable("Invalid hardware generation");
   98134    }
   98135 }
   98136 
   98137 
   98138 
   98139 #define GEN10_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_start  40
   98140 #define GEN9_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_start  40
   98141 #define GEN8_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_start  40
   98142 #define GEN75_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_start  40
   98143 #define GEN7_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_start  40
   98144 #define GEN6_3DSTATE_WM_LineEndCapAntialiasingRegionWidth_start  176
   98145 
   98146 static inline uint32_t ATTRIBUTE_PURE
   98147 _3DSTATE_WM_LineEndCapAntialiasingRegionWidth_start(const struct gen_device_info *devinfo)
   98148 {
   98149    switch (devinfo->gen) {
   98150    case 10: return 40;
   98151    case 9: return 40;
   98152    case 8: return 40;
   98153    case 7:
   98154       if (devinfo->is_haswell) {
   98155          return 40;
   98156       } else {
   98157          return 40;
   98158       }
   98159    case 6: return 176;
   98160    case 5: return 0;
   98161    case 4:
   98162       if (devinfo->is_g4x) {
   98163          return 0;
   98164       } else {
   98165          return 0;
   98166       }
   98167    default:
   98168       unreachable("Invalid hardware generation");
   98169    }
   98170 }
   98171 
   98172 
   98173 
   98174 /* 3DSTATE_WM::Line Stipple Enable */
   98175 
   98176 
   98177 #define GEN10_3DSTATE_WM_LineStippleEnable_bits  1
   98178 #define GEN9_3DSTATE_WM_LineStippleEnable_bits  1
   98179 #define GEN8_3DSTATE_WM_LineStippleEnable_bits  1
   98180 #define GEN75_3DSTATE_WM_LineStippleEnable_bits  1
   98181 #define GEN7_3DSTATE_WM_LineStippleEnable_bits  1
   98182 #define GEN6_3DSTATE_WM_LineStippleEnable_bits  1
   98183 
   98184 static inline uint32_t ATTRIBUTE_PURE
   98185 _3DSTATE_WM_LineStippleEnable_bits(const struct gen_device_info *devinfo)
   98186 {
   98187    switch (devinfo->gen) {
   98188    case 10: return 1;
   98189    case 9: return 1;
   98190    case 8: return 1;
   98191    case 7:
   98192       if (devinfo->is_haswell) {
   98193          return 1;
   98194       } else {
   98195          return 1;
   98196       }
   98197    case 6: return 1;
   98198    case 5: return 0;
   98199    case 4:
   98200       if (devinfo->is_g4x) {
   98201          return 0;
   98202       } else {
   98203          return 0;
   98204       }
   98205    default:
   98206       unreachable("Invalid hardware generation");
   98207    }
   98208 }
   98209 
   98210 
   98211 
   98212 #define GEN10_3DSTATE_WM_LineStippleEnable_start  35
   98213 #define GEN9_3DSTATE_WM_LineStippleEnable_start  35
   98214 #define GEN8_3DSTATE_WM_LineStippleEnable_start  35
   98215 #define GEN75_3DSTATE_WM_LineStippleEnable_start  35
   98216 #define GEN7_3DSTATE_WM_LineStippleEnable_start  35
   98217 #define GEN6_3DSTATE_WM_LineStippleEnable_start  171
   98218 
   98219 static inline uint32_t ATTRIBUTE_PURE
   98220 _3DSTATE_WM_LineStippleEnable_start(const struct gen_device_info *devinfo)
   98221 {
   98222    switch (devinfo->gen) {
   98223    case 10: return 35;
   98224    case 9: return 35;
   98225    case 8: return 35;
   98226    case 7:
   98227       if (devinfo->is_haswell) {
   98228          return 35;
   98229       } else {
   98230          return 35;
   98231       }
   98232    case 6: return 171;
   98233    case 5: return 0;
   98234    case 4:
   98235       if (devinfo->is_g4x) {
   98236          return 0;
   98237       } else {
   98238          return 0;
   98239       }
   98240    default:
   98241       unreachable("Invalid hardware generation");
   98242    }
   98243 }
   98244 
   98245 
   98246 
   98247 /* 3DSTATE_WM::MaskStack Exception Enable */
   98248 
   98249 
   98250 #define GEN6_3DSTATE_WM_MaskStackExceptionEnable_bits  1
   98251 
   98252 static inline uint32_t ATTRIBUTE_PURE
   98253 _3DSTATE_WM_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   98254 {
   98255    switch (devinfo->gen) {
   98256    case 10: return 0;
   98257    case 9: return 0;
   98258    case 8: return 0;
   98259    case 7:
   98260       if (devinfo->is_haswell) {
   98261          return 0;
   98262       } else {
   98263          return 0;
   98264       }
   98265    case 6: return 1;
   98266    case 5: return 0;
   98267    case 4:
   98268       if (devinfo->is_g4x) {
   98269          return 0;
   98270       } else {
   98271          return 0;
   98272       }
   98273    default:
   98274       unreachable("Invalid hardware generation");
   98275    }
   98276 }
   98277 
   98278 
   98279 
   98280 #define GEN6_3DSTATE_WM_MaskStackExceptionEnable_start  75
   98281 
   98282 static inline uint32_t ATTRIBUTE_PURE
   98283 _3DSTATE_WM_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   98284 {
   98285    switch (devinfo->gen) {
   98286    case 10: return 0;
   98287    case 9: return 0;
   98288    case 8: return 0;
   98289    case 7:
   98290       if (devinfo->is_haswell) {
   98291          return 0;
   98292       } else {
   98293          return 0;
   98294       }
   98295    case 6: return 75;
   98296    case 5: return 0;
   98297    case 4:
   98298       if (devinfo->is_g4x) {
   98299          return 0;
   98300       } else {
   98301          return 0;
   98302       }
   98303    default:
   98304       unreachable("Invalid hardware generation");
   98305    }
   98306 }
   98307 
   98308 
   98309 
   98310 /* 3DSTATE_WM::Maximum Number of Threads */
   98311 
   98312 
   98313 #define GEN6_3DSTATE_WM_MaximumNumberofThreads_bits  7
   98314 
   98315 static inline uint32_t ATTRIBUTE_PURE
   98316 _3DSTATE_WM_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   98317 {
   98318    switch (devinfo->gen) {
   98319    case 10: return 0;
   98320    case 9: return 0;
   98321    case 8: return 0;
   98322    case 7:
   98323       if (devinfo->is_haswell) {
   98324          return 0;
   98325       } else {
   98326          return 0;
   98327       }
   98328    case 6: return 7;
   98329    case 5: return 0;
   98330    case 4:
   98331       if (devinfo->is_g4x) {
   98332          return 0;
   98333       } else {
   98334          return 0;
   98335       }
   98336    default:
   98337       unreachable("Invalid hardware generation");
   98338    }
   98339 }
   98340 
   98341 
   98342 
   98343 #define GEN6_3DSTATE_WM_MaximumNumberofThreads_start  185
   98344 
   98345 static inline uint32_t ATTRIBUTE_PURE
   98346 _3DSTATE_WM_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   98347 {
   98348    switch (devinfo->gen) {
   98349    case 10: return 0;
   98350    case 9: return 0;
   98351    case 8: return 0;
   98352    case 7:
   98353       if (devinfo->is_haswell) {
   98354          return 0;
   98355       } else {
   98356          return 0;
   98357       }
   98358    case 6: return 185;
   98359    case 5: return 0;
   98360    case 4:
   98361       if (devinfo->is_g4x) {
   98362          return 0;
   98363       } else {
   98364          return 0;
   98365       }
   98366    default:
   98367       unreachable("Invalid hardware generation");
   98368    }
   98369 }
   98370 
   98371 
   98372 
   98373 /* 3DSTATE_WM::Multisample Dispatch Mode */
   98374 
   98375 
   98376 #define GEN75_3DSTATE_WM_MultisampleDispatchMode_bits  1
   98377 #define GEN7_3DSTATE_WM_MultisampleDispatchMode_bits  1
   98378 #define GEN6_3DSTATE_WM_MultisampleDispatchMode_bits  1
   98379 
   98380 static inline uint32_t ATTRIBUTE_PURE
   98381 _3DSTATE_WM_MultisampleDispatchMode_bits(const struct gen_device_info *devinfo)
   98382 {
   98383    switch (devinfo->gen) {
   98384    case 10: return 0;
   98385    case 9: return 0;
   98386    case 8: return 0;
   98387    case 7:
   98388       if (devinfo->is_haswell) {
   98389          return 1;
   98390       } else {
   98391          return 1;
   98392       }
   98393    case 6: return 1;
   98394    case 5: return 0;
   98395    case 4:
   98396       if (devinfo->is_g4x) {
   98397          return 0;
   98398       } else {
   98399          return 0;
   98400       }
   98401    default:
   98402       unreachable("Invalid hardware generation");
   98403    }
   98404 }
   98405 
   98406 
   98407 
   98408 #define GEN75_3DSTATE_WM_MultisampleDispatchMode_start  95
   98409 #define GEN7_3DSTATE_WM_MultisampleDispatchMode_start  95
   98410 #define GEN6_3DSTATE_WM_MultisampleDispatchMode_start  192
   98411 
   98412 static inline uint32_t ATTRIBUTE_PURE
   98413 _3DSTATE_WM_MultisampleDispatchMode_start(const struct gen_device_info *devinfo)
   98414 {
   98415    switch (devinfo->gen) {
   98416    case 10: return 0;
   98417    case 9: return 0;
   98418    case 8: return 0;
   98419    case 7:
   98420       if (devinfo->is_haswell) {
   98421          return 95;
   98422       } else {
   98423          return 95;
   98424       }
   98425    case 6: return 192;
   98426    case 5: return 0;
   98427    case 4:
   98428       if (devinfo->is_g4x) {
   98429          return 0;
   98430       } else {
   98431          return 0;
   98432       }
   98433    default:
   98434       unreachable("Invalid hardware generation");
   98435    }
   98436 }
   98437 
   98438 
   98439 
   98440 /* 3DSTATE_WM::Multisample Rasterization Mode */
   98441 
   98442 
   98443 #define GEN75_3DSTATE_WM_MultisampleRasterizationMode_bits  2
   98444 #define GEN7_3DSTATE_WM_MultisampleRasterizationMode_bits  2
   98445 #define GEN6_3DSTATE_WM_MultisampleRasterizationMode_bits  2
   98446 
   98447 static inline uint32_t ATTRIBUTE_PURE
   98448 _3DSTATE_WM_MultisampleRasterizationMode_bits(const struct gen_device_info *devinfo)
   98449 {
   98450    switch (devinfo->gen) {
   98451    case 10: return 0;
   98452    case 9: return 0;
   98453    case 8: return 0;
   98454    case 7:
   98455       if (devinfo->is_haswell) {
   98456          return 2;
   98457       } else {
   98458          return 2;
   98459       }
   98460    case 6: return 2;
   98461    case 5: return 0;
   98462    case 4:
   98463       if (devinfo->is_g4x) {
   98464          return 0;
   98465       } else {
   98466          return 0;
   98467       }
   98468    default:
   98469       unreachable("Invalid hardware generation");
   98470    }
   98471 }
   98472 
   98473 
   98474 
   98475 #define GEN75_3DSTATE_WM_MultisampleRasterizationMode_start  32
   98476 #define GEN7_3DSTATE_WM_MultisampleRasterizationMode_start  32
   98477 #define GEN6_3DSTATE_WM_MultisampleRasterizationMode_start  193
   98478 
   98479 static inline uint32_t ATTRIBUTE_PURE
   98480 _3DSTATE_WM_MultisampleRasterizationMode_start(const struct gen_device_info *devinfo)
   98481 {
   98482    switch (devinfo->gen) {
   98483    case 10: return 0;
   98484    case 9: return 0;
   98485    case 8: return 0;
   98486    case 7:
   98487       if (devinfo->is_haswell) {
   98488          return 32;
   98489       } else {
   98490          return 32;
   98491       }
   98492    case 6: return 193;
   98493    case 5: return 0;
   98494    case 4:
   98495       if (devinfo->is_g4x) {
   98496          return 0;
   98497       } else {
   98498          return 0;
   98499       }
   98500    default:
   98501       unreachable("Invalid hardware generation");
   98502    }
   98503 }
   98504 
   98505 
   98506 
   98507 /* 3DSTATE_WM::Number of SF Output Attributes */
   98508 
   98509 
   98510 #define GEN6_3DSTATE_WM_NumberofSFOutputAttributes_bits  6
   98511 
   98512 static inline uint32_t ATTRIBUTE_PURE
   98513 _3DSTATE_WM_NumberofSFOutputAttributes_bits(const struct gen_device_info *devinfo)
   98514 {
   98515    switch (devinfo->gen) {
   98516    case 10: return 0;
   98517    case 9: return 0;
   98518    case 8: return 0;
   98519    case 7:
   98520       if (devinfo->is_haswell) {
   98521          return 0;
   98522       } else {
   98523          return 0;
   98524       }
   98525    case 6: return 6;
   98526    case 5: return 0;
   98527    case 4:
   98528       if (devinfo->is_g4x) {
   98529          return 0;
   98530       } else {
   98531          return 0;
   98532       }
   98533    default:
   98534       unreachable("Invalid hardware generation");
   98535    }
   98536 }
   98537 
   98538 
   98539 
   98540 #define GEN6_3DSTATE_WM_NumberofSFOutputAttributes_start  212
   98541 
   98542 static inline uint32_t ATTRIBUTE_PURE
   98543 _3DSTATE_WM_NumberofSFOutputAttributes_start(const struct gen_device_info *devinfo)
   98544 {
   98545    switch (devinfo->gen) {
   98546    case 10: return 0;
   98547    case 9: return 0;
   98548    case 8: return 0;
   98549    case 7:
   98550       if (devinfo->is_haswell) {
   98551          return 0;
   98552       } else {
   98553          return 0;
   98554       }
   98555    case 6: return 212;
   98556    case 5: return 0;
   98557    case 4:
   98558       if (devinfo->is_g4x) {
   98559          return 0;
   98560       } else {
   98561          return 0;
   98562       }
   98563    default:
   98564       unreachable("Invalid hardware generation");
   98565    }
   98566 }
   98567 
   98568 
   98569 
   98570 /* 3DSTATE_WM::PS UAV-only */
   98571 
   98572 
   98573 #define GEN75_3DSTATE_WM_PSUAVonly_bits  1
   98574 
   98575 static inline uint32_t ATTRIBUTE_PURE
   98576 _3DSTATE_WM_PSUAVonly_bits(const struct gen_device_info *devinfo)
   98577 {
   98578    switch (devinfo->gen) {
   98579    case 10: return 0;
   98580    case 9: return 0;
   98581    case 8: return 0;
   98582    case 7:
   98583       if (devinfo->is_haswell) {
   98584          return 1;
   98585       } else {
   98586          return 0;
   98587       }
   98588    case 6: return 0;
   98589    case 5: return 0;
   98590    case 4:
   98591       if (devinfo->is_g4x) {
   98592          return 0;
   98593       } else {
   98594          return 0;
   98595       }
   98596    default:
   98597       unreachable("Invalid hardware generation");
   98598    }
   98599 }
   98600 
   98601 
   98602 
   98603 #define GEN75_3DSTATE_WM_PSUAVonly_start  94
   98604 
   98605 static inline uint32_t ATTRIBUTE_PURE
   98606 _3DSTATE_WM_PSUAVonly_start(const struct gen_device_info *devinfo)
   98607 {
   98608    switch (devinfo->gen) {
   98609    case 10: return 0;
   98610    case 9: return 0;
   98611    case 8: return 0;
   98612    case 7:
   98613       if (devinfo->is_haswell) {
   98614          return 94;
   98615       } else {
   98616          return 0;
   98617       }
   98618    case 6: return 0;
   98619    case 5: return 0;
   98620    case 4:
   98621       if (devinfo->is_g4x) {
   98622          return 0;
   98623       } else {
   98624          return 0;
   98625       }
   98626    default:
   98627       unreachable("Invalid hardware generation");
   98628    }
   98629 }
   98630 
   98631 
   98632 
   98633 /* 3DSTATE_WM::Per Thread Scratch Space */
   98634 
   98635 
   98636 #define GEN6_3DSTATE_WM_PerThreadScratchSpace_bits  4
   98637 
   98638 static inline uint32_t ATTRIBUTE_PURE
   98639 _3DSTATE_WM_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   98640 {
   98641    switch (devinfo->gen) {
   98642    case 10: return 0;
   98643    case 9: return 0;
   98644    case 8: return 0;
   98645    case 7:
   98646       if (devinfo->is_haswell) {
   98647          return 0;
   98648       } else {
   98649          return 0;
   98650       }
   98651    case 6: return 4;
   98652    case 5: return 0;
   98653    case 4:
   98654       if (devinfo->is_g4x) {
   98655          return 0;
   98656       } else {
   98657          return 0;
   98658       }
   98659    default:
   98660       unreachable("Invalid hardware generation");
   98661    }
   98662 }
   98663 
   98664 
   98665 
   98666 #define GEN6_3DSTATE_WM_PerThreadScratchSpace_start  96
   98667 
   98668 static inline uint32_t ATTRIBUTE_PURE
   98669 _3DSTATE_WM_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   98670 {
   98671    switch (devinfo->gen) {
   98672    case 10: return 0;
   98673    case 9: return 0;
   98674    case 8: return 0;
   98675    case 7:
   98676       if (devinfo->is_haswell) {
   98677          return 0;
   98678       } else {
   98679          return 0;
   98680       }
   98681    case 6: return 96;
   98682    case 5: return 0;
   98683    case 4:
   98684       if (devinfo->is_g4x) {
   98685          return 0;
   98686       } else {
   98687          return 0;
   98688       }
   98689    default:
   98690       unreachable("Invalid hardware generation");
   98691    }
   98692 }
   98693 
   98694 
   98695 
   98696 /* 3DSTATE_WM::Pixel Shader Computed Depth */
   98697 
   98698 
   98699 #define GEN6_3DSTATE_WM_PixelShaderComputedDepth_bits  1
   98700 
   98701 static inline uint32_t ATTRIBUTE_PURE
   98702 _3DSTATE_WM_PixelShaderComputedDepth_bits(const struct gen_device_info *devinfo)
   98703 {
   98704    switch (devinfo->gen) {
   98705    case 10: return 0;
   98706    case 9: return 0;
   98707    case 8: return 0;
   98708    case 7:
   98709       if (devinfo->is_haswell) {
   98710          return 0;
   98711       } else {
   98712          return 0;
   98713       }
   98714    case 6: return 1;
   98715    case 5: return 0;
   98716    case 4:
   98717       if (devinfo->is_g4x) {
   98718          return 0;
   98719       } else {
   98720          return 0;
   98721       }
   98722    default:
   98723       unreachable("Invalid hardware generation");
   98724    }
   98725 }
   98726 
   98727 
   98728 
   98729 #define GEN6_3DSTATE_WM_PixelShaderComputedDepth_start  181
   98730 
   98731 static inline uint32_t ATTRIBUTE_PURE
   98732 _3DSTATE_WM_PixelShaderComputedDepth_start(const struct gen_device_info *devinfo)
   98733 {
   98734    switch (devinfo->gen) {
   98735    case 10: return 0;
   98736    case 9: return 0;
   98737    case 8: return 0;
   98738    case 7:
   98739       if (devinfo->is_haswell) {
   98740          return 0;
   98741       } else {
   98742          return 0;
   98743       }
   98744    case 6: return 181;
   98745    case 5: return 0;
   98746    case 4:
   98747       if (devinfo->is_g4x) {
   98748          return 0;
   98749       } else {
   98750          return 0;
   98751       }
   98752    default:
   98753       unreachable("Invalid hardware generation");
   98754    }
   98755 }
   98756 
   98757 
   98758 
   98759 /* 3DSTATE_WM::Pixel Shader Computed Depth Mode */
   98760 
   98761 
   98762 #define GEN75_3DSTATE_WM_PixelShaderComputedDepthMode_bits  2
   98763 #define GEN7_3DSTATE_WM_PixelShaderComputedDepthMode_bits  2
   98764 
   98765 static inline uint32_t ATTRIBUTE_PURE
   98766 _3DSTATE_WM_PixelShaderComputedDepthMode_bits(const struct gen_device_info *devinfo)
   98767 {
   98768    switch (devinfo->gen) {
   98769    case 10: return 0;
   98770    case 9: return 0;
   98771    case 8: return 0;
   98772    case 7:
   98773       if (devinfo->is_haswell) {
   98774          return 2;
   98775       } else {
   98776          return 2;
   98777       }
   98778    case 6: return 0;
   98779    case 5: return 0;
   98780    case 4:
   98781       if (devinfo->is_g4x) {
   98782          return 0;
   98783       } else {
   98784          return 0;
   98785       }
   98786    default:
   98787       unreachable("Invalid hardware generation");
   98788    }
   98789 }
   98790 
   98791 
   98792 
   98793 #define GEN75_3DSTATE_WM_PixelShaderComputedDepthMode_start  55
   98794 #define GEN7_3DSTATE_WM_PixelShaderComputedDepthMode_start  55
   98795 
   98796 static inline uint32_t ATTRIBUTE_PURE
   98797 _3DSTATE_WM_PixelShaderComputedDepthMode_start(const struct gen_device_info *devinfo)
   98798 {
   98799    switch (devinfo->gen) {
   98800    case 10: return 0;
   98801    case 9: return 0;
   98802    case 8: return 0;
   98803    case 7:
   98804       if (devinfo->is_haswell) {
   98805          return 55;
   98806       } else {
   98807          return 55;
   98808       }
   98809    case 6: return 0;
   98810    case 5: return 0;
   98811    case 4:
   98812       if (devinfo->is_g4x) {
   98813          return 0;
   98814       } else {
   98815          return 0;
   98816       }
   98817    default:
   98818       unreachable("Invalid hardware generation");
   98819    }
   98820 }
   98821 
   98822 
   98823 
   98824 /* 3DSTATE_WM::Pixel Shader Kills Pixel */
   98825 
   98826 
   98827 #define GEN75_3DSTATE_WM_PixelShaderKillsPixel_bits  1
   98828 #define GEN7_3DSTATE_WM_PixelShaderKillsPixel_bits  1
   98829 #define GEN6_3DSTATE_WM_PixelShaderKillsPixel_bits  1
   98830 
   98831 static inline uint32_t ATTRIBUTE_PURE
   98832 _3DSTATE_WM_PixelShaderKillsPixel_bits(const struct gen_device_info *devinfo)
   98833 {
   98834    switch (devinfo->gen) {
   98835    case 10: return 0;
   98836    case 9: return 0;
   98837    case 8: return 0;
   98838    case 7:
   98839       if (devinfo->is_haswell) {
   98840          return 1;
   98841       } else {
   98842          return 1;
   98843       }
   98844    case 6: return 1;
   98845    case 5: return 0;
   98846    case 4:
   98847       if (devinfo->is_g4x) {
   98848          return 0;
   98849       } else {
   98850          return 0;
   98851       }
   98852    default:
   98853       unreachable("Invalid hardware generation");
   98854    }
   98855 }
   98856 
   98857 
   98858 
   98859 #define GEN75_3DSTATE_WM_PixelShaderKillsPixel_start  57
   98860 #define GEN7_3DSTATE_WM_PixelShaderKillsPixel_start  57
   98861 #define GEN6_3DSTATE_WM_PixelShaderKillsPixel_start  182
   98862 
   98863 static inline uint32_t ATTRIBUTE_PURE
   98864 _3DSTATE_WM_PixelShaderKillsPixel_start(const struct gen_device_info *devinfo)
   98865 {
   98866    switch (devinfo->gen) {
   98867    case 10: return 0;
   98868    case 9: return 0;
   98869    case 8: return 0;
   98870    case 7:
   98871       if (devinfo->is_haswell) {
   98872          return 57;
   98873       } else {
   98874          return 57;
   98875       }
   98876    case 6: return 182;
   98877    case 5: return 0;
   98878    case 4:
   98879       if (devinfo->is_g4x) {
   98880          return 0;
   98881       } else {
   98882          return 0;
   98883       }
   98884    default:
   98885       unreachable("Invalid hardware generation");
   98886    }
   98887 }
   98888 
   98889 
   98890 
   98891 /* 3DSTATE_WM::Pixel Shader Uses Input Coverage Mask */
   98892 
   98893 
   98894 #define GEN75_3DSTATE_WM_PixelShaderUsesInputCoverageMask_bits  1
   98895 #define GEN7_3DSTATE_WM_PixelShaderUsesInputCoverageMask_bits  1
   98896 
   98897 static inline uint32_t ATTRIBUTE_PURE
   98898 _3DSTATE_WM_PixelShaderUsesInputCoverageMask_bits(const struct gen_device_info *devinfo)
   98899 {
   98900    switch (devinfo->gen) {
   98901    case 10: return 0;
   98902    case 9: return 0;
   98903    case 8: return 0;
   98904    case 7:
   98905       if (devinfo->is_haswell) {
   98906          return 1;
   98907       } else {
   98908          return 1;
   98909       }
   98910    case 6: return 0;
   98911    case 5: return 0;
   98912    case 4:
   98913       if (devinfo->is_g4x) {
   98914          return 0;
   98915       } else {
   98916          return 0;
   98917       }
   98918    default:
   98919       unreachable("Invalid hardware generation");
   98920    }
   98921 }
   98922 
   98923 
   98924 
   98925 #define GEN75_3DSTATE_WM_PixelShaderUsesInputCoverageMask_start  42
   98926 #define GEN7_3DSTATE_WM_PixelShaderUsesInputCoverageMask_start  42
   98927 
   98928 static inline uint32_t ATTRIBUTE_PURE
   98929 _3DSTATE_WM_PixelShaderUsesInputCoverageMask_start(const struct gen_device_info *devinfo)
   98930 {
   98931    switch (devinfo->gen) {
   98932    case 10: return 0;
   98933    case 9: return 0;
   98934    case 8: return 0;
   98935    case 7:
   98936       if (devinfo->is_haswell) {
   98937          return 42;
   98938       } else {
   98939          return 42;
   98940       }
   98941    case 6: return 0;
   98942    case 5: return 0;
   98943    case 4:
   98944       if (devinfo->is_g4x) {
   98945          return 0;
   98946       } else {
   98947          return 0;
   98948       }
   98949    default:
   98950       unreachable("Invalid hardware generation");
   98951    }
   98952 }
   98953 
   98954 
   98955 
   98956 /* 3DSTATE_WM::Pixel Shader Uses Source Depth */
   98957 
   98958 
   98959 #define GEN75_3DSTATE_WM_PixelShaderUsesSourceDepth_bits  1
   98960 #define GEN7_3DSTATE_WM_PixelShaderUsesSourceDepth_bits  1
   98961 #define GEN6_3DSTATE_WM_PixelShaderUsesSourceDepth_bits  1
   98962 
   98963 static inline uint32_t ATTRIBUTE_PURE
   98964 _3DSTATE_WM_PixelShaderUsesSourceDepth_bits(const struct gen_device_info *devinfo)
   98965 {
   98966    switch (devinfo->gen) {
   98967    case 10: return 0;
   98968    case 9: return 0;
   98969    case 8: return 0;
   98970    case 7:
   98971       if (devinfo->is_haswell) {
   98972          return 1;
   98973       } else {
   98974          return 1;
   98975       }
   98976    case 6: return 1;
   98977    case 5: return 0;
   98978    case 4:
   98979       if (devinfo->is_g4x) {
   98980          return 0;
   98981       } else {
   98982          return 0;
   98983       }
   98984    default:
   98985       unreachable("Invalid hardware generation");
   98986    }
   98987 }
   98988 
   98989 
   98990 
   98991 #define GEN75_3DSTATE_WM_PixelShaderUsesSourceDepth_start  52
   98992 #define GEN7_3DSTATE_WM_PixelShaderUsesSourceDepth_start  52
   98993 #define GEN6_3DSTATE_WM_PixelShaderUsesSourceDepth_start  180
   98994 
   98995 static inline uint32_t ATTRIBUTE_PURE
   98996 _3DSTATE_WM_PixelShaderUsesSourceDepth_start(const struct gen_device_info *devinfo)
   98997 {
   98998    switch (devinfo->gen) {
   98999    case 10: return 0;
   99000    case 9: return 0;
   99001    case 8: return 0;
   99002    case 7:
   99003       if (devinfo->is_haswell) {
   99004          return 52;
   99005       } else {
   99006          return 52;
   99007       }
   99008    case 6: return 180;
   99009    case 5: return 0;
   99010    case 4:
   99011       if (devinfo->is_g4x) {
   99012          return 0;
   99013       } else {
   99014          return 0;
   99015       }
   99016    default:
   99017       unreachable("Invalid hardware generation");
   99018    }
   99019 }
   99020 
   99021 
   99022 
   99023 /* 3DSTATE_WM::Pixel Shader Uses Source W */
   99024 
   99025 
   99026 #define GEN75_3DSTATE_WM_PixelShaderUsesSourceW_bits  1
   99027 #define GEN7_3DSTATE_WM_PixelShaderUsesSourceW_bits  1
   99028 #define GEN6_3DSTATE_WM_PixelShaderUsesSourceW_bits  1
   99029 
   99030 static inline uint32_t ATTRIBUTE_PURE
   99031 _3DSTATE_WM_PixelShaderUsesSourceW_bits(const struct gen_device_info *devinfo)
   99032 {
   99033    switch (devinfo->gen) {
   99034    case 10: return 0;
   99035    case 9: return 0;
   99036    case 8: return 0;
   99037    case 7:
   99038       if (devinfo->is_haswell) {
   99039          return 1;
   99040       } else {
   99041          return 1;
   99042       }
   99043    case 6: return 1;
   99044    case 5: return 0;
   99045    case 4:
   99046       if (devinfo->is_g4x) {
   99047          return 0;
   99048       } else {
   99049          return 0;
   99050       }
   99051    default:
   99052       unreachable("Invalid hardware generation");
   99053    }
   99054 }
   99055 
   99056 
   99057 
   99058 #define GEN75_3DSTATE_WM_PixelShaderUsesSourceW_start  51
   99059 #define GEN7_3DSTATE_WM_PixelShaderUsesSourceW_start  51
   99060 #define GEN6_3DSTATE_WM_PixelShaderUsesSourceW_start  168
   99061 
   99062 static inline uint32_t ATTRIBUTE_PURE
   99063 _3DSTATE_WM_PixelShaderUsesSourceW_start(const struct gen_device_info *devinfo)
   99064 {
   99065    switch (devinfo->gen) {
   99066    case 10: return 0;
   99067    case 9: return 0;
   99068    case 8: return 0;
   99069    case 7:
   99070       if (devinfo->is_haswell) {
   99071          return 51;
   99072       } else {
   99073          return 51;
   99074       }
   99075    case 6: return 168;
   99076    case 5: return 0;
   99077    case 4:
   99078       if (devinfo->is_g4x) {
   99079          return 0;
   99080       } else {
   99081          return 0;
   99082       }
   99083    default:
   99084       unreachable("Invalid hardware generation");
   99085    }
   99086 }
   99087 
   99088 
   99089 
   99090 /* 3DSTATE_WM::Point Rasterization Rule */
   99091 
   99092 
   99093 #define GEN10_3DSTATE_WM_PointRasterizationRule_bits  1
   99094 #define GEN9_3DSTATE_WM_PointRasterizationRule_bits  1
   99095 #define GEN8_3DSTATE_WM_PointRasterizationRule_bits  1
   99096 #define GEN75_3DSTATE_WM_PointRasterizationRule_bits  1
   99097 #define GEN7_3DSTATE_WM_PointRasterizationRule_bits  1
   99098 #define GEN6_3DSTATE_WM_PointRasterizationRule_bits  1
   99099 
   99100 static inline uint32_t ATTRIBUTE_PURE
   99101 _3DSTATE_WM_PointRasterizationRule_bits(const struct gen_device_info *devinfo)
   99102 {
   99103    switch (devinfo->gen) {
   99104    case 10: return 1;
   99105    case 9: return 1;
   99106    case 8: return 1;
   99107    case 7:
   99108       if (devinfo->is_haswell) {
   99109          return 1;
   99110       } else {
   99111          return 1;
   99112       }
   99113    case 6: return 1;
   99114    case 5: return 0;
   99115    case 4:
   99116       if (devinfo->is_g4x) {
   99117          return 0;
   99118       } else {
   99119          return 0;
   99120       }
   99121    default:
   99122       unreachable("Invalid hardware generation");
   99123    }
   99124 }
   99125 
   99126 
   99127 
   99128 #define GEN10_3DSTATE_WM_PointRasterizationRule_start  34
   99129 #define GEN9_3DSTATE_WM_PointRasterizationRule_start  34
   99130 #define GEN8_3DSTATE_WM_PointRasterizationRule_start  34
   99131 #define GEN75_3DSTATE_WM_PointRasterizationRule_start  34
   99132 #define GEN7_3DSTATE_WM_PointRasterizationRule_start  34
   99133 #define GEN6_3DSTATE_WM_PointRasterizationRule_start  201
   99134 
   99135 static inline uint32_t ATTRIBUTE_PURE
   99136 _3DSTATE_WM_PointRasterizationRule_start(const struct gen_device_info *devinfo)
   99137 {
   99138    switch (devinfo->gen) {
   99139    case 10: return 34;
   99140    case 9: return 34;
   99141    case 8: return 34;
   99142    case 7:
   99143       if (devinfo->is_haswell) {
   99144          return 34;
   99145       } else {
   99146          return 34;
   99147       }
   99148    case 6: return 201;
   99149    case 5: return 0;
   99150    case 4:
   99151       if (devinfo->is_g4x) {
   99152          return 0;
   99153       } else {
   99154          return 0;
   99155       }
   99156    default:
   99157       unreachable("Invalid hardware generation");
   99158    }
   99159 }
   99160 
   99161 
   99162 
   99163 /* 3DSTATE_WM::Polygon Stipple Enable */
   99164 
   99165 
   99166 #define GEN10_3DSTATE_WM_PolygonStippleEnable_bits  1
   99167 #define GEN9_3DSTATE_WM_PolygonStippleEnable_bits  1
   99168 #define GEN8_3DSTATE_WM_PolygonStippleEnable_bits  1
   99169 #define GEN75_3DSTATE_WM_PolygonStippleEnable_bits  1
   99170 #define GEN7_3DSTATE_WM_PolygonStippleEnable_bits  1
   99171 #define GEN6_3DSTATE_WM_PolygonStippleEnable_bits  1
   99172 
   99173 static inline uint32_t ATTRIBUTE_PURE
   99174 _3DSTATE_WM_PolygonStippleEnable_bits(const struct gen_device_info *devinfo)
   99175 {
   99176    switch (devinfo->gen) {
   99177    case 10: return 1;
   99178    case 9: return 1;
   99179    case 8: return 1;
   99180    case 7:
   99181       if (devinfo->is_haswell) {
   99182          return 1;
   99183       } else {
   99184          return 1;
   99185       }
   99186    case 6: return 1;
   99187    case 5: return 0;
   99188    case 4:
   99189       if (devinfo->is_g4x) {
   99190          return 0;
   99191       } else {
   99192          return 0;
   99193       }
   99194    default:
   99195       unreachable("Invalid hardware generation");
   99196    }
   99197 }
   99198 
   99199 
   99200 
   99201 #define GEN10_3DSTATE_WM_PolygonStippleEnable_start  36
   99202 #define GEN9_3DSTATE_WM_PolygonStippleEnable_start  36
   99203 #define GEN8_3DSTATE_WM_PolygonStippleEnable_start  36
   99204 #define GEN75_3DSTATE_WM_PolygonStippleEnable_start  36
   99205 #define GEN7_3DSTATE_WM_PolygonStippleEnable_start  36
   99206 #define GEN6_3DSTATE_WM_PolygonStippleEnable_start  173
   99207 
   99208 static inline uint32_t ATTRIBUTE_PURE
   99209 _3DSTATE_WM_PolygonStippleEnable_start(const struct gen_device_info *devinfo)
   99210 {
   99211    switch (devinfo->gen) {
   99212    case 10: return 36;
   99213    case 9: return 36;
   99214    case 8: return 36;
   99215    case 7:
   99216       if (devinfo->is_haswell) {
   99217          return 36;
   99218       } else {
   99219          return 36;
   99220       }
   99221    case 6: return 173;
   99222    case 5: return 0;
   99223    case 4:
   99224       if (devinfo->is_g4x) {
   99225          return 0;
   99226       } else {
   99227          return 0;
   99228       }
   99229    default:
   99230       unreachable("Invalid hardware generation");
   99231    }
   99232 }
   99233 
   99234 
   99235 
   99236 /* 3DSTATE_WM::Position XY Offset Select */
   99237 
   99238 
   99239 #define GEN6_3DSTATE_WM_PositionXYOffsetSelect_bits  2
   99240 
   99241 static inline uint32_t ATTRIBUTE_PURE
   99242 _3DSTATE_WM_PositionXYOffsetSelect_bits(const struct gen_device_info *devinfo)
   99243 {
   99244    switch (devinfo->gen) {
   99245    case 10: return 0;
   99246    case 9: return 0;
   99247    case 8: return 0;
   99248    case 7:
   99249       if (devinfo->is_haswell) {
   99250          return 0;
   99251       } else {
   99252          return 0;
   99253       }
   99254    case 6: return 2;
   99255    case 5: return 0;
   99256    case 4:
   99257       if (devinfo->is_g4x) {
   99258          return 0;
   99259       } else {
   99260          return 0;
   99261       }
   99262    default:
   99263       unreachable("Invalid hardware generation");
   99264    }
   99265 }
   99266 
   99267 
   99268 
   99269 #define GEN6_3DSTATE_WM_PositionXYOffsetSelect_start  210
   99270 
   99271 static inline uint32_t ATTRIBUTE_PURE
   99272 _3DSTATE_WM_PositionXYOffsetSelect_start(const struct gen_device_info *devinfo)
   99273 {
   99274    switch (devinfo->gen) {
   99275    case 10: return 0;
   99276    case 9: return 0;
   99277    case 8: return 0;
   99278    case 7:
   99279       if (devinfo->is_haswell) {
   99280          return 0;
   99281       } else {
   99282          return 0;
   99283       }
   99284    case 6: return 210;
   99285    case 5: return 0;
   99286    case 4:
   99287       if (devinfo->is_g4x) {
   99288          return 0;
   99289       } else {
   99290          return 0;
   99291       }
   99292    default:
   99293       unreachable("Invalid hardware generation");
   99294    }
   99295 }
   99296 
   99297 
   99298 
   99299 /* 3DSTATE_WM::Position ZW Interpolation Mode */
   99300 
   99301 
   99302 #define GEN10_3DSTATE_WM_PositionZWInterpolationMode_bits  2
   99303 #define GEN9_3DSTATE_WM_PositionZWInterpolationMode_bits  2
   99304 #define GEN8_3DSTATE_WM_PositionZWInterpolationMode_bits  2
   99305 #define GEN75_3DSTATE_WM_PositionZWInterpolationMode_bits  2
   99306 #define GEN7_3DSTATE_WM_PositionZWInterpolationMode_bits  2
   99307 #define GEN6_3DSTATE_WM_PositionZWInterpolationMode_bits  2
   99308 
   99309 static inline uint32_t ATTRIBUTE_PURE
   99310 _3DSTATE_WM_PositionZWInterpolationMode_bits(const struct gen_device_info *devinfo)
   99311 {
   99312    switch (devinfo->gen) {
   99313    case 10: return 2;
   99314    case 9: return 2;
   99315    case 8: return 2;
   99316    case 7:
   99317       if (devinfo->is_haswell) {
   99318          return 2;
   99319       } else {
   99320          return 2;
   99321       }
   99322    case 6: return 2;
   99323    case 5: return 0;
   99324    case 4:
   99325       if (devinfo->is_g4x) {
   99326          return 0;
   99327       } else {
   99328          return 0;
   99329       }
   99330    default:
   99331       unreachable("Invalid hardware generation");
   99332    }
   99333 }
   99334 
   99335 
   99336 
   99337 #define GEN10_3DSTATE_WM_PositionZWInterpolationMode_start  49
   99338 #define GEN9_3DSTATE_WM_PositionZWInterpolationMode_start  49
   99339 #define GEN8_3DSTATE_WM_PositionZWInterpolationMode_start  49
   99340 #define GEN75_3DSTATE_WM_PositionZWInterpolationMode_start  49
   99341 #define GEN7_3DSTATE_WM_PositionZWInterpolationMode_start  49
   99342 #define GEN6_3DSTATE_WM_PositionZWInterpolationMode_start  208
   99343 
   99344 static inline uint32_t ATTRIBUTE_PURE
   99345 _3DSTATE_WM_PositionZWInterpolationMode_start(const struct gen_device_info *devinfo)
   99346 {
   99347    switch (devinfo->gen) {
   99348    case 10: return 49;
   99349    case 9: return 49;
   99350    case 8: return 49;
   99351    case 7:
   99352       if (devinfo->is_haswell) {
   99353          return 49;
   99354       } else {
   99355          return 49;
   99356       }
   99357    case 6: return 208;
   99358    case 5: return 0;
   99359    case 4:
   99360       if (devinfo->is_g4x) {
   99361          return 0;
   99362       } else {
   99363          return 0;
   99364       }
   99365    default:
   99366       unreachable("Invalid hardware generation");
   99367    }
   99368 }
   99369 
   99370 
   99371 
   99372 /* 3DSTATE_WM::RT Independent Rasterization Enable */
   99373 
   99374 
   99375 #define GEN75_3DSTATE_WM_RTIndependentRasterizationEnable_bits  1
   99376 
   99377 static inline uint32_t ATTRIBUTE_PURE
   99378 _3DSTATE_WM_RTIndependentRasterizationEnable_bits(const struct gen_device_info *devinfo)
   99379 {
   99380    switch (devinfo->gen) {
   99381    case 10: return 0;
   99382    case 9: return 0;
   99383    case 8: return 0;
   99384    case 7:
   99385       if (devinfo->is_haswell) {
   99386          return 1;
   99387       } else {
   99388          return 0;
   99389       }
   99390    case 6: return 0;
   99391    case 5: return 0;
   99392    case 4:
   99393       if (devinfo->is_g4x) {
   99394          return 0;
   99395       } else {
   99396          return 0;
   99397       }
   99398    default:
   99399       unreachable("Invalid hardware generation");
   99400    }
   99401 }
   99402 
   99403 
   99404 
   99405 #define GEN75_3DSTATE_WM_RTIndependentRasterizationEnable_start  37
   99406 
   99407 static inline uint32_t ATTRIBUTE_PURE
   99408 _3DSTATE_WM_RTIndependentRasterizationEnable_start(const struct gen_device_info *devinfo)
   99409 {
   99410    switch (devinfo->gen) {
   99411    case 10: return 0;
   99412    case 9: return 0;
   99413    case 8: return 0;
   99414    case 7:
   99415       if (devinfo->is_haswell) {
   99416          return 37;
   99417       } else {
   99418          return 0;
   99419       }
   99420    case 6: return 0;
   99421    case 5: return 0;
   99422    case 4:
   99423       if (devinfo->is_g4x) {
   99424          return 0;
   99425       } else {
   99426          return 0;
   99427       }
   99428    default:
   99429       unreachable("Invalid hardware generation");
   99430    }
   99431 }
   99432 
   99433 
   99434 
   99435 /* 3DSTATE_WM::Sampler Count */
   99436 
   99437 
   99438 #define GEN6_3DSTATE_WM_SamplerCount_bits  3
   99439 
   99440 static inline uint32_t ATTRIBUTE_PURE
   99441 _3DSTATE_WM_SamplerCount_bits(const struct gen_device_info *devinfo)
   99442 {
   99443    switch (devinfo->gen) {
   99444    case 10: return 0;
   99445    case 9: return 0;
   99446    case 8: return 0;
   99447    case 7:
   99448       if (devinfo->is_haswell) {
   99449          return 0;
   99450       } else {
   99451          return 0;
   99452       }
   99453    case 6: return 3;
   99454    case 5: return 0;
   99455    case 4:
   99456       if (devinfo->is_g4x) {
   99457          return 0;
   99458       } else {
   99459          return 0;
   99460       }
   99461    default:
   99462       unreachable("Invalid hardware generation");
   99463    }
   99464 }
   99465 
   99466 
   99467 
   99468 #define GEN6_3DSTATE_WM_SamplerCount_start  91
   99469 
   99470 static inline uint32_t ATTRIBUTE_PURE
   99471 _3DSTATE_WM_SamplerCount_start(const struct gen_device_info *devinfo)
   99472 {
   99473    switch (devinfo->gen) {
   99474    case 10: return 0;
   99475    case 9: return 0;
   99476    case 8: return 0;
   99477    case 7:
   99478       if (devinfo->is_haswell) {
   99479          return 0;
   99480       } else {
   99481          return 0;
   99482       }
   99483    case 6: return 91;
   99484    case 5: return 0;
   99485    case 4:
   99486       if (devinfo->is_g4x) {
   99487          return 0;
   99488       } else {
   99489          return 0;
   99490       }
   99491    default:
   99492       unreachable("Invalid hardware generation");
   99493    }
   99494 }
   99495 
   99496 
   99497 
   99498 /* 3DSTATE_WM::Scratch Space Base Pointer */
   99499 
   99500 
   99501 #define GEN6_3DSTATE_WM_ScratchSpaceBasePointer_bits  22
   99502 
   99503 static inline uint32_t ATTRIBUTE_PURE
   99504 _3DSTATE_WM_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   99505 {
   99506    switch (devinfo->gen) {
   99507    case 10: return 0;
   99508    case 9: return 0;
   99509    case 8: return 0;
   99510    case 7:
   99511       if (devinfo->is_haswell) {
   99512          return 0;
   99513       } else {
   99514          return 0;
   99515       }
   99516    case 6: return 22;
   99517    case 5: return 0;
   99518    case 4:
   99519       if (devinfo->is_g4x) {
   99520          return 0;
   99521       } else {
   99522          return 0;
   99523       }
   99524    default:
   99525       unreachable("Invalid hardware generation");
   99526    }
   99527 }
   99528 
   99529 
   99530 
   99531 #define GEN6_3DSTATE_WM_ScratchSpaceBasePointer_start  106
   99532 
   99533 static inline uint32_t ATTRIBUTE_PURE
   99534 _3DSTATE_WM_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   99535 {
   99536    switch (devinfo->gen) {
   99537    case 10: return 0;
   99538    case 9: return 0;
   99539    case 8: return 0;
   99540    case 7:
   99541       if (devinfo->is_haswell) {
   99542          return 0;
   99543       } else {
   99544          return 0;
   99545       }
   99546    case 6: return 106;
   99547    case 5: return 0;
   99548    case 4:
   99549       if (devinfo->is_g4x) {
   99550          return 0;
   99551       } else {
   99552          return 0;
   99553       }
   99554    default:
   99555       unreachable("Invalid hardware generation");
   99556    }
   99557 }
   99558 
   99559 
   99560 
   99561 /* 3DSTATE_WM::Single Program Flow */
   99562 
   99563 
   99564 #define GEN6_3DSTATE_WM_SingleProgramFlow_bits  1
   99565 
   99566 static inline uint32_t ATTRIBUTE_PURE
   99567 _3DSTATE_WM_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   99568 {
   99569    switch (devinfo->gen) {
   99570    case 10: return 0;
   99571    case 9: return 0;
   99572    case 8: return 0;
   99573    case 7:
   99574       if (devinfo->is_haswell) {
   99575          return 0;
   99576       } else {
   99577          return 0;
   99578       }
   99579    case 6: return 1;
   99580    case 5: return 0;
   99581    case 4:
   99582       if (devinfo->is_g4x) {
   99583          return 0;
   99584       } else {
   99585          return 0;
   99586       }
   99587    default:
   99588       unreachable("Invalid hardware generation");
   99589    }
   99590 }
   99591 
   99592 
   99593 
   99594 #define GEN6_3DSTATE_WM_SingleProgramFlow_start  95
   99595 
   99596 static inline uint32_t ATTRIBUTE_PURE
   99597 _3DSTATE_WM_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   99598 {
   99599    switch (devinfo->gen) {
   99600    case 10: return 0;
   99601    case 9: return 0;
   99602    case 8: return 0;
   99603    case 7:
   99604       if (devinfo->is_haswell) {
   99605          return 0;
   99606       } else {
   99607          return 0;
   99608       }
   99609    case 6: return 95;
   99610    case 5: return 0;
   99611    case 4:
   99612       if (devinfo->is_g4x) {
   99613          return 0;
   99614       } else {
   99615          return 0;
   99616       }
   99617    default:
   99618       unreachable("Invalid hardware generation");
   99619    }
   99620 }
   99621 
   99622 
   99623 
   99624 /* 3DSTATE_WM::Software Exception Enable */
   99625 
   99626 
   99627 #define GEN6_3DSTATE_WM_SoftwareExceptionEnable_bits  1
   99628 
   99629 static inline uint32_t ATTRIBUTE_PURE
   99630 _3DSTATE_WM_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   99631 {
   99632    switch (devinfo->gen) {
   99633    case 10: return 0;
   99634    case 9: return 0;
   99635    case 8: return 0;
   99636    case 7:
   99637       if (devinfo->is_haswell) {
   99638          return 0;
   99639       } else {
   99640          return 0;
   99641       }
   99642    case 6: return 1;
   99643    case 5: return 0;
   99644    case 4:
   99645       if (devinfo->is_g4x) {
   99646          return 0;
   99647       } else {
   99648          return 0;
   99649       }
   99650    default:
   99651       unreachable("Invalid hardware generation");
   99652    }
   99653 }
   99654 
   99655 
   99656 
   99657 #define GEN6_3DSTATE_WM_SoftwareExceptionEnable_start  71
   99658 
   99659 static inline uint32_t ATTRIBUTE_PURE
   99660 _3DSTATE_WM_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   99661 {
   99662    switch (devinfo->gen) {
   99663    case 10: return 0;
   99664    case 9: return 0;
   99665    case 8: return 0;
   99666    case 7:
   99667       if (devinfo->is_haswell) {
   99668          return 0;
   99669       } else {
   99670          return 0;
   99671       }
   99672    case 6: return 71;
   99673    case 5: return 0;
   99674    case 4:
   99675       if (devinfo->is_g4x) {
   99676          return 0;
   99677       } else {
   99678          return 0;
   99679       }
   99680    default:
   99681       unreachable("Invalid hardware generation");
   99682    }
   99683 }
   99684 
   99685 
   99686 
   99687 /* 3DSTATE_WM::Statistics Enable */
   99688 
   99689 
   99690 #define GEN10_3DSTATE_WM_StatisticsEnable_bits  1
   99691 #define GEN9_3DSTATE_WM_StatisticsEnable_bits  1
   99692 #define GEN8_3DSTATE_WM_StatisticsEnable_bits  1
   99693 #define GEN75_3DSTATE_WM_StatisticsEnable_bits  1
   99694 #define GEN7_3DSTATE_WM_StatisticsEnable_bits  1
   99695 #define GEN6_3DSTATE_WM_StatisticsEnable_bits  1
   99696 
   99697 static inline uint32_t ATTRIBUTE_PURE
   99698 _3DSTATE_WM_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   99699 {
   99700    switch (devinfo->gen) {
   99701    case 10: return 1;
   99702    case 9: return 1;
   99703    case 8: return 1;
   99704    case 7:
   99705       if (devinfo->is_haswell) {
   99706          return 1;
   99707       } else {
   99708          return 1;
   99709       }
   99710    case 6: return 1;
   99711    case 5: return 0;
   99712    case 4:
   99713       if (devinfo->is_g4x) {
   99714          return 0;
   99715       } else {
   99716          return 0;
   99717       }
   99718    default:
   99719       unreachable("Invalid hardware generation");
   99720    }
   99721 }
   99722 
   99723 
   99724 
   99725 #define GEN10_3DSTATE_WM_StatisticsEnable_start  63
   99726 #define GEN9_3DSTATE_WM_StatisticsEnable_start  63
   99727 #define GEN8_3DSTATE_WM_StatisticsEnable_start  63
   99728 #define GEN75_3DSTATE_WM_StatisticsEnable_start  63
   99729 #define GEN7_3DSTATE_WM_StatisticsEnable_start  63
   99730 #define GEN6_3DSTATE_WM_StatisticsEnable_start  159
   99731 
   99732 static inline uint32_t ATTRIBUTE_PURE
   99733 _3DSTATE_WM_StatisticsEnable_start(const struct gen_device_info *devinfo)
   99734 {
   99735    switch (devinfo->gen) {
   99736    case 10: return 63;
   99737    case 9: return 63;
   99738    case 8: return 63;
   99739    case 7:
   99740       if (devinfo->is_haswell) {
   99741          return 63;
   99742       } else {
   99743          return 63;
   99744       }
   99745    case 6: return 159;
   99746    case 5: return 0;
   99747    case 4:
   99748       if (devinfo->is_g4x) {
   99749          return 0;
   99750       } else {
   99751          return 0;
   99752       }
   99753    default:
   99754       unreachable("Invalid hardware generation");
   99755    }
   99756 }
   99757 
   99758 
   99759 
   99760 /* 3DSTATE_WM::Thread Dispatch Enable */
   99761 
   99762 
   99763 #define GEN75_3DSTATE_WM_ThreadDispatchEnable_bits  1
   99764 #define GEN7_3DSTATE_WM_ThreadDispatchEnable_bits  1
   99765 #define GEN6_3DSTATE_WM_ThreadDispatchEnable_bits  1
   99766 
   99767 static inline uint32_t ATTRIBUTE_PURE
   99768 _3DSTATE_WM_ThreadDispatchEnable_bits(const struct gen_device_info *devinfo)
   99769 {
   99770    switch (devinfo->gen) {
   99771    case 10: return 0;
   99772    case 9: return 0;
   99773    case 8: return 0;
   99774    case 7:
   99775       if (devinfo->is_haswell) {
   99776          return 1;
   99777       } else {
   99778          return 1;
   99779       }
   99780    case 6: return 1;
   99781    case 5: return 0;
   99782    case 4:
   99783       if (devinfo->is_g4x) {
   99784          return 0;
   99785       } else {
   99786          return 0;
   99787       }
   99788    default:
   99789       unreachable("Invalid hardware generation");
   99790    }
   99791 }
   99792 
   99793 
   99794 
   99795 #define GEN75_3DSTATE_WM_ThreadDispatchEnable_start  61
   99796 #define GEN7_3DSTATE_WM_ThreadDispatchEnable_start  61
   99797 #define GEN6_3DSTATE_WM_ThreadDispatchEnable_start  179
   99798 
   99799 static inline uint32_t ATTRIBUTE_PURE
   99800 _3DSTATE_WM_ThreadDispatchEnable_start(const struct gen_device_info *devinfo)
   99801 {
   99802    switch (devinfo->gen) {
   99803    case 10: return 0;
   99804    case 9: return 0;
   99805    case 8: return 0;
   99806    case 7:
   99807       if (devinfo->is_haswell) {
   99808          return 61;
   99809       } else {
   99810          return 61;
   99811       }
   99812    case 6: return 179;
   99813    case 5: return 0;
   99814    case 4:
   99815       if (devinfo->is_g4x) {
   99816          return 0;
   99817       } else {
   99818          return 0;
   99819       }
   99820    default:
   99821       unreachable("Invalid hardware generation");
   99822    }
   99823 }
   99824 
   99825 
   99826 
   99827 /* 3DSTATE_WM::Thread Priority */
   99828 
   99829 
   99830 #define GEN6_3DSTATE_WM_ThreadPriority_bits  1
   99831 
   99832 static inline uint32_t ATTRIBUTE_PURE
   99833 _3DSTATE_WM_ThreadPriority_bits(const struct gen_device_info *devinfo)
   99834 {
   99835    switch (devinfo->gen) {
   99836    case 10: return 0;
   99837    case 9: return 0;
   99838    case 8: return 0;
   99839    case 7:
   99840       if (devinfo->is_haswell) {
   99841          return 0;
   99842       } else {
   99843          return 0;
   99844       }
   99845    case 6: return 1;
   99846    case 5: return 0;
   99847    case 4:
   99848       if (devinfo->is_g4x) {
   99849          return 0;
   99850       } else {
   99851          return 0;
   99852       }
   99853    default:
   99854       unreachable("Invalid hardware generation");
   99855    }
   99856 }
   99857 
   99858 
   99859 
   99860 #define GEN6_3DSTATE_WM_ThreadPriority_start  81
   99861 
   99862 static inline uint32_t ATTRIBUTE_PURE
   99863 _3DSTATE_WM_ThreadPriority_start(const struct gen_device_info *devinfo)
   99864 {
   99865    switch (devinfo->gen) {
   99866    case 10: return 0;
   99867    case 9: return 0;
   99868    case 8: return 0;
   99869    case 7:
   99870       if (devinfo->is_haswell) {
   99871          return 0;
   99872       } else {
   99873          return 0;
   99874       }
   99875    case 6: return 81;
   99876    case 5: return 0;
   99877    case 4:
   99878       if (devinfo->is_g4x) {
   99879          return 0;
   99880       } else {
   99881          return 0;
   99882       }
   99883    default:
   99884       unreachable("Invalid hardware generation");
   99885    }
   99886 }
   99887 
   99888 
   99889 
   99890 /* 3DSTATE_WM::Vector Mask Enable */
   99891 
   99892 
   99893 #define GEN6_3DSTATE_WM_VectorMaskEnable_bits  1
   99894 
   99895 static inline uint32_t ATTRIBUTE_PURE
   99896 _3DSTATE_WM_VectorMaskEnable_bits(const struct gen_device_info *devinfo)
   99897 {
   99898    switch (devinfo->gen) {
   99899    case 10: return 0;
   99900    case 9: return 0;
   99901    case 8: return 0;
   99902    case 7:
   99903       if (devinfo->is_haswell) {
   99904          return 0;
   99905       } else {
   99906          return 0;
   99907       }
   99908    case 6: return 1;
   99909    case 5: return 0;
   99910    case 4:
   99911       if (devinfo->is_g4x) {
   99912          return 0;
   99913       } else {
   99914          return 0;
   99915       }
   99916    default:
   99917       unreachable("Invalid hardware generation");
   99918    }
   99919 }
   99920 
   99921 
   99922 
   99923 #define GEN6_3DSTATE_WM_VectorMaskEnable_start  94
   99924 
   99925 static inline uint32_t ATTRIBUTE_PURE
   99926 _3DSTATE_WM_VectorMaskEnable_start(const struct gen_device_info *devinfo)
   99927 {
   99928    switch (devinfo->gen) {
   99929    case 10: return 0;
   99930    case 9: return 0;
   99931    case 8: return 0;
   99932    case 7:
   99933       if (devinfo->is_haswell) {
   99934          return 0;
   99935       } else {
   99936          return 0;
   99937       }
   99938    case 6: return 94;
   99939    case 5: return 0;
   99940    case 4:
   99941       if (devinfo->is_g4x) {
   99942          return 0;
   99943       } else {
   99944          return 0;
   99945       }
   99946    default:
   99947       unreachable("Invalid hardware generation");
   99948    }
   99949 }
   99950 
   99951 
   99952 
   99953 /* 3DSTATE_WM::oMask Present to RenderTarget */
   99954 
   99955 
   99956 #define GEN6_3DSTATE_WM_oMaskPresenttoRenderTarget_bits  1
   99957 
   99958 static inline uint32_t ATTRIBUTE_PURE
   99959 _3DSTATE_WM_oMaskPresenttoRenderTarget_bits(const struct gen_device_info *devinfo)
   99960 {
   99961    switch (devinfo->gen) {
   99962    case 10: return 0;
   99963    case 9: return 0;
   99964    case 8: return 0;
   99965    case 7:
   99966       if (devinfo->is_haswell) {
   99967          return 0;
   99968       } else {
   99969          return 0;
   99970       }
   99971    case 6: return 1;
   99972    case 5: return 0;
   99973    case 4:
   99974       if (devinfo->is_g4x) {
   99975          return 0;
   99976       } else {
   99977          return 0;
   99978       }
   99979    default:
   99980       unreachable("Invalid hardware generation");
   99981    }
   99982 }
   99983 
   99984 
   99985 
   99986 #define GEN6_3DSTATE_WM_oMaskPresenttoRenderTarget_start  169
   99987 
   99988 static inline uint32_t ATTRIBUTE_PURE
   99989 _3DSTATE_WM_oMaskPresenttoRenderTarget_start(const struct gen_device_info *devinfo)
   99990 {
   99991    switch (devinfo->gen) {
   99992    case 10: return 0;
   99993    case 9: return 0;
   99994    case 8: return 0;
   99995    case 7:
   99996       if (devinfo->is_haswell) {
   99997          return 0;
   99998       } else {
   99999          return 0;
   100000       }
   100001    case 6: return 169;
   100002    case 5: return 0;
   100003    case 4:
   100004       if (devinfo->is_g4x) {
   100005          return 0;
   100006       } else {
   100007          return 0;
   100008       }
   100009    default:
   100010       unreachable("Invalid hardware generation");
   100011    }
   100012 }
   100013 
   100014 
   100015 
   100016 /* 3DSTATE_WM_CHROMAKEY */
   100017 
   100018 
   100019 #define GEN10_3DSTATE_WM_CHROMAKEY_length  2
   100020 #define GEN9_3DSTATE_WM_CHROMAKEY_length  2
   100021 #define GEN8_3DSTATE_WM_CHROMAKEY_length  2
   100022 
   100023 static inline uint32_t ATTRIBUTE_PURE
   100024 _3DSTATE_WM_CHROMAKEY_length(const struct gen_device_info *devinfo)
   100025 {
   100026    switch (devinfo->gen) {
   100027    case 10: return 2;
   100028    case 9: return 2;
   100029    case 8: return 2;
   100030    case 7:
   100031       if (devinfo->is_haswell) {
   100032          return 0;
   100033       } else {
   100034          return 0;
   100035       }
   100036    case 6: return 0;
   100037    case 5: return 0;
   100038    case 4:
   100039       if (devinfo->is_g4x) {
   100040          return 0;
   100041       } else {
   100042          return 0;
   100043       }
   100044    default:
   100045       unreachable("Invalid hardware generation");
   100046    }
   100047 }
   100048 
   100049 
   100050 
   100051 /* 3DSTATE_WM_CHROMAKEY::3D Command Opcode */
   100052 
   100053 
   100054 #define GEN10_3DSTATE_WM_CHROMAKEY_3DCommandOpcode_bits  3
   100055 #define GEN9_3DSTATE_WM_CHROMAKEY_3DCommandOpcode_bits  3
   100056 #define GEN8_3DSTATE_WM_CHROMAKEY_3DCommandOpcode_bits  3
   100057 
   100058 static inline uint32_t ATTRIBUTE_PURE
   100059 _3DSTATE_WM_CHROMAKEY_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   100060 {
   100061    switch (devinfo->gen) {
   100062    case 10: return 3;
   100063    case 9: return 3;
   100064    case 8: return 3;
   100065    case 7:
   100066       if (devinfo->is_haswell) {
   100067          return 0;
   100068       } else {
   100069          return 0;
   100070       }
   100071    case 6: return 0;
   100072    case 5: return 0;
   100073    case 4:
   100074       if (devinfo->is_g4x) {
   100075          return 0;
   100076       } else {
   100077          return 0;
   100078       }
   100079    default:
   100080       unreachable("Invalid hardware generation");
   100081    }
   100082 }
   100083 
   100084 
   100085 
   100086 #define GEN10_3DSTATE_WM_CHROMAKEY_3DCommandOpcode_start  24
   100087 #define GEN9_3DSTATE_WM_CHROMAKEY_3DCommandOpcode_start  24
   100088 #define GEN8_3DSTATE_WM_CHROMAKEY_3DCommandOpcode_start  24
   100089 
   100090 static inline uint32_t ATTRIBUTE_PURE
   100091 _3DSTATE_WM_CHROMAKEY_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   100092 {
   100093    switch (devinfo->gen) {
   100094    case 10: return 24;
   100095    case 9: return 24;
   100096    case 8: return 24;
   100097    case 7:
   100098       if (devinfo->is_haswell) {
   100099          return 0;
   100100       } else {
   100101          return 0;
   100102       }
   100103    case 6: return 0;
   100104    case 5: return 0;
   100105    case 4:
   100106       if (devinfo->is_g4x) {
   100107          return 0;
   100108       } else {
   100109          return 0;
   100110       }
   100111    default:
   100112       unreachable("Invalid hardware generation");
   100113    }
   100114 }
   100115 
   100116 
   100117 
   100118 /* 3DSTATE_WM_CHROMAKEY::3D Command Sub Opcode */
   100119 
   100120 
   100121 #define GEN10_3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_bits  8
   100122 #define GEN9_3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_bits  8
   100123 #define GEN8_3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_bits  8
   100124 
   100125 static inline uint32_t ATTRIBUTE_PURE
   100126 _3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   100127 {
   100128    switch (devinfo->gen) {
   100129    case 10: return 8;
   100130    case 9: return 8;
   100131    case 8: return 8;
   100132    case 7:
   100133       if (devinfo->is_haswell) {
   100134          return 0;
   100135       } else {
   100136          return 0;
   100137       }
   100138    case 6: return 0;
   100139    case 5: return 0;
   100140    case 4:
   100141       if (devinfo->is_g4x) {
   100142          return 0;
   100143       } else {
   100144          return 0;
   100145       }
   100146    default:
   100147       unreachable("Invalid hardware generation");
   100148    }
   100149 }
   100150 
   100151 
   100152 
   100153 #define GEN10_3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_start  16
   100154 #define GEN9_3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_start  16
   100155 #define GEN8_3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_start  16
   100156 
   100157 static inline uint32_t ATTRIBUTE_PURE
   100158 _3DSTATE_WM_CHROMAKEY_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   100159 {
   100160    switch (devinfo->gen) {
   100161    case 10: return 16;
   100162    case 9: return 16;
   100163    case 8: return 16;
   100164    case 7:
   100165       if (devinfo->is_haswell) {
   100166          return 0;
   100167       } else {
   100168          return 0;
   100169       }
   100170    case 6: return 0;
   100171    case 5: return 0;
   100172    case 4:
   100173       if (devinfo->is_g4x) {
   100174          return 0;
   100175       } else {
   100176          return 0;
   100177       }
   100178    default:
   100179       unreachable("Invalid hardware generation");
   100180    }
   100181 }
   100182 
   100183 
   100184 
   100185 /* 3DSTATE_WM_CHROMAKEY::ChromaKey Kill Enable */
   100186 
   100187 
   100188 #define GEN10_3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_bits  1
   100189 #define GEN9_3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_bits  1
   100190 #define GEN8_3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_bits  1
   100191 
   100192 static inline uint32_t ATTRIBUTE_PURE
   100193 _3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_bits(const struct gen_device_info *devinfo)
   100194 {
   100195    switch (devinfo->gen) {
   100196    case 10: return 1;
   100197    case 9: return 1;
   100198    case 8: return 1;
   100199    case 7:
   100200       if (devinfo->is_haswell) {
   100201          return 0;
   100202       } else {
   100203          return 0;
   100204       }
   100205    case 6: return 0;
   100206    case 5: return 0;
   100207    case 4:
   100208       if (devinfo->is_g4x) {
   100209          return 0;
   100210       } else {
   100211          return 0;
   100212       }
   100213    default:
   100214       unreachable("Invalid hardware generation");
   100215    }
   100216 }
   100217 
   100218 
   100219 
   100220 #define GEN10_3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_start  63
   100221 #define GEN9_3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_start  63
   100222 #define GEN8_3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_start  63
   100223 
   100224 static inline uint32_t ATTRIBUTE_PURE
   100225 _3DSTATE_WM_CHROMAKEY_ChromaKeyKillEnable_start(const struct gen_device_info *devinfo)
   100226 {
   100227    switch (devinfo->gen) {
   100228    case 10: return 63;
   100229    case 9: return 63;
   100230    case 8: return 63;
   100231    case 7:
   100232       if (devinfo->is_haswell) {
   100233          return 0;
   100234       } else {
   100235          return 0;
   100236       }
   100237    case 6: return 0;
   100238    case 5: return 0;
   100239    case 4:
   100240       if (devinfo->is_g4x) {
   100241          return 0;
   100242       } else {
   100243          return 0;
   100244       }
   100245    default:
   100246       unreachable("Invalid hardware generation");
   100247    }
   100248 }
   100249 
   100250 
   100251 
   100252 /* 3DSTATE_WM_CHROMAKEY::Command SubType */
   100253 
   100254 
   100255 #define GEN10_3DSTATE_WM_CHROMAKEY_CommandSubType_bits  2
   100256 #define GEN9_3DSTATE_WM_CHROMAKEY_CommandSubType_bits  2
   100257 #define GEN8_3DSTATE_WM_CHROMAKEY_CommandSubType_bits  2
   100258 
   100259 static inline uint32_t ATTRIBUTE_PURE
   100260 _3DSTATE_WM_CHROMAKEY_CommandSubType_bits(const struct gen_device_info *devinfo)
   100261 {
   100262    switch (devinfo->gen) {
   100263    case 10: return 2;
   100264    case 9: return 2;
   100265    case 8: return 2;
   100266    case 7:
   100267       if (devinfo->is_haswell) {
   100268          return 0;
   100269       } else {
   100270          return 0;
   100271       }
   100272    case 6: return 0;
   100273    case 5: return 0;
   100274    case 4:
   100275       if (devinfo->is_g4x) {
   100276          return 0;
   100277       } else {
   100278          return 0;
   100279       }
   100280    default:
   100281       unreachable("Invalid hardware generation");
   100282    }
   100283 }
   100284 
   100285 
   100286 
   100287 #define GEN10_3DSTATE_WM_CHROMAKEY_CommandSubType_start  27
   100288 #define GEN9_3DSTATE_WM_CHROMAKEY_CommandSubType_start  27
   100289 #define GEN8_3DSTATE_WM_CHROMAKEY_CommandSubType_start  27
   100290 
   100291 static inline uint32_t ATTRIBUTE_PURE
   100292 _3DSTATE_WM_CHROMAKEY_CommandSubType_start(const struct gen_device_info *devinfo)
   100293 {
   100294    switch (devinfo->gen) {
   100295    case 10: return 27;
   100296    case 9: return 27;
   100297    case 8: return 27;
   100298    case 7:
   100299       if (devinfo->is_haswell) {
   100300          return 0;
   100301       } else {
   100302          return 0;
   100303       }
   100304    case 6: return 0;
   100305    case 5: return 0;
   100306    case 4:
   100307       if (devinfo->is_g4x) {
   100308          return 0;
   100309       } else {
   100310          return 0;
   100311       }
   100312    default:
   100313       unreachable("Invalid hardware generation");
   100314    }
   100315 }
   100316 
   100317 
   100318 
   100319 /* 3DSTATE_WM_CHROMAKEY::Command Type */
   100320 
   100321 
   100322 #define GEN10_3DSTATE_WM_CHROMAKEY_CommandType_bits  3
   100323 #define GEN9_3DSTATE_WM_CHROMAKEY_CommandType_bits  3
   100324 #define GEN8_3DSTATE_WM_CHROMAKEY_CommandType_bits  3
   100325 
   100326 static inline uint32_t ATTRIBUTE_PURE
   100327 _3DSTATE_WM_CHROMAKEY_CommandType_bits(const struct gen_device_info *devinfo)
   100328 {
   100329    switch (devinfo->gen) {
   100330    case 10: return 3;
   100331    case 9: return 3;
   100332    case 8: return 3;
   100333    case 7:
   100334       if (devinfo->is_haswell) {
   100335          return 0;
   100336       } else {
   100337          return 0;
   100338       }
   100339    case 6: return 0;
   100340    case 5: return 0;
   100341    case 4:
   100342       if (devinfo->is_g4x) {
   100343          return 0;
   100344       } else {
   100345          return 0;
   100346       }
   100347    default:
   100348       unreachable("Invalid hardware generation");
   100349    }
   100350 }
   100351 
   100352 
   100353 
   100354 #define GEN10_3DSTATE_WM_CHROMAKEY_CommandType_start  29
   100355 #define GEN9_3DSTATE_WM_CHROMAKEY_CommandType_start  29
   100356 #define GEN8_3DSTATE_WM_CHROMAKEY_CommandType_start  29
   100357 
   100358 static inline uint32_t ATTRIBUTE_PURE
   100359 _3DSTATE_WM_CHROMAKEY_CommandType_start(const struct gen_device_info *devinfo)
   100360 {
   100361    switch (devinfo->gen) {
   100362    case 10: return 29;
   100363    case 9: return 29;
   100364    case 8: return 29;
   100365    case 7:
   100366       if (devinfo->is_haswell) {
   100367          return 0;
   100368       } else {
   100369          return 0;
   100370       }
   100371    case 6: return 0;
   100372    case 5: return 0;
   100373    case 4:
   100374       if (devinfo->is_g4x) {
   100375          return 0;
   100376       } else {
   100377          return 0;
   100378       }
   100379    default:
   100380       unreachable("Invalid hardware generation");
   100381    }
   100382 }
   100383 
   100384 
   100385 
   100386 /* 3DSTATE_WM_CHROMAKEY::DWord Length */
   100387 
   100388 
   100389 #define GEN10_3DSTATE_WM_CHROMAKEY_DWordLength_bits  8
   100390 #define GEN9_3DSTATE_WM_CHROMAKEY_DWordLength_bits  8
   100391 #define GEN8_3DSTATE_WM_CHROMAKEY_DWordLength_bits  8
   100392 
   100393 static inline uint32_t ATTRIBUTE_PURE
   100394 _3DSTATE_WM_CHROMAKEY_DWordLength_bits(const struct gen_device_info *devinfo)
   100395 {
   100396    switch (devinfo->gen) {
   100397    case 10: return 8;
   100398    case 9: return 8;
   100399    case 8: return 8;
   100400    case 7:
   100401       if (devinfo->is_haswell) {
   100402          return 0;
   100403       } else {
   100404          return 0;
   100405       }
   100406    case 6: return 0;
   100407    case 5: return 0;
   100408    case 4:
   100409       if (devinfo->is_g4x) {
   100410          return 0;
   100411       } else {
   100412          return 0;
   100413       }
   100414    default:
   100415       unreachable("Invalid hardware generation");
   100416    }
   100417 }
   100418 
   100419 
   100420 
   100421 #define GEN10_3DSTATE_WM_CHROMAKEY_DWordLength_start  0
   100422 #define GEN9_3DSTATE_WM_CHROMAKEY_DWordLength_start  0
   100423 #define GEN8_3DSTATE_WM_CHROMAKEY_DWordLength_start  0
   100424 
   100425 static inline uint32_t ATTRIBUTE_PURE
   100426 _3DSTATE_WM_CHROMAKEY_DWordLength_start(const struct gen_device_info *devinfo)
   100427 {
   100428    switch (devinfo->gen) {
   100429    case 10: return 0;
   100430    case 9: return 0;
   100431    case 8: return 0;
   100432    case 7:
   100433       if (devinfo->is_haswell) {
   100434          return 0;
   100435       } else {
   100436          return 0;
   100437       }
   100438    case 6: return 0;
   100439    case 5: return 0;
   100440    case 4:
   100441       if (devinfo->is_g4x) {
   100442          return 0;
   100443       } else {
   100444          return 0;
   100445       }
   100446    default:
   100447       unreachable("Invalid hardware generation");
   100448    }
   100449 }
   100450 
   100451 
   100452 
   100453 /* 3DSTATE_WM_DEPTH_STENCIL */
   100454 
   100455 
   100456 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_length  4
   100457 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_length  4
   100458 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_length  3
   100459 
   100460 static inline uint32_t ATTRIBUTE_PURE
   100461 _3DSTATE_WM_DEPTH_STENCIL_length(const struct gen_device_info *devinfo)
   100462 {
   100463    switch (devinfo->gen) {
   100464    case 10: return 4;
   100465    case 9: return 4;
   100466    case 8: return 3;
   100467    case 7:
   100468       if (devinfo->is_haswell) {
   100469          return 0;
   100470       } else {
   100471          return 0;
   100472       }
   100473    case 6: return 0;
   100474    case 5: return 0;
   100475    case 4:
   100476       if (devinfo->is_g4x) {
   100477          return 0;
   100478       } else {
   100479          return 0;
   100480       }
   100481    default:
   100482       unreachable("Invalid hardware generation");
   100483    }
   100484 }
   100485 
   100486 
   100487 
   100488 /* 3DSTATE_WM_DEPTH_STENCIL::3D Command Opcode */
   100489 
   100490 
   100491 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_bits  3
   100492 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_bits  3
   100493 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_bits  3
   100494 
   100495 static inline uint32_t ATTRIBUTE_PURE
   100496 _3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   100497 {
   100498    switch (devinfo->gen) {
   100499    case 10: return 3;
   100500    case 9: return 3;
   100501    case 8: return 3;
   100502    case 7:
   100503       if (devinfo->is_haswell) {
   100504          return 0;
   100505       } else {
   100506          return 0;
   100507       }
   100508    case 6: return 0;
   100509    case 5: return 0;
   100510    case 4:
   100511       if (devinfo->is_g4x) {
   100512          return 0;
   100513       } else {
   100514          return 0;
   100515       }
   100516    default:
   100517       unreachable("Invalid hardware generation");
   100518    }
   100519 }
   100520 
   100521 
   100522 
   100523 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_start  24
   100524 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_start  24
   100525 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_start  24
   100526 
   100527 static inline uint32_t ATTRIBUTE_PURE
   100528 _3DSTATE_WM_DEPTH_STENCIL_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   100529 {
   100530    switch (devinfo->gen) {
   100531    case 10: return 24;
   100532    case 9: return 24;
   100533    case 8: return 24;
   100534    case 7:
   100535       if (devinfo->is_haswell) {
   100536          return 0;
   100537       } else {
   100538          return 0;
   100539       }
   100540    case 6: return 0;
   100541    case 5: return 0;
   100542    case 4:
   100543       if (devinfo->is_g4x) {
   100544          return 0;
   100545       } else {
   100546          return 0;
   100547       }
   100548    default:
   100549       unreachable("Invalid hardware generation");
   100550    }
   100551 }
   100552 
   100553 
   100554 
   100555 /* 3DSTATE_WM_DEPTH_STENCIL::3D Command Sub Opcode */
   100556 
   100557 
   100558 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_bits  8
   100559 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_bits  8
   100560 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_bits  8
   100561 
   100562 static inline uint32_t ATTRIBUTE_PURE
   100563 _3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   100564 {
   100565    switch (devinfo->gen) {
   100566    case 10: return 8;
   100567    case 9: return 8;
   100568    case 8: return 8;
   100569    case 7:
   100570       if (devinfo->is_haswell) {
   100571          return 0;
   100572       } else {
   100573          return 0;
   100574       }
   100575    case 6: return 0;
   100576    case 5: return 0;
   100577    case 4:
   100578       if (devinfo->is_g4x) {
   100579          return 0;
   100580       } else {
   100581          return 0;
   100582       }
   100583    default:
   100584       unreachable("Invalid hardware generation");
   100585    }
   100586 }
   100587 
   100588 
   100589 
   100590 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_start  16
   100591 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_start  16
   100592 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_start  16
   100593 
   100594 static inline uint32_t ATTRIBUTE_PURE
   100595 _3DSTATE_WM_DEPTH_STENCIL_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   100596 {
   100597    switch (devinfo->gen) {
   100598    case 10: return 16;
   100599    case 9: return 16;
   100600    case 8: return 16;
   100601    case 7:
   100602       if (devinfo->is_haswell) {
   100603          return 0;
   100604       } else {
   100605          return 0;
   100606       }
   100607    case 6: return 0;
   100608    case 5: return 0;
   100609    case 4:
   100610       if (devinfo->is_g4x) {
   100611          return 0;
   100612       } else {
   100613          return 0;
   100614       }
   100615    default:
   100616       unreachable("Invalid hardware generation");
   100617    }
   100618 }
   100619 
   100620 
   100621 
   100622 /* 3DSTATE_WM_DEPTH_STENCIL::Backface Stencil Fail Op */
   100623 
   100624 
   100625 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_bits  3
   100626 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_bits  3
   100627 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_bits  3
   100628 
   100629 static inline uint32_t ATTRIBUTE_PURE
   100630 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_bits(const struct gen_device_info *devinfo)
   100631 {
   100632    switch (devinfo->gen) {
   100633    case 10: return 3;
   100634    case 9: return 3;
   100635    case 8: return 3;
   100636    case 7:
   100637       if (devinfo->is_haswell) {
   100638          return 0;
   100639       } else {
   100640          return 0;
   100641       }
   100642    case 6: return 0;
   100643    case 5: return 0;
   100644    case 4:
   100645       if (devinfo->is_g4x) {
   100646          return 0;
   100647       } else {
   100648          return 0;
   100649       }
   100650    default:
   100651       unreachable("Invalid hardware generation");
   100652    }
   100653 }
   100654 
   100655 
   100656 
   100657 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_start  49
   100658 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_start  49
   100659 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_start  49
   100660 
   100661 static inline uint32_t ATTRIBUTE_PURE
   100662 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilFailOp_start(const struct gen_device_info *devinfo)
   100663 {
   100664    switch (devinfo->gen) {
   100665    case 10: return 49;
   100666    case 9: return 49;
   100667    case 8: return 49;
   100668    case 7:
   100669       if (devinfo->is_haswell) {
   100670          return 0;
   100671       } else {
   100672          return 0;
   100673       }
   100674    case 6: return 0;
   100675    case 5: return 0;
   100676    case 4:
   100677       if (devinfo->is_g4x) {
   100678          return 0;
   100679       } else {
   100680          return 0;
   100681       }
   100682    default:
   100683       unreachable("Invalid hardware generation");
   100684    }
   100685 }
   100686 
   100687 
   100688 
   100689 /* 3DSTATE_WM_DEPTH_STENCIL::Backface Stencil Pass Depth Fail Op */
   100690 
   100691 
   100692 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_bits  3
   100693 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_bits  3
   100694 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_bits  3
   100695 
   100696 static inline uint32_t ATTRIBUTE_PURE
   100697 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_bits(const struct gen_device_info *devinfo)
   100698 {
   100699    switch (devinfo->gen) {
   100700    case 10: return 3;
   100701    case 9: return 3;
   100702    case 8: return 3;
   100703    case 7:
   100704       if (devinfo->is_haswell) {
   100705          return 0;
   100706       } else {
   100707          return 0;
   100708       }
   100709    case 6: return 0;
   100710    case 5: return 0;
   100711    case 4:
   100712       if (devinfo->is_g4x) {
   100713          return 0;
   100714       } else {
   100715          return 0;
   100716       }
   100717    default:
   100718       unreachable("Invalid hardware generation");
   100719    }
   100720 }
   100721 
   100722 
   100723 
   100724 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_start  46
   100725 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_start  46
   100726 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_start  46
   100727 
   100728 static inline uint32_t ATTRIBUTE_PURE
   100729 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthFailOp_start(const struct gen_device_info *devinfo)
   100730 {
   100731    switch (devinfo->gen) {
   100732    case 10: return 46;
   100733    case 9: return 46;
   100734    case 8: return 46;
   100735    case 7:
   100736       if (devinfo->is_haswell) {
   100737          return 0;
   100738       } else {
   100739          return 0;
   100740       }
   100741    case 6: return 0;
   100742    case 5: return 0;
   100743    case 4:
   100744       if (devinfo->is_g4x) {
   100745          return 0;
   100746       } else {
   100747          return 0;
   100748       }
   100749    default:
   100750       unreachable("Invalid hardware generation");
   100751    }
   100752 }
   100753 
   100754 
   100755 
   100756 /* 3DSTATE_WM_DEPTH_STENCIL::Backface Stencil Pass Depth Pass Op */
   100757 
   100758 
   100759 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_bits  3
   100760 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_bits  3
   100761 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_bits  3
   100762 
   100763 static inline uint32_t ATTRIBUTE_PURE
   100764 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_bits(const struct gen_device_info *devinfo)
   100765 {
   100766    switch (devinfo->gen) {
   100767    case 10: return 3;
   100768    case 9: return 3;
   100769    case 8: return 3;
   100770    case 7:
   100771       if (devinfo->is_haswell) {
   100772          return 0;
   100773       } else {
   100774          return 0;
   100775       }
   100776    case 6: return 0;
   100777    case 5: return 0;
   100778    case 4:
   100779       if (devinfo->is_g4x) {
   100780          return 0;
   100781       } else {
   100782          return 0;
   100783       }
   100784    default:
   100785       unreachable("Invalid hardware generation");
   100786    }
   100787 }
   100788 
   100789 
   100790 
   100791 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_start  43
   100792 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_start  43
   100793 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_start  43
   100794 
   100795 static inline uint32_t ATTRIBUTE_PURE
   100796 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilPassDepthPassOp_start(const struct gen_device_info *devinfo)
   100797 {
   100798    switch (devinfo->gen) {
   100799    case 10: return 43;
   100800    case 9: return 43;
   100801    case 8: return 43;
   100802    case 7:
   100803       if (devinfo->is_haswell) {
   100804          return 0;
   100805       } else {
   100806          return 0;
   100807       }
   100808    case 6: return 0;
   100809    case 5: return 0;
   100810    case 4:
   100811       if (devinfo->is_g4x) {
   100812          return 0;
   100813       } else {
   100814          return 0;
   100815       }
   100816    default:
   100817       unreachable("Invalid hardware generation");
   100818    }
   100819 }
   100820 
   100821 
   100822 
   100823 /* 3DSTATE_WM_DEPTH_STENCIL::Backface Stencil Reference Value */
   100824 
   100825 
   100826 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilReferenceValue_bits  8
   100827 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilReferenceValue_bits  8
   100828 
   100829 static inline uint32_t ATTRIBUTE_PURE
   100830 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilReferenceValue_bits(const struct gen_device_info *devinfo)
   100831 {
   100832    switch (devinfo->gen) {
   100833    case 10: return 8;
   100834    case 9: return 8;
   100835    case 8: return 0;
   100836    case 7:
   100837       if (devinfo->is_haswell) {
   100838          return 0;
   100839       } else {
   100840          return 0;
   100841       }
   100842    case 6: return 0;
   100843    case 5: return 0;
   100844    case 4:
   100845       if (devinfo->is_g4x) {
   100846          return 0;
   100847       } else {
   100848          return 0;
   100849       }
   100850    default:
   100851       unreachable("Invalid hardware generation");
   100852    }
   100853 }
   100854 
   100855 
   100856 
   100857 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilReferenceValue_start  96
   100858 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilReferenceValue_start  96
   100859 
   100860 static inline uint32_t ATTRIBUTE_PURE
   100861 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilReferenceValue_start(const struct gen_device_info *devinfo)
   100862 {
   100863    switch (devinfo->gen) {
   100864    case 10: return 96;
   100865    case 9: return 96;
   100866    case 8: return 0;
   100867    case 7:
   100868       if (devinfo->is_haswell) {
   100869          return 0;
   100870       } else {
   100871          return 0;
   100872       }
   100873    case 6: return 0;
   100874    case 5: return 0;
   100875    case 4:
   100876       if (devinfo->is_g4x) {
   100877          return 0;
   100878       } else {
   100879          return 0;
   100880       }
   100881    default:
   100882       unreachable("Invalid hardware generation");
   100883    }
   100884 }
   100885 
   100886 
   100887 
   100888 /* 3DSTATE_WM_DEPTH_STENCIL::Backface Stencil Test Function */
   100889 
   100890 
   100891 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_bits  3
   100892 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_bits  3
   100893 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_bits  3
   100894 
   100895 static inline uint32_t ATTRIBUTE_PURE
   100896 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_bits(const struct gen_device_info *devinfo)
   100897 {
   100898    switch (devinfo->gen) {
   100899    case 10: return 3;
   100900    case 9: return 3;
   100901    case 8: return 3;
   100902    case 7:
   100903       if (devinfo->is_haswell) {
   100904          return 0;
   100905       } else {
   100906          return 0;
   100907       }
   100908    case 6: return 0;
   100909    case 5: return 0;
   100910    case 4:
   100911       if (devinfo->is_g4x) {
   100912          return 0;
   100913       } else {
   100914          return 0;
   100915       }
   100916    default:
   100917       unreachable("Invalid hardware generation");
   100918    }
   100919 }
   100920 
   100921 
   100922 
   100923 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_start  52
   100924 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_start  52
   100925 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_start  52
   100926 
   100927 static inline uint32_t ATTRIBUTE_PURE
   100928 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestFunction_start(const struct gen_device_info *devinfo)
   100929 {
   100930    switch (devinfo->gen) {
   100931    case 10: return 52;
   100932    case 9: return 52;
   100933    case 8: return 52;
   100934    case 7:
   100935       if (devinfo->is_haswell) {
   100936          return 0;
   100937       } else {
   100938          return 0;
   100939       }
   100940    case 6: return 0;
   100941    case 5: return 0;
   100942    case 4:
   100943       if (devinfo->is_g4x) {
   100944          return 0;
   100945       } else {
   100946          return 0;
   100947       }
   100948    default:
   100949       unreachable("Invalid hardware generation");
   100950    }
   100951 }
   100952 
   100953 
   100954 
   100955 /* 3DSTATE_WM_DEPTH_STENCIL::Backface Stencil Test Mask */
   100956 
   100957 
   100958 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_bits  8
   100959 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_bits  8
   100960 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_bits  8
   100961 
   100962 static inline uint32_t ATTRIBUTE_PURE
   100963 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_bits(const struct gen_device_info *devinfo)
   100964 {
   100965    switch (devinfo->gen) {
   100966    case 10: return 8;
   100967    case 9: return 8;
   100968    case 8: return 8;
   100969    case 7:
   100970       if (devinfo->is_haswell) {
   100971          return 0;
   100972       } else {
   100973          return 0;
   100974       }
   100975    case 6: return 0;
   100976    case 5: return 0;
   100977    case 4:
   100978       if (devinfo->is_g4x) {
   100979          return 0;
   100980       } else {
   100981          return 0;
   100982       }
   100983    default:
   100984       unreachable("Invalid hardware generation");
   100985    }
   100986 }
   100987 
   100988 
   100989 
   100990 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_start  72
   100991 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_start  72
   100992 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_start  72
   100993 
   100994 static inline uint32_t ATTRIBUTE_PURE
   100995 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilTestMask_start(const struct gen_device_info *devinfo)
   100996 {
   100997    switch (devinfo->gen) {
   100998    case 10: return 72;
   100999    case 9: return 72;
   101000    case 8: return 72;
   101001    case 7:
   101002       if (devinfo->is_haswell) {
   101003          return 0;
   101004       } else {
   101005          return 0;
   101006       }
   101007    case 6: return 0;
   101008    case 5: return 0;
   101009    case 4:
   101010       if (devinfo->is_g4x) {
   101011          return 0;
   101012       } else {
   101013          return 0;
   101014       }
   101015    default:
   101016       unreachable("Invalid hardware generation");
   101017    }
   101018 }
   101019 
   101020 
   101021 
   101022 /* 3DSTATE_WM_DEPTH_STENCIL::Backface Stencil Write Mask */
   101023 
   101024 
   101025 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_bits  8
   101026 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_bits  8
   101027 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_bits  8
   101028 
   101029 static inline uint32_t ATTRIBUTE_PURE
   101030 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_bits(const struct gen_device_info *devinfo)
   101031 {
   101032    switch (devinfo->gen) {
   101033    case 10: return 8;
   101034    case 9: return 8;
   101035    case 8: return 8;
   101036    case 7:
   101037       if (devinfo->is_haswell) {
   101038          return 0;
   101039       } else {
   101040          return 0;
   101041       }
   101042    case 6: return 0;
   101043    case 5: return 0;
   101044    case 4:
   101045       if (devinfo->is_g4x) {
   101046          return 0;
   101047       } else {
   101048          return 0;
   101049       }
   101050    default:
   101051       unreachable("Invalid hardware generation");
   101052    }
   101053 }
   101054 
   101055 
   101056 
   101057 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_start  64
   101058 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_start  64
   101059 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_start  64
   101060 
   101061 static inline uint32_t ATTRIBUTE_PURE
   101062 _3DSTATE_WM_DEPTH_STENCIL_BackfaceStencilWriteMask_start(const struct gen_device_info *devinfo)
   101063 {
   101064    switch (devinfo->gen) {
   101065    case 10: return 64;
   101066    case 9: return 64;
   101067    case 8: return 64;
   101068    case 7:
   101069       if (devinfo->is_haswell) {
   101070          return 0;
   101071       } else {
   101072          return 0;
   101073       }
   101074    case 6: return 0;
   101075    case 5: return 0;
   101076    case 4:
   101077       if (devinfo->is_g4x) {
   101078          return 0;
   101079       } else {
   101080          return 0;
   101081       }
   101082    default:
   101083       unreachable("Invalid hardware generation");
   101084    }
   101085 }
   101086 
   101087 
   101088 
   101089 /* 3DSTATE_WM_DEPTH_STENCIL::Command SubType */
   101090 
   101091 
   101092 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_CommandSubType_bits  2
   101093 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_CommandSubType_bits  2
   101094 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_CommandSubType_bits  2
   101095 
   101096 static inline uint32_t ATTRIBUTE_PURE
   101097 _3DSTATE_WM_DEPTH_STENCIL_CommandSubType_bits(const struct gen_device_info *devinfo)
   101098 {
   101099    switch (devinfo->gen) {
   101100    case 10: return 2;
   101101    case 9: return 2;
   101102    case 8: return 2;
   101103    case 7:
   101104       if (devinfo->is_haswell) {
   101105          return 0;
   101106       } else {
   101107          return 0;
   101108       }
   101109    case 6: return 0;
   101110    case 5: return 0;
   101111    case 4:
   101112       if (devinfo->is_g4x) {
   101113          return 0;
   101114       } else {
   101115          return 0;
   101116       }
   101117    default:
   101118       unreachable("Invalid hardware generation");
   101119    }
   101120 }
   101121 
   101122 
   101123 
   101124 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_CommandSubType_start  27
   101125 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_CommandSubType_start  27
   101126 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_CommandSubType_start  27
   101127 
   101128 static inline uint32_t ATTRIBUTE_PURE
   101129 _3DSTATE_WM_DEPTH_STENCIL_CommandSubType_start(const struct gen_device_info *devinfo)
   101130 {
   101131    switch (devinfo->gen) {
   101132    case 10: return 27;
   101133    case 9: return 27;
   101134    case 8: return 27;
   101135    case 7:
   101136       if (devinfo->is_haswell) {
   101137          return 0;
   101138       } else {
   101139          return 0;
   101140       }
   101141    case 6: return 0;
   101142    case 5: return 0;
   101143    case 4:
   101144       if (devinfo->is_g4x) {
   101145          return 0;
   101146       } else {
   101147          return 0;
   101148       }
   101149    default:
   101150       unreachable("Invalid hardware generation");
   101151    }
   101152 }
   101153 
   101154 
   101155 
   101156 /* 3DSTATE_WM_DEPTH_STENCIL::Command Type */
   101157 
   101158 
   101159 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_CommandType_bits  3
   101160 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_CommandType_bits  3
   101161 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_CommandType_bits  3
   101162 
   101163 static inline uint32_t ATTRIBUTE_PURE
   101164 _3DSTATE_WM_DEPTH_STENCIL_CommandType_bits(const struct gen_device_info *devinfo)
   101165 {
   101166    switch (devinfo->gen) {
   101167    case 10: return 3;
   101168    case 9: return 3;
   101169    case 8: return 3;
   101170    case 7:
   101171       if (devinfo->is_haswell) {
   101172          return 0;
   101173       } else {
   101174          return 0;
   101175       }
   101176    case 6: return 0;
   101177    case 5: return 0;
   101178    case 4:
   101179       if (devinfo->is_g4x) {
   101180          return 0;
   101181       } else {
   101182          return 0;
   101183       }
   101184    default:
   101185       unreachable("Invalid hardware generation");
   101186    }
   101187 }
   101188 
   101189 
   101190 
   101191 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_CommandType_start  29
   101192 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_CommandType_start  29
   101193 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_CommandType_start  29
   101194 
   101195 static inline uint32_t ATTRIBUTE_PURE
   101196 _3DSTATE_WM_DEPTH_STENCIL_CommandType_start(const struct gen_device_info *devinfo)
   101197 {
   101198    switch (devinfo->gen) {
   101199    case 10: return 29;
   101200    case 9: return 29;
   101201    case 8: return 29;
   101202    case 7:
   101203       if (devinfo->is_haswell) {
   101204          return 0;
   101205       } else {
   101206          return 0;
   101207       }
   101208    case 6: return 0;
   101209    case 5: return 0;
   101210    case 4:
   101211       if (devinfo->is_g4x) {
   101212          return 0;
   101213       } else {
   101214          return 0;
   101215       }
   101216    default:
   101217       unreachable("Invalid hardware generation");
   101218    }
   101219 }
   101220 
   101221 
   101222 
   101223 /* 3DSTATE_WM_DEPTH_STENCIL::DWord Length */
   101224 
   101225 
   101226 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DWordLength_bits  8
   101227 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DWordLength_bits  8
   101228 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DWordLength_bits  8
   101229 
   101230 static inline uint32_t ATTRIBUTE_PURE
   101231 _3DSTATE_WM_DEPTH_STENCIL_DWordLength_bits(const struct gen_device_info *devinfo)
   101232 {
   101233    switch (devinfo->gen) {
   101234    case 10: return 8;
   101235    case 9: return 8;
   101236    case 8: return 8;
   101237    case 7:
   101238       if (devinfo->is_haswell) {
   101239          return 0;
   101240       } else {
   101241          return 0;
   101242       }
   101243    case 6: return 0;
   101244    case 5: return 0;
   101245    case 4:
   101246       if (devinfo->is_g4x) {
   101247          return 0;
   101248       } else {
   101249          return 0;
   101250       }
   101251    default:
   101252       unreachable("Invalid hardware generation");
   101253    }
   101254 }
   101255 
   101256 
   101257 
   101258 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DWordLength_start  0
   101259 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DWordLength_start  0
   101260 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DWordLength_start  0
   101261 
   101262 static inline uint32_t ATTRIBUTE_PURE
   101263 _3DSTATE_WM_DEPTH_STENCIL_DWordLength_start(const struct gen_device_info *devinfo)
   101264 {
   101265    switch (devinfo->gen) {
   101266    case 10: return 0;
   101267    case 9: return 0;
   101268    case 8: return 0;
   101269    case 7:
   101270       if (devinfo->is_haswell) {
   101271          return 0;
   101272       } else {
   101273          return 0;
   101274       }
   101275    case 6: return 0;
   101276    case 5: return 0;
   101277    case 4:
   101278       if (devinfo->is_g4x) {
   101279          return 0;
   101280       } else {
   101281          return 0;
   101282       }
   101283    default:
   101284       unreachable("Invalid hardware generation");
   101285    }
   101286 }
   101287 
   101288 
   101289 
   101290 /* 3DSTATE_WM_DEPTH_STENCIL::Depth Buffer Write Enable */
   101291 
   101292 
   101293 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_bits  1
   101294 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_bits  1
   101295 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_bits  1
   101296 
   101297 static inline uint32_t ATTRIBUTE_PURE
   101298 _3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_bits(const struct gen_device_info *devinfo)
   101299 {
   101300    switch (devinfo->gen) {
   101301    case 10: return 1;
   101302    case 9: return 1;
   101303    case 8: return 1;
   101304    case 7:
   101305       if (devinfo->is_haswell) {
   101306          return 0;
   101307       } else {
   101308          return 0;
   101309       }
   101310    case 6: return 0;
   101311    case 5: return 0;
   101312    case 4:
   101313       if (devinfo->is_g4x) {
   101314          return 0;
   101315       } else {
   101316          return 0;
   101317       }
   101318    default:
   101319       unreachable("Invalid hardware generation");
   101320    }
   101321 }
   101322 
   101323 
   101324 
   101325 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_start  32
   101326 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_start  32
   101327 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_start  32
   101328 
   101329 static inline uint32_t ATTRIBUTE_PURE
   101330 _3DSTATE_WM_DEPTH_STENCIL_DepthBufferWriteEnable_start(const struct gen_device_info *devinfo)
   101331 {
   101332    switch (devinfo->gen) {
   101333    case 10: return 32;
   101334    case 9: return 32;
   101335    case 8: return 32;
   101336    case 7:
   101337       if (devinfo->is_haswell) {
   101338          return 0;
   101339       } else {
   101340          return 0;
   101341       }
   101342    case 6: return 0;
   101343    case 5: return 0;
   101344    case 4:
   101345       if (devinfo->is_g4x) {
   101346          return 0;
   101347       } else {
   101348          return 0;
   101349       }
   101350    default:
   101351       unreachable("Invalid hardware generation");
   101352    }
   101353 }
   101354 
   101355 
   101356 
   101357 /* 3DSTATE_WM_DEPTH_STENCIL::Depth Test Enable */
   101358 
   101359 
   101360 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_bits  1
   101361 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_bits  1
   101362 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_bits  1
   101363 
   101364 static inline uint32_t ATTRIBUTE_PURE
   101365 _3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_bits(const struct gen_device_info *devinfo)
   101366 {
   101367    switch (devinfo->gen) {
   101368    case 10: return 1;
   101369    case 9: return 1;
   101370    case 8: return 1;
   101371    case 7:
   101372       if (devinfo->is_haswell) {
   101373          return 0;
   101374       } else {
   101375          return 0;
   101376       }
   101377    case 6: return 0;
   101378    case 5: return 0;
   101379    case 4:
   101380       if (devinfo->is_g4x) {
   101381          return 0;
   101382       } else {
   101383          return 0;
   101384       }
   101385    default:
   101386       unreachable("Invalid hardware generation");
   101387    }
   101388 }
   101389 
   101390 
   101391 
   101392 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_start  33
   101393 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_start  33
   101394 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_start  33
   101395 
   101396 static inline uint32_t ATTRIBUTE_PURE
   101397 _3DSTATE_WM_DEPTH_STENCIL_DepthTestEnable_start(const struct gen_device_info *devinfo)
   101398 {
   101399    switch (devinfo->gen) {
   101400    case 10: return 33;
   101401    case 9: return 33;
   101402    case 8: return 33;
   101403    case 7:
   101404       if (devinfo->is_haswell) {
   101405          return 0;
   101406       } else {
   101407          return 0;
   101408       }
   101409    case 6: return 0;
   101410    case 5: return 0;
   101411    case 4:
   101412       if (devinfo->is_g4x) {
   101413          return 0;
   101414       } else {
   101415          return 0;
   101416       }
   101417    default:
   101418       unreachable("Invalid hardware generation");
   101419    }
   101420 }
   101421 
   101422 
   101423 
   101424 /* 3DSTATE_WM_DEPTH_STENCIL::Depth Test Function */
   101425 
   101426 
   101427 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_bits  3
   101428 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_bits  3
   101429 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_bits  3
   101430 
   101431 static inline uint32_t ATTRIBUTE_PURE
   101432 _3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_bits(const struct gen_device_info *devinfo)
   101433 {
   101434    switch (devinfo->gen) {
   101435    case 10: return 3;
   101436    case 9: return 3;
   101437    case 8: return 3;
   101438    case 7:
   101439       if (devinfo->is_haswell) {
   101440          return 0;
   101441       } else {
   101442          return 0;
   101443       }
   101444    case 6: return 0;
   101445    case 5: return 0;
   101446    case 4:
   101447       if (devinfo->is_g4x) {
   101448          return 0;
   101449       } else {
   101450          return 0;
   101451       }
   101452    default:
   101453       unreachable("Invalid hardware generation");
   101454    }
   101455 }
   101456 
   101457 
   101458 
   101459 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_start  37
   101460 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_start  37
   101461 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_start  37
   101462 
   101463 static inline uint32_t ATTRIBUTE_PURE
   101464 _3DSTATE_WM_DEPTH_STENCIL_DepthTestFunction_start(const struct gen_device_info *devinfo)
   101465 {
   101466    switch (devinfo->gen) {
   101467    case 10: return 37;
   101468    case 9: return 37;
   101469    case 8: return 37;
   101470    case 7:
   101471       if (devinfo->is_haswell) {
   101472          return 0;
   101473       } else {
   101474          return 0;
   101475       }
   101476    case 6: return 0;
   101477    case 5: return 0;
   101478    case 4:
   101479       if (devinfo->is_g4x) {
   101480          return 0;
   101481       } else {
   101482          return 0;
   101483       }
   101484    default:
   101485       unreachable("Invalid hardware generation");
   101486    }
   101487 }
   101488 
   101489 
   101490 
   101491 /* 3DSTATE_WM_DEPTH_STENCIL::Double Sided Stencil Enable */
   101492 
   101493 
   101494 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_bits  1
   101495 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_bits  1
   101496 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_bits  1
   101497 
   101498 static inline uint32_t ATTRIBUTE_PURE
   101499 _3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_bits(const struct gen_device_info *devinfo)
   101500 {
   101501    switch (devinfo->gen) {
   101502    case 10: return 1;
   101503    case 9: return 1;
   101504    case 8: return 1;
   101505    case 7:
   101506       if (devinfo->is_haswell) {
   101507          return 0;
   101508       } else {
   101509          return 0;
   101510       }
   101511    case 6: return 0;
   101512    case 5: return 0;
   101513    case 4:
   101514       if (devinfo->is_g4x) {
   101515          return 0;
   101516       } else {
   101517          return 0;
   101518       }
   101519    default:
   101520       unreachable("Invalid hardware generation");
   101521    }
   101522 }
   101523 
   101524 
   101525 
   101526 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_start  36
   101527 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_start  36
   101528 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_start  36
   101529 
   101530 static inline uint32_t ATTRIBUTE_PURE
   101531 _3DSTATE_WM_DEPTH_STENCIL_DoubleSidedStencilEnable_start(const struct gen_device_info *devinfo)
   101532 {
   101533    switch (devinfo->gen) {
   101534    case 10: return 36;
   101535    case 9: return 36;
   101536    case 8: return 36;
   101537    case 7:
   101538       if (devinfo->is_haswell) {
   101539          return 0;
   101540       } else {
   101541          return 0;
   101542       }
   101543    case 6: return 0;
   101544    case 5: return 0;
   101545    case 4:
   101546       if (devinfo->is_g4x) {
   101547          return 0;
   101548       } else {
   101549          return 0;
   101550       }
   101551    default:
   101552       unreachable("Invalid hardware generation");
   101553    }
   101554 }
   101555 
   101556 
   101557 
   101558 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Buffer Write Enable */
   101559 
   101560 
   101561 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_bits  1
   101562 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_bits  1
   101563 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_bits  1
   101564 
   101565 static inline uint32_t ATTRIBUTE_PURE
   101566 _3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_bits(const struct gen_device_info *devinfo)
   101567 {
   101568    switch (devinfo->gen) {
   101569    case 10: return 1;
   101570    case 9: return 1;
   101571    case 8: return 1;
   101572    case 7:
   101573       if (devinfo->is_haswell) {
   101574          return 0;
   101575       } else {
   101576          return 0;
   101577       }
   101578    case 6: return 0;
   101579    case 5: return 0;
   101580    case 4:
   101581       if (devinfo->is_g4x) {
   101582          return 0;
   101583       } else {
   101584          return 0;
   101585       }
   101586    default:
   101587       unreachable("Invalid hardware generation");
   101588    }
   101589 }
   101590 
   101591 
   101592 
   101593 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_start  34
   101594 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_start  34
   101595 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_start  34
   101596 
   101597 static inline uint32_t ATTRIBUTE_PURE
   101598 _3DSTATE_WM_DEPTH_STENCIL_StencilBufferWriteEnable_start(const struct gen_device_info *devinfo)
   101599 {
   101600    switch (devinfo->gen) {
   101601    case 10: return 34;
   101602    case 9: return 34;
   101603    case 8: return 34;
   101604    case 7:
   101605       if (devinfo->is_haswell) {
   101606          return 0;
   101607       } else {
   101608          return 0;
   101609       }
   101610    case 6: return 0;
   101611    case 5: return 0;
   101612    case 4:
   101613       if (devinfo->is_g4x) {
   101614          return 0;
   101615       } else {
   101616          return 0;
   101617       }
   101618    default:
   101619       unreachable("Invalid hardware generation");
   101620    }
   101621 }
   101622 
   101623 
   101624 
   101625 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Fail Op */
   101626 
   101627 
   101628 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_bits  3
   101629 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_bits  3
   101630 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_bits  3
   101631 
   101632 static inline uint32_t ATTRIBUTE_PURE
   101633 _3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_bits(const struct gen_device_info *devinfo)
   101634 {
   101635    switch (devinfo->gen) {
   101636    case 10: return 3;
   101637    case 9: return 3;
   101638    case 8: return 3;
   101639    case 7:
   101640       if (devinfo->is_haswell) {
   101641          return 0;
   101642       } else {
   101643          return 0;
   101644       }
   101645    case 6: return 0;
   101646    case 5: return 0;
   101647    case 4:
   101648       if (devinfo->is_g4x) {
   101649          return 0;
   101650       } else {
   101651          return 0;
   101652       }
   101653    default:
   101654       unreachable("Invalid hardware generation");
   101655    }
   101656 }
   101657 
   101658 
   101659 
   101660 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_start  61
   101661 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_start  61
   101662 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_start  61
   101663 
   101664 static inline uint32_t ATTRIBUTE_PURE
   101665 _3DSTATE_WM_DEPTH_STENCIL_StencilFailOp_start(const struct gen_device_info *devinfo)
   101666 {
   101667    switch (devinfo->gen) {
   101668    case 10: return 61;
   101669    case 9: return 61;
   101670    case 8: return 61;
   101671    case 7:
   101672       if (devinfo->is_haswell) {
   101673          return 0;
   101674       } else {
   101675          return 0;
   101676       }
   101677    case 6: return 0;
   101678    case 5: return 0;
   101679    case 4:
   101680       if (devinfo->is_g4x) {
   101681          return 0;
   101682       } else {
   101683          return 0;
   101684       }
   101685    default:
   101686       unreachable("Invalid hardware generation");
   101687    }
   101688 }
   101689 
   101690 
   101691 
   101692 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Pass Depth Fail Op */
   101693 
   101694 
   101695 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_bits  3
   101696 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_bits  3
   101697 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_bits  3
   101698 
   101699 static inline uint32_t ATTRIBUTE_PURE
   101700 _3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_bits(const struct gen_device_info *devinfo)
   101701 {
   101702    switch (devinfo->gen) {
   101703    case 10: return 3;
   101704    case 9: return 3;
   101705    case 8: return 3;
   101706    case 7:
   101707       if (devinfo->is_haswell) {
   101708          return 0;
   101709       } else {
   101710          return 0;
   101711       }
   101712    case 6: return 0;
   101713    case 5: return 0;
   101714    case 4:
   101715       if (devinfo->is_g4x) {
   101716          return 0;
   101717       } else {
   101718          return 0;
   101719       }
   101720    default:
   101721       unreachable("Invalid hardware generation");
   101722    }
   101723 }
   101724 
   101725 
   101726 
   101727 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_start  58
   101728 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_start  58
   101729 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_start  58
   101730 
   101731 static inline uint32_t ATTRIBUTE_PURE
   101732 _3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthFailOp_start(const struct gen_device_info *devinfo)
   101733 {
   101734    switch (devinfo->gen) {
   101735    case 10: return 58;
   101736    case 9: return 58;
   101737    case 8: return 58;
   101738    case 7:
   101739       if (devinfo->is_haswell) {
   101740          return 0;
   101741       } else {
   101742          return 0;
   101743       }
   101744    case 6: return 0;
   101745    case 5: return 0;
   101746    case 4:
   101747       if (devinfo->is_g4x) {
   101748          return 0;
   101749       } else {
   101750          return 0;
   101751       }
   101752    default:
   101753       unreachable("Invalid hardware generation");
   101754    }
   101755 }
   101756 
   101757 
   101758 
   101759 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Pass Depth Pass Op */
   101760 
   101761 
   101762 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_bits  3
   101763 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_bits  3
   101764 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_bits  3
   101765 
   101766 static inline uint32_t ATTRIBUTE_PURE
   101767 _3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_bits(const struct gen_device_info *devinfo)
   101768 {
   101769    switch (devinfo->gen) {
   101770    case 10: return 3;
   101771    case 9: return 3;
   101772    case 8: return 3;
   101773    case 7:
   101774       if (devinfo->is_haswell) {
   101775          return 0;
   101776       } else {
   101777          return 0;
   101778       }
   101779    case 6: return 0;
   101780    case 5: return 0;
   101781    case 4:
   101782       if (devinfo->is_g4x) {
   101783          return 0;
   101784       } else {
   101785          return 0;
   101786       }
   101787    default:
   101788       unreachable("Invalid hardware generation");
   101789    }
   101790 }
   101791 
   101792 
   101793 
   101794 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_start  55
   101795 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_start  55
   101796 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_start  55
   101797 
   101798 static inline uint32_t ATTRIBUTE_PURE
   101799 _3DSTATE_WM_DEPTH_STENCIL_StencilPassDepthPassOp_start(const struct gen_device_info *devinfo)
   101800 {
   101801    switch (devinfo->gen) {
   101802    case 10: return 55;
   101803    case 9: return 55;
   101804    case 8: return 55;
   101805    case 7:
   101806       if (devinfo->is_haswell) {
   101807          return 0;
   101808       } else {
   101809          return 0;
   101810       }
   101811    case 6: return 0;
   101812    case 5: return 0;
   101813    case 4:
   101814       if (devinfo->is_g4x) {
   101815          return 0;
   101816       } else {
   101817          return 0;
   101818       }
   101819    default:
   101820       unreachable("Invalid hardware generation");
   101821    }
   101822 }
   101823 
   101824 
   101825 
   101826 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Reference Value */
   101827 
   101828 
   101829 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilReferenceValue_bits  8
   101830 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilReferenceValue_bits  8
   101831 
   101832 static inline uint32_t ATTRIBUTE_PURE
   101833 _3DSTATE_WM_DEPTH_STENCIL_StencilReferenceValue_bits(const struct gen_device_info *devinfo)
   101834 {
   101835    switch (devinfo->gen) {
   101836    case 10: return 8;
   101837    case 9: return 8;
   101838    case 8: return 0;
   101839    case 7:
   101840       if (devinfo->is_haswell) {
   101841          return 0;
   101842       } else {
   101843          return 0;
   101844       }
   101845    case 6: return 0;
   101846    case 5: return 0;
   101847    case 4:
   101848       if (devinfo->is_g4x) {
   101849          return 0;
   101850       } else {
   101851          return 0;
   101852       }
   101853    default:
   101854       unreachable("Invalid hardware generation");
   101855    }
   101856 }
   101857 
   101858 
   101859 
   101860 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilReferenceValue_start  104
   101861 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilReferenceValue_start  104
   101862 
   101863 static inline uint32_t ATTRIBUTE_PURE
   101864 _3DSTATE_WM_DEPTH_STENCIL_StencilReferenceValue_start(const struct gen_device_info *devinfo)
   101865 {
   101866    switch (devinfo->gen) {
   101867    case 10: return 104;
   101868    case 9: return 104;
   101869    case 8: return 0;
   101870    case 7:
   101871       if (devinfo->is_haswell) {
   101872          return 0;
   101873       } else {
   101874          return 0;
   101875       }
   101876    case 6: return 0;
   101877    case 5: return 0;
   101878    case 4:
   101879       if (devinfo->is_g4x) {
   101880          return 0;
   101881       } else {
   101882          return 0;
   101883       }
   101884    default:
   101885       unreachable("Invalid hardware generation");
   101886    }
   101887 }
   101888 
   101889 
   101890 
   101891 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Test Enable */
   101892 
   101893 
   101894 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_bits  1
   101895 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_bits  1
   101896 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_bits  1
   101897 
   101898 static inline uint32_t ATTRIBUTE_PURE
   101899 _3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_bits(const struct gen_device_info *devinfo)
   101900 {
   101901    switch (devinfo->gen) {
   101902    case 10: return 1;
   101903    case 9: return 1;
   101904    case 8: return 1;
   101905    case 7:
   101906       if (devinfo->is_haswell) {
   101907          return 0;
   101908       } else {
   101909          return 0;
   101910       }
   101911    case 6: return 0;
   101912    case 5: return 0;
   101913    case 4:
   101914       if (devinfo->is_g4x) {
   101915          return 0;
   101916       } else {
   101917          return 0;
   101918       }
   101919    default:
   101920       unreachable("Invalid hardware generation");
   101921    }
   101922 }
   101923 
   101924 
   101925 
   101926 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_start  35
   101927 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_start  35
   101928 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_start  35
   101929 
   101930 static inline uint32_t ATTRIBUTE_PURE
   101931 _3DSTATE_WM_DEPTH_STENCIL_StencilTestEnable_start(const struct gen_device_info *devinfo)
   101932 {
   101933    switch (devinfo->gen) {
   101934    case 10: return 35;
   101935    case 9: return 35;
   101936    case 8: return 35;
   101937    case 7:
   101938       if (devinfo->is_haswell) {
   101939          return 0;
   101940       } else {
   101941          return 0;
   101942       }
   101943    case 6: return 0;
   101944    case 5: return 0;
   101945    case 4:
   101946       if (devinfo->is_g4x) {
   101947          return 0;
   101948       } else {
   101949          return 0;
   101950       }
   101951    default:
   101952       unreachable("Invalid hardware generation");
   101953    }
   101954 }
   101955 
   101956 
   101957 
   101958 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Test Function */
   101959 
   101960 
   101961 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_bits  3
   101962 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_bits  3
   101963 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_bits  3
   101964 
   101965 static inline uint32_t ATTRIBUTE_PURE
   101966 _3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_bits(const struct gen_device_info *devinfo)
   101967 {
   101968    switch (devinfo->gen) {
   101969    case 10: return 3;
   101970    case 9: return 3;
   101971    case 8: return 3;
   101972    case 7:
   101973       if (devinfo->is_haswell) {
   101974          return 0;
   101975       } else {
   101976          return 0;
   101977       }
   101978    case 6: return 0;
   101979    case 5: return 0;
   101980    case 4:
   101981       if (devinfo->is_g4x) {
   101982          return 0;
   101983       } else {
   101984          return 0;
   101985       }
   101986    default:
   101987       unreachable("Invalid hardware generation");
   101988    }
   101989 }
   101990 
   101991 
   101992 
   101993 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_start  40
   101994 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_start  40
   101995 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_start  40
   101996 
   101997 static inline uint32_t ATTRIBUTE_PURE
   101998 _3DSTATE_WM_DEPTH_STENCIL_StencilTestFunction_start(const struct gen_device_info *devinfo)
   101999 {
   102000    switch (devinfo->gen) {
   102001    case 10: return 40;
   102002    case 9: return 40;
   102003    case 8: return 40;
   102004    case 7:
   102005       if (devinfo->is_haswell) {
   102006          return 0;
   102007       } else {
   102008          return 0;
   102009       }
   102010    case 6: return 0;
   102011    case 5: return 0;
   102012    case 4:
   102013       if (devinfo->is_g4x) {
   102014          return 0;
   102015       } else {
   102016          return 0;
   102017       }
   102018    default:
   102019       unreachable("Invalid hardware generation");
   102020    }
   102021 }
   102022 
   102023 
   102024 
   102025 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Test Mask */
   102026 
   102027 
   102028 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_bits  8
   102029 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_bits  8
   102030 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_bits  8
   102031 
   102032 static inline uint32_t ATTRIBUTE_PURE
   102033 _3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_bits(const struct gen_device_info *devinfo)
   102034 {
   102035    switch (devinfo->gen) {
   102036    case 10: return 8;
   102037    case 9: return 8;
   102038    case 8: return 8;
   102039    case 7:
   102040       if (devinfo->is_haswell) {
   102041          return 0;
   102042       } else {
   102043          return 0;
   102044       }
   102045    case 6: return 0;
   102046    case 5: return 0;
   102047    case 4:
   102048       if (devinfo->is_g4x) {
   102049          return 0;
   102050       } else {
   102051          return 0;
   102052       }
   102053    default:
   102054       unreachable("Invalid hardware generation");
   102055    }
   102056 }
   102057 
   102058 
   102059 
   102060 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_start  88
   102061 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_start  88
   102062 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_start  88
   102063 
   102064 static inline uint32_t ATTRIBUTE_PURE
   102065 _3DSTATE_WM_DEPTH_STENCIL_StencilTestMask_start(const struct gen_device_info *devinfo)
   102066 {
   102067    switch (devinfo->gen) {
   102068    case 10: return 88;
   102069    case 9: return 88;
   102070    case 8: return 88;
   102071    case 7:
   102072       if (devinfo->is_haswell) {
   102073          return 0;
   102074       } else {
   102075          return 0;
   102076       }
   102077    case 6: return 0;
   102078    case 5: return 0;
   102079    case 4:
   102080       if (devinfo->is_g4x) {
   102081          return 0;
   102082       } else {
   102083          return 0;
   102084       }
   102085    default:
   102086       unreachable("Invalid hardware generation");
   102087    }
   102088 }
   102089 
   102090 
   102091 
   102092 /* 3DSTATE_WM_DEPTH_STENCIL::Stencil Write Mask */
   102093 
   102094 
   102095 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_bits  8
   102096 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_bits  8
   102097 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_bits  8
   102098 
   102099 static inline uint32_t ATTRIBUTE_PURE
   102100 _3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_bits(const struct gen_device_info *devinfo)
   102101 {
   102102    switch (devinfo->gen) {
   102103    case 10: return 8;
   102104    case 9: return 8;
   102105    case 8: return 8;
   102106    case 7:
   102107       if (devinfo->is_haswell) {
   102108          return 0;
   102109       } else {
   102110          return 0;
   102111       }
   102112    case 6: return 0;
   102113    case 5: return 0;
   102114    case 4:
   102115       if (devinfo->is_g4x) {
   102116          return 0;
   102117       } else {
   102118          return 0;
   102119       }
   102120    default:
   102121       unreachable("Invalid hardware generation");
   102122    }
   102123 }
   102124 
   102125 
   102126 
   102127 #define GEN10_3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_start  80
   102128 #define GEN9_3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_start  80
   102129 #define GEN8_3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_start  80
   102130 
   102131 static inline uint32_t ATTRIBUTE_PURE
   102132 _3DSTATE_WM_DEPTH_STENCIL_StencilWriteMask_start(const struct gen_device_info *devinfo)
   102133 {
   102134    switch (devinfo->gen) {
   102135    case 10: return 80;
   102136    case 9: return 80;
   102137    case 8: return 80;
   102138    case 7:
   102139       if (devinfo->is_haswell) {
   102140          return 0;
   102141       } else {
   102142          return 0;
   102143       }
   102144    case 6: return 0;
   102145    case 5: return 0;
   102146    case 4:
   102147       if (devinfo->is_g4x) {
   102148          return 0;
   102149       } else {
   102150          return 0;
   102151       }
   102152    default:
   102153       unreachable("Invalid hardware generation");
   102154    }
   102155 }
   102156 
   102157 
   102158 
   102159 /* 3DSTATE_WM_HZ_OP */
   102160 
   102161 
   102162 #define GEN10_3DSTATE_WM_HZ_OP_length  5
   102163 #define GEN9_3DSTATE_WM_HZ_OP_length  5
   102164 #define GEN8_3DSTATE_WM_HZ_OP_length  5
   102165 
   102166 static inline uint32_t ATTRIBUTE_PURE
   102167 _3DSTATE_WM_HZ_OP_length(const struct gen_device_info *devinfo)
   102168 {
   102169    switch (devinfo->gen) {
   102170    case 10: return 5;
   102171    case 9: return 5;
   102172    case 8: return 5;
   102173    case 7:
   102174       if (devinfo->is_haswell) {
   102175          return 0;
   102176       } else {
   102177          return 0;
   102178       }
   102179    case 6: return 0;
   102180    case 5: return 0;
   102181    case 4:
   102182       if (devinfo->is_g4x) {
   102183          return 0;
   102184       } else {
   102185          return 0;
   102186       }
   102187    default:
   102188       unreachable("Invalid hardware generation");
   102189    }
   102190 }
   102191 
   102192 
   102193 
   102194 /* 3DSTATE_WM_HZ_OP::3D Command Opcode */
   102195 
   102196 
   102197 #define GEN10_3DSTATE_WM_HZ_OP_3DCommandOpcode_bits  3
   102198 #define GEN9_3DSTATE_WM_HZ_OP_3DCommandOpcode_bits  3
   102199 #define GEN8_3DSTATE_WM_HZ_OP_3DCommandOpcode_bits  3
   102200 
   102201 static inline uint32_t ATTRIBUTE_PURE
   102202 _3DSTATE_WM_HZ_OP_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   102203 {
   102204    switch (devinfo->gen) {
   102205    case 10: return 3;
   102206    case 9: return 3;
   102207    case 8: return 3;
   102208    case 7:
   102209       if (devinfo->is_haswell) {
   102210          return 0;
   102211       } else {
   102212          return 0;
   102213       }
   102214    case 6: return 0;
   102215    case 5: return 0;
   102216    case 4:
   102217       if (devinfo->is_g4x) {
   102218          return 0;
   102219       } else {
   102220          return 0;
   102221       }
   102222    default:
   102223       unreachable("Invalid hardware generation");
   102224    }
   102225 }
   102226 
   102227 
   102228 
   102229 #define GEN10_3DSTATE_WM_HZ_OP_3DCommandOpcode_start  24
   102230 #define GEN9_3DSTATE_WM_HZ_OP_3DCommandOpcode_start  24
   102231 #define GEN8_3DSTATE_WM_HZ_OP_3DCommandOpcode_start  24
   102232 
   102233 static inline uint32_t ATTRIBUTE_PURE
   102234 _3DSTATE_WM_HZ_OP_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   102235 {
   102236    switch (devinfo->gen) {
   102237    case 10: return 24;
   102238    case 9: return 24;
   102239    case 8: return 24;
   102240    case 7:
   102241       if (devinfo->is_haswell) {
   102242          return 0;
   102243       } else {
   102244          return 0;
   102245       }
   102246    case 6: return 0;
   102247    case 5: return 0;
   102248    case 4:
   102249       if (devinfo->is_g4x) {
   102250          return 0;
   102251       } else {
   102252          return 0;
   102253       }
   102254    default:
   102255       unreachable("Invalid hardware generation");
   102256    }
   102257 }
   102258 
   102259 
   102260 
   102261 /* 3DSTATE_WM_HZ_OP::3D Command Sub Opcode */
   102262 
   102263 
   102264 #define GEN10_3DSTATE_WM_HZ_OP_3DCommandSubOpcode_bits  8
   102265 #define GEN9_3DSTATE_WM_HZ_OP_3DCommandSubOpcode_bits  8
   102266 #define GEN8_3DSTATE_WM_HZ_OP_3DCommandSubOpcode_bits  8
   102267 
   102268 static inline uint32_t ATTRIBUTE_PURE
   102269 _3DSTATE_WM_HZ_OP_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   102270 {
   102271    switch (devinfo->gen) {
   102272    case 10: return 8;
   102273    case 9: return 8;
   102274    case 8: return 8;
   102275    case 7:
   102276       if (devinfo->is_haswell) {
   102277          return 0;
   102278       } else {
   102279          return 0;
   102280       }
   102281    case 6: return 0;
   102282    case 5: return 0;
   102283    case 4:
   102284       if (devinfo->is_g4x) {
   102285          return 0;
   102286       } else {
   102287          return 0;
   102288       }
   102289    default:
   102290       unreachable("Invalid hardware generation");
   102291    }
   102292 }
   102293 
   102294 
   102295 
   102296 #define GEN10_3DSTATE_WM_HZ_OP_3DCommandSubOpcode_start  16
   102297 #define GEN9_3DSTATE_WM_HZ_OP_3DCommandSubOpcode_start  16
   102298 #define GEN8_3DSTATE_WM_HZ_OP_3DCommandSubOpcode_start  16
   102299 
   102300 static inline uint32_t ATTRIBUTE_PURE
   102301 _3DSTATE_WM_HZ_OP_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   102302 {
   102303    switch (devinfo->gen) {
   102304    case 10: return 16;
   102305    case 9: return 16;
   102306    case 8: return 16;
   102307    case 7:
   102308       if (devinfo->is_haswell) {
   102309          return 0;
   102310       } else {
   102311          return 0;
   102312       }
   102313    case 6: return 0;
   102314    case 5: return 0;
   102315    case 4:
   102316       if (devinfo->is_g4x) {
   102317          return 0;
   102318       } else {
   102319          return 0;
   102320       }
   102321    default:
   102322       unreachable("Invalid hardware generation");
   102323    }
   102324 }
   102325 
   102326 
   102327 
   102328 /* 3DSTATE_WM_HZ_OP::Clear Rectangle X Max */
   102329 
   102330 
   102331 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleXMax_bits  16
   102332 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleXMax_bits  16
   102333 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleXMax_bits  16
   102334 
   102335 static inline uint32_t ATTRIBUTE_PURE
   102336 _3DSTATE_WM_HZ_OP_ClearRectangleXMax_bits(const struct gen_device_info *devinfo)
   102337 {
   102338    switch (devinfo->gen) {
   102339    case 10: return 16;
   102340    case 9: return 16;
   102341    case 8: return 16;
   102342    case 7:
   102343       if (devinfo->is_haswell) {
   102344          return 0;
   102345       } else {
   102346          return 0;
   102347       }
   102348    case 6: return 0;
   102349    case 5: return 0;
   102350    case 4:
   102351       if (devinfo->is_g4x) {
   102352          return 0;
   102353       } else {
   102354          return 0;
   102355       }
   102356    default:
   102357       unreachable("Invalid hardware generation");
   102358    }
   102359 }
   102360 
   102361 
   102362 
   102363 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleXMax_start  96
   102364 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleXMax_start  96
   102365 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleXMax_start  96
   102366 
   102367 static inline uint32_t ATTRIBUTE_PURE
   102368 _3DSTATE_WM_HZ_OP_ClearRectangleXMax_start(const struct gen_device_info *devinfo)
   102369 {
   102370    switch (devinfo->gen) {
   102371    case 10: return 96;
   102372    case 9: return 96;
   102373    case 8: return 96;
   102374    case 7:
   102375       if (devinfo->is_haswell) {
   102376          return 0;
   102377       } else {
   102378          return 0;
   102379       }
   102380    case 6: return 0;
   102381    case 5: return 0;
   102382    case 4:
   102383       if (devinfo->is_g4x) {
   102384          return 0;
   102385       } else {
   102386          return 0;
   102387       }
   102388    default:
   102389       unreachable("Invalid hardware generation");
   102390    }
   102391 }
   102392 
   102393 
   102394 
   102395 /* 3DSTATE_WM_HZ_OP::Clear Rectangle X Min */
   102396 
   102397 
   102398 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleXMin_bits  16
   102399 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleXMin_bits  16
   102400 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleXMin_bits  16
   102401 
   102402 static inline uint32_t ATTRIBUTE_PURE
   102403 _3DSTATE_WM_HZ_OP_ClearRectangleXMin_bits(const struct gen_device_info *devinfo)
   102404 {
   102405    switch (devinfo->gen) {
   102406    case 10: return 16;
   102407    case 9: return 16;
   102408    case 8: return 16;
   102409    case 7:
   102410       if (devinfo->is_haswell) {
   102411          return 0;
   102412       } else {
   102413          return 0;
   102414       }
   102415    case 6: return 0;
   102416    case 5: return 0;
   102417    case 4:
   102418       if (devinfo->is_g4x) {
   102419          return 0;
   102420       } else {
   102421          return 0;
   102422       }
   102423    default:
   102424       unreachable("Invalid hardware generation");
   102425    }
   102426 }
   102427 
   102428 
   102429 
   102430 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleXMin_start  64
   102431 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleXMin_start  64
   102432 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleXMin_start  64
   102433 
   102434 static inline uint32_t ATTRIBUTE_PURE
   102435 _3DSTATE_WM_HZ_OP_ClearRectangleXMin_start(const struct gen_device_info *devinfo)
   102436 {
   102437    switch (devinfo->gen) {
   102438    case 10: return 64;
   102439    case 9: return 64;
   102440    case 8: return 64;
   102441    case 7:
   102442       if (devinfo->is_haswell) {
   102443          return 0;
   102444       } else {
   102445          return 0;
   102446       }
   102447    case 6: return 0;
   102448    case 5: return 0;
   102449    case 4:
   102450       if (devinfo->is_g4x) {
   102451          return 0;
   102452       } else {
   102453          return 0;
   102454       }
   102455    default:
   102456       unreachable("Invalid hardware generation");
   102457    }
   102458 }
   102459 
   102460 
   102461 
   102462 /* 3DSTATE_WM_HZ_OP::Clear Rectangle Y Max */
   102463 
   102464 
   102465 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleYMax_bits  16
   102466 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleYMax_bits  16
   102467 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleYMax_bits  16
   102468 
   102469 static inline uint32_t ATTRIBUTE_PURE
   102470 _3DSTATE_WM_HZ_OP_ClearRectangleYMax_bits(const struct gen_device_info *devinfo)
   102471 {
   102472    switch (devinfo->gen) {
   102473    case 10: return 16;
   102474    case 9: return 16;
   102475    case 8: return 16;
   102476    case 7:
   102477       if (devinfo->is_haswell) {
   102478          return 0;
   102479       } else {
   102480          return 0;
   102481       }
   102482    case 6: return 0;
   102483    case 5: return 0;
   102484    case 4:
   102485       if (devinfo->is_g4x) {
   102486          return 0;
   102487       } else {
   102488          return 0;
   102489       }
   102490    default:
   102491       unreachable("Invalid hardware generation");
   102492    }
   102493 }
   102494 
   102495 
   102496 
   102497 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleYMax_start  112
   102498 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleYMax_start  112
   102499 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleYMax_start  112
   102500 
   102501 static inline uint32_t ATTRIBUTE_PURE
   102502 _3DSTATE_WM_HZ_OP_ClearRectangleYMax_start(const struct gen_device_info *devinfo)
   102503 {
   102504    switch (devinfo->gen) {
   102505    case 10: return 112;
   102506    case 9: return 112;
   102507    case 8: return 112;
   102508    case 7:
   102509       if (devinfo->is_haswell) {
   102510          return 0;
   102511       } else {
   102512          return 0;
   102513       }
   102514    case 6: return 0;
   102515    case 5: return 0;
   102516    case 4:
   102517       if (devinfo->is_g4x) {
   102518          return 0;
   102519       } else {
   102520          return 0;
   102521       }
   102522    default:
   102523       unreachable("Invalid hardware generation");
   102524    }
   102525 }
   102526 
   102527 
   102528 
   102529 /* 3DSTATE_WM_HZ_OP::Clear Rectangle Y Min */
   102530 
   102531 
   102532 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleYMin_bits  16
   102533 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleYMin_bits  16
   102534 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleYMin_bits  16
   102535 
   102536 static inline uint32_t ATTRIBUTE_PURE
   102537 _3DSTATE_WM_HZ_OP_ClearRectangleYMin_bits(const struct gen_device_info *devinfo)
   102538 {
   102539    switch (devinfo->gen) {
   102540    case 10: return 16;
   102541    case 9: return 16;
   102542    case 8: return 16;
   102543    case 7:
   102544       if (devinfo->is_haswell) {
   102545          return 0;
   102546       } else {
   102547          return 0;
   102548       }
   102549    case 6: return 0;
   102550    case 5: return 0;
   102551    case 4:
   102552       if (devinfo->is_g4x) {
   102553          return 0;
   102554       } else {
   102555          return 0;
   102556       }
   102557    default:
   102558       unreachable("Invalid hardware generation");
   102559    }
   102560 }
   102561 
   102562 
   102563 
   102564 #define GEN10_3DSTATE_WM_HZ_OP_ClearRectangleYMin_start  80
   102565 #define GEN9_3DSTATE_WM_HZ_OP_ClearRectangleYMin_start  80
   102566 #define GEN8_3DSTATE_WM_HZ_OP_ClearRectangleYMin_start  80
   102567 
   102568 static inline uint32_t ATTRIBUTE_PURE
   102569 _3DSTATE_WM_HZ_OP_ClearRectangleYMin_start(const struct gen_device_info *devinfo)
   102570 {
   102571    switch (devinfo->gen) {
   102572    case 10: return 80;
   102573    case 9: return 80;
   102574    case 8: return 80;
   102575    case 7:
   102576       if (devinfo->is_haswell) {
   102577          return 0;
   102578       } else {
   102579          return 0;
   102580       }
   102581    case 6: return 0;
   102582    case 5: return 0;
   102583    case 4:
   102584       if (devinfo->is_g4x) {
   102585          return 0;
   102586       } else {
   102587          return 0;
   102588       }
   102589    default:
   102590       unreachable("Invalid hardware generation");
   102591    }
   102592 }
   102593 
   102594 
   102595 
   102596 /* 3DSTATE_WM_HZ_OP::Command SubType */
   102597 
   102598 
   102599 #define GEN10_3DSTATE_WM_HZ_OP_CommandSubType_bits  2
   102600 #define GEN9_3DSTATE_WM_HZ_OP_CommandSubType_bits  2
   102601 #define GEN8_3DSTATE_WM_HZ_OP_CommandSubType_bits  2
   102602 
   102603 static inline uint32_t ATTRIBUTE_PURE
   102604 _3DSTATE_WM_HZ_OP_CommandSubType_bits(const struct gen_device_info *devinfo)
   102605 {
   102606    switch (devinfo->gen) {
   102607    case 10: return 2;
   102608    case 9: return 2;
   102609    case 8: return 2;
   102610    case 7:
   102611       if (devinfo->is_haswell) {
   102612          return 0;
   102613       } else {
   102614          return 0;
   102615       }
   102616    case 6: return 0;
   102617    case 5: return 0;
   102618    case 4:
   102619       if (devinfo->is_g4x) {
   102620          return 0;
   102621       } else {
   102622          return 0;
   102623       }
   102624    default:
   102625       unreachable("Invalid hardware generation");
   102626    }
   102627 }
   102628 
   102629 
   102630 
   102631 #define GEN10_3DSTATE_WM_HZ_OP_CommandSubType_start  27
   102632 #define GEN9_3DSTATE_WM_HZ_OP_CommandSubType_start  27
   102633 #define GEN8_3DSTATE_WM_HZ_OP_CommandSubType_start  27
   102634 
   102635 static inline uint32_t ATTRIBUTE_PURE
   102636 _3DSTATE_WM_HZ_OP_CommandSubType_start(const struct gen_device_info *devinfo)
   102637 {
   102638    switch (devinfo->gen) {
   102639    case 10: return 27;
   102640    case 9: return 27;
   102641    case 8: return 27;
   102642    case 7:
   102643       if (devinfo->is_haswell) {
   102644          return 0;
   102645       } else {
   102646          return 0;
   102647       }
   102648    case 6: return 0;
   102649    case 5: return 0;
   102650    case 4:
   102651       if (devinfo->is_g4x) {
   102652          return 0;
   102653       } else {
   102654          return 0;
   102655       }
   102656    default:
   102657       unreachable("Invalid hardware generation");
   102658    }
   102659 }
   102660 
   102661 
   102662 
   102663 /* 3DSTATE_WM_HZ_OP::Command Type */
   102664 
   102665 
   102666 #define GEN10_3DSTATE_WM_HZ_OP_CommandType_bits  3
   102667 #define GEN9_3DSTATE_WM_HZ_OP_CommandType_bits  3
   102668 #define GEN8_3DSTATE_WM_HZ_OP_CommandType_bits  3
   102669 
   102670 static inline uint32_t ATTRIBUTE_PURE
   102671 _3DSTATE_WM_HZ_OP_CommandType_bits(const struct gen_device_info *devinfo)
   102672 {
   102673    switch (devinfo->gen) {
   102674    case 10: return 3;
   102675    case 9: return 3;
   102676    case 8: return 3;
   102677    case 7:
   102678       if (devinfo->is_haswell) {
   102679          return 0;
   102680       } else {
   102681          return 0;
   102682       }
   102683    case 6: return 0;
   102684    case 5: return 0;
   102685    case 4:
   102686       if (devinfo->is_g4x) {
   102687          return 0;
   102688       } else {
   102689          return 0;
   102690       }
   102691    default:
   102692       unreachable("Invalid hardware generation");
   102693    }
   102694 }
   102695 
   102696 
   102697 
   102698 #define GEN10_3DSTATE_WM_HZ_OP_CommandType_start  29
   102699 #define GEN9_3DSTATE_WM_HZ_OP_CommandType_start  29
   102700 #define GEN8_3DSTATE_WM_HZ_OP_CommandType_start  29
   102701 
   102702 static inline uint32_t ATTRIBUTE_PURE
   102703 _3DSTATE_WM_HZ_OP_CommandType_start(const struct gen_device_info *devinfo)
   102704 {
   102705    switch (devinfo->gen) {
   102706    case 10: return 29;
   102707    case 9: return 29;
   102708    case 8: return 29;
   102709    case 7:
   102710       if (devinfo->is_haswell) {
   102711          return 0;
   102712       } else {
   102713          return 0;
   102714       }
   102715    case 6: return 0;
   102716    case 5: return 0;
   102717    case 4:
   102718       if (devinfo->is_g4x) {
   102719          return 0;
   102720       } else {
   102721          return 0;
   102722       }
   102723    default:
   102724       unreachable("Invalid hardware generation");
   102725    }
   102726 }
   102727 
   102728 
   102729 
   102730 /* 3DSTATE_WM_HZ_OP::DWord Length */
   102731 
   102732 
   102733 #define GEN10_3DSTATE_WM_HZ_OP_DWordLength_bits  8
   102734 #define GEN9_3DSTATE_WM_HZ_OP_DWordLength_bits  8
   102735 #define GEN8_3DSTATE_WM_HZ_OP_DWordLength_bits  8
   102736 
   102737 static inline uint32_t ATTRIBUTE_PURE
   102738 _3DSTATE_WM_HZ_OP_DWordLength_bits(const struct gen_device_info *devinfo)
   102739 {
   102740    switch (devinfo->gen) {
   102741    case 10: return 8;
   102742    case 9: return 8;
   102743    case 8: return 8;
   102744    case 7:
   102745       if (devinfo->is_haswell) {
   102746          return 0;
   102747       } else {
   102748          return 0;
   102749       }
   102750    case 6: return 0;
   102751    case 5: return 0;
   102752    case 4:
   102753       if (devinfo->is_g4x) {
   102754          return 0;
   102755       } else {
   102756          return 0;
   102757       }
   102758    default:
   102759       unreachable("Invalid hardware generation");
   102760    }
   102761 }
   102762 
   102763 
   102764 
   102765 #define GEN10_3DSTATE_WM_HZ_OP_DWordLength_start  0
   102766 #define GEN9_3DSTATE_WM_HZ_OP_DWordLength_start  0
   102767 #define GEN8_3DSTATE_WM_HZ_OP_DWordLength_start  0
   102768 
   102769 static inline uint32_t ATTRIBUTE_PURE
   102770 _3DSTATE_WM_HZ_OP_DWordLength_start(const struct gen_device_info *devinfo)
   102771 {
   102772    switch (devinfo->gen) {
   102773    case 10: return 0;
   102774    case 9: return 0;
   102775    case 8: return 0;
   102776    case 7:
   102777       if (devinfo->is_haswell) {
   102778          return 0;
   102779       } else {
   102780          return 0;
   102781       }
   102782    case 6: return 0;
   102783    case 5: return 0;
   102784    case 4:
   102785       if (devinfo->is_g4x) {
   102786          return 0;
   102787       } else {
   102788          return 0;
   102789       }
   102790    default:
   102791       unreachable("Invalid hardware generation");
   102792    }
   102793 }
   102794 
   102795 
   102796 
   102797 /* 3DSTATE_WM_HZ_OP::Depth Buffer Clear Enable */
   102798 
   102799 
   102800 #define GEN10_3DSTATE_WM_HZ_OP_DepthBufferClearEnable_bits  1
   102801 #define GEN9_3DSTATE_WM_HZ_OP_DepthBufferClearEnable_bits  1
   102802 #define GEN8_3DSTATE_WM_HZ_OP_DepthBufferClearEnable_bits  1
   102803 
   102804 static inline uint32_t ATTRIBUTE_PURE
   102805 _3DSTATE_WM_HZ_OP_DepthBufferClearEnable_bits(const struct gen_device_info *devinfo)
   102806 {
   102807    switch (devinfo->gen) {
   102808    case 10: return 1;
   102809    case 9: return 1;
   102810    case 8: return 1;
   102811    case 7:
   102812       if (devinfo->is_haswell) {
   102813          return 0;
   102814       } else {
   102815          return 0;
   102816       }
   102817    case 6: return 0;
   102818    case 5: return 0;
   102819    case 4:
   102820       if (devinfo->is_g4x) {
   102821          return 0;
   102822       } else {
   102823          return 0;
   102824       }
   102825    default:
   102826       unreachable("Invalid hardware generation");
   102827    }
   102828 }
   102829 
   102830 
   102831 
   102832 #define GEN10_3DSTATE_WM_HZ_OP_DepthBufferClearEnable_start  62
   102833 #define GEN9_3DSTATE_WM_HZ_OP_DepthBufferClearEnable_start  62
   102834 #define GEN8_3DSTATE_WM_HZ_OP_DepthBufferClearEnable_start  62
   102835 
   102836 static inline uint32_t ATTRIBUTE_PURE
   102837 _3DSTATE_WM_HZ_OP_DepthBufferClearEnable_start(const struct gen_device_info *devinfo)
   102838 {
   102839    switch (devinfo->gen) {
   102840    case 10: return 62;
   102841    case 9: return 62;
   102842    case 8: return 62;
   102843    case 7:
   102844       if (devinfo->is_haswell) {
   102845          return 0;
   102846       } else {
   102847          return 0;
   102848       }
   102849    case 6: return 0;
   102850    case 5: return 0;
   102851    case 4:
   102852       if (devinfo->is_g4x) {
   102853          return 0;
   102854       } else {
   102855          return 0;
   102856       }
   102857    default:
   102858       unreachable("Invalid hardware generation");
   102859    }
   102860 }
   102861 
   102862 
   102863 
   102864 /* 3DSTATE_WM_HZ_OP::Depth Buffer Resolve Enable */
   102865 
   102866 
   102867 #define GEN10_3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_bits  1
   102868 #define GEN9_3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_bits  1
   102869 #define GEN8_3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_bits  1
   102870 
   102871 static inline uint32_t ATTRIBUTE_PURE
   102872 _3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   102873 {
   102874    switch (devinfo->gen) {
   102875    case 10: return 1;
   102876    case 9: return 1;
   102877    case 8: return 1;
   102878    case 7:
   102879       if (devinfo->is_haswell) {
   102880          return 0;
   102881       } else {
   102882          return 0;
   102883       }
   102884    case 6: return 0;
   102885    case 5: return 0;
   102886    case 4:
   102887       if (devinfo->is_g4x) {
   102888          return 0;
   102889       } else {
   102890          return 0;
   102891       }
   102892    default:
   102893       unreachable("Invalid hardware generation");
   102894    }
   102895 }
   102896 
   102897 
   102898 
   102899 #define GEN10_3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_start  60
   102900 #define GEN9_3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_start  60
   102901 #define GEN8_3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_start  60
   102902 
   102903 static inline uint32_t ATTRIBUTE_PURE
   102904 _3DSTATE_WM_HZ_OP_DepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   102905 {
   102906    switch (devinfo->gen) {
   102907    case 10: return 60;
   102908    case 9: return 60;
   102909    case 8: return 60;
   102910    case 7:
   102911       if (devinfo->is_haswell) {
   102912          return 0;
   102913       } else {
   102914          return 0;
   102915       }
   102916    case 6: return 0;
   102917    case 5: return 0;
   102918    case 4:
   102919       if (devinfo->is_g4x) {
   102920          return 0;
   102921       } else {
   102922          return 0;
   102923       }
   102924    default:
   102925       unreachable("Invalid hardware generation");
   102926    }
   102927 }
   102928 
   102929 
   102930 
   102931 /* 3DSTATE_WM_HZ_OP::Full Surface Depth and Stencil Clear */
   102932 
   102933 
   102934 #define GEN10_3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_bits  1
   102935 #define GEN9_3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_bits  1
   102936 #define GEN8_3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_bits  1
   102937 
   102938 static inline uint32_t ATTRIBUTE_PURE
   102939 _3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_bits(const struct gen_device_info *devinfo)
   102940 {
   102941    switch (devinfo->gen) {
   102942    case 10: return 1;
   102943    case 9: return 1;
   102944    case 8: return 1;
   102945    case 7:
   102946       if (devinfo->is_haswell) {
   102947          return 0;
   102948       } else {
   102949          return 0;
   102950       }
   102951    case 6: return 0;
   102952    case 5: return 0;
   102953    case 4:
   102954       if (devinfo->is_g4x) {
   102955          return 0;
   102956       } else {
   102957          return 0;
   102958       }
   102959    default:
   102960       unreachable("Invalid hardware generation");
   102961    }
   102962 }
   102963 
   102964 
   102965 
   102966 #define GEN10_3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_start  57
   102967 #define GEN9_3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_start  57
   102968 #define GEN8_3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_start  57
   102969 
   102970 static inline uint32_t ATTRIBUTE_PURE
   102971 _3DSTATE_WM_HZ_OP_FullSurfaceDepthandStencilClear_start(const struct gen_device_info *devinfo)
   102972 {
   102973    switch (devinfo->gen) {
   102974    case 10: return 57;
   102975    case 9: return 57;
   102976    case 8: return 57;
   102977    case 7:
   102978       if (devinfo->is_haswell) {
   102979          return 0;
   102980       } else {
   102981          return 0;
   102982       }
   102983    case 6: return 0;
   102984    case 5: return 0;
   102985    case 4:
   102986       if (devinfo->is_g4x) {
   102987          return 0;
   102988       } else {
   102989          return 0;
   102990       }
   102991    default:
   102992       unreachable("Invalid hardware generation");
   102993    }
   102994 }
   102995 
   102996 
   102997 
   102998 /* 3DSTATE_WM_HZ_OP::Hierarchical Depth Buffer Resolve Enable */
   102999 
   103000 
   103001 #define GEN10_3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_bits  1
   103002 #define GEN9_3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_bits  1
   103003 #define GEN8_3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_bits  1
   103004 
   103005 static inline uint32_t ATTRIBUTE_PURE
   103006 _3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   103007 {
   103008    switch (devinfo->gen) {
   103009    case 10: return 1;
   103010    case 9: return 1;
   103011    case 8: return 1;
   103012    case 7:
   103013       if (devinfo->is_haswell) {
   103014          return 0;
   103015       } else {
   103016          return 0;
   103017       }
   103018    case 6: return 0;
   103019    case 5: return 0;
   103020    case 4:
   103021       if (devinfo->is_g4x) {
   103022          return 0;
   103023       } else {
   103024          return 0;
   103025       }
   103026    default:
   103027       unreachable("Invalid hardware generation");
   103028    }
   103029 }
   103030 
   103031 
   103032 
   103033 #define GEN10_3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_start  59
   103034 #define GEN9_3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_start  59
   103035 #define GEN8_3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_start  59
   103036 
   103037 static inline uint32_t ATTRIBUTE_PURE
   103038 _3DSTATE_WM_HZ_OP_HierarchicalDepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   103039 {
   103040    switch (devinfo->gen) {
   103041    case 10: return 59;
   103042    case 9: return 59;
   103043    case 8: return 59;
   103044    case 7:
   103045       if (devinfo->is_haswell) {
   103046          return 0;
   103047       } else {
   103048          return 0;
   103049       }
   103050    case 6: return 0;
   103051    case 5: return 0;
   103052    case 4:
   103053       if (devinfo->is_g4x) {
   103054          return 0;
   103055       } else {
   103056          return 0;
   103057       }
   103058    default:
   103059       unreachable("Invalid hardware generation");
   103060    }
   103061 }
   103062 
   103063 
   103064 
   103065 /* 3DSTATE_WM_HZ_OP::Number of Multisamples */
   103066 
   103067 
   103068 #define GEN10_3DSTATE_WM_HZ_OP_NumberofMultisamples_bits  3
   103069 #define GEN9_3DSTATE_WM_HZ_OP_NumberofMultisamples_bits  3
   103070 #define GEN8_3DSTATE_WM_HZ_OP_NumberofMultisamples_bits  3
   103071 
   103072 static inline uint32_t ATTRIBUTE_PURE
   103073 _3DSTATE_WM_HZ_OP_NumberofMultisamples_bits(const struct gen_device_info *devinfo)
   103074 {
   103075    switch (devinfo->gen) {
   103076    case 10: return 3;
   103077    case 9: return 3;
   103078    case 8: return 3;
   103079    case 7:
   103080       if (devinfo->is_haswell) {
   103081          return 0;
   103082       } else {
   103083          return 0;
   103084       }
   103085    case 6: return 0;
   103086    case 5: return 0;
   103087    case 4:
   103088       if (devinfo->is_g4x) {
   103089          return 0;
   103090       } else {
   103091          return 0;
   103092       }
   103093    default:
   103094       unreachable("Invalid hardware generation");
   103095    }
   103096 }
   103097 
   103098 
   103099 
   103100 #define GEN10_3DSTATE_WM_HZ_OP_NumberofMultisamples_start  45
   103101 #define GEN9_3DSTATE_WM_HZ_OP_NumberofMultisamples_start  45
   103102 #define GEN8_3DSTATE_WM_HZ_OP_NumberofMultisamples_start  45
   103103 
   103104 static inline uint32_t ATTRIBUTE_PURE
   103105 _3DSTATE_WM_HZ_OP_NumberofMultisamples_start(const struct gen_device_info *devinfo)
   103106 {
   103107    switch (devinfo->gen) {
   103108    case 10: return 45;
   103109    case 9: return 45;
   103110    case 8: return 45;
   103111    case 7:
   103112       if (devinfo->is_haswell) {
   103113          return 0;
   103114       } else {
   103115          return 0;
   103116       }
   103117    case 6: return 0;
   103118    case 5: return 0;
   103119    case 4:
   103120       if (devinfo->is_g4x) {
   103121          return 0;
   103122       } else {
   103123          return 0;
   103124       }
   103125    default:
   103126       unreachable("Invalid hardware generation");
   103127    }
   103128 }
   103129 
   103130 
   103131 
   103132 /* 3DSTATE_WM_HZ_OP::Pixel Position Offset Enable */
   103133 
   103134 
   103135 #define GEN10_3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_bits  1
   103136 #define GEN9_3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_bits  1
   103137 #define GEN8_3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_bits  1
   103138 
   103139 static inline uint32_t ATTRIBUTE_PURE
   103140 _3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_bits(const struct gen_device_info *devinfo)
   103141 {
   103142    switch (devinfo->gen) {
   103143    case 10: return 1;
   103144    case 9: return 1;
   103145    case 8: return 1;
   103146    case 7:
   103147       if (devinfo->is_haswell) {
   103148          return 0;
   103149       } else {
   103150          return 0;
   103151       }
   103152    case 6: return 0;
   103153    case 5: return 0;
   103154    case 4:
   103155       if (devinfo->is_g4x) {
   103156          return 0;
   103157       } else {
   103158          return 0;
   103159       }
   103160    default:
   103161       unreachable("Invalid hardware generation");
   103162    }
   103163 }
   103164 
   103165 
   103166 
   103167 #define GEN10_3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_start  58
   103168 #define GEN9_3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_start  58
   103169 #define GEN8_3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_start  58
   103170 
   103171 static inline uint32_t ATTRIBUTE_PURE
   103172 _3DSTATE_WM_HZ_OP_PixelPositionOffsetEnable_start(const struct gen_device_info *devinfo)
   103173 {
   103174    switch (devinfo->gen) {
   103175    case 10: return 58;
   103176    case 9: return 58;
   103177    case 8: return 58;
   103178    case 7:
   103179       if (devinfo->is_haswell) {
   103180          return 0;
   103181       } else {
   103182          return 0;
   103183       }
   103184    case 6: return 0;
   103185    case 5: return 0;
   103186    case 4:
   103187       if (devinfo->is_g4x) {
   103188          return 0;
   103189       } else {
   103190          return 0;
   103191       }
   103192    default:
   103193       unreachable("Invalid hardware generation");
   103194    }
   103195 }
   103196 
   103197 
   103198 
   103199 /* 3DSTATE_WM_HZ_OP::Sample Mask */
   103200 
   103201 
   103202 #define GEN10_3DSTATE_WM_HZ_OP_SampleMask_bits  16
   103203 #define GEN9_3DSTATE_WM_HZ_OP_SampleMask_bits  16
   103204 #define GEN8_3DSTATE_WM_HZ_OP_SampleMask_bits  16
   103205 
   103206 static inline uint32_t ATTRIBUTE_PURE
   103207 _3DSTATE_WM_HZ_OP_SampleMask_bits(const struct gen_device_info *devinfo)
   103208 {
   103209    switch (devinfo->gen) {
   103210    case 10: return 16;
   103211    case 9: return 16;
   103212    case 8: return 16;
   103213    case 7:
   103214       if (devinfo->is_haswell) {
   103215          return 0;
   103216       } else {
   103217          return 0;
   103218       }
   103219    case 6: return 0;
   103220    case 5: return 0;
   103221    case 4:
   103222       if (devinfo->is_g4x) {
   103223          return 0;
   103224       } else {
   103225          return 0;
   103226       }
   103227    default:
   103228       unreachable("Invalid hardware generation");
   103229    }
   103230 }
   103231 
   103232 
   103233 
   103234 #define GEN10_3DSTATE_WM_HZ_OP_SampleMask_start  128
   103235 #define GEN9_3DSTATE_WM_HZ_OP_SampleMask_start  128
   103236 #define GEN8_3DSTATE_WM_HZ_OP_SampleMask_start  128
   103237 
   103238 static inline uint32_t ATTRIBUTE_PURE
   103239 _3DSTATE_WM_HZ_OP_SampleMask_start(const struct gen_device_info *devinfo)
   103240 {
   103241    switch (devinfo->gen) {
   103242    case 10: return 128;
   103243    case 9: return 128;
   103244    case 8: return 128;
   103245    case 7:
   103246       if (devinfo->is_haswell) {
   103247          return 0;
   103248       } else {
   103249          return 0;
   103250       }
   103251    case 6: return 0;
   103252    case 5: return 0;
   103253    case 4:
   103254       if (devinfo->is_g4x) {
   103255          return 0;
   103256       } else {
   103257          return 0;
   103258       }
   103259    default:
   103260       unreachable("Invalid hardware generation");
   103261    }
   103262 }
   103263 
   103264 
   103265 
   103266 /* 3DSTATE_WM_HZ_OP::Scissor Rectangle Enable */
   103267 
   103268 
   103269 #define GEN10_3DSTATE_WM_HZ_OP_ScissorRectangleEnable_bits  1
   103270 #define GEN9_3DSTATE_WM_HZ_OP_ScissorRectangleEnable_bits  1
   103271 #define GEN8_3DSTATE_WM_HZ_OP_ScissorRectangleEnable_bits  1
   103272 
   103273 static inline uint32_t ATTRIBUTE_PURE
   103274 _3DSTATE_WM_HZ_OP_ScissorRectangleEnable_bits(const struct gen_device_info *devinfo)
   103275 {
   103276    switch (devinfo->gen) {
   103277    case 10: return 1;
   103278    case 9: return 1;
   103279    case 8: return 1;
   103280    case 7:
   103281       if (devinfo->is_haswell) {
   103282          return 0;
   103283       } else {
   103284          return 0;
   103285       }
   103286    case 6: return 0;
   103287    case 5: return 0;
   103288    case 4:
   103289       if (devinfo->is_g4x) {
   103290          return 0;
   103291       } else {
   103292          return 0;
   103293       }
   103294    default:
   103295       unreachable("Invalid hardware generation");
   103296    }
   103297 }
   103298 
   103299 
   103300 
   103301 #define GEN10_3DSTATE_WM_HZ_OP_ScissorRectangleEnable_start  61
   103302 #define GEN9_3DSTATE_WM_HZ_OP_ScissorRectangleEnable_start  61
   103303 #define GEN8_3DSTATE_WM_HZ_OP_ScissorRectangleEnable_start  61
   103304 
   103305 static inline uint32_t ATTRIBUTE_PURE
   103306 _3DSTATE_WM_HZ_OP_ScissorRectangleEnable_start(const struct gen_device_info *devinfo)
   103307 {
   103308    switch (devinfo->gen) {
   103309    case 10: return 61;
   103310    case 9: return 61;
   103311    case 8: return 61;
   103312    case 7:
   103313       if (devinfo->is_haswell) {
   103314          return 0;
   103315       } else {
   103316          return 0;
   103317       }
   103318    case 6: return 0;
   103319    case 5: return 0;
   103320    case 4:
   103321       if (devinfo->is_g4x) {
   103322          return 0;
   103323       } else {
   103324          return 0;
   103325       }
   103326    default:
   103327       unreachable("Invalid hardware generation");
   103328    }
   103329 }
   103330 
   103331 
   103332 
   103333 /* 3DSTATE_WM_HZ_OP::Stencil Buffer Clear Enable */
   103334 
   103335 
   103336 #define GEN10_3DSTATE_WM_HZ_OP_StencilBufferClearEnable_bits  1
   103337 #define GEN9_3DSTATE_WM_HZ_OP_StencilBufferClearEnable_bits  1
   103338 #define GEN8_3DSTATE_WM_HZ_OP_StencilBufferClearEnable_bits  1
   103339 
   103340 static inline uint32_t ATTRIBUTE_PURE
   103341 _3DSTATE_WM_HZ_OP_StencilBufferClearEnable_bits(const struct gen_device_info *devinfo)
   103342 {
   103343    switch (devinfo->gen) {
   103344    case 10: return 1;
   103345    case 9: return 1;
   103346    case 8: return 1;
   103347    case 7:
   103348       if (devinfo->is_haswell) {
   103349          return 0;
   103350       } else {
   103351          return 0;
   103352       }
   103353    case 6: return 0;
   103354    case 5: return 0;
   103355    case 4:
   103356       if (devinfo->is_g4x) {
   103357          return 0;
   103358       } else {
   103359          return 0;
   103360       }
   103361    default:
   103362       unreachable("Invalid hardware generation");
   103363    }
   103364 }
   103365 
   103366 
   103367 
   103368 #define GEN10_3DSTATE_WM_HZ_OP_StencilBufferClearEnable_start  63
   103369 #define GEN9_3DSTATE_WM_HZ_OP_StencilBufferClearEnable_start  63
   103370 #define GEN8_3DSTATE_WM_HZ_OP_StencilBufferClearEnable_start  63
   103371 
   103372 static inline uint32_t ATTRIBUTE_PURE
   103373 _3DSTATE_WM_HZ_OP_StencilBufferClearEnable_start(const struct gen_device_info *devinfo)
   103374 {
   103375    switch (devinfo->gen) {
   103376    case 10: return 63;
   103377    case 9: return 63;
   103378    case 8: return 63;
   103379    case 7:
   103380       if (devinfo->is_haswell) {
   103381          return 0;
   103382       } else {
   103383          return 0;
   103384       }
   103385    case 6: return 0;
   103386    case 5: return 0;
   103387    case 4:
   103388       if (devinfo->is_g4x) {
   103389          return 0;
   103390       } else {
   103391          return 0;
   103392       }
   103393    default:
   103394       unreachable("Invalid hardware generation");
   103395    }
   103396 }
   103397 
   103398 
   103399 
   103400 /* 3DSTATE_WM_HZ_OP::Stencil Clear Value */
   103401 
   103402 
   103403 #define GEN10_3DSTATE_WM_HZ_OP_StencilClearValue_bits  8
   103404 #define GEN9_3DSTATE_WM_HZ_OP_StencilClearValue_bits  8
   103405 #define GEN8_3DSTATE_WM_HZ_OP_StencilClearValue_bits  8
   103406 
   103407 static inline uint32_t ATTRIBUTE_PURE
   103408 _3DSTATE_WM_HZ_OP_StencilClearValue_bits(const struct gen_device_info *devinfo)
   103409 {
   103410    switch (devinfo->gen) {
   103411    case 10: return 8;
   103412    case 9: return 8;
   103413    case 8: return 8;
   103414    case 7:
   103415       if (devinfo->is_haswell) {
   103416          return 0;
   103417       } else {
   103418          return 0;
   103419       }
   103420    case 6: return 0;
   103421    case 5: return 0;
   103422    case 4:
   103423       if (devinfo->is_g4x) {
   103424          return 0;
   103425       } else {
   103426          return 0;
   103427       }
   103428    default:
   103429       unreachable("Invalid hardware generation");
   103430    }
   103431 }
   103432 
   103433 
   103434 
   103435 #define GEN10_3DSTATE_WM_HZ_OP_StencilClearValue_start  48
   103436 #define GEN9_3DSTATE_WM_HZ_OP_StencilClearValue_start  48
   103437 #define GEN8_3DSTATE_WM_HZ_OP_StencilClearValue_start  48
   103438 
   103439 static inline uint32_t ATTRIBUTE_PURE
   103440 _3DSTATE_WM_HZ_OP_StencilClearValue_start(const struct gen_device_info *devinfo)
   103441 {
   103442    switch (devinfo->gen) {
   103443    case 10: return 48;
   103444    case 9: return 48;
   103445    case 8: return 48;
   103446    case 7:
   103447       if (devinfo->is_haswell) {
   103448          return 0;
   103449       } else {
   103450          return 0;
   103451       }
   103452    case 6: return 0;
   103453    case 5: return 0;
   103454    case 4:
   103455       if (devinfo->is_g4x) {
   103456          return 0;
   103457       } else {
   103458          return 0;
   103459       }
   103460    default:
   103461       unreachable("Invalid hardware generation");
   103462    }
   103463 }
   103464 
   103465 
   103466 
   103467 /* ACTHD_UDW */
   103468 
   103469 
   103470 #define GEN9_ACTHD_UDW_length  1
   103471 #define GEN8_ACTHD_UDW_length  1
   103472 
   103473 static inline uint32_t ATTRIBUTE_PURE
   103474 ACTHD_UDW_length(const struct gen_device_info *devinfo)
   103475 {
   103476    switch (devinfo->gen) {
   103477    case 10: return 0;
   103478    case 9: return 1;
   103479    case 8: return 1;
   103480    case 7:
   103481       if (devinfo->is_haswell) {
   103482          return 0;
   103483       } else {
   103484          return 0;
   103485       }
   103486    case 6: return 0;
   103487    case 5: return 0;
   103488    case 4:
   103489       if (devinfo->is_g4x) {
   103490          return 0;
   103491       } else {
   103492          return 0;
   103493       }
   103494    default:
   103495       unreachable("Invalid hardware generation");
   103496    }
   103497 }
   103498 
   103499 
   103500 
   103501 /* ACTHD_UDW::Head Pointer Upper DWORD */
   103502 
   103503 
   103504 #define GEN9_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   103505 #define GEN8_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   103506 
   103507 static inline uint32_t ATTRIBUTE_PURE
   103508 ACTHD_UDW_HeadPointerUpperDWORD_bits(const struct gen_device_info *devinfo)
   103509 {
   103510    switch (devinfo->gen) {
   103511    case 10: return 0;
   103512    case 9: return 16;
   103513    case 8: return 16;
   103514    case 7:
   103515       if (devinfo->is_haswell) {
   103516          return 0;
   103517       } else {
   103518          return 0;
   103519       }
   103520    case 6: return 0;
   103521    case 5: return 0;
   103522    case 4:
   103523       if (devinfo->is_g4x) {
   103524          return 0;
   103525       } else {
   103526          return 0;
   103527       }
   103528    default:
   103529       unreachable("Invalid hardware generation");
   103530    }
   103531 }
   103532 
   103533 
   103534 
   103535 #define GEN9_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   103536 #define GEN8_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   103537 
   103538 static inline uint32_t ATTRIBUTE_PURE
   103539 ACTHD_UDW_HeadPointerUpperDWORD_start(const struct gen_device_info *devinfo)
   103540 {
   103541    switch (devinfo->gen) {
   103542    case 10: return 0;
   103543    case 9: return 0;
   103544    case 8: return 0;
   103545    case 7:
   103546       if (devinfo->is_haswell) {
   103547          return 0;
   103548       } else {
   103549          return 0;
   103550       }
   103551    case 6: return 0;
   103552    case 5: return 0;
   103553    case 4:
   103554       if (devinfo->is_g4x) {
   103555          return 0;
   103556       } else {
   103557          return 0;
   103558       }
   103559    default:
   103560       unreachable("Invalid hardware generation");
   103561    }
   103562 }
   103563 
   103564 
   103565 
   103566 /* BCS_ACTHD_UDW */
   103567 
   103568 
   103569 #define GEN9_BCS_ACTHD_UDW_length  1
   103570 #define GEN8_BCS_ACTHD_UDW_length  1
   103571 
   103572 static inline uint32_t ATTRIBUTE_PURE
   103573 BCS_ACTHD_UDW_length(const struct gen_device_info *devinfo)
   103574 {
   103575    switch (devinfo->gen) {
   103576    case 10: return 0;
   103577    case 9: return 1;
   103578    case 8: return 1;
   103579    case 7:
   103580       if (devinfo->is_haswell) {
   103581          return 0;
   103582       } else {
   103583          return 0;
   103584       }
   103585    case 6: return 0;
   103586    case 5: return 0;
   103587    case 4:
   103588       if (devinfo->is_g4x) {
   103589          return 0;
   103590       } else {
   103591          return 0;
   103592       }
   103593    default:
   103594       unreachable("Invalid hardware generation");
   103595    }
   103596 }
   103597 
   103598 
   103599 
   103600 /* BCS_ACTHD_UDW::Head Pointer Upper DWORD */
   103601 
   103602 
   103603 #define GEN9_BCS_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   103604 #define GEN8_BCS_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   103605 
   103606 static inline uint32_t ATTRIBUTE_PURE
   103607 BCS_ACTHD_UDW_HeadPointerUpperDWORD_bits(const struct gen_device_info *devinfo)
   103608 {
   103609    switch (devinfo->gen) {
   103610    case 10: return 0;
   103611    case 9: return 16;
   103612    case 8: return 16;
   103613    case 7:
   103614       if (devinfo->is_haswell) {
   103615          return 0;
   103616       } else {
   103617          return 0;
   103618       }
   103619    case 6: return 0;
   103620    case 5: return 0;
   103621    case 4:
   103622       if (devinfo->is_g4x) {
   103623          return 0;
   103624       } else {
   103625          return 0;
   103626       }
   103627    default:
   103628       unreachable("Invalid hardware generation");
   103629    }
   103630 }
   103631 
   103632 
   103633 
   103634 #define GEN9_BCS_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   103635 #define GEN8_BCS_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   103636 
   103637 static inline uint32_t ATTRIBUTE_PURE
   103638 BCS_ACTHD_UDW_HeadPointerUpperDWORD_start(const struct gen_device_info *devinfo)
   103639 {
   103640    switch (devinfo->gen) {
   103641    case 10: return 0;
   103642    case 9: return 0;
   103643    case 8: return 0;
   103644    case 7:
   103645       if (devinfo->is_haswell) {
   103646          return 0;
   103647       } else {
   103648          return 0;
   103649       }
   103650    case 6: return 0;
   103651    case 5: return 0;
   103652    case 4:
   103653       if (devinfo->is_g4x) {
   103654          return 0;
   103655       } else {
   103656          return 0;
   103657       }
   103658    default:
   103659       unreachable("Invalid hardware generation");
   103660    }
   103661 }
   103662 
   103663 
   103664 
   103665 /* BCS_FAULT_REG */
   103666 
   103667 
   103668 #define GEN75_BCS_FAULT_REG_length  1
   103669 #define GEN7_BCS_FAULT_REG_length  1
   103670 #define GEN6_BCS_FAULT_REG_length  1
   103671 
   103672 static inline uint32_t ATTRIBUTE_PURE
   103673 BCS_FAULT_REG_length(const struct gen_device_info *devinfo)
   103674 {
   103675    switch (devinfo->gen) {
   103676    case 10: return 0;
   103677    case 9: return 0;
   103678    case 8: return 0;
   103679    case 7:
   103680       if (devinfo->is_haswell) {
   103681          return 1;
   103682       } else {
   103683          return 1;
   103684       }
   103685    case 6: return 1;
   103686    case 5: return 0;
   103687    case 4:
   103688       if (devinfo->is_g4x) {
   103689          return 0;
   103690       } else {
   103691          return 0;
   103692       }
   103693    default:
   103694       unreachable("Invalid hardware generation");
   103695    }
   103696 }
   103697 
   103698 
   103699 
   103700 /* BCS_FAULT_REG::Fault Type */
   103701 
   103702 
   103703 #define GEN75_BCS_FAULT_REG_FaultType_bits  2
   103704 #define GEN7_BCS_FAULT_REG_FaultType_bits  2
   103705 #define GEN6_BCS_FAULT_REG_FaultType_bits  2
   103706 
   103707 static inline uint32_t ATTRIBUTE_PURE
   103708 BCS_FAULT_REG_FaultType_bits(const struct gen_device_info *devinfo)
   103709 {
   103710    switch (devinfo->gen) {
   103711    case 10: return 0;
   103712    case 9: return 0;
   103713    case 8: return 0;
   103714    case 7:
   103715       if (devinfo->is_haswell) {
   103716          return 2;
   103717       } else {
   103718          return 2;
   103719       }
   103720    case 6: return 2;
   103721    case 5: return 0;
   103722    case 4:
   103723       if (devinfo->is_g4x) {
   103724          return 0;
   103725       } else {
   103726          return 0;
   103727       }
   103728    default:
   103729       unreachable("Invalid hardware generation");
   103730    }
   103731 }
   103732 
   103733 
   103734 
   103735 #define GEN75_BCS_FAULT_REG_FaultType_start  1
   103736 #define GEN7_BCS_FAULT_REG_FaultType_start  1
   103737 #define GEN6_BCS_FAULT_REG_FaultType_start  1
   103738 
   103739 static inline uint32_t ATTRIBUTE_PURE
   103740 BCS_FAULT_REG_FaultType_start(const struct gen_device_info *devinfo)
   103741 {
   103742    switch (devinfo->gen) {
   103743    case 10: return 0;
   103744    case 9: return 0;
   103745    case 8: return 0;
   103746    case 7:
   103747       if (devinfo->is_haswell) {
   103748          return 1;
   103749       } else {
   103750          return 1;
   103751       }
   103752    case 6: return 1;
   103753    case 5: return 0;
   103754    case 4:
   103755       if (devinfo->is_g4x) {
   103756          return 0;
   103757       } else {
   103758          return 0;
   103759       }
   103760    default:
   103761       unreachable("Invalid hardware generation");
   103762    }
   103763 }
   103764 
   103765 
   103766 
   103767 /* BCS_FAULT_REG::GTTSEL */
   103768 
   103769 
   103770 #define GEN75_BCS_FAULT_REG_GTTSEL_bits  -9
   103771 #define GEN7_BCS_FAULT_REG_GTTSEL_bits  -9
   103772 #define GEN6_BCS_FAULT_REG_GTTSEL_bits  -9
   103773 
   103774 static inline uint32_t ATTRIBUTE_PURE
   103775 BCS_FAULT_REG_GTTSEL_bits(const struct gen_device_info *devinfo)
   103776 {
   103777    switch (devinfo->gen) {
   103778    case 10: return 0;
   103779    case 9: return 0;
   103780    case 8: return 0;
   103781    case 7:
   103782       if (devinfo->is_haswell) {
   103783          return -9;
   103784       } else {
   103785          return -9;
   103786       }
   103787    case 6: return -9;
   103788    case 5: return 0;
   103789    case 4:
   103790       if (devinfo->is_g4x) {
   103791          return 0;
   103792       } else {
   103793          return 0;
   103794       }
   103795    default:
   103796       unreachable("Invalid hardware generation");
   103797    }
   103798 }
   103799 
   103800 
   103801 
   103802 #define GEN75_BCS_FAULT_REG_GTTSEL_start  11
   103803 #define GEN7_BCS_FAULT_REG_GTTSEL_start  11
   103804 #define GEN6_BCS_FAULT_REG_GTTSEL_start  11
   103805 
   103806 static inline uint32_t ATTRIBUTE_PURE
   103807 BCS_FAULT_REG_GTTSEL_start(const struct gen_device_info *devinfo)
   103808 {
   103809    switch (devinfo->gen) {
   103810    case 10: return 0;
   103811    case 9: return 0;
   103812    case 8: return 0;
   103813    case 7:
   103814       if (devinfo->is_haswell) {
   103815          return 11;
   103816       } else {
   103817          return 11;
   103818       }
   103819    case 6: return 11;
   103820    case 5: return 0;
   103821    case 4:
   103822       if (devinfo->is_g4x) {
   103823          return 0;
   103824       } else {
   103825          return 0;
   103826       }
   103827    default:
   103828       unreachable("Invalid hardware generation");
   103829    }
   103830 }
   103831 
   103832 
   103833 
   103834 /* BCS_FAULT_REG::SRCID of Fault */
   103835 
   103836 
   103837 #define GEN75_BCS_FAULT_REG_SRCIDofFault_bits  8
   103838 #define GEN7_BCS_FAULT_REG_SRCIDofFault_bits  8
   103839 #define GEN6_BCS_FAULT_REG_SRCIDofFault_bits  8
   103840 
   103841 static inline uint32_t ATTRIBUTE_PURE
   103842 BCS_FAULT_REG_SRCIDofFault_bits(const struct gen_device_info *devinfo)
   103843 {
   103844    switch (devinfo->gen) {
   103845    case 10: return 0;
   103846    case 9: return 0;
   103847    case 8: return 0;
   103848    case 7:
   103849       if (devinfo->is_haswell) {
   103850          return 8;
   103851       } else {
   103852          return 8;
   103853       }
   103854    case 6: return 8;
   103855    case 5: return 0;
   103856    case 4:
   103857       if (devinfo->is_g4x) {
   103858          return 0;
   103859       } else {
   103860          return 0;
   103861       }
   103862    default:
   103863       unreachable("Invalid hardware generation");
   103864    }
   103865 }
   103866 
   103867 
   103868 
   103869 #define GEN75_BCS_FAULT_REG_SRCIDofFault_start  3
   103870 #define GEN7_BCS_FAULT_REG_SRCIDofFault_start  3
   103871 #define GEN6_BCS_FAULT_REG_SRCIDofFault_start  3
   103872 
   103873 static inline uint32_t ATTRIBUTE_PURE
   103874 BCS_FAULT_REG_SRCIDofFault_start(const struct gen_device_info *devinfo)
   103875 {
   103876    switch (devinfo->gen) {
   103877    case 10: return 0;
   103878    case 9: return 0;
   103879    case 8: return 0;
   103880    case 7:
   103881       if (devinfo->is_haswell) {
   103882          return 3;
   103883       } else {
   103884          return 3;
   103885       }
   103886    case 6: return 3;
   103887    case 5: return 0;
   103888    case 4:
   103889       if (devinfo->is_g4x) {
   103890          return 0;
   103891       } else {
   103892          return 0;
   103893       }
   103894    default:
   103895       unreachable("Invalid hardware generation");
   103896    }
   103897 }
   103898 
   103899 
   103900 
   103901 /* BCS_FAULT_REG::Valid Bit */
   103902 
   103903 
   103904 #define GEN75_BCS_FAULT_REG_ValidBit_bits  1
   103905 #define GEN7_BCS_FAULT_REG_ValidBit_bits  1
   103906 #define GEN6_BCS_FAULT_REG_ValidBit_bits  1
   103907 
   103908 static inline uint32_t ATTRIBUTE_PURE
   103909 BCS_FAULT_REG_ValidBit_bits(const struct gen_device_info *devinfo)
   103910 {
   103911    switch (devinfo->gen) {
   103912    case 10: return 0;
   103913    case 9: return 0;
   103914    case 8: return 0;
   103915    case 7:
   103916       if (devinfo->is_haswell) {
   103917          return 1;
   103918       } else {
   103919          return 1;
   103920       }
   103921    case 6: return 1;
   103922    case 5: return 0;
   103923    case 4:
   103924       if (devinfo->is_g4x) {
   103925          return 0;
   103926       } else {
   103927          return 0;
   103928       }
   103929    default:
   103930       unreachable("Invalid hardware generation");
   103931    }
   103932 }
   103933 
   103934 
   103935 
   103936 #define GEN75_BCS_FAULT_REG_ValidBit_start  0
   103937 #define GEN7_BCS_FAULT_REG_ValidBit_start  0
   103938 #define GEN6_BCS_FAULT_REG_ValidBit_start  0
   103939 
   103940 static inline uint32_t ATTRIBUTE_PURE
   103941 BCS_FAULT_REG_ValidBit_start(const struct gen_device_info *devinfo)
   103942 {
   103943    switch (devinfo->gen) {
   103944    case 10: return 0;
   103945    case 9: return 0;
   103946    case 8: return 0;
   103947    case 7:
   103948       if (devinfo->is_haswell) {
   103949          return 0;
   103950       } else {
   103951          return 0;
   103952       }
   103953    case 6: return 0;
   103954    case 5: return 0;
   103955    case 4:
   103956       if (devinfo->is_g4x) {
   103957          return 0;
   103958       } else {
   103959          return 0;
   103960       }
   103961    default:
   103962       unreachable("Invalid hardware generation");
   103963    }
   103964 }
   103965 
   103966 
   103967 
   103968 /* BCS_FAULT_REG::Virtual Address of Fault */
   103969 
   103970 
   103971 #define GEN75_BCS_FAULT_REG_VirtualAddressofFault_bits  20
   103972 #define GEN7_BCS_FAULT_REG_VirtualAddressofFault_bits  20
   103973 #define GEN6_BCS_FAULT_REG_VirtualAddressofFault_bits  20
   103974 
   103975 static inline uint32_t ATTRIBUTE_PURE
   103976 BCS_FAULT_REG_VirtualAddressofFault_bits(const struct gen_device_info *devinfo)
   103977 {
   103978    switch (devinfo->gen) {
   103979    case 10: return 0;
   103980    case 9: return 0;
   103981    case 8: return 0;
   103982    case 7:
   103983       if (devinfo->is_haswell) {
   103984          return 20;
   103985       } else {
   103986          return 20;
   103987       }
   103988    case 6: return 20;
   103989    case 5: return 0;
   103990    case 4:
   103991       if (devinfo->is_g4x) {
   103992          return 0;
   103993       } else {
   103994          return 0;
   103995       }
   103996    default:
   103997       unreachable("Invalid hardware generation");
   103998    }
   103999 }
   104000 
   104001 
   104002 
   104003 #define GEN75_BCS_FAULT_REG_VirtualAddressofFault_start  12
   104004 #define GEN7_BCS_FAULT_REG_VirtualAddressofFault_start  12
   104005 #define GEN6_BCS_FAULT_REG_VirtualAddressofFault_start  12
   104006 
   104007 static inline uint32_t ATTRIBUTE_PURE
   104008 BCS_FAULT_REG_VirtualAddressofFault_start(const struct gen_device_info *devinfo)
   104009 {
   104010    switch (devinfo->gen) {
   104011    case 10: return 0;
   104012    case 9: return 0;
   104013    case 8: return 0;
   104014    case 7:
   104015       if (devinfo->is_haswell) {
   104016          return 12;
   104017       } else {
   104018          return 12;
   104019       }
   104020    case 6: return 12;
   104021    case 5: return 0;
   104022    case 4:
   104023       if (devinfo->is_g4x) {
   104024          return 0;
   104025       } else {
   104026          return 0;
   104027       }
   104028    default:
   104029       unreachable("Invalid hardware generation");
   104030    }
   104031 }
   104032 
   104033 
   104034 
   104035 /* BCS_INSTDONE */
   104036 
   104037 
   104038 #define GEN10_BCS_INSTDONE_length  1
   104039 #define GEN9_BCS_INSTDONE_length  1
   104040 #define GEN8_BCS_INSTDONE_length  1
   104041 #define GEN75_BCS_INSTDONE_length  1
   104042 #define GEN7_BCS_INSTDONE_length  1
   104043 #define GEN6_BCS_INSTDONE_length  1
   104044 
   104045 static inline uint32_t ATTRIBUTE_PURE
   104046 BCS_INSTDONE_length(const struct gen_device_info *devinfo)
   104047 {
   104048    switch (devinfo->gen) {
   104049    case 10: return 1;
   104050    case 9: return 1;
   104051    case 8: return 1;
   104052    case 7:
   104053       if (devinfo->is_haswell) {
   104054          return 1;
   104055       } else {
   104056          return 1;
   104057       }
   104058    case 6: return 1;
   104059    case 5: return 0;
   104060    case 4:
   104061       if (devinfo->is_g4x) {
   104062          return 0;
   104063       } else {
   104064          return 0;
   104065       }
   104066    default:
   104067       unreachable("Invalid hardware generation");
   104068    }
   104069 }
   104070 
   104071 
   104072 
   104073 /* BCS_INSTDONE::BCS Done */
   104074 
   104075 
   104076 #define GEN10_BCS_INSTDONE_BCSDone_bits  1
   104077 #define GEN9_BCS_INSTDONE_BCSDone_bits  1
   104078 #define GEN8_BCS_INSTDONE_BCSDone_bits  1
   104079 #define GEN75_BCS_INSTDONE_BCSDone_bits  1
   104080 #define GEN7_BCS_INSTDONE_BCSDone_bits  1
   104081 #define GEN6_BCS_INSTDONE_BCSDone_bits  1
   104082 
   104083 static inline uint32_t ATTRIBUTE_PURE
   104084 BCS_INSTDONE_BCSDone_bits(const struct gen_device_info *devinfo)
   104085 {
   104086    switch (devinfo->gen) {
   104087    case 10: return 1;
   104088    case 9: return 1;
   104089    case 8: return 1;
   104090    case 7:
   104091       if (devinfo->is_haswell) {
   104092          return 1;
   104093       } else {
   104094          return 1;
   104095       }
   104096    case 6: return 1;
   104097    case 5: return 0;
   104098    case 4:
   104099       if (devinfo->is_g4x) {
   104100          return 0;
   104101       } else {
   104102          return 0;
   104103       }
   104104    default:
   104105       unreachable("Invalid hardware generation");
   104106    }
   104107 }
   104108 
   104109 
   104110 
   104111 #define GEN10_BCS_INSTDONE_BCSDone_start  3
   104112 #define GEN9_BCS_INSTDONE_BCSDone_start  3
   104113 #define GEN8_BCS_INSTDONE_BCSDone_start  3
   104114 #define GEN75_BCS_INSTDONE_BCSDone_start  3
   104115 #define GEN7_BCS_INSTDONE_BCSDone_start  3
   104116 #define GEN6_BCS_INSTDONE_BCSDone_start  3
   104117 
   104118 static inline uint32_t ATTRIBUTE_PURE
   104119 BCS_INSTDONE_BCSDone_start(const struct gen_device_info *devinfo)
   104120 {
   104121    switch (devinfo->gen) {
   104122    case 10: return 3;
   104123    case 9: return 3;
   104124    case 8: return 3;
   104125    case 7:
   104126       if (devinfo->is_haswell) {
   104127          return 3;
   104128       } else {
   104129          return 3;
   104130       }
   104131    case 6: return 3;
   104132    case 5: return 0;
   104133    case 4:
   104134       if (devinfo->is_g4x) {
   104135          return 0;
   104136       } else {
   104137          return 0;
   104138       }
   104139    default:
   104140       unreachable("Invalid hardware generation");
   104141    }
   104142 }
   104143 
   104144 
   104145 
   104146 /* BCS_INSTDONE::Blitter IDLE */
   104147 
   104148 
   104149 #define GEN10_BCS_INSTDONE_BlitterIDLE_bits  1
   104150 #define GEN9_BCS_INSTDONE_BlitterIDLE_bits  1
   104151 #define GEN8_BCS_INSTDONE_BlitterIDLE_bits  1
   104152 #define GEN75_BCS_INSTDONE_BlitterIDLE_bits  1
   104153 #define GEN7_BCS_INSTDONE_BlitterIDLE_bits  1
   104154 #define GEN6_BCS_INSTDONE_BlitterIDLE_bits  1
   104155 
   104156 static inline uint32_t ATTRIBUTE_PURE
   104157 BCS_INSTDONE_BlitterIDLE_bits(const struct gen_device_info *devinfo)
   104158 {
   104159    switch (devinfo->gen) {
   104160    case 10: return 1;
   104161    case 9: return 1;
   104162    case 8: return 1;
   104163    case 7:
   104164       if (devinfo->is_haswell) {
   104165          return 1;
   104166       } else {
   104167          return 1;
   104168       }
   104169    case 6: return 1;
   104170    case 5: return 0;
   104171    case 4:
   104172       if (devinfo->is_g4x) {
   104173          return 0;
   104174       } else {
   104175          return 0;
   104176       }
   104177    default:
   104178       unreachable("Invalid hardware generation");
   104179    }
   104180 }
   104181 
   104182 
   104183 
   104184 #define GEN10_BCS_INSTDONE_BlitterIDLE_start  1
   104185 #define GEN9_BCS_INSTDONE_BlitterIDLE_start  1
   104186 #define GEN8_BCS_INSTDONE_BlitterIDLE_start  1
   104187 #define GEN75_BCS_INSTDONE_BlitterIDLE_start  1
   104188 #define GEN7_BCS_INSTDONE_BlitterIDLE_start  1
   104189 #define GEN6_BCS_INSTDONE_BlitterIDLE_start  1
   104190 
   104191 static inline uint32_t ATTRIBUTE_PURE
   104192 BCS_INSTDONE_BlitterIDLE_start(const struct gen_device_info *devinfo)
   104193 {
   104194    switch (devinfo->gen) {
   104195    case 10: return 1;
   104196    case 9: return 1;
   104197    case 8: return 1;
   104198    case 7:
   104199       if (devinfo->is_haswell) {
   104200          return 1;
   104201       } else {
   104202          return 1;
   104203       }
   104204    case 6: return 1;
   104205    case 5: return 0;
   104206    case 4:
   104207       if (devinfo->is_g4x) {
   104208          return 0;
   104209       } else {
   104210          return 0;
   104211       }
   104212    default:
   104213       unreachable("Invalid hardware generation");
   104214    }
   104215 }
   104216 
   104217 
   104218 
   104219 /* BCS_INSTDONE::GAB IDLE */
   104220 
   104221 
   104222 #define GEN10_BCS_INSTDONE_GABIDLE_bits  1
   104223 #define GEN9_BCS_INSTDONE_GABIDLE_bits  1
   104224 #define GEN8_BCS_INSTDONE_GABIDLE_bits  1
   104225 #define GEN75_BCS_INSTDONE_GABIDLE_bits  1
   104226 #define GEN7_BCS_INSTDONE_GABIDLE_bits  1
   104227 #define GEN6_BCS_INSTDONE_GABIDLE_bits  1
   104228 
   104229 static inline uint32_t ATTRIBUTE_PURE
   104230 BCS_INSTDONE_GABIDLE_bits(const struct gen_device_info *devinfo)
   104231 {
   104232    switch (devinfo->gen) {
   104233    case 10: return 1;
   104234    case 9: return 1;
   104235    case 8: return 1;
   104236    case 7:
   104237       if (devinfo->is_haswell) {
   104238          return 1;
   104239       } else {
   104240          return 1;
   104241       }
   104242    case 6: return 1;
   104243    case 5: return 0;
   104244    case 4:
   104245       if (devinfo->is_g4x) {
   104246          return 0;
   104247       } else {
   104248          return 0;
   104249       }
   104250    default:
   104251       unreachable("Invalid hardware generation");
   104252    }
   104253 }
   104254 
   104255 
   104256 
   104257 #define GEN10_BCS_INSTDONE_GABIDLE_start  2
   104258 #define GEN9_BCS_INSTDONE_GABIDLE_start  2
   104259 #define GEN8_BCS_INSTDONE_GABIDLE_start  2
   104260 #define GEN75_BCS_INSTDONE_GABIDLE_start  2
   104261 #define GEN7_BCS_INSTDONE_GABIDLE_start  2
   104262 #define GEN6_BCS_INSTDONE_GABIDLE_start  2
   104263 
   104264 static inline uint32_t ATTRIBUTE_PURE
   104265 BCS_INSTDONE_GABIDLE_start(const struct gen_device_info *devinfo)
   104266 {
   104267    switch (devinfo->gen) {
   104268    case 10: return 2;
   104269    case 9: return 2;
   104270    case 8: return 2;
   104271    case 7:
   104272       if (devinfo->is_haswell) {
   104273          return 2;
   104274       } else {
   104275          return 2;
   104276       }
   104277    case 6: return 2;
   104278    case 5: return 0;
   104279    case 4:
   104280       if (devinfo->is_g4x) {
   104281          return 0;
   104282       } else {
   104283          return 0;
   104284       }
   104285    default:
   104286       unreachable("Invalid hardware generation");
   104287    }
   104288 }
   104289 
   104290 
   104291 
   104292 /* BCS_INSTDONE::Ring Enable */
   104293 
   104294 
   104295 #define GEN10_BCS_INSTDONE_RingEnable_bits  1
   104296 #define GEN9_BCS_INSTDONE_RingEnable_bits  1
   104297 #define GEN8_BCS_INSTDONE_RingEnable_bits  1
   104298 #define GEN75_BCS_INSTDONE_RingEnable_bits  1
   104299 #define GEN7_BCS_INSTDONE_RingEnable_bits  1
   104300 #define GEN6_BCS_INSTDONE_RingEnable_bits  1
   104301 
   104302 static inline uint32_t ATTRIBUTE_PURE
   104303 BCS_INSTDONE_RingEnable_bits(const struct gen_device_info *devinfo)
   104304 {
   104305    switch (devinfo->gen) {
   104306    case 10: return 1;
   104307    case 9: return 1;
   104308    case 8: return 1;
   104309    case 7:
   104310       if (devinfo->is_haswell) {
   104311          return 1;
   104312       } else {
   104313          return 1;
   104314       }
   104315    case 6: return 1;
   104316    case 5: return 0;
   104317    case 4:
   104318       if (devinfo->is_g4x) {
   104319          return 0;
   104320       } else {
   104321          return 0;
   104322       }
   104323    default:
   104324       unreachable("Invalid hardware generation");
   104325    }
   104326 }
   104327 
   104328 
   104329 
   104330 #define GEN10_BCS_INSTDONE_RingEnable_start  0
   104331 #define GEN9_BCS_INSTDONE_RingEnable_start  0
   104332 #define GEN8_BCS_INSTDONE_RingEnable_start  0
   104333 #define GEN75_BCS_INSTDONE_RingEnable_start  0
   104334 #define GEN7_BCS_INSTDONE_RingEnable_start  0
   104335 #define GEN6_BCS_INSTDONE_RingEnable_start  0
   104336 
   104337 static inline uint32_t ATTRIBUTE_PURE
   104338 BCS_INSTDONE_RingEnable_start(const struct gen_device_info *devinfo)
   104339 {
   104340    switch (devinfo->gen) {
   104341    case 10: return 0;
   104342    case 9: return 0;
   104343    case 8: return 0;
   104344    case 7:
   104345       if (devinfo->is_haswell) {
   104346          return 0;
   104347       } else {
   104348          return 0;
   104349       }
   104350    case 6: return 0;
   104351    case 5: return 0;
   104352    case 4:
   104353       if (devinfo->is_g4x) {
   104354          return 0;
   104355       } else {
   104356          return 0;
   104357       }
   104358    default:
   104359       unreachable("Invalid hardware generation");
   104360    }
   104361 }
   104362 
   104363 
   104364 
   104365 /* BCS_RING_BUFFER_CTL */
   104366 
   104367 
   104368 #define GEN9_BCS_RING_BUFFER_CTL_length  1
   104369 #define GEN8_BCS_RING_BUFFER_CTL_length  1
   104370 #define GEN75_BCS_RING_BUFFER_CTL_length  1
   104371 #define GEN7_BCS_RING_BUFFER_CTL_length  1
   104372 #define GEN6_BCS_RING_BUFFER_CTL_length  1
   104373 
   104374 static inline uint32_t ATTRIBUTE_PURE
   104375 BCS_RING_BUFFER_CTL_length(const struct gen_device_info *devinfo)
   104376 {
   104377    switch (devinfo->gen) {
   104378    case 10: return 0;
   104379    case 9: return 1;
   104380    case 8: return 1;
   104381    case 7:
   104382       if (devinfo->is_haswell) {
   104383          return 1;
   104384       } else {
   104385          return 1;
   104386       }
   104387    case 6: return 1;
   104388    case 5: return 0;
   104389    case 4:
   104390       if (devinfo->is_g4x) {
   104391          return 0;
   104392       } else {
   104393          return 0;
   104394       }
   104395    default:
   104396       unreachable("Invalid hardware generation");
   104397    }
   104398 }
   104399 
   104400 
   104401 
   104402 /* BCS_RING_BUFFER_CTL::Automatic Report Head Pointer */
   104403 
   104404 
   104405 #define GEN9_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   104406 #define GEN8_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   104407 #define GEN75_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   104408 #define GEN7_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   104409 #define GEN6_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   104410 
   104411 static inline uint32_t ATTRIBUTE_PURE
   104412 BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits(const struct gen_device_info *devinfo)
   104413 {
   104414    switch (devinfo->gen) {
   104415    case 10: return 0;
   104416    case 9: return 2;
   104417    case 8: return 2;
   104418    case 7:
   104419       if (devinfo->is_haswell) {
   104420          return 2;
   104421       } else {
   104422          return 2;
   104423       }
   104424    case 6: return 2;
   104425    case 5: return 0;
   104426    case 4:
   104427       if (devinfo->is_g4x) {
   104428          return 0;
   104429       } else {
   104430          return 0;
   104431       }
   104432    default:
   104433       unreachable("Invalid hardware generation");
   104434    }
   104435 }
   104436 
   104437 
   104438 
   104439 #define GEN9_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   104440 #define GEN8_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   104441 #define GEN75_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   104442 #define GEN7_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   104443 #define GEN6_BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   104444 
   104445 static inline uint32_t ATTRIBUTE_PURE
   104446 BCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start(const struct gen_device_info *devinfo)
   104447 {
   104448    switch (devinfo->gen) {
   104449    case 10: return 0;
   104450    case 9: return 1;
   104451    case 8: return 1;
   104452    case 7:
   104453       if (devinfo->is_haswell) {
   104454          return 1;
   104455       } else {
   104456          return 1;
   104457       }
   104458    case 6: return 1;
   104459    case 5: return 0;
   104460    case 4:
   104461       if (devinfo->is_g4x) {
   104462          return 0;
   104463       } else {
   104464          return 0;
   104465       }
   104466    default:
   104467       unreachable("Invalid hardware generation");
   104468    }
   104469 }
   104470 
   104471 
   104472 
   104473 /* BCS_RING_BUFFER_CTL::Buffer Length (in pages - 1) */
   104474 
   104475 
   104476 #define GEN9_BCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   104477 #define GEN8_BCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   104478 #define GEN75_BCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   104479 #define GEN7_BCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   104480 #define GEN6_BCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   104481 
   104482 static inline uint32_t ATTRIBUTE_PURE
   104483 BCS_RING_BUFFER_CTL_BufferLengthinpages1_bits(const struct gen_device_info *devinfo)
   104484 {
   104485    switch (devinfo->gen) {
   104486    case 10: return 0;
   104487    case 9: return 9;
   104488    case 8: return 9;
   104489    case 7:
   104490       if (devinfo->is_haswell) {
   104491          return 9;
   104492       } else {
   104493          return 9;
   104494       }
   104495    case 6: return 9;
   104496    case 5: return 0;
   104497    case 4:
   104498       if (devinfo->is_g4x) {
   104499          return 0;
   104500       } else {
   104501          return 0;
   104502       }
   104503    default:
   104504       unreachable("Invalid hardware generation");
   104505    }
   104506 }
   104507 
   104508 
   104509 
   104510 #define GEN9_BCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   104511 #define GEN8_BCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   104512 #define GEN75_BCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   104513 #define GEN7_BCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   104514 #define GEN6_BCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   104515 
   104516 static inline uint32_t ATTRIBUTE_PURE
   104517 BCS_RING_BUFFER_CTL_BufferLengthinpages1_start(const struct gen_device_info *devinfo)
   104518 {
   104519    switch (devinfo->gen) {
   104520    case 10: return 0;
   104521    case 9: return 12;
   104522    case 8: return 12;
   104523    case 7:
   104524       if (devinfo->is_haswell) {
   104525          return 12;
   104526       } else {
   104527          return 12;
   104528       }
   104529    case 6: return 12;
   104530    case 5: return 0;
   104531    case 4:
   104532       if (devinfo->is_g4x) {
   104533          return 0;
   104534       } else {
   104535          return 0;
   104536       }
   104537    default:
   104538       unreachable("Invalid hardware generation");
   104539    }
   104540 }
   104541 
   104542 
   104543 
   104544 /* BCS_RING_BUFFER_CTL::Disable Register Accesses */
   104545 
   104546 
   104547 #define GEN9_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   104548 #define GEN8_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   104549 #define GEN75_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   104550 #define GEN7_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   104551 #define GEN6_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   104552 
   104553 static inline uint32_t ATTRIBUTE_PURE
   104554 BCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits(const struct gen_device_info *devinfo)
   104555 {
   104556    switch (devinfo->gen) {
   104557    case 10: return 0;
   104558    case 9: return 1;
   104559    case 8: return 1;
   104560    case 7:
   104561       if (devinfo->is_haswell) {
   104562          return 1;
   104563       } else {
   104564          return 1;
   104565       }
   104566    case 6: return 1;
   104567    case 5: return 0;
   104568    case 4:
   104569       if (devinfo->is_g4x) {
   104570          return 0;
   104571       } else {
   104572          return 0;
   104573       }
   104574    default:
   104575       unreachable("Invalid hardware generation");
   104576    }
   104577 }
   104578 
   104579 
   104580 
   104581 #define GEN9_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   104582 #define GEN8_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   104583 #define GEN75_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   104584 #define GEN7_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   104585 #define GEN6_BCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   104586 
   104587 static inline uint32_t ATTRIBUTE_PURE
   104588 BCS_RING_BUFFER_CTL_DisableRegisterAccesses_start(const struct gen_device_info *devinfo)
   104589 {
   104590    switch (devinfo->gen) {
   104591    case 10: return 0;
   104592    case 9: return 8;
   104593    case 8: return 8;
   104594    case 7:
   104595       if (devinfo->is_haswell) {
   104596          return 8;
   104597       } else {
   104598          return 8;
   104599       }
   104600    case 6: return 8;
   104601    case 5: return 0;
   104602    case 4:
   104603       if (devinfo->is_g4x) {
   104604          return 0;
   104605       } else {
   104606          return 0;
   104607       }
   104608    default:
   104609       unreachable("Invalid hardware generation");
   104610    }
   104611 }
   104612 
   104613 
   104614 
   104615 /* BCS_RING_BUFFER_CTL::RBWait */
   104616 
   104617 
   104618 #define GEN9_BCS_RING_BUFFER_CTL_RBWait_bits  1
   104619 #define GEN8_BCS_RING_BUFFER_CTL_RBWait_bits  1
   104620 #define GEN75_BCS_RING_BUFFER_CTL_RBWait_bits  1
   104621 #define GEN7_BCS_RING_BUFFER_CTL_RBWait_bits  1
   104622 #define GEN6_BCS_RING_BUFFER_CTL_RBWait_bits  1
   104623 
   104624 static inline uint32_t ATTRIBUTE_PURE
   104625 BCS_RING_BUFFER_CTL_RBWait_bits(const struct gen_device_info *devinfo)
   104626 {
   104627    switch (devinfo->gen) {
   104628    case 10: return 0;
   104629    case 9: return 1;
   104630    case 8: return 1;
   104631    case 7:
   104632       if (devinfo->is_haswell) {
   104633          return 1;
   104634       } else {
   104635          return 1;
   104636       }
   104637    case 6: return 1;
   104638    case 5: return 0;
   104639    case 4:
   104640       if (devinfo->is_g4x) {
   104641          return 0;
   104642       } else {
   104643          return 0;
   104644       }
   104645    default:
   104646       unreachable("Invalid hardware generation");
   104647    }
   104648 }
   104649 
   104650 
   104651 
   104652 #define GEN9_BCS_RING_BUFFER_CTL_RBWait_start  11
   104653 #define GEN8_BCS_RING_BUFFER_CTL_RBWait_start  11
   104654 #define GEN75_BCS_RING_BUFFER_CTL_RBWait_start  11
   104655 #define GEN7_BCS_RING_BUFFER_CTL_RBWait_start  11
   104656 #define GEN6_BCS_RING_BUFFER_CTL_RBWait_start  11
   104657 
   104658 static inline uint32_t ATTRIBUTE_PURE
   104659 BCS_RING_BUFFER_CTL_RBWait_start(const struct gen_device_info *devinfo)
   104660 {
   104661    switch (devinfo->gen) {
   104662    case 10: return 0;
   104663    case 9: return 11;
   104664    case 8: return 11;
   104665    case 7:
   104666       if (devinfo->is_haswell) {
   104667          return 11;
   104668       } else {
   104669          return 11;
   104670       }
   104671    case 6: return 11;
   104672    case 5: return 0;
   104673    case 4:
   104674       if (devinfo->is_g4x) {
   104675          return 0;
   104676       } else {
   104677          return 0;
   104678       }
   104679    default:
   104680       unreachable("Invalid hardware generation");
   104681    }
   104682 }
   104683 
   104684 
   104685 
   104686 /* BCS_RING_BUFFER_CTL::Ring Buffer Enable */
   104687 
   104688 
   104689 #define GEN9_BCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   104690 #define GEN8_BCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   104691 #define GEN75_BCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   104692 #define GEN7_BCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   104693 #define GEN6_BCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   104694 
   104695 static inline uint32_t ATTRIBUTE_PURE
   104696 BCS_RING_BUFFER_CTL_RingBufferEnable_bits(const struct gen_device_info *devinfo)
   104697 {
   104698    switch (devinfo->gen) {
   104699    case 10: return 0;
   104700    case 9: return 1;
   104701    case 8: return 1;
   104702    case 7:
   104703       if (devinfo->is_haswell) {
   104704          return 1;
   104705       } else {
   104706          return 1;
   104707       }
   104708    case 6: return 1;
   104709    case 5: return 0;
   104710    case 4:
   104711       if (devinfo->is_g4x) {
   104712          return 0;
   104713       } else {
   104714          return 0;
   104715       }
   104716    default:
   104717       unreachable("Invalid hardware generation");
   104718    }
   104719 }
   104720 
   104721 
   104722 
   104723 #define GEN9_BCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   104724 #define GEN8_BCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   104725 #define GEN75_BCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   104726 #define GEN7_BCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   104727 #define GEN6_BCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   104728 
   104729 static inline uint32_t ATTRIBUTE_PURE
   104730 BCS_RING_BUFFER_CTL_RingBufferEnable_start(const struct gen_device_info *devinfo)
   104731 {
   104732    switch (devinfo->gen) {
   104733    case 10: return 0;
   104734    case 9: return 0;
   104735    case 8: return 0;
   104736    case 7:
   104737       if (devinfo->is_haswell) {
   104738          return 0;
   104739       } else {
   104740          return 0;
   104741       }
   104742    case 6: return 0;
   104743    case 5: return 0;
   104744    case 4:
   104745       if (devinfo->is_g4x) {
   104746          return 0;
   104747       } else {
   104748          return 0;
   104749       }
   104750    default:
   104751       unreachable("Invalid hardware generation");
   104752    }
   104753 }
   104754 
   104755 
   104756 
   104757 /* BCS_RING_BUFFER_CTL::Semaphore Wait */
   104758 
   104759 
   104760 #define GEN9_BCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   104761 #define GEN8_BCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   104762 #define GEN75_BCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   104763 #define GEN7_BCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   104764 #define GEN6_BCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   104765 
   104766 static inline uint32_t ATTRIBUTE_PURE
   104767 BCS_RING_BUFFER_CTL_SemaphoreWait_bits(const struct gen_device_info *devinfo)
   104768 {
   104769    switch (devinfo->gen) {
   104770    case 10: return 0;
   104771    case 9: return 1;
   104772    case 8: return 1;
   104773    case 7:
   104774       if (devinfo->is_haswell) {
   104775          return 1;
   104776       } else {
   104777          return 1;
   104778       }
   104779    case 6: return 1;
   104780    case 5: return 0;
   104781    case 4:
   104782       if (devinfo->is_g4x) {
   104783          return 0;
   104784       } else {
   104785          return 0;
   104786       }
   104787    default:
   104788       unreachable("Invalid hardware generation");
   104789    }
   104790 }
   104791 
   104792 
   104793 
   104794 #define GEN9_BCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   104795 #define GEN8_BCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   104796 #define GEN75_BCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   104797 #define GEN7_BCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   104798 #define GEN6_BCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   104799 
   104800 static inline uint32_t ATTRIBUTE_PURE
   104801 BCS_RING_BUFFER_CTL_SemaphoreWait_start(const struct gen_device_info *devinfo)
   104802 {
   104803    switch (devinfo->gen) {
   104804    case 10: return 0;
   104805    case 9: return 10;
   104806    case 8: return 10;
   104807    case 7:
   104808       if (devinfo->is_haswell) {
   104809          return 10;
   104810       } else {
   104811          return 10;
   104812       }
   104813    case 6: return 10;
   104814    case 5: return 0;
   104815    case 4:
   104816       if (devinfo->is_g4x) {
   104817          return 0;
   104818       } else {
   104819          return 0;
   104820       }
   104821    default:
   104822       unreachable("Invalid hardware generation");
   104823    }
   104824 }
   104825 
   104826 
   104827 
   104828 /* BINDING_TABLE_EDIT_ENTRY */
   104829 
   104830 
   104831 #define GEN10_BINDING_TABLE_EDIT_ENTRY_length  1
   104832 #define GEN9_BINDING_TABLE_EDIT_ENTRY_length  1
   104833 #define GEN8_BINDING_TABLE_EDIT_ENTRY_length  1
   104834 #define GEN75_BINDING_TABLE_EDIT_ENTRY_length  1
   104835 
   104836 static inline uint32_t ATTRIBUTE_PURE
   104837 BINDING_TABLE_EDIT_ENTRY_length(const struct gen_device_info *devinfo)
   104838 {
   104839    switch (devinfo->gen) {
   104840    case 10: return 1;
   104841    case 9: return 1;
   104842    case 8: return 1;
   104843    case 7:
   104844       if (devinfo->is_haswell) {
   104845          return 1;
   104846       } else {
   104847          return 0;
   104848       }
   104849    case 6: return 0;
   104850    case 5: return 0;
   104851    case 4:
   104852       if (devinfo->is_g4x) {
   104853          return 0;
   104854       } else {
   104855          return 0;
   104856       }
   104857    default:
   104858       unreachable("Invalid hardware generation");
   104859    }
   104860 }
   104861 
   104862 
   104863 
   104864 /* BINDING_TABLE_EDIT_ENTRY::Binding Table Index */
   104865 
   104866 
   104867 #define GEN10_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_bits  8
   104868 #define GEN9_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_bits  8
   104869 #define GEN8_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_bits  8
   104870 #define GEN75_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_bits  8
   104871 
   104872 static inline uint32_t ATTRIBUTE_PURE
   104873 BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_bits(const struct gen_device_info *devinfo)
   104874 {
   104875    switch (devinfo->gen) {
   104876    case 10: return 8;
   104877    case 9: return 8;
   104878    case 8: return 8;
   104879    case 7:
   104880       if (devinfo->is_haswell) {
   104881          return 8;
   104882       } else {
   104883          return 0;
   104884       }
   104885    case 6: return 0;
   104886    case 5: return 0;
   104887    case 4:
   104888       if (devinfo->is_g4x) {
   104889          return 0;
   104890       } else {
   104891          return 0;
   104892       }
   104893    default:
   104894       unreachable("Invalid hardware generation");
   104895    }
   104896 }
   104897 
   104898 
   104899 
   104900 #define GEN10_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_start  16
   104901 #define GEN9_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_start  16
   104902 #define GEN8_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_start  16
   104903 #define GEN75_BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_start  16
   104904 
   104905 static inline uint32_t ATTRIBUTE_PURE
   104906 BINDING_TABLE_EDIT_ENTRY_BindingTableIndex_start(const struct gen_device_info *devinfo)
   104907 {
   104908    switch (devinfo->gen) {
   104909    case 10: return 16;
   104910    case 9: return 16;
   104911    case 8: return 16;
   104912    case 7:
   104913       if (devinfo->is_haswell) {
   104914          return 16;
   104915       } else {
   104916          return 0;
   104917       }
   104918    case 6: return 0;
   104919    case 5: return 0;
   104920    case 4:
   104921       if (devinfo->is_g4x) {
   104922          return 0;
   104923       } else {
   104924          return 0;
   104925       }
   104926    default:
   104927       unreachable("Invalid hardware generation");
   104928    }
   104929 }
   104930 
   104931 
   104932 
   104933 /* BINDING_TABLE_EDIT_ENTRY::Surface State Pointer */
   104934 
   104935 
   104936 #define GEN10_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_bits  16
   104937 #define GEN9_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_bits  16
   104938 #define GEN8_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_bits  16
   104939 #define GEN75_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_bits  16
   104940 
   104941 static inline uint32_t ATTRIBUTE_PURE
   104942 BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_bits(const struct gen_device_info *devinfo)
   104943 {
   104944    switch (devinfo->gen) {
   104945    case 10: return 16;
   104946    case 9: return 16;
   104947    case 8: return 16;
   104948    case 7:
   104949       if (devinfo->is_haswell) {
   104950          return 16;
   104951       } else {
   104952          return 0;
   104953       }
   104954    case 6: return 0;
   104955    case 5: return 0;
   104956    case 4:
   104957       if (devinfo->is_g4x) {
   104958          return 0;
   104959       } else {
   104960          return 0;
   104961       }
   104962    default:
   104963       unreachable("Invalid hardware generation");
   104964    }
   104965 }
   104966 
   104967 
   104968 
   104969 #define GEN10_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_start  0
   104970 #define GEN9_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_start  0
   104971 #define GEN8_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_start  0
   104972 #define GEN75_BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_start  0
   104973 
   104974 static inline uint32_t ATTRIBUTE_PURE
   104975 BINDING_TABLE_EDIT_ENTRY_SurfaceStatePointer_start(const struct gen_device_info *devinfo)
   104976 {
   104977    switch (devinfo->gen) {
   104978    case 10: return 0;
   104979    case 9: return 0;
   104980    case 8: return 0;
   104981    case 7:
   104982       if (devinfo->is_haswell) {
   104983          return 0;
   104984       } else {
   104985          return 0;
   104986       }
   104987    case 6: return 0;
   104988    case 5: return 0;
   104989    case 4:
   104990       if (devinfo->is_g4x) {
   104991          return 0;
   104992       } else {
   104993          return 0;
   104994       }
   104995    default:
   104996       unreachable("Invalid hardware generation");
   104997    }
   104998 }
   104999 
   105000 
   105001 
   105002 /* BINDING_TABLE_STATE */
   105003 
   105004 
   105005 #define GEN10_BINDING_TABLE_STATE_length  1
   105006 #define GEN9_BINDING_TABLE_STATE_length  1
   105007 #define GEN8_BINDING_TABLE_STATE_length  1
   105008 #define GEN75_BINDING_TABLE_STATE_length  1
   105009 #define GEN7_BINDING_TABLE_STATE_length  1
   105010 #define GEN6_BINDING_TABLE_STATE_length  1
   105011 
   105012 static inline uint32_t ATTRIBUTE_PURE
   105013 BINDING_TABLE_STATE_length(const struct gen_device_info *devinfo)
   105014 {
   105015    switch (devinfo->gen) {
   105016    case 10: return 1;
   105017    case 9: return 1;
   105018    case 8: return 1;
   105019    case 7:
   105020       if (devinfo->is_haswell) {
   105021          return 1;
   105022       } else {
   105023          return 1;
   105024       }
   105025    case 6: return 1;
   105026    case 5: return 0;
   105027    case 4:
   105028       if (devinfo->is_g4x) {
   105029          return 0;
   105030       } else {
   105031          return 0;
   105032       }
   105033    default:
   105034       unreachable("Invalid hardware generation");
   105035    }
   105036 }
   105037 
   105038 
   105039 
   105040 /* BINDING_TABLE_STATE::Surface State Pointer */
   105041 
   105042 
   105043 #define GEN10_BINDING_TABLE_STATE_SurfaceStatePointer_bits  26
   105044 #define GEN9_BINDING_TABLE_STATE_SurfaceStatePointer_bits  26
   105045 #define GEN8_BINDING_TABLE_STATE_SurfaceStatePointer_bits  26
   105046 #define GEN75_BINDING_TABLE_STATE_SurfaceStatePointer_bits  27
   105047 #define GEN7_BINDING_TABLE_STATE_SurfaceStatePointer_bits  27
   105048 #define GEN6_BINDING_TABLE_STATE_SurfaceStatePointer_bits  27
   105049 
   105050 static inline uint32_t ATTRIBUTE_PURE
   105051 BINDING_TABLE_STATE_SurfaceStatePointer_bits(const struct gen_device_info *devinfo)
   105052 {
   105053    switch (devinfo->gen) {
   105054    case 10: return 26;
   105055    case 9: return 26;
   105056    case 8: return 26;
   105057    case 7:
   105058       if (devinfo->is_haswell) {
   105059          return 27;
   105060       } else {
   105061          return 27;
   105062       }
   105063    case 6: return 27;
   105064    case 5: return 0;
   105065    case 4:
   105066       if (devinfo->is_g4x) {
   105067          return 0;
   105068       } else {
   105069          return 0;
   105070       }
   105071    default:
   105072       unreachable("Invalid hardware generation");
   105073    }
   105074 }
   105075 
   105076 
   105077 
   105078 #define GEN10_BINDING_TABLE_STATE_SurfaceStatePointer_start  6
   105079 #define GEN9_BINDING_TABLE_STATE_SurfaceStatePointer_start  6
   105080 #define GEN8_BINDING_TABLE_STATE_SurfaceStatePointer_start  6
   105081 #define GEN75_BINDING_TABLE_STATE_SurfaceStatePointer_start  5
   105082 #define GEN7_BINDING_TABLE_STATE_SurfaceStatePointer_start  5
   105083 #define GEN6_BINDING_TABLE_STATE_SurfaceStatePointer_start  5
   105084 
   105085 static inline uint32_t ATTRIBUTE_PURE
   105086 BINDING_TABLE_STATE_SurfaceStatePointer_start(const struct gen_device_info *devinfo)
   105087 {
   105088    switch (devinfo->gen) {
   105089    case 10: return 6;
   105090    case 9: return 6;
   105091    case 8: return 6;
   105092    case 7:
   105093       if (devinfo->is_haswell) {
   105094          return 5;
   105095       } else {
   105096          return 5;
   105097       }
   105098    case 6: return 5;
   105099    case 5: return 0;
   105100    case 4:
   105101       if (devinfo->is_g4x) {
   105102          return 0;
   105103       } else {
   105104          return 0;
   105105       }
   105106    default:
   105107       unreachable("Invalid hardware generation");
   105108    }
   105109 }
   105110 
   105111 
   105112 
   105113 /* BLEND_STATE */
   105114 
   105115 
   105116 #define GEN10_BLEND_STATE_length  1
   105117 #define GEN9_BLEND_STATE_length  1
   105118 #define GEN8_BLEND_STATE_length  1
   105119 #define GEN75_BLEND_STATE_length  0
   105120 #define GEN7_BLEND_STATE_length  0
   105121 #define GEN6_BLEND_STATE_length  0
   105122 
   105123 static inline uint32_t ATTRIBUTE_PURE
   105124 BLEND_STATE_length(const struct gen_device_info *devinfo)
   105125 {
   105126    switch (devinfo->gen) {
   105127    case 10: return 1;
   105128    case 9: return 1;
   105129    case 8: return 1;
   105130    case 7:
   105131       if (devinfo->is_haswell) {
   105132          return 0;
   105133       } else {
   105134          return 0;
   105135       }
   105136    case 6: return 0;
   105137    case 5: return 0;
   105138    case 4:
   105139       if (devinfo->is_g4x) {
   105140          return 0;
   105141       } else {
   105142          return 0;
   105143       }
   105144    default:
   105145       unreachable("Invalid hardware generation");
   105146    }
   105147 }
   105148 
   105149 
   105150 
   105151 /* BLEND_STATE::Alpha Test Enable */
   105152 
   105153 
   105154 #define GEN10_BLEND_STATE_AlphaTestEnable_bits  1
   105155 #define GEN9_BLEND_STATE_AlphaTestEnable_bits  1
   105156 #define GEN8_BLEND_STATE_AlphaTestEnable_bits  1
   105157 
   105158 static inline uint32_t ATTRIBUTE_PURE
   105159 BLEND_STATE_AlphaTestEnable_bits(const struct gen_device_info *devinfo)
   105160 {
   105161    switch (devinfo->gen) {
   105162    case 10: return 1;
   105163    case 9: return 1;
   105164    case 8: return 1;
   105165    case 7:
   105166       if (devinfo->is_haswell) {
   105167          return 0;
   105168       } else {
   105169          return 0;
   105170       }
   105171    case 6: return 0;
   105172    case 5: return 0;
   105173    case 4:
   105174       if (devinfo->is_g4x) {
   105175          return 0;
   105176       } else {
   105177          return 0;
   105178       }
   105179    default:
   105180       unreachable("Invalid hardware generation");
   105181    }
   105182 }
   105183 
   105184 
   105185 
   105186 #define GEN10_BLEND_STATE_AlphaTestEnable_start  27
   105187 #define GEN9_BLEND_STATE_AlphaTestEnable_start  27
   105188 #define GEN8_BLEND_STATE_AlphaTestEnable_start  27
   105189 
   105190 static inline uint32_t ATTRIBUTE_PURE
   105191 BLEND_STATE_AlphaTestEnable_start(const struct gen_device_info *devinfo)
   105192 {
   105193    switch (devinfo->gen) {
   105194    case 10: return 27;
   105195    case 9: return 27;
   105196    case 8: return 27;
   105197    case 7:
   105198       if (devinfo->is_haswell) {
   105199          return 0;
   105200       } else {
   105201          return 0;
   105202       }
   105203    case 6: return 0;
   105204    case 5: return 0;
   105205    case 4:
   105206       if (devinfo->is_g4x) {
   105207          return 0;
   105208       } else {
   105209          return 0;
   105210       }
   105211    default:
   105212       unreachable("Invalid hardware generation");
   105213    }
   105214 }
   105215 
   105216 
   105217 
   105218 /* BLEND_STATE::Alpha Test Function */
   105219 
   105220 
   105221 #define GEN10_BLEND_STATE_AlphaTestFunction_bits  3
   105222 #define GEN9_BLEND_STATE_AlphaTestFunction_bits  3
   105223 #define GEN8_BLEND_STATE_AlphaTestFunction_bits  3
   105224 
   105225 static inline uint32_t ATTRIBUTE_PURE
   105226 BLEND_STATE_AlphaTestFunction_bits(const struct gen_device_info *devinfo)
   105227 {
   105228    switch (devinfo->gen) {
   105229    case 10: return 3;
   105230    case 9: return 3;
   105231    case 8: return 3;
   105232    case 7:
   105233       if (devinfo->is_haswell) {
   105234          return 0;
   105235       } else {
   105236          return 0;
   105237       }
   105238    case 6: return 0;
   105239    case 5: return 0;
   105240    case 4:
   105241       if (devinfo->is_g4x) {
   105242          return 0;
   105243       } else {
   105244          return 0;
   105245       }
   105246    default:
   105247       unreachable("Invalid hardware generation");
   105248    }
   105249 }
   105250 
   105251 
   105252 
   105253 #define GEN10_BLEND_STATE_AlphaTestFunction_start  24
   105254 #define GEN9_BLEND_STATE_AlphaTestFunction_start  24
   105255 #define GEN8_BLEND_STATE_AlphaTestFunction_start  24
   105256 
   105257 static inline uint32_t ATTRIBUTE_PURE
   105258 BLEND_STATE_AlphaTestFunction_start(const struct gen_device_info *devinfo)
   105259 {
   105260    switch (devinfo->gen) {
   105261    case 10: return 24;
   105262    case 9: return 24;
   105263    case 8: return 24;
   105264    case 7:
   105265       if (devinfo->is_haswell) {
   105266          return 0;
   105267       } else {
   105268          return 0;
   105269       }
   105270    case 6: return 0;
   105271    case 5: return 0;
   105272    case 4:
   105273       if (devinfo->is_g4x) {
   105274          return 0;
   105275       } else {
   105276          return 0;
   105277       }
   105278    default:
   105279       unreachable("Invalid hardware generation");
   105280    }
   105281 }
   105282 
   105283 
   105284 
   105285 /* BLEND_STATE::Alpha To Coverage Dither Enable */
   105286 
   105287 
   105288 #define GEN10_BLEND_STATE_AlphaToCoverageDitherEnable_bits  1
   105289 #define GEN9_BLEND_STATE_AlphaToCoverageDitherEnable_bits  1
   105290 #define GEN8_BLEND_STATE_AlphaToCoverageDitherEnable_bits  1
   105291 
   105292 static inline uint32_t ATTRIBUTE_PURE
   105293 BLEND_STATE_AlphaToCoverageDitherEnable_bits(const struct gen_device_info *devinfo)
   105294 {
   105295    switch (devinfo->gen) {
   105296    case 10: return 1;
   105297    case 9: return 1;
   105298    case 8: return 1;
   105299    case 7:
   105300       if (devinfo->is_haswell) {
   105301          return 0;
   105302       } else {
   105303          return 0;
   105304       }
   105305    case 6: return 0;
   105306    case 5: return 0;
   105307    case 4:
   105308       if (devinfo->is_g4x) {
   105309          return 0;
   105310       } else {
   105311          return 0;
   105312       }
   105313    default:
   105314       unreachable("Invalid hardware generation");
   105315    }
   105316 }
   105317 
   105318 
   105319 
   105320 #define GEN10_BLEND_STATE_AlphaToCoverageDitherEnable_start  28
   105321 #define GEN9_BLEND_STATE_AlphaToCoverageDitherEnable_start  28
   105322 #define GEN8_BLEND_STATE_AlphaToCoverageDitherEnable_start  28
   105323 
   105324 static inline uint32_t ATTRIBUTE_PURE
   105325 BLEND_STATE_AlphaToCoverageDitherEnable_start(const struct gen_device_info *devinfo)
   105326 {
   105327    switch (devinfo->gen) {
   105328    case 10: return 28;
   105329    case 9: return 28;
   105330    case 8: return 28;
   105331    case 7:
   105332       if (devinfo->is_haswell) {
   105333          return 0;
   105334       } else {
   105335          return 0;
   105336       }
   105337    case 6: return 0;
   105338    case 5: return 0;
   105339    case 4:
   105340       if (devinfo->is_g4x) {
   105341          return 0;
   105342       } else {
   105343          return 0;
   105344       }
   105345    default:
   105346       unreachable("Invalid hardware generation");
   105347    }
   105348 }
   105349 
   105350 
   105351 
   105352 /* BLEND_STATE::Alpha To Coverage Enable */
   105353 
   105354 
   105355 #define GEN10_BLEND_STATE_AlphaToCoverageEnable_bits  1
   105356 #define GEN9_BLEND_STATE_AlphaToCoverageEnable_bits  1
   105357 #define GEN8_BLEND_STATE_AlphaToCoverageEnable_bits  1
   105358 
   105359 static inline uint32_t ATTRIBUTE_PURE
   105360 BLEND_STATE_AlphaToCoverageEnable_bits(const struct gen_device_info *devinfo)
   105361 {
   105362    switch (devinfo->gen) {
   105363    case 10: return 1;
   105364    case 9: return 1;
   105365    case 8: return 1;
   105366    case 7:
   105367       if (devinfo->is_haswell) {
   105368          return 0;
   105369       } else {
   105370          return 0;
   105371       }
   105372    case 6: return 0;
   105373    case 5: return 0;
   105374    case 4:
   105375       if (devinfo->is_g4x) {
   105376          return 0;
   105377       } else {
   105378          return 0;
   105379       }
   105380    default:
   105381       unreachable("Invalid hardware generation");
   105382    }
   105383 }
   105384 
   105385 
   105386 
   105387 #define GEN10_BLEND_STATE_AlphaToCoverageEnable_start  31
   105388 #define GEN9_BLEND_STATE_AlphaToCoverageEnable_start  31
   105389 #define GEN8_BLEND_STATE_AlphaToCoverageEnable_start  31
   105390 
   105391 static inline uint32_t ATTRIBUTE_PURE
   105392 BLEND_STATE_AlphaToCoverageEnable_start(const struct gen_device_info *devinfo)
   105393 {
   105394    switch (devinfo->gen) {
   105395    case 10: return 31;
   105396    case 9: return 31;
   105397    case 8: return 31;
   105398    case 7:
   105399       if (devinfo->is_haswell) {
   105400          return 0;
   105401       } else {
   105402          return 0;
   105403       }
   105404    case 6: return 0;
   105405    case 5: return 0;
   105406    case 4:
   105407       if (devinfo->is_g4x) {
   105408          return 0;
   105409       } else {
   105410          return 0;
   105411       }
   105412    default:
   105413       unreachable("Invalid hardware generation");
   105414    }
   105415 }
   105416 
   105417 
   105418 
   105419 /* BLEND_STATE::Alpha To One Enable */
   105420 
   105421 
   105422 #define GEN10_BLEND_STATE_AlphaToOneEnable_bits  1
   105423 #define GEN9_BLEND_STATE_AlphaToOneEnable_bits  1
   105424 #define GEN8_BLEND_STATE_AlphaToOneEnable_bits  1
   105425 
   105426 static inline uint32_t ATTRIBUTE_PURE
   105427 BLEND_STATE_AlphaToOneEnable_bits(const struct gen_device_info *devinfo)
   105428 {
   105429    switch (devinfo->gen) {
   105430    case 10: return 1;
   105431    case 9: return 1;
   105432    case 8: return 1;
   105433    case 7:
   105434       if (devinfo->is_haswell) {
   105435          return 0;
   105436       } else {
   105437          return 0;
   105438       }
   105439    case 6: return 0;
   105440    case 5: return 0;
   105441    case 4:
   105442       if (devinfo->is_g4x) {
   105443          return 0;
   105444       } else {
   105445          return 0;
   105446       }
   105447    default:
   105448       unreachable("Invalid hardware generation");
   105449    }
   105450 }
   105451 
   105452 
   105453 
   105454 #define GEN10_BLEND_STATE_AlphaToOneEnable_start  29
   105455 #define GEN9_BLEND_STATE_AlphaToOneEnable_start  29
   105456 #define GEN8_BLEND_STATE_AlphaToOneEnable_start  29
   105457 
   105458 static inline uint32_t ATTRIBUTE_PURE
   105459 BLEND_STATE_AlphaToOneEnable_start(const struct gen_device_info *devinfo)
   105460 {
   105461    switch (devinfo->gen) {
   105462    case 10: return 29;
   105463    case 9: return 29;
   105464    case 8: return 29;
   105465    case 7:
   105466       if (devinfo->is_haswell) {
   105467          return 0;
   105468       } else {
   105469          return 0;
   105470       }
   105471    case 6: return 0;
   105472    case 5: return 0;
   105473    case 4:
   105474       if (devinfo->is_g4x) {
   105475          return 0;
   105476       } else {
   105477          return 0;
   105478       }
   105479    default:
   105480       unreachable("Invalid hardware generation");
   105481    }
   105482 }
   105483 
   105484 
   105485 
   105486 /* BLEND_STATE::Color Dither Enable */
   105487 
   105488 
   105489 #define GEN10_BLEND_STATE_ColorDitherEnable_bits  1
   105490 #define GEN9_BLEND_STATE_ColorDitherEnable_bits  1
   105491 #define GEN8_BLEND_STATE_ColorDitherEnable_bits  1
   105492 
   105493 static inline uint32_t ATTRIBUTE_PURE
   105494 BLEND_STATE_ColorDitherEnable_bits(const struct gen_device_info *devinfo)
   105495 {
   105496    switch (devinfo->gen) {
   105497    case 10: return 1;
   105498    case 9: return 1;
   105499    case 8: return 1;
   105500    case 7:
   105501       if (devinfo->is_haswell) {
   105502          return 0;
   105503       } else {
   105504          return 0;
   105505       }
   105506    case 6: return 0;
   105507    case 5: return 0;
   105508    case 4:
   105509       if (devinfo->is_g4x) {
   105510          return 0;
   105511       } else {
   105512          return 0;
   105513       }
   105514    default:
   105515       unreachable("Invalid hardware generation");
   105516    }
   105517 }
   105518 
   105519 
   105520 
   105521 #define GEN10_BLEND_STATE_ColorDitherEnable_start  23
   105522 #define GEN9_BLEND_STATE_ColorDitherEnable_start  23
   105523 #define GEN8_BLEND_STATE_ColorDitherEnable_start  23
   105524 
   105525 static inline uint32_t ATTRIBUTE_PURE
   105526 BLEND_STATE_ColorDitherEnable_start(const struct gen_device_info *devinfo)
   105527 {
   105528    switch (devinfo->gen) {
   105529    case 10: return 23;
   105530    case 9: return 23;
   105531    case 8: return 23;
   105532    case 7:
   105533       if (devinfo->is_haswell) {
   105534          return 0;
   105535       } else {
   105536          return 0;
   105537       }
   105538    case 6: return 0;
   105539    case 5: return 0;
   105540    case 4:
   105541       if (devinfo->is_g4x) {
   105542          return 0;
   105543       } else {
   105544          return 0;
   105545       }
   105546    default:
   105547       unreachable("Invalid hardware generation");
   105548    }
   105549 }
   105550 
   105551 
   105552 
   105553 /* BLEND_STATE::Entry */
   105554 
   105555 
   105556 #define GEN10_BLEND_STATE_Entry_bits  64
   105557 #define GEN9_BLEND_STATE_Entry_bits  64
   105558 #define GEN8_BLEND_STATE_Entry_bits  64
   105559 #define GEN75_BLEND_STATE_Entry_bits  64
   105560 #define GEN7_BLEND_STATE_Entry_bits  64
   105561 #define GEN6_BLEND_STATE_Entry_bits  64
   105562 
   105563 static inline uint32_t ATTRIBUTE_PURE
   105564 BLEND_STATE_Entry_bits(const struct gen_device_info *devinfo)
   105565 {
   105566    switch (devinfo->gen) {
   105567    case 10: return 64;
   105568    case 9: return 64;
   105569    case 8: return 64;
   105570    case 7:
   105571       if (devinfo->is_haswell) {
   105572          return 64;
   105573       } else {
   105574          return 64;
   105575       }
   105576    case 6: return 64;
   105577    case 5: return 0;
   105578    case 4:
   105579       if (devinfo->is_g4x) {
   105580          return 0;
   105581       } else {
   105582          return 0;
   105583       }
   105584    default:
   105585       unreachable("Invalid hardware generation");
   105586    }
   105587 }
   105588 
   105589 
   105590 
   105591 #define GEN10_BLEND_STATE_Entry_start  0
   105592 #define GEN9_BLEND_STATE_Entry_start  0
   105593 #define GEN8_BLEND_STATE_Entry_start  0
   105594 #define GEN75_BLEND_STATE_Entry_start  0
   105595 #define GEN7_BLEND_STATE_Entry_start  0
   105596 #define GEN6_BLEND_STATE_Entry_start  0
   105597 
   105598 static inline uint32_t ATTRIBUTE_PURE
   105599 BLEND_STATE_Entry_start(const struct gen_device_info *devinfo)
   105600 {
   105601    switch (devinfo->gen) {
   105602    case 10: return 0;
   105603    case 9: return 0;
   105604    case 8: return 0;
   105605    case 7:
   105606       if (devinfo->is_haswell) {
   105607          return 0;
   105608       } else {
   105609          return 0;
   105610       }
   105611    case 6: return 0;
   105612    case 5: return 0;
   105613    case 4:
   105614       if (devinfo->is_g4x) {
   105615          return 0;
   105616       } else {
   105617          return 0;
   105618       }
   105619    default:
   105620       unreachable("Invalid hardware generation");
   105621    }
   105622 }
   105623 
   105624 
   105625 
   105626 /* BLEND_STATE::Independent Alpha Blend Enable */
   105627 
   105628 
   105629 #define GEN10_BLEND_STATE_IndependentAlphaBlendEnable_bits  1
   105630 #define GEN9_BLEND_STATE_IndependentAlphaBlendEnable_bits  1
   105631 #define GEN8_BLEND_STATE_IndependentAlphaBlendEnable_bits  1
   105632 
   105633 static inline uint32_t ATTRIBUTE_PURE
   105634 BLEND_STATE_IndependentAlphaBlendEnable_bits(const struct gen_device_info *devinfo)
   105635 {
   105636    switch (devinfo->gen) {
   105637    case 10: return 1;
   105638    case 9: return 1;
   105639    case 8: return 1;
   105640    case 7:
   105641       if (devinfo->is_haswell) {
   105642          return 0;
   105643       } else {
   105644          return 0;
   105645       }
   105646    case 6: return 0;
   105647    case 5: return 0;
   105648    case 4:
   105649       if (devinfo->is_g4x) {
   105650          return 0;
   105651       } else {
   105652          return 0;
   105653       }
   105654    default:
   105655       unreachable("Invalid hardware generation");
   105656    }
   105657 }
   105658 
   105659 
   105660 
   105661 #define GEN10_BLEND_STATE_IndependentAlphaBlendEnable_start  30
   105662 #define GEN9_BLEND_STATE_IndependentAlphaBlendEnable_start  30
   105663 #define GEN8_BLEND_STATE_IndependentAlphaBlendEnable_start  30
   105664 
   105665 static inline uint32_t ATTRIBUTE_PURE
   105666 BLEND_STATE_IndependentAlphaBlendEnable_start(const struct gen_device_info *devinfo)
   105667 {
   105668    switch (devinfo->gen) {
   105669    case 10: return 30;
   105670    case 9: return 30;
   105671    case 8: return 30;
   105672    case 7:
   105673       if (devinfo->is_haswell) {
   105674          return 0;
   105675       } else {
   105676          return 0;
   105677       }
   105678    case 6: return 0;
   105679    case 5: return 0;
   105680    case 4:
   105681       if (devinfo->is_g4x) {
   105682          return 0;
   105683       } else {
   105684          return 0;
   105685       }
   105686    default:
   105687       unreachable("Invalid hardware generation");
   105688    }
   105689 }
   105690 
   105691 
   105692 
   105693 /* BLEND_STATE::X Dither Offset */
   105694 
   105695 
   105696 #define GEN10_BLEND_STATE_XDitherOffset_bits  2
   105697 #define GEN9_BLEND_STATE_XDitherOffset_bits  2
   105698 #define GEN8_BLEND_STATE_XDitherOffset_bits  2
   105699 
   105700 static inline uint32_t ATTRIBUTE_PURE
   105701 BLEND_STATE_XDitherOffset_bits(const struct gen_device_info *devinfo)
   105702 {
   105703    switch (devinfo->gen) {
   105704    case 10: return 2;
   105705    case 9: return 2;
   105706    case 8: return 2;
   105707    case 7:
   105708       if (devinfo->is_haswell) {
   105709          return 0;
   105710       } else {
   105711          return 0;
   105712       }
   105713    case 6: return 0;
   105714    case 5: return 0;
   105715    case 4:
   105716       if (devinfo->is_g4x) {
   105717          return 0;
   105718       } else {
   105719          return 0;
   105720       }
   105721    default:
   105722       unreachable("Invalid hardware generation");
   105723    }
   105724 }
   105725 
   105726 
   105727 
   105728 #define GEN10_BLEND_STATE_XDitherOffset_start  21
   105729 #define GEN9_BLEND_STATE_XDitherOffset_start  21
   105730 #define GEN8_BLEND_STATE_XDitherOffset_start  21
   105731 
   105732 static inline uint32_t ATTRIBUTE_PURE
   105733 BLEND_STATE_XDitherOffset_start(const struct gen_device_info *devinfo)
   105734 {
   105735    switch (devinfo->gen) {
   105736    case 10: return 21;
   105737    case 9: return 21;
   105738    case 8: return 21;
   105739    case 7:
   105740       if (devinfo->is_haswell) {
   105741          return 0;
   105742       } else {
   105743          return 0;
   105744       }
   105745    case 6: return 0;
   105746    case 5: return 0;
   105747    case 4:
   105748       if (devinfo->is_g4x) {
   105749          return 0;
   105750       } else {
   105751          return 0;
   105752       }
   105753    default:
   105754       unreachable("Invalid hardware generation");
   105755    }
   105756 }
   105757 
   105758 
   105759 
   105760 /* BLEND_STATE::Y Dither Offset */
   105761 
   105762 
   105763 #define GEN10_BLEND_STATE_YDitherOffset_bits  2
   105764 #define GEN9_BLEND_STATE_YDitherOffset_bits  2
   105765 #define GEN8_BLEND_STATE_YDitherOffset_bits  2
   105766 
   105767 static inline uint32_t ATTRIBUTE_PURE
   105768 BLEND_STATE_YDitherOffset_bits(const struct gen_device_info *devinfo)
   105769 {
   105770    switch (devinfo->gen) {
   105771    case 10: return 2;
   105772    case 9: return 2;
   105773    case 8: return 2;
   105774    case 7:
   105775       if (devinfo->is_haswell) {
   105776          return 0;
   105777       } else {
   105778          return 0;
   105779       }
   105780    case 6: return 0;
   105781    case 5: return 0;
   105782    case 4:
   105783       if (devinfo->is_g4x) {
   105784          return 0;
   105785       } else {
   105786          return 0;
   105787       }
   105788    default:
   105789       unreachable("Invalid hardware generation");
   105790    }
   105791 }
   105792 
   105793 
   105794 
   105795 #define GEN10_BLEND_STATE_YDitherOffset_start  19
   105796 #define GEN9_BLEND_STATE_YDitherOffset_start  19
   105797 #define GEN8_BLEND_STATE_YDitherOffset_start  19
   105798 
   105799 static inline uint32_t ATTRIBUTE_PURE
   105800 BLEND_STATE_YDitherOffset_start(const struct gen_device_info *devinfo)
   105801 {
   105802    switch (devinfo->gen) {
   105803    case 10: return 19;
   105804    case 9: return 19;
   105805    case 8: return 19;
   105806    case 7:
   105807       if (devinfo->is_haswell) {
   105808          return 0;
   105809       } else {
   105810          return 0;
   105811       }
   105812    case 6: return 0;
   105813    case 5: return 0;
   105814    case 4:
   105815       if (devinfo->is_g4x) {
   105816          return 0;
   105817       } else {
   105818          return 0;
   105819       }
   105820    default:
   105821       unreachable("Invalid hardware generation");
   105822    }
   105823 }
   105824 
   105825 
   105826 
   105827 /* BLEND_STATE_ENTRY */
   105828 
   105829 
   105830 #define GEN10_BLEND_STATE_ENTRY_length  2
   105831 #define GEN9_BLEND_STATE_ENTRY_length  2
   105832 #define GEN8_BLEND_STATE_ENTRY_length  2
   105833 #define GEN75_BLEND_STATE_ENTRY_length  2
   105834 #define GEN7_BLEND_STATE_ENTRY_length  2
   105835 #define GEN6_BLEND_STATE_ENTRY_length  2
   105836 
   105837 static inline uint32_t ATTRIBUTE_PURE
   105838 BLEND_STATE_ENTRY_length(const struct gen_device_info *devinfo)
   105839 {
   105840    switch (devinfo->gen) {
   105841    case 10: return 2;
   105842    case 9: return 2;
   105843    case 8: return 2;
   105844    case 7:
   105845       if (devinfo->is_haswell) {
   105846          return 2;
   105847       } else {
   105848          return 2;
   105849       }
   105850    case 6: return 2;
   105851    case 5: return 0;
   105852    case 4:
   105853       if (devinfo->is_g4x) {
   105854          return 0;
   105855       } else {
   105856          return 0;
   105857       }
   105858    default:
   105859       unreachable("Invalid hardware generation");
   105860    }
   105861 }
   105862 
   105863 
   105864 
   105865 /* BLEND_STATE_ENTRY::Alpha Blend Function */
   105866 
   105867 
   105868 #define GEN10_BLEND_STATE_ENTRY_AlphaBlendFunction_bits  3
   105869 #define GEN9_BLEND_STATE_ENTRY_AlphaBlendFunction_bits  3
   105870 #define GEN8_BLEND_STATE_ENTRY_AlphaBlendFunction_bits  3
   105871 #define GEN75_BLEND_STATE_ENTRY_AlphaBlendFunction_bits  3
   105872 #define GEN7_BLEND_STATE_ENTRY_AlphaBlendFunction_bits  3
   105873 #define GEN6_BLEND_STATE_ENTRY_AlphaBlendFunction_bits  3
   105874 
   105875 static inline uint32_t ATTRIBUTE_PURE
   105876 BLEND_STATE_ENTRY_AlphaBlendFunction_bits(const struct gen_device_info *devinfo)
   105877 {
   105878    switch (devinfo->gen) {
   105879    case 10: return 3;
   105880    case 9: return 3;
   105881    case 8: return 3;
   105882    case 7:
   105883       if (devinfo->is_haswell) {
   105884          return 3;
   105885       } else {
   105886          return 3;
   105887       }
   105888    case 6: return 3;
   105889    case 5: return 0;
   105890    case 4:
   105891       if (devinfo->is_g4x) {
   105892          return 0;
   105893       } else {
   105894          return 0;
   105895       }
   105896    default:
   105897       unreachable("Invalid hardware generation");
   105898    }
   105899 }
   105900 
   105901 
   105902 
   105903 #define GEN10_BLEND_STATE_ENTRY_AlphaBlendFunction_start  5
   105904 #define GEN9_BLEND_STATE_ENTRY_AlphaBlendFunction_start  5
   105905 #define GEN8_BLEND_STATE_ENTRY_AlphaBlendFunction_start  5
   105906 #define GEN75_BLEND_STATE_ENTRY_AlphaBlendFunction_start  26
   105907 #define GEN7_BLEND_STATE_ENTRY_AlphaBlendFunction_start  26
   105908 #define GEN6_BLEND_STATE_ENTRY_AlphaBlendFunction_start  26
   105909 
   105910 static inline uint32_t ATTRIBUTE_PURE
   105911 BLEND_STATE_ENTRY_AlphaBlendFunction_start(const struct gen_device_info *devinfo)
   105912 {
   105913    switch (devinfo->gen) {
   105914    case 10: return 5;
   105915    case 9: return 5;
   105916    case 8: return 5;
   105917    case 7:
   105918       if (devinfo->is_haswell) {
   105919          return 26;
   105920       } else {
   105921          return 26;
   105922       }
   105923    case 6: return 26;
   105924    case 5: return 0;
   105925    case 4:
   105926       if (devinfo->is_g4x) {
   105927          return 0;
   105928       } else {
   105929          return 0;
   105930       }
   105931    default:
   105932       unreachable("Invalid hardware generation");
   105933    }
   105934 }
   105935 
   105936 
   105937 
   105938 /* BLEND_STATE_ENTRY::Alpha Test Enable */
   105939 
   105940 
   105941 #define GEN75_BLEND_STATE_ENTRY_AlphaTestEnable_bits  1
   105942 #define GEN7_BLEND_STATE_ENTRY_AlphaTestEnable_bits  1
   105943 #define GEN6_BLEND_STATE_ENTRY_AlphaTestEnable_bits  1
   105944 
   105945 static inline uint32_t ATTRIBUTE_PURE
   105946 BLEND_STATE_ENTRY_AlphaTestEnable_bits(const struct gen_device_info *devinfo)
   105947 {
   105948    switch (devinfo->gen) {
   105949    case 10: return 0;
   105950    case 9: return 0;
   105951    case 8: return 0;
   105952    case 7:
   105953       if (devinfo->is_haswell) {
   105954          return 1;
   105955       } else {
   105956          return 1;
   105957       }
   105958    case 6: return 1;
   105959    case 5: return 0;
   105960    case 4:
   105961       if (devinfo->is_g4x) {
   105962          return 0;
   105963       } else {
   105964          return 0;
   105965       }
   105966    default:
   105967       unreachable("Invalid hardware generation");
   105968    }
   105969 }
   105970 
   105971 
   105972 
   105973 #define GEN75_BLEND_STATE_ENTRY_AlphaTestEnable_start  48
   105974 #define GEN7_BLEND_STATE_ENTRY_AlphaTestEnable_start  48
   105975 #define GEN6_BLEND_STATE_ENTRY_AlphaTestEnable_start  48
   105976 
   105977 static inline uint32_t ATTRIBUTE_PURE
   105978 BLEND_STATE_ENTRY_AlphaTestEnable_start(const struct gen_device_info *devinfo)
   105979 {
   105980    switch (devinfo->gen) {
   105981    case 10: return 0;
   105982    case 9: return 0;
   105983    case 8: return 0;
   105984    case 7:
   105985       if (devinfo->is_haswell) {
   105986          return 48;
   105987       } else {
   105988          return 48;
   105989       }
   105990    case 6: return 48;
   105991    case 5: return 0;
   105992    case 4:
   105993       if (devinfo->is_g4x) {
   105994          return 0;
   105995       } else {
   105996          return 0;
   105997       }
   105998    default:
   105999       unreachable("Invalid hardware generation");
   106000    }
   106001 }
   106002 
   106003 
   106004 
   106005 /* BLEND_STATE_ENTRY::Alpha Test Function */
   106006 
   106007 
   106008 #define GEN75_BLEND_STATE_ENTRY_AlphaTestFunction_bits  3
   106009 #define GEN7_BLEND_STATE_ENTRY_AlphaTestFunction_bits  3
   106010 #define GEN6_BLEND_STATE_ENTRY_AlphaTestFunction_bits  3
   106011 
   106012 static inline uint32_t ATTRIBUTE_PURE
   106013 BLEND_STATE_ENTRY_AlphaTestFunction_bits(const struct gen_device_info *devinfo)
   106014 {
   106015    switch (devinfo->gen) {
   106016    case 10: return 0;
   106017    case 9: return 0;
   106018    case 8: return 0;
   106019    case 7:
   106020       if (devinfo->is_haswell) {
   106021          return 3;
   106022       } else {
   106023          return 3;
   106024       }
   106025    case 6: return 3;
   106026    case 5: return 0;
   106027    case 4:
   106028       if (devinfo->is_g4x) {
   106029          return 0;
   106030       } else {
   106031          return 0;
   106032       }
   106033    default:
   106034       unreachable("Invalid hardware generation");
   106035    }
   106036 }
   106037 
   106038 
   106039 
   106040 #define GEN75_BLEND_STATE_ENTRY_AlphaTestFunction_start  45
   106041 #define GEN7_BLEND_STATE_ENTRY_AlphaTestFunction_start  45
   106042 #define GEN6_BLEND_STATE_ENTRY_AlphaTestFunction_start  45
   106043 
   106044 static inline uint32_t ATTRIBUTE_PURE
   106045 BLEND_STATE_ENTRY_AlphaTestFunction_start(const struct gen_device_info *devinfo)
   106046 {
   106047    switch (devinfo->gen) {
   106048    case 10: return 0;
   106049    case 9: return 0;
   106050    case 8: return 0;
   106051    case 7:
   106052       if (devinfo->is_haswell) {
   106053          return 45;
   106054       } else {
   106055          return 45;
   106056       }
   106057    case 6: return 45;
   106058    case 5: return 0;
   106059    case 4:
   106060       if (devinfo->is_g4x) {
   106061          return 0;
   106062       } else {
   106063          return 0;
   106064       }
   106065    default:
   106066       unreachable("Invalid hardware generation");
   106067    }
   106068 }
   106069 
   106070 
   106071 
   106072 /* BLEND_STATE_ENTRY::AlphaToCoverage Dither Enable */
   106073 
   106074 
   106075 #define GEN75_BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_bits  1
   106076 #define GEN7_BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_bits  1
   106077 #define GEN6_BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_bits  1
   106078 
   106079 static inline uint32_t ATTRIBUTE_PURE
   106080 BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_bits(const struct gen_device_info *devinfo)
   106081 {
   106082    switch (devinfo->gen) {
   106083    case 10: return 0;
   106084    case 9: return 0;
   106085    case 8: return 0;
   106086    case 7:
   106087       if (devinfo->is_haswell) {
   106088          return 1;
   106089       } else {
   106090          return 1;
   106091       }
   106092    case 6: return 1;
   106093    case 5: return 0;
   106094    case 4:
   106095       if (devinfo->is_g4x) {
   106096          return 0;
   106097       } else {
   106098          return 0;
   106099       }
   106100    default:
   106101       unreachable("Invalid hardware generation");
   106102    }
   106103 }
   106104 
   106105 
   106106 
   106107 #define GEN75_BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_start  61
   106108 #define GEN7_BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_start  61
   106109 #define GEN6_BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_start  61
   106110 
   106111 static inline uint32_t ATTRIBUTE_PURE
   106112 BLEND_STATE_ENTRY_AlphaToCoverageDitherEnable_start(const struct gen_device_info *devinfo)
   106113 {
   106114    switch (devinfo->gen) {
   106115    case 10: return 0;
   106116    case 9: return 0;
   106117    case 8: return 0;
   106118    case 7:
   106119       if (devinfo->is_haswell) {
   106120          return 61;
   106121       } else {
   106122          return 61;
   106123       }
   106124    case 6: return 61;
   106125    case 5: return 0;
   106126    case 4:
   106127       if (devinfo->is_g4x) {
   106128          return 0;
   106129       } else {
   106130          return 0;
   106131       }
   106132    default:
   106133       unreachable("Invalid hardware generation");
   106134    }
   106135 }
   106136 
   106137 
   106138 
   106139 /* BLEND_STATE_ENTRY::AlphaToCoverage Enable */
   106140 
   106141 
   106142 #define GEN75_BLEND_STATE_ENTRY_AlphaToCoverageEnable_bits  1
   106143 #define GEN7_BLEND_STATE_ENTRY_AlphaToCoverageEnable_bits  1
   106144 #define GEN6_BLEND_STATE_ENTRY_AlphaToCoverageEnable_bits  1
   106145 
   106146 static inline uint32_t ATTRIBUTE_PURE
   106147 BLEND_STATE_ENTRY_AlphaToCoverageEnable_bits(const struct gen_device_info *devinfo)
   106148 {
   106149    switch (devinfo->gen) {
   106150    case 10: return 0;
   106151    case 9: return 0;
   106152    case 8: return 0;
   106153    case 7:
   106154       if (devinfo->is_haswell) {
   106155          return 1;
   106156       } else {
   106157          return 1;
   106158       }
   106159    case 6: return 1;
   106160    case 5: return 0;
   106161    case 4:
   106162       if (devinfo->is_g4x) {
   106163          return 0;
   106164       } else {
   106165          return 0;
   106166       }
   106167    default:
   106168       unreachable("Invalid hardware generation");
   106169    }
   106170 }
   106171 
   106172 
   106173 
   106174 #define GEN75_BLEND_STATE_ENTRY_AlphaToCoverageEnable_start  63
   106175 #define GEN7_BLEND_STATE_ENTRY_AlphaToCoverageEnable_start  63
   106176 #define GEN6_BLEND_STATE_ENTRY_AlphaToCoverageEnable_start  63
   106177 
   106178 static inline uint32_t ATTRIBUTE_PURE
   106179 BLEND_STATE_ENTRY_AlphaToCoverageEnable_start(const struct gen_device_info *devinfo)
   106180 {
   106181    switch (devinfo->gen) {
   106182    case 10: return 0;
   106183    case 9: return 0;
   106184    case 8: return 0;
   106185    case 7:
   106186       if (devinfo->is_haswell) {
   106187          return 63;
   106188       } else {
   106189          return 63;
   106190       }
   106191    case 6: return 63;
   106192    case 5: return 0;
   106193    case 4:
   106194       if (devinfo->is_g4x) {
   106195          return 0;
   106196       } else {
   106197          return 0;
   106198       }
   106199    default:
   106200       unreachable("Invalid hardware generation");
   106201    }
   106202 }
   106203 
   106204 
   106205 
   106206 /* BLEND_STATE_ENTRY::AlphaToOne Enable */
   106207 
   106208 
   106209 #define GEN75_BLEND_STATE_ENTRY_AlphaToOneEnable_bits  1
   106210 #define GEN7_BLEND_STATE_ENTRY_AlphaToOneEnable_bits  1
   106211 #define GEN6_BLEND_STATE_ENTRY_AlphaToOneEnable_bits  1
   106212 
   106213 static inline uint32_t ATTRIBUTE_PURE
   106214 BLEND_STATE_ENTRY_AlphaToOneEnable_bits(const struct gen_device_info *devinfo)
   106215 {
   106216    switch (devinfo->gen) {
   106217    case 10: return 0;
   106218    case 9: return 0;
   106219    case 8: return 0;
   106220    case 7:
   106221       if (devinfo->is_haswell) {
   106222          return 1;
   106223       } else {
   106224          return 1;
   106225       }
   106226    case 6: return 1;
   106227    case 5: return 0;
   106228    case 4:
   106229       if (devinfo->is_g4x) {
   106230          return 0;
   106231       } else {
   106232          return 0;
   106233       }
   106234    default:
   106235       unreachable("Invalid hardware generation");
   106236    }
   106237 }
   106238 
   106239 
   106240 
   106241 #define GEN75_BLEND_STATE_ENTRY_AlphaToOneEnable_start  62
   106242 #define GEN7_BLEND_STATE_ENTRY_AlphaToOneEnable_start  62
   106243 #define GEN6_BLEND_STATE_ENTRY_AlphaToOneEnable_start  62
   106244 
   106245 static inline uint32_t ATTRIBUTE_PURE
   106246 BLEND_STATE_ENTRY_AlphaToOneEnable_start(const struct gen_device_info *devinfo)
   106247 {
   106248    switch (devinfo->gen) {
   106249    case 10: return 0;
   106250    case 9: return 0;
   106251    case 8: return 0;
   106252    case 7:
   106253       if (devinfo->is_haswell) {
   106254          return 62;
   106255       } else {
   106256          return 62;
   106257       }
   106258    case 6: return 62;
   106259    case 5: return 0;
   106260    case 4:
   106261       if (devinfo->is_g4x) {
   106262          return 0;
   106263       } else {
   106264          return 0;
   106265       }
   106266    default:
   106267       unreachable("Invalid hardware generation");
   106268    }
   106269 }
   106270 
   106271 
   106272 
   106273 /* BLEND_STATE_ENTRY::Color Blend Function */
   106274 
   106275 
   106276 #define GEN10_BLEND_STATE_ENTRY_ColorBlendFunction_bits  3
   106277 #define GEN9_BLEND_STATE_ENTRY_ColorBlendFunction_bits  3
   106278 #define GEN8_BLEND_STATE_ENTRY_ColorBlendFunction_bits  3
   106279 #define GEN75_BLEND_STATE_ENTRY_ColorBlendFunction_bits  3
   106280 #define GEN7_BLEND_STATE_ENTRY_ColorBlendFunction_bits  3
   106281 #define GEN6_BLEND_STATE_ENTRY_ColorBlendFunction_bits  3
   106282 
   106283 static inline uint32_t ATTRIBUTE_PURE
   106284 BLEND_STATE_ENTRY_ColorBlendFunction_bits(const struct gen_device_info *devinfo)
   106285 {
   106286    switch (devinfo->gen) {
   106287    case 10: return 3;
   106288    case 9: return 3;
   106289    case 8: return 3;
   106290    case 7:
   106291       if (devinfo->is_haswell) {
   106292          return 3;
   106293       } else {
   106294          return 3;
   106295       }
   106296    case 6: return 3;
   106297    case 5: return 0;
   106298    case 4:
   106299       if (devinfo->is_g4x) {
   106300          return 0;
   106301       } else {
   106302          return 0;
   106303       }
   106304    default:
   106305       unreachable("Invalid hardware generation");
   106306    }
   106307 }
   106308 
   106309 
   106310 
   106311 #define GEN10_BLEND_STATE_ENTRY_ColorBlendFunction_start  18
   106312 #define GEN9_BLEND_STATE_ENTRY_ColorBlendFunction_start  18
   106313 #define GEN8_BLEND_STATE_ENTRY_ColorBlendFunction_start  18
   106314 #define GEN75_BLEND_STATE_ENTRY_ColorBlendFunction_start  11
   106315 #define GEN7_BLEND_STATE_ENTRY_ColorBlendFunction_start  11
   106316 #define GEN6_BLEND_STATE_ENTRY_ColorBlendFunction_start  11
   106317 
   106318 static inline uint32_t ATTRIBUTE_PURE
   106319 BLEND_STATE_ENTRY_ColorBlendFunction_start(const struct gen_device_info *devinfo)
   106320 {
   106321    switch (devinfo->gen) {
   106322    case 10: return 18;
   106323    case 9: return 18;
   106324    case 8: return 18;
   106325    case 7:
   106326       if (devinfo->is_haswell) {
   106327          return 11;
   106328       } else {
   106329          return 11;
   106330       }
   106331    case 6: return 11;
   106332    case 5: return 0;
   106333    case 4:
   106334       if (devinfo->is_g4x) {
   106335          return 0;
   106336       } else {
   106337          return 0;
   106338       }
   106339    default:
   106340       unreachable("Invalid hardware generation");
   106341    }
   106342 }
   106343 
   106344 
   106345 
   106346 /* BLEND_STATE_ENTRY::Color Buffer Blend Enable */
   106347 
   106348 
   106349 #define GEN10_BLEND_STATE_ENTRY_ColorBufferBlendEnable_bits  1
   106350 #define GEN9_BLEND_STATE_ENTRY_ColorBufferBlendEnable_bits  1
   106351 #define GEN8_BLEND_STATE_ENTRY_ColorBufferBlendEnable_bits  1
   106352 #define GEN75_BLEND_STATE_ENTRY_ColorBufferBlendEnable_bits  1
   106353 #define GEN7_BLEND_STATE_ENTRY_ColorBufferBlendEnable_bits  1
   106354 #define GEN6_BLEND_STATE_ENTRY_ColorBufferBlendEnable_bits  1
   106355 
   106356 static inline uint32_t ATTRIBUTE_PURE
   106357 BLEND_STATE_ENTRY_ColorBufferBlendEnable_bits(const struct gen_device_info *devinfo)
   106358 {
   106359    switch (devinfo->gen) {
   106360    case 10: return 1;
   106361    case 9: return 1;
   106362    case 8: return 1;
   106363    case 7:
   106364       if (devinfo->is_haswell) {
   106365          return 1;
   106366       } else {
   106367          return 1;
   106368       }
   106369    case 6: return 1;
   106370    case 5: return 0;
   106371    case 4:
   106372       if (devinfo->is_g4x) {
   106373          return 0;
   106374       } else {
   106375          return 0;
   106376       }
   106377    default:
   106378       unreachable("Invalid hardware generation");
   106379    }
   106380 }
   106381 
   106382 
   106383 
   106384 #define GEN10_BLEND_STATE_ENTRY_ColorBufferBlendEnable_start  31
   106385 #define GEN9_BLEND_STATE_ENTRY_ColorBufferBlendEnable_start  31
   106386 #define GEN8_BLEND_STATE_ENTRY_ColorBufferBlendEnable_start  31
   106387 #define GEN75_BLEND_STATE_ENTRY_ColorBufferBlendEnable_start  31
   106388 #define GEN7_BLEND_STATE_ENTRY_ColorBufferBlendEnable_start  31
   106389 #define GEN6_BLEND_STATE_ENTRY_ColorBufferBlendEnable_start  31
   106390 
   106391 static inline uint32_t ATTRIBUTE_PURE
   106392 BLEND_STATE_ENTRY_ColorBufferBlendEnable_start(const struct gen_device_info *devinfo)
   106393 {
   106394    switch (devinfo->gen) {
   106395    case 10: return 31;
   106396    case 9: return 31;
   106397    case 8: return 31;
   106398    case 7:
   106399       if (devinfo->is_haswell) {
   106400          return 31;
   106401       } else {
   106402          return 31;
   106403       }
   106404    case 6: return 31;
   106405    case 5: return 0;
   106406    case 4:
   106407       if (devinfo->is_g4x) {
   106408          return 0;
   106409       } else {
   106410          return 0;
   106411       }
   106412    default:
   106413       unreachable("Invalid hardware generation");
   106414    }
   106415 }
   106416 
   106417 
   106418 
   106419 /* BLEND_STATE_ENTRY::Color Clamp Range */
   106420 
   106421 
   106422 #define GEN10_BLEND_STATE_ENTRY_ColorClampRange_bits  2
   106423 #define GEN9_BLEND_STATE_ENTRY_ColorClampRange_bits  2
   106424 #define GEN8_BLEND_STATE_ENTRY_ColorClampRange_bits  2
   106425 #define GEN75_BLEND_STATE_ENTRY_ColorClampRange_bits  2
   106426 #define GEN7_BLEND_STATE_ENTRY_ColorClampRange_bits  2
   106427 #define GEN6_BLEND_STATE_ENTRY_ColorClampRange_bits  2
   106428 
   106429 static inline uint32_t ATTRIBUTE_PURE
   106430 BLEND_STATE_ENTRY_ColorClampRange_bits(const struct gen_device_info *devinfo)
   106431 {
   106432    switch (devinfo->gen) {
   106433    case 10: return 2;
   106434    case 9: return 2;
   106435    case 8: return 2;
   106436    case 7:
   106437       if (devinfo->is_haswell) {
   106438          return 2;
   106439       } else {
   106440          return 2;
   106441       }
   106442    case 6: return 2;
   106443    case 5: return 0;
   106444    case 4:
   106445       if (devinfo->is_g4x) {
   106446          return 0;
   106447       } else {
   106448          return 0;
   106449       }
   106450    default:
   106451       unreachable("Invalid hardware generation");
   106452    }
   106453 }
   106454 
   106455 
   106456 
   106457 #define GEN10_BLEND_STATE_ENTRY_ColorClampRange_start  34
   106458 #define GEN9_BLEND_STATE_ENTRY_ColorClampRange_start  34
   106459 #define GEN8_BLEND_STATE_ENTRY_ColorClampRange_start  34
   106460 #define GEN75_BLEND_STATE_ENTRY_ColorClampRange_start  34
   106461 #define GEN7_BLEND_STATE_ENTRY_ColorClampRange_start  34
   106462 #define GEN6_BLEND_STATE_ENTRY_ColorClampRange_start  34
   106463 
   106464 static inline uint32_t ATTRIBUTE_PURE
   106465 BLEND_STATE_ENTRY_ColorClampRange_start(const struct gen_device_info *devinfo)
   106466 {
   106467    switch (devinfo->gen) {
   106468    case 10: return 34;
   106469    case 9: return 34;
   106470    case 8: return 34;
   106471    case 7:
   106472       if (devinfo->is_haswell) {
   106473          return 34;
   106474       } else {
   106475          return 34;
   106476       }
   106477    case 6: return 34;
   106478    case 5: return 0;
   106479    case 4:
   106480       if (devinfo->is_g4x) {
   106481          return 0;
   106482       } else {
   106483          return 0;
   106484       }
   106485    default:
   106486       unreachable("Invalid hardware generation");
   106487    }
   106488 }
   106489 
   106490 
   106491 
   106492 /* BLEND_STATE_ENTRY::Color Dither Enable */
   106493 
   106494 
   106495 #define GEN75_BLEND_STATE_ENTRY_ColorDitherEnable_bits  1
   106496 #define GEN7_BLEND_STATE_ENTRY_ColorDitherEnable_bits  1
   106497 #define GEN6_BLEND_STATE_ENTRY_ColorDitherEnable_bits  1
   106498 
   106499 static inline uint32_t ATTRIBUTE_PURE
   106500 BLEND_STATE_ENTRY_ColorDitherEnable_bits(const struct gen_device_info *devinfo)
   106501 {
   106502    switch (devinfo->gen) {
   106503    case 10: return 0;
   106504    case 9: return 0;
   106505    case 8: return 0;
   106506    case 7:
   106507       if (devinfo->is_haswell) {
   106508          return 1;
   106509       } else {
   106510          return 1;
   106511       }
   106512    case 6: return 1;
   106513    case 5: return 0;
   106514    case 4:
   106515       if (devinfo->is_g4x) {
   106516          return 0;
   106517       } else {
   106518          return 0;
   106519       }
   106520    default:
   106521       unreachable("Invalid hardware generation");
   106522    }
   106523 }
   106524 
   106525 
   106526 
   106527 #define GEN75_BLEND_STATE_ENTRY_ColorDitherEnable_start  44
   106528 #define GEN7_BLEND_STATE_ENTRY_ColorDitherEnable_start  44
   106529 #define GEN6_BLEND_STATE_ENTRY_ColorDitherEnable_start  44
   106530 
   106531 static inline uint32_t ATTRIBUTE_PURE
   106532 BLEND_STATE_ENTRY_ColorDitherEnable_start(const struct gen_device_info *devinfo)
   106533 {
   106534    switch (devinfo->gen) {
   106535    case 10: return 0;
   106536    case 9: return 0;
   106537    case 8: return 0;
   106538    case 7:
   106539       if (devinfo->is_haswell) {
   106540          return 44;
   106541       } else {
   106542          return 44;
   106543       }
   106544    case 6: return 44;
   106545    case 5: return 0;
   106546    case 4:
   106547       if (devinfo->is_g4x) {
   106548          return 0;
   106549       } else {
   106550          return 0;
   106551       }
   106552    default:
   106553       unreachable("Invalid hardware generation");
   106554    }
   106555 }
   106556 
   106557 
   106558 
   106559 /* BLEND_STATE_ENTRY::Destination Alpha Blend Factor */
   106560 
   106561 
   106562 #define GEN10_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_bits  5
   106563 #define GEN9_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_bits  5
   106564 #define GEN8_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_bits  5
   106565 #define GEN75_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_bits  5
   106566 #define GEN7_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_bits  5
   106567 #define GEN6_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_bits  5
   106568 
   106569 static inline uint32_t ATTRIBUTE_PURE
   106570 BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_bits(const struct gen_device_info *devinfo)
   106571 {
   106572    switch (devinfo->gen) {
   106573    case 10: return 5;
   106574    case 9: return 5;
   106575    case 8: return 5;
   106576    case 7:
   106577       if (devinfo->is_haswell) {
   106578          return 5;
   106579       } else {
   106580          return 5;
   106581       }
   106582    case 6: return 5;
   106583    case 5: return 0;
   106584    case 4:
   106585       if (devinfo->is_g4x) {
   106586          return 0;
   106587       } else {
   106588          return 0;
   106589       }
   106590    default:
   106591       unreachable("Invalid hardware generation");
   106592    }
   106593 }
   106594 
   106595 
   106596 
   106597 #define GEN10_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_start  8
   106598 #define GEN9_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_start  8
   106599 #define GEN8_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_start  8
   106600 #define GEN75_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_start  15
   106601 #define GEN7_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_start  15
   106602 #define GEN6_BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_start  15
   106603 
   106604 static inline uint32_t ATTRIBUTE_PURE
   106605 BLEND_STATE_ENTRY_DestinationAlphaBlendFactor_start(const struct gen_device_info *devinfo)
   106606 {
   106607    switch (devinfo->gen) {
   106608    case 10: return 8;
   106609    case 9: return 8;
   106610    case 8: return 8;
   106611    case 7:
   106612       if (devinfo->is_haswell) {
   106613          return 15;
   106614       } else {
   106615          return 15;
   106616       }
   106617    case 6: return 15;
   106618    case 5: return 0;
   106619    case 4:
   106620       if (devinfo->is_g4x) {
   106621          return 0;
   106622       } else {
   106623          return 0;
   106624       }
   106625    default:
   106626       unreachable("Invalid hardware generation");
   106627    }
   106628 }
   106629 
   106630 
   106631 
   106632 /* BLEND_STATE_ENTRY::Destination Blend Factor */
   106633 
   106634 
   106635 #define GEN10_BLEND_STATE_ENTRY_DestinationBlendFactor_bits  5
   106636 #define GEN9_BLEND_STATE_ENTRY_DestinationBlendFactor_bits  5
   106637 #define GEN8_BLEND_STATE_ENTRY_DestinationBlendFactor_bits  5
   106638 #define GEN75_BLEND_STATE_ENTRY_DestinationBlendFactor_bits  5
   106639 #define GEN7_BLEND_STATE_ENTRY_DestinationBlendFactor_bits  5
   106640 #define GEN6_BLEND_STATE_ENTRY_DestinationBlendFactor_bits  5
   106641 
   106642 static inline uint32_t ATTRIBUTE_PURE
   106643 BLEND_STATE_ENTRY_DestinationBlendFactor_bits(const struct gen_device_info *devinfo)
   106644 {
   106645    switch (devinfo->gen) {
   106646    case 10: return 5;
   106647    case 9: return 5;
   106648    case 8: return 5;
   106649    case 7:
   106650       if (devinfo->is_haswell) {
   106651          return 5;
   106652       } else {
   106653          return 5;
   106654       }
   106655    case 6: return 5;
   106656    case 5: return 0;
   106657    case 4:
   106658       if (devinfo->is_g4x) {
   106659          return 0;
   106660       } else {
   106661          return 0;
   106662       }
   106663    default:
   106664       unreachable("Invalid hardware generation");
   106665    }
   106666 }
   106667 
   106668 
   106669 
   106670 #define GEN10_BLEND_STATE_ENTRY_DestinationBlendFactor_start  21
   106671 #define GEN9_BLEND_STATE_ENTRY_DestinationBlendFactor_start  21
   106672 #define GEN8_BLEND_STATE_ENTRY_DestinationBlendFactor_start  21
   106673 #define GEN75_BLEND_STATE_ENTRY_DestinationBlendFactor_start  0
   106674 #define GEN7_BLEND_STATE_ENTRY_DestinationBlendFactor_start  0
   106675 #define GEN6_BLEND_STATE_ENTRY_DestinationBlendFactor_start  0
   106676 
   106677 static inline uint32_t ATTRIBUTE_PURE
   106678 BLEND_STATE_ENTRY_DestinationBlendFactor_start(const struct gen_device_info *devinfo)
   106679 {
   106680    switch (devinfo->gen) {
   106681    case 10: return 21;
   106682    case 9: return 21;
   106683    case 8: return 21;
   106684    case 7:
   106685       if (devinfo->is_haswell) {
   106686          return 0;
   106687       } else {
   106688          return 0;
   106689       }
   106690    case 6: return 0;
   106691    case 5: return 0;
   106692    case 4:
   106693       if (devinfo->is_g4x) {
   106694          return 0;
   106695       } else {
   106696          return 0;
   106697       }
   106698    default:
   106699       unreachable("Invalid hardware generation");
   106700    }
   106701 }
   106702 
   106703 
   106704 
   106705 /* BLEND_STATE_ENTRY::Independent Alpha Blend Enable */
   106706 
   106707 
   106708 #define GEN75_BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_bits  1
   106709 #define GEN7_BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_bits  1
   106710 #define GEN6_BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_bits  1
   106711 
   106712 static inline uint32_t ATTRIBUTE_PURE
   106713 BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_bits(const struct gen_device_info *devinfo)
   106714 {
   106715    switch (devinfo->gen) {
   106716    case 10: return 0;
   106717    case 9: return 0;
   106718    case 8: return 0;
   106719    case 7:
   106720       if (devinfo->is_haswell) {
   106721          return 1;
   106722       } else {
   106723          return 1;
   106724       }
   106725    case 6: return 1;
   106726    case 5: return 0;
   106727    case 4:
   106728       if (devinfo->is_g4x) {
   106729          return 0;
   106730       } else {
   106731          return 0;
   106732       }
   106733    default:
   106734       unreachable("Invalid hardware generation");
   106735    }
   106736 }
   106737 
   106738 
   106739 
   106740 #define GEN75_BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_start  30
   106741 #define GEN7_BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_start  30
   106742 #define GEN6_BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_start  30
   106743 
   106744 static inline uint32_t ATTRIBUTE_PURE
   106745 BLEND_STATE_ENTRY_IndependentAlphaBlendEnable_start(const struct gen_device_info *devinfo)
   106746 {
   106747    switch (devinfo->gen) {
   106748    case 10: return 0;
   106749    case 9: return 0;
   106750    case 8: return 0;
   106751    case 7:
   106752       if (devinfo->is_haswell) {
   106753          return 30;
   106754       } else {
   106755          return 30;
   106756       }
   106757    case 6: return 30;
   106758    case 5: return 0;
   106759    case 4:
   106760       if (devinfo->is_g4x) {
   106761          return 0;
   106762       } else {
   106763          return 0;
   106764       }
   106765    default:
   106766       unreachable("Invalid hardware generation");
   106767    }
   106768 }
   106769 
   106770 
   106771 
   106772 /* BLEND_STATE_ENTRY::Logic Op Enable */
   106773 
   106774 
   106775 #define GEN10_BLEND_STATE_ENTRY_LogicOpEnable_bits  1
   106776 #define GEN9_BLEND_STATE_ENTRY_LogicOpEnable_bits  1
   106777 #define GEN8_BLEND_STATE_ENTRY_LogicOpEnable_bits  1
   106778 #define GEN75_BLEND_STATE_ENTRY_LogicOpEnable_bits  1
   106779 #define GEN7_BLEND_STATE_ENTRY_LogicOpEnable_bits  1
   106780 #define GEN6_BLEND_STATE_ENTRY_LogicOpEnable_bits  1
   106781 
   106782 static inline uint32_t ATTRIBUTE_PURE
   106783 BLEND_STATE_ENTRY_LogicOpEnable_bits(const struct gen_device_info *devinfo)
   106784 {
   106785    switch (devinfo->gen) {
   106786    case 10: return 1;
   106787    case 9: return 1;
   106788    case 8: return 1;
   106789    case 7:
   106790       if (devinfo->is_haswell) {
   106791          return 1;
   106792       } else {
   106793          return 1;
   106794       }
   106795    case 6: return 1;
   106796    case 5: return 0;
   106797    case 4:
   106798       if (devinfo->is_g4x) {
   106799          return 0;
   106800       } else {
   106801          return 0;
   106802       }
   106803    default:
   106804       unreachable("Invalid hardware generation");
   106805    }
   106806 }
   106807 
   106808 
   106809 
   106810 #define GEN10_BLEND_STATE_ENTRY_LogicOpEnable_start  63
   106811 #define GEN9_BLEND_STATE_ENTRY_LogicOpEnable_start  63
   106812 #define GEN8_BLEND_STATE_ENTRY_LogicOpEnable_start  63
   106813 #define GEN75_BLEND_STATE_ENTRY_LogicOpEnable_start  54
   106814 #define GEN7_BLEND_STATE_ENTRY_LogicOpEnable_start  54
   106815 #define GEN6_BLEND_STATE_ENTRY_LogicOpEnable_start  54
   106816 
   106817 static inline uint32_t ATTRIBUTE_PURE
   106818 BLEND_STATE_ENTRY_LogicOpEnable_start(const struct gen_device_info *devinfo)
   106819 {
   106820    switch (devinfo->gen) {
   106821    case 10: return 63;
   106822    case 9: return 63;
   106823    case 8: return 63;
   106824    case 7:
   106825       if (devinfo->is_haswell) {
   106826          return 54;
   106827       } else {
   106828          return 54;
   106829       }
   106830    case 6: return 54;
   106831    case 5: return 0;
   106832    case 4:
   106833       if (devinfo->is_g4x) {
   106834          return 0;
   106835       } else {
   106836          return 0;
   106837       }
   106838    default:
   106839       unreachable("Invalid hardware generation");
   106840    }
   106841 }
   106842 
   106843 
   106844 
   106845 /* BLEND_STATE_ENTRY::Logic Op Function */
   106846 
   106847 
   106848 #define GEN10_BLEND_STATE_ENTRY_LogicOpFunction_bits  4
   106849 #define GEN9_BLEND_STATE_ENTRY_LogicOpFunction_bits  4
   106850 #define GEN8_BLEND_STATE_ENTRY_LogicOpFunction_bits  4
   106851 #define GEN75_BLEND_STATE_ENTRY_LogicOpFunction_bits  4
   106852 #define GEN7_BLEND_STATE_ENTRY_LogicOpFunction_bits  4
   106853 #define GEN6_BLEND_STATE_ENTRY_LogicOpFunction_bits  4
   106854 
   106855 static inline uint32_t ATTRIBUTE_PURE
   106856 BLEND_STATE_ENTRY_LogicOpFunction_bits(const struct gen_device_info *devinfo)
   106857 {
   106858    switch (devinfo->gen) {
   106859    case 10: return 4;
   106860    case 9: return 4;
   106861    case 8: return 4;
   106862    case 7:
   106863       if (devinfo->is_haswell) {
   106864          return 4;
   106865       } else {
   106866          return 4;
   106867       }
   106868    case 6: return 4;
   106869    case 5: return 0;
   106870    case 4:
   106871       if (devinfo->is_g4x) {
   106872          return 0;
   106873       } else {
   106874          return 0;
   106875       }
   106876    default:
   106877       unreachable("Invalid hardware generation");
   106878    }
   106879 }
   106880 
   106881 
   106882 
   106883 #define GEN10_BLEND_STATE_ENTRY_LogicOpFunction_start  59
   106884 #define GEN9_BLEND_STATE_ENTRY_LogicOpFunction_start  59
   106885 #define GEN8_BLEND_STATE_ENTRY_LogicOpFunction_start  59
   106886 #define GEN75_BLEND_STATE_ENTRY_LogicOpFunction_start  50
   106887 #define GEN7_BLEND_STATE_ENTRY_LogicOpFunction_start  50
   106888 #define GEN6_BLEND_STATE_ENTRY_LogicOpFunction_start  50
   106889 
   106890 static inline uint32_t ATTRIBUTE_PURE
   106891 BLEND_STATE_ENTRY_LogicOpFunction_start(const struct gen_device_info *devinfo)
   106892 {
   106893    switch (devinfo->gen) {
   106894    case 10: return 59;
   106895    case 9: return 59;
   106896    case 8: return 59;
   106897    case 7:
   106898       if (devinfo->is_haswell) {
   106899          return 50;
   106900       } else {
   106901          return 50;
   106902       }
   106903    case 6: return 50;
   106904    case 5: return 0;
   106905    case 4:
   106906       if (devinfo->is_g4x) {
   106907          return 0;
   106908       } else {
   106909          return 0;
   106910       }
   106911    default:
   106912       unreachable("Invalid hardware generation");
   106913    }
   106914 }
   106915 
   106916 
   106917 
   106918 /* BLEND_STATE_ENTRY::Post-Blend Color Clamp Enable */
   106919 
   106920 
   106921 #define GEN10_BLEND_STATE_ENTRY_PostBlendColorClampEnable_bits  1
   106922 #define GEN9_BLEND_STATE_ENTRY_PostBlendColorClampEnable_bits  1
   106923 #define GEN8_BLEND_STATE_ENTRY_PostBlendColorClampEnable_bits  1
   106924 #define GEN75_BLEND_STATE_ENTRY_PostBlendColorClampEnable_bits  1
   106925 #define GEN7_BLEND_STATE_ENTRY_PostBlendColorClampEnable_bits  1
   106926 #define GEN6_BLEND_STATE_ENTRY_PostBlendColorClampEnable_bits  1
   106927 
   106928 static inline uint32_t ATTRIBUTE_PURE
   106929 BLEND_STATE_ENTRY_PostBlendColorClampEnable_bits(const struct gen_device_info *devinfo)
   106930 {
   106931    switch (devinfo->gen) {
   106932    case 10: return 1;
   106933    case 9: return 1;
   106934    case 8: return 1;
   106935    case 7:
   106936       if (devinfo->is_haswell) {
   106937          return 1;
   106938       } else {
   106939          return 1;
   106940       }
   106941    case 6: return 1;
   106942    case 5: return 0;
   106943    case 4:
   106944       if (devinfo->is_g4x) {
   106945          return 0;
   106946       } else {
   106947          return 0;
   106948       }
   106949    default:
   106950       unreachable("Invalid hardware generation");
   106951    }
   106952 }
   106953 
   106954 
   106955 
   106956 #define GEN10_BLEND_STATE_ENTRY_PostBlendColorClampEnable_start  32
   106957 #define GEN9_BLEND_STATE_ENTRY_PostBlendColorClampEnable_start  32
   106958 #define GEN8_BLEND_STATE_ENTRY_PostBlendColorClampEnable_start  32
   106959 #define GEN75_BLEND_STATE_ENTRY_PostBlendColorClampEnable_start  32
   106960 #define GEN7_BLEND_STATE_ENTRY_PostBlendColorClampEnable_start  32
   106961 #define GEN6_BLEND_STATE_ENTRY_PostBlendColorClampEnable_start  32
   106962 
   106963 static inline uint32_t ATTRIBUTE_PURE
   106964 BLEND_STATE_ENTRY_PostBlendColorClampEnable_start(const struct gen_device_info *devinfo)
   106965 {
   106966    switch (devinfo->gen) {
   106967    case 10: return 32;
   106968    case 9: return 32;
   106969    case 8: return 32;
   106970    case 7:
   106971       if (devinfo->is_haswell) {
   106972          return 32;
   106973       } else {
   106974          return 32;
   106975       }
   106976    case 6: return 32;
   106977    case 5: return 0;
   106978    case 4:
   106979       if (devinfo->is_g4x) {
   106980          return 0;
   106981       } else {
   106982          return 0;
   106983       }
   106984    default:
   106985       unreachable("Invalid hardware generation");
   106986    }
   106987 }
   106988 
   106989 
   106990 
   106991 /* BLEND_STATE_ENTRY::Pre-Blend Color Clamp Enable */
   106992 
   106993 
   106994 #define GEN10_BLEND_STATE_ENTRY_PreBlendColorClampEnable_bits  1
   106995 #define GEN9_BLEND_STATE_ENTRY_PreBlendColorClampEnable_bits  1
   106996 #define GEN8_BLEND_STATE_ENTRY_PreBlendColorClampEnable_bits  1
   106997 #define GEN75_BLEND_STATE_ENTRY_PreBlendColorClampEnable_bits  1
   106998 #define GEN7_BLEND_STATE_ENTRY_PreBlendColorClampEnable_bits  1
   106999 #define GEN6_BLEND_STATE_ENTRY_PreBlendColorClampEnable_bits  1
   107000 
   107001 static inline uint32_t ATTRIBUTE_PURE
   107002 BLEND_STATE_ENTRY_PreBlendColorClampEnable_bits(const struct gen_device_info *devinfo)
   107003 {
   107004    switch (devinfo->gen) {
   107005    case 10: return 1;
   107006    case 9: return 1;
   107007    case 8: return 1;
   107008    case 7:
   107009       if (devinfo->is_haswell) {
   107010          return 1;
   107011       } else {
   107012          return 1;
   107013       }
   107014    case 6: return 1;
   107015    case 5: return 0;
   107016    case 4:
   107017       if (devinfo->is_g4x) {
   107018          return 0;
   107019       } else {
   107020          return 0;
   107021       }
   107022    default:
   107023       unreachable("Invalid hardware generation");
   107024    }
   107025 }
   107026 
   107027 
   107028 
   107029 #define GEN10_BLEND_STATE_ENTRY_PreBlendColorClampEnable_start  33
   107030 #define GEN9_BLEND_STATE_ENTRY_PreBlendColorClampEnable_start  33
   107031 #define GEN8_BLEND_STATE_ENTRY_PreBlendColorClampEnable_start  33
   107032 #define GEN75_BLEND_STATE_ENTRY_PreBlendColorClampEnable_start  33
   107033 #define GEN7_BLEND_STATE_ENTRY_PreBlendColorClampEnable_start  33
   107034 #define GEN6_BLEND_STATE_ENTRY_PreBlendColorClampEnable_start  33
   107035 
   107036 static inline uint32_t ATTRIBUTE_PURE
   107037 BLEND_STATE_ENTRY_PreBlendColorClampEnable_start(const struct gen_device_info *devinfo)
   107038 {
   107039    switch (devinfo->gen) {
   107040    case 10: return 33;
   107041    case 9: return 33;
   107042    case 8: return 33;
   107043    case 7:
   107044       if (devinfo->is_haswell) {
   107045          return 33;
   107046       } else {
   107047          return 33;
   107048       }
   107049    case 6: return 33;
   107050    case 5: return 0;
   107051    case 4:
   107052       if (devinfo->is_g4x) {
   107053          return 0;
   107054       } else {
   107055          return 0;
   107056       }
   107057    default:
   107058       unreachable("Invalid hardware generation");
   107059    }
   107060 }
   107061 
   107062 
   107063 
   107064 /* BLEND_STATE_ENTRY::Pre-Blend Source Only Clamp Enable */
   107065 
   107066 
   107067 #define GEN10_BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_bits  1
   107068 #define GEN9_BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_bits  1
   107069 #define GEN8_BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_bits  1
   107070 
   107071 static inline uint32_t ATTRIBUTE_PURE
   107072 BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_bits(const struct gen_device_info *devinfo)
   107073 {
   107074    switch (devinfo->gen) {
   107075    case 10: return 1;
   107076    case 9: return 1;
   107077    case 8: return 1;
   107078    case 7:
   107079       if (devinfo->is_haswell) {
   107080          return 0;
   107081       } else {
   107082          return 0;
   107083       }
   107084    case 6: return 0;
   107085    case 5: return 0;
   107086    case 4:
   107087       if (devinfo->is_g4x) {
   107088          return 0;
   107089       } else {
   107090          return 0;
   107091       }
   107092    default:
   107093       unreachable("Invalid hardware generation");
   107094    }
   107095 }
   107096 
   107097 
   107098 
   107099 #define GEN10_BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_start  36
   107100 #define GEN9_BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_start  36
   107101 #define GEN8_BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_start  36
   107102 
   107103 static inline uint32_t ATTRIBUTE_PURE
   107104 BLEND_STATE_ENTRY_PreBlendSourceOnlyClampEnable_start(const struct gen_device_info *devinfo)
   107105 {
   107106    switch (devinfo->gen) {
   107107    case 10: return 36;
   107108    case 9: return 36;
   107109    case 8: return 36;
   107110    case 7:
   107111       if (devinfo->is_haswell) {
   107112          return 0;
   107113       } else {
   107114          return 0;
   107115       }
   107116    case 6: return 0;
   107117    case 5: return 0;
   107118    case 4:
   107119       if (devinfo->is_g4x) {
   107120          return 0;
   107121       } else {
   107122          return 0;
   107123       }
   107124    default:
   107125       unreachable("Invalid hardware generation");
   107126    }
   107127 }
   107128 
   107129 
   107130 
   107131 /* BLEND_STATE_ENTRY::Source Alpha Blend Factor */
   107132 
   107133 
   107134 #define GEN10_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_bits  5
   107135 #define GEN9_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_bits  5
   107136 #define GEN8_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_bits  5
   107137 #define GEN75_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_bits  5
   107138 #define GEN7_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_bits  5
   107139 #define GEN6_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_bits  5
   107140 
   107141 static inline uint32_t ATTRIBUTE_PURE
   107142 BLEND_STATE_ENTRY_SourceAlphaBlendFactor_bits(const struct gen_device_info *devinfo)
   107143 {
   107144    switch (devinfo->gen) {
   107145    case 10: return 5;
   107146    case 9: return 5;
   107147    case 8: return 5;
   107148    case 7:
   107149       if (devinfo->is_haswell) {
   107150          return 5;
   107151       } else {
   107152          return 5;
   107153       }
   107154    case 6: return 5;
   107155    case 5: return 0;
   107156    case 4:
   107157       if (devinfo->is_g4x) {
   107158          return 0;
   107159       } else {
   107160          return 0;
   107161       }
   107162    default:
   107163       unreachable("Invalid hardware generation");
   107164    }
   107165 }
   107166 
   107167 
   107168 
   107169 #define GEN10_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_start  13
   107170 #define GEN9_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_start  13
   107171 #define GEN8_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_start  13
   107172 #define GEN75_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_start  20
   107173 #define GEN7_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_start  20
   107174 #define GEN6_BLEND_STATE_ENTRY_SourceAlphaBlendFactor_start  20
   107175 
   107176 static inline uint32_t ATTRIBUTE_PURE
   107177 BLEND_STATE_ENTRY_SourceAlphaBlendFactor_start(const struct gen_device_info *devinfo)
   107178 {
   107179    switch (devinfo->gen) {
   107180    case 10: return 13;
   107181    case 9: return 13;
   107182    case 8: return 13;
   107183    case 7:
   107184       if (devinfo->is_haswell) {
   107185          return 20;
   107186       } else {
   107187          return 20;
   107188       }
   107189    case 6: return 20;
   107190    case 5: return 0;
   107191    case 4:
   107192       if (devinfo->is_g4x) {
   107193          return 0;
   107194       } else {
   107195          return 0;
   107196       }
   107197    default:
   107198       unreachable("Invalid hardware generation");
   107199    }
   107200 }
   107201 
   107202 
   107203 
   107204 /* BLEND_STATE_ENTRY::Source Blend Factor */
   107205 
   107206 
   107207 #define GEN10_BLEND_STATE_ENTRY_SourceBlendFactor_bits  5
   107208 #define GEN9_BLEND_STATE_ENTRY_SourceBlendFactor_bits  5
   107209 #define GEN8_BLEND_STATE_ENTRY_SourceBlendFactor_bits  5
   107210 #define GEN75_BLEND_STATE_ENTRY_SourceBlendFactor_bits  5
   107211 #define GEN7_BLEND_STATE_ENTRY_SourceBlendFactor_bits  5
   107212 #define GEN6_BLEND_STATE_ENTRY_SourceBlendFactor_bits  5
   107213 
   107214 static inline uint32_t ATTRIBUTE_PURE
   107215 BLEND_STATE_ENTRY_SourceBlendFactor_bits(const struct gen_device_info *devinfo)
   107216 {
   107217    switch (devinfo->gen) {
   107218    case 10: return 5;
   107219    case 9: return 5;
   107220    case 8: return 5;
   107221    case 7:
   107222       if (devinfo->is_haswell) {
   107223          return 5;
   107224       } else {
   107225          return 5;
   107226       }
   107227    case 6: return 5;
   107228    case 5: return 0;
   107229    case 4:
   107230       if (devinfo->is_g4x) {
   107231          return 0;
   107232       } else {
   107233          return 0;
   107234       }
   107235    default:
   107236       unreachable("Invalid hardware generation");
   107237    }
   107238 }
   107239 
   107240 
   107241 
   107242 #define GEN10_BLEND_STATE_ENTRY_SourceBlendFactor_start  26
   107243 #define GEN9_BLEND_STATE_ENTRY_SourceBlendFactor_start  26
   107244 #define GEN8_BLEND_STATE_ENTRY_SourceBlendFactor_start  26
   107245 #define GEN75_BLEND_STATE_ENTRY_SourceBlendFactor_start  5
   107246 #define GEN7_BLEND_STATE_ENTRY_SourceBlendFactor_start  5
   107247 #define GEN6_BLEND_STATE_ENTRY_SourceBlendFactor_start  5
   107248 
   107249 static inline uint32_t ATTRIBUTE_PURE
   107250 BLEND_STATE_ENTRY_SourceBlendFactor_start(const struct gen_device_info *devinfo)
   107251 {
   107252    switch (devinfo->gen) {
   107253    case 10: return 26;
   107254    case 9: return 26;
   107255    case 8: return 26;
   107256    case 7:
   107257       if (devinfo->is_haswell) {
   107258          return 5;
   107259       } else {
   107260          return 5;
   107261       }
   107262    case 6: return 5;
   107263    case 5: return 0;
   107264    case 4:
   107265       if (devinfo->is_g4x) {
   107266          return 0;
   107267       } else {
   107268          return 0;
   107269       }
   107270    default:
   107271       unreachable("Invalid hardware generation");
   107272    }
   107273 }
   107274 
   107275 
   107276 
   107277 /* BLEND_STATE_ENTRY::Write Disable Alpha */
   107278 
   107279 
   107280 #define GEN10_BLEND_STATE_ENTRY_WriteDisableAlpha_bits  1
   107281 #define GEN9_BLEND_STATE_ENTRY_WriteDisableAlpha_bits  1
   107282 #define GEN8_BLEND_STATE_ENTRY_WriteDisableAlpha_bits  1
   107283 #define GEN75_BLEND_STATE_ENTRY_WriteDisableAlpha_bits  1
   107284 #define GEN7_BLEND_STATE_ENTRY_WriteDisableAlpha_bits  1
   107285 #define GEN6_BLEND_STATE_ENTRY_WriteDisableAlpha_bits  1
   107286 
   107287 static inline uint32_t ATTRIBUTE_PURE
   107288 BLEND_STATE_ENTRY_WriteDisableAlpha_bits(const struct gen_device_info *devinfo)
   107289 {
   107290    switch (devinfo->gen) {
   107291    case 10: return 1;
   107292    case 9: return 1;
   107293    case 8: return 1;
   107294    case 7:
   107295       if (devinfo->is_haswell) {
   107296          return 1;
   107297       } else {
   107298          return 1;
   107299       }
   107300    case 6: return 1;
   107301    case 5: return 0;
   107302    case 4:
   107303       if (devinfo->is_g4x) {
   107304          return 0;
   107305       } else {
   107306          return 0;
   107307       }
   107308    default:
   107309       unreachable("Invalid hardware generation");
   107310    }
   107311 }
   107312 
   107313 
   107314 
   107315 #define GEN10_BLEND_STATE_ENTRY_WriteDisableAlpha_start  3
   107316 #define GEN9_BLEND_STATE_ENTRY_WriteDisableAlpha_start  3
   107317 #define GEN8_BLEND_STATE_ENTRY_WriteDisableAlpha_start  3
   107318 #define GEN75_BLEND_STATE_ENTRY_WriteDisableAlpha_start  59
   107319 #define GEN7_BLEND_STATE_ENTRY_WriteDisableAlpha_start  59
   107320 #define GEN6_BLEND_STATE_ENTRY_WriteDisableAlpha_start  59
   107321 
   107322 static inline uint32_t ATTRIBUTE_PURE
   107323 BLEND_STATE_ENTRY_WriteDisableAlpha_start(const struct gen_device_info *devinfo)
   107324 {
   107325    switch (devinfo->gen) {
   107326    case 10: return 3;
   107327    case 9: return 3;
   107328    case 8: return 3;
   107329    case 7:
   107330       if (devinfo->is_haswell) {
   107331          return 59;
   107332       } else {
   107333          return 59;
   107334       }
   107335    case 6: return 59;
   107336    case 5: return 0;
   107337    case 4:
   107338       if (devinfo->is_g4x) {
   107339          return 0;
   107340       } else {
   107341          return 0;
   107342       }
   107343    default:
   107344       unreachable("Invalid hardware generation");
   107345    }
   107346 }
   107347 
   107348 
   107349 
   107350 /* BLEND_STATE_ENTRY::Write Disable Blue */
   107351 
   107352 
   107353 #define GEN10_BLEND_STATE_ENTRY_WriteDisableBlue_bits  1
   107354 #define GEN9_BLEND_STATE_ENTRY_WriteDisableBlue_bits  1
   107355 #define GEN8_BLEND_STATE_ENTRY_WriteDisableBlue_bits  1
   107356 #define GEN75_BLEND_STATE_ENTRY_WriteDisableBlue_bits  1
   107357 #define GEN7_BLEND_STATE_ENTRY_WriteDisableBlue_bits  1
   107358 #define GEN6_BLEND_STATE_ENTRY_WriteDisableBlue_bits  1
   107359 
   107360 static inline uint32_t ATTRIBUTE_PURE
   107361 BLEND_STATE_ENTRY_WriteDisableBlue_bits(const struct gen_device_info *devinfo)
   107362 {
   107363    switch (devinfo->gen) {
   107364    case 10: return 1;
   107365    case 9: return 1;
   107366    case 8: return 1;
   107367    case 7:
   107368       if (devinfo->is_haswell) {
   107369          return 1;
   107370       } else {
   107371          return 1;
   107372       }
   107373    case 6: return 1;
   107374    case 5: return 0;
   107375    case 4:
   107376       if (devinfo->is_g4x) {
   107377          return 0;
   107378       } else {
   107379          return 0;
   107380       }
   107381    default:
   107382       unreachable("Invalid hardware generation");
   107383    }
   107384 }
   107385 
   107386 
   107387 
   107388 #define GEN10_BLEND_STATE_ENTRY_WriteDisableBlue_start  0
   107389 #define GEN9_BLEND_STATE_ENTRY_WriteDisableBlue_start  0
   107390 #define GEN8_BLEND_STATE_ENTRY_WriteDisableBlue_start  0
   107391 #define GEN75_BLEND_STATE_ENTRY_WriteDisableBlue_start  56
   107392 #define GEN7_BLEND_STATE_ENTRY_WriteDisableBlue_start  56
   107393 #define GEN6_BLEND_STATE_ENTRY_WriteDisableBlue_start  56
   107394 
   107395 static inline uint32_t ATTRIBUTE_PURE
   107396 BLEND_STATE_ENTRY_WriteDisableBlue_start(const struct gen_device_info *devinfo)
   107397 {
   107398    switch (devinfo->gen) {
   107399    case 10: return 0;
   107400    case 9: return 0;
   107401    case 8: return 0;
   107402    case 7:
   107403       if (devinfo->is_haswell) {
   107404          return 56;
   107405       } else {
   107406          return 56;
   107407       }
   107408    case 6: return 56;
   107409    case 5: return 0;
   107410    case 4:
   107411       if (devinfo->is_g4x) {
   107412          return 0;
   107413       } else {
   107414          return 0;
   107415       }
   107416    default:
   107417       unreachable("Invalid hardware generation");
   107418    }
   107419 }
   107420 
   107421 
   107422 
   107423 /* BLEND_STATE_ENTRY::Write Disable Green */
   107424 
   107425 
   107426 #define GEN10_BLEND_STATE_ENTRY_WriteDisableGreen_bits  1
   107427 #define GEN9_BLEND_STATE_ENTRY_WriteDisableGreen_bits  1
   107428 #define GEN8_BLEND_STATE_ENTRY_WriteDisableGreen_bits  1
   107429 #define GEN75_BLEND_STATE_ENTRY_WriteDisableGreen_bits  1
   107430 #define GEN7_BLEND_STATE_ENTRY_WriteDisableGreen_bits  1
   107431 #define GEN6_BLEND_STATE_ENTRY_WriteDisableGreen_bits  1
   107432 
   107433 static inline uint32_t ATTRIBUTE_PURE
   107434 BLEND_STATE_ENTRY_WriteDisableGreen_bits(const struct gen_device_info *devinfo)
   107435 {
   107436    switch (devinfo->gen) {
   107437    case 10: return 1;
   107438    case 9: return 1;
   107439    case 8: return 1;
   107440    case 7:
   107441       if (devinfo->is_haswell) {
   107442          return 1;
   107443       } else {
   107444          return 1;
   107445       }
   107446    case 6: return 1;
   107447    case 5: return 0;
   107448    case 4:
   107449       if (devinfo->is_g4x) {
   107450          return 0;
   107451       } else {
   107452          return 0;
   107453       }
   107454    default:
   107455       unreachable("Invalid hardware generation");
   107456    }
   107457 }
   107458 
   107459 
   107460 
   107461 #define GEN10_BLEND_STATE_ENTRY_WriteDisableGreen_start  1
   107462 #define GEN9_BLEND_STATE_ENTRY_WriteDisableGreen_start  1
   107463 #define GEN8_BLEND_STATE_ENTRY_WriteDisableGreen_start  1
   107464 #define GEN75_BLEND_STATE_ENTRY_WriteDisableGreen_start  57
   107465 #define GEN7_BLEND_STATE_ENTRY_WriteDisableGreen_start  57
   107466 #define GEN6_BLEND_STATE_ENTRY_WriteDisableGreen_start  57
   107467 
   107468 static inline uint32_t ATTRIBUTE_PURE
   107469 BLEND_STATE_ENTRY_WriteDisableGreen_start(const struct gen_device_info *devinfo)
   107470 {
   107471    switch (devinfo->gen) {
   107472    case 10: return 1;
   107473    case 9: return 1;
   107474    case 8: return 1;
   107475    case 7:
   107476       if (devinfo->is_haswell) {
   107477          return 57;
   107478       } else {
   107479          return 57;
   107480       }
   107481    case 6: return 57;
   107482    case 5: return 0;
   107483    case 4:
   107484       if (devinfo->is_g4x) {
   107485          return 0;
   107486       } else {
   107487          return 0;
   107488       }
   107489    default:
   107490       unreachable("Invalid hardware generation");
   107491    }
   107492 }
   107493 
   107494 
   107495 
   107496 /* BLEND_STATE_ENTRY::Write Disable Red */
   107497 
   107498 
   107499 #define GEN10_BLEND_STATE_ENTRY_WriteDisableRed_bits  1
   107500 #define GEN9_BLEND_STATE_ENTRY_WriteDisableRed_bits  1
   107501 #define GEN8_BLEND_STATE_ENTRY_WriteDisableRed_bits  1
   107502 #define GEN75_BLEND_STATE_ENTRY_WriteDisableRed_bits  1
   107503 #define GEN7_BLEND_STATE_ENTRY_WriteDisableRed_bits  1
   107504 #define GEN6_BLEND_STATE_ENTRY_WriteDisableRed_bits  1
   107505 
   107506 static inline uint32_t ATTRIBUTE_PURE
   107507 BLEND_STATE_ENTRY_WriteDisableRed_bits(const struct gen_device_info *devinfo)
   107508 {
   107509    switch (devinfo->gen) {
   107510    case 10: return 1;
   107511    case 9: return 1;
   107512    case 8: return 1;
   107513    case 7:
   107514       if (devinfo->is_haswell) {
   107515          return 1;
   107516       } else {
   107517          return 1;
   107518       }
   107519    case 6: return 1;
   107520    case 5: return 0;
   107521    case 4:
   107522       if (devinfo->is_g4x) {
   107523          return 0;
   107524       } else {
   107525          return 0;
   107526       }
   107527    default:
   107528       unreachable("Invalid hardware generation");
   107529    }
   107530 }
   107531 
   107532 
   107533 
   107534 #define GEN10_BLEND_STATE_ENTRY_WriteDisableRed_start  2
   107535 #define GEN9_BLEND_STATE_ENTRY_WriteDisableRed_start  2
   107536 #define GEN8_BLEND_STATE_ENTRY_WriteDisableRed_start  2
   107537 #define GEN75_BLEND_STATE_ENTRY_WriteDisableRed_start  58
   107538 #define GEN7_BLEND_STATE_ENTRY_WriteDisableRed_start  58
   107539 #define GEN6_BLEND_STATE_ENTRY_WriteDisableRed_start  58
   107540 
   107541 static inline uint32_t ATTRIBUTE_PURE
   107542 BLEND_STATE_ENTRY_WriteDisableRed_start(const struct gen_device_info *devinfo)
   107543 {
   107544    switch (devinfo->gen) {
   107545    case 10: return 2;
   107546    case 9: return 2;
   107547    case 8: return 2;
   107548    case 7:
   107549       if (devinfo->is_haswell) {
   107550          return 58;
   107551       } else {
   107552          return 58;
   107553       }
   107554    case 6: return 58;
   107555    case 5: return 0;
   107556    case 4:
   107557       if (devinfo->is_g4x) {
   107558          return 0;
   107559       } else {
   107560          return 0;
   107561       }
   107562    default:
   107563       unreachable("Invalid hardware generation");
   107564    }
   107565 }
   107566 
   107567 
   107568 
   107569 /* BLEND_STATE_ENTRY::X Dither Offset */
   107570 
   107571 
   107572 #define GEN75_BLEND_STATE_ENTRY_XDitherOffset_bits  2
   107573 #define GEN7_BLEND_STATE_ENTRY_XDitherOffset_bits  2
   107574 #define GEN6_BLEND_STATE_ENTRY_XDitherOffset_bits  2
   107575 
   107576 static inline uint32_t ATTRIBUTE_PURE
   107577 BLEND_STATE_ENTRY_XDitherOffset_bits(const struct gen_device_info *devinfo)
   107578 {
   107579    switch (devinfo->gen) {
   107580    case 10: return 0;
   107581    case 9: return 0;
   107582    case 8: return 0;
   107583    case 7:
   107584       if (devinfo->is_haswell) {
   107585          return 2;
   107586       } else {
   107587          return 2;
   107588       }
   107589    case 6: return 2;
   107590    case 5: return 0;
   107591    case 4:
   107592       if (devinfo->is_g4x) {
   107593          return 0;
   107594       } else {
   107595          return 0;
   107596       }
   107597    default:
   107598       unreachable("Invalid hardware generation");
   107599    }
   107600 }
   107601 
   107602 
   107603 
   107604 #define GEN75_BLEND_STATE_ENTRY_XDitherOffset_start  42
   107605 #define GEN7_BLEND_STATE_ENTRY_XDitherOffset_start  42
   107606 #define GEN6_BLEND_STATE_ENTRY_XDitherOffset_start  42
   107607 
   107608 static inline uint32_t ATTRIBUTE_PURE
   107609 BLEND_STATE_ENTRY_XDitherOffset_start(const struct gen_device_info *devinfo)
   107610 {
   107611    switch (devinfo->gen) {
   107612    case 10: return 0;
   107613    case 9: return 0;
   107614    case 8: return 0;
   107615    case 7:
   107616       if (devinfo->is_haswell) {
   107617          return 42;
   107618       } else {
   107619          return 42;
   107620       }
   107621    case 6: return 42;
   107622    case 5: return 0;
   107623    case 4:
   107624       if (devinfo->is_g4x) {
   107625          return 0;
   107626       } else {
   107627          return 0;
   107628       }
   107629    default:
   107630       unreachable("Invalid hardware generation");
   107631    }
   107632 }
   107633 
   107634 
   107635 
   107636 /* BLEND_STATE_ENTRY::Y Dither Offset */
   107637 
   107638 
   107639 #define GEN75_BLEND_STATE_ENTRY_YDitherOffset_bits  2
   107640 #define GEN7_BLEND_STATE_ENTRY_YDitherOffset_bits  2
   107641 #define GEN6_BLEND_STATE_ENTRY_YDitherOffset_bits  2
   107642 
   107643 static inline uint32_t ATTRIBUTE_PURE
   107644 BLEND_STATE_ENTRY_YDitherOffset_bits(const struct gen_device_info *devinfo)
   107645 {
   107646    switch (devinfo->gen) {
   107647    case 10: return 0;
   107648    case 9: return 0;
   107649    case 8: return 0;
   107650    case 7:
   107651       if (devinfo->is_haswell) {
   107652          return 2;
   107653       } else {
   107654          return 2;
   107655       }
   107656    case 6: return 2;
   107657    case 5: return 0;
   107658    case 4:
   107659       if (devinfo->is_g4x) {
   107660          return 0;
   107661       } else {
   107662          return 0;
   107663       }
   107664    default:
   107665       unreachable("Invalid hardware generation");
   107666    }
   107667 }
   107668 
   107669 
   107670 
   107671 #define GEN75_BLEND_STATE_ENTRY_YDitherOffset_start  40
   107672 #define GEN7_BLEND_STATE_ENTRY_YDitherOffset_start  40
   107673 #define GEN6_BLEND_STATE_ENTRY_YDitherOffset_start  40
   107674 
   107675 static inline uint32_t ATTRIBUTE_PURE
   107676 BLEND_STATE_ENTRY_YDitherOffset_start(const struct gen_device_info *devinfo)
   107677 {
   107678    switch (devinfo->gen) {
   107679    case 10: return 0;
   107680    case 9: return 0;
   107681    case 8: return 0;
   107682    case 7:
   107683       if (devinfo->is_haswell) {
   107684          return 40;
   107685       } else {
   107686          return 40;
   107687       }
   107688    case 6: return 40;
   107689    case 5: return 0;
   107690    case 4:
   107691       if (devinfo->is_g4x) {
   107692          return 0;
   107693       } else {
   107694          return 0;
   107695       }
   107696    default:
   107697       unreachable("Invalid hardware generation");
   107698    }
   107699 }
   107700 
   107701 
   107702 
   107703 /* CACHE_MODE_0 */
   107704 
   107705 
   107706 #define GEN10_CACHE_MODE_0_length  1
   107707 #define GEN9_CACHE_MODE_0_length  1
   107708 
   107709 static inline uint32_t ATTRIBUTE_PURE
   107710 CACHE_MODE_0_length(const struct gen_device_info *devinfo)
   107711 {
   107712    switch (devinfo->gen) {
   107713    case 10: return 1;
   107714    case 9: return 1;
   107715    case 8: return 0;
   107716    case 7:
   107717       if (devinfo->is_haswell) {
   107718          return 0;
   107719       } else {
   107720          return 0;
   107721       }
   107722    case 6: return 0;
   107723    case 5: return 0;
   107724    case 4:
   107725       if (devinfo->is_g4x) {
   107726          return 0;
   107727       } else {
   107728          return 0;
   107729       }
   107730    default:
   107731       unreachable("Invalid hardware generation");
   107732    }
   107733 }
   107734 
   107735 
   107736 
   107737 /* CACHE_MODE_0::Disable clock gating in the pixel backend */
   107738 
   107739 
   107740 #define GEN10_CACHE_MODE_0_Disableclockgatinginthepixelbackend_bits  1
   107741 #define GEN9_CACHE_MODE_0_Disableclockgatinginthepixelbackend_bits  1
   107742 
   107743 static inline uint32_t ATTRIBUTE_PURE
   107744 CACHE_MODE_0_Disableclockgatinginthepixelbackend_bits(const struct gen_device_info *devinfo)
   107745 {
   107746    switch (devinfo->gen) {
   107747    case 10: return 1;
   107748    case 9: return 1;
   107749    case 8: return 0;
   107750    case 7:
   107751       if (devinfo->is_haswell) {
   107752          return 0;
   107753       } else {
   107754          return 0;
   107755       }
   107756    case 6: return 0;
   107757    case 5: return 0;
   107758    case 4:
   107759       if (devinfo->is_g4x) {
   107760          return 0;
   107761       } else {
   107762          return 0;
   107763       }
   107764    default:
   107765       unreachable("Invalid hardware generation");
   107766    }
   107767 }
   107768 
   107769 
   107770 
   107771 #define GEN10_CACHE_MODE_0_Disableclockgatinginthepixelbackend_start  1
   107772 #define GEN9_CACHE_MODE_0_Disableclockgatinginthepixelbackend_start  1
   107773 
   107774 static inline uint32_t ATTRIBUTE_PURE
   107775 CACHE_MODE_0_Disableclockgatinginthepixelbackend_start(const struct gen_device_info *devinfo)
   107776 {
   107777    switch (devinfo->gen) {
   107778    case 10: return 1;
   107779    case 9: return 1;
   107780    case 8: return 0;
   107781    case 7:
   107782       if (devinfo->is_haswell) {
   107783          return 0;
   107784       } else {
   107785          return 0;
   107786       }
   107787    case 6: return 0;
   107788    case 5: return 0;
   107789    case 4:
   107790       if (devinfo->is_g4x) {
   107791          return 0;
   107792       } else {
   107793          return 0;
   107794       }
   107795    default:
   107796       unreachable("Invalid hardware generation");
   107797    }
   107798 }
   107799 
   107800 
   107801 
   107802 /* CACHE_MODE_0::Disable clock gating in the pixel backend Mask */
   107803 
   107804 
   107805 #define GEN10_CACHE_MODE_0_DisableclockgatinginthepixelbackendMask_bits  1
   107806 #define GEN9_CACHE_MODE_0_DisableclockgatinginthepixelbackendMask_bits  1
   107807 
   107808 static inline uint32_t ATTRIBUTE_PURE
   107809 CACHE_MODE_0_DisableclockgatinginthepixelbackendMask_bits(const struct gen_device_info *devinfo)
   107810 {
   107811    switch (devinfo->gen) {
   107812    case 10: return 1;
   107813    case 9: return 1;
   107814    case 8: return 0;
   107815    case 7:
   107816       if (devinfo->is_haswell) {
   107817          return 0;
   107818       } else {
   107819          return 0;
   107820       }
   107821    case 6: return 0;
   107822    case 5: return 0;
   107823    case 4:
   107824       if (devinfo->is_g4x) {
   107825          return 0;
   107826       } else {
   107827          return 0;
   107828       }
   107829    default:
   107830       unreachable("Invalid hardware generation");
   107831    }
   107832 }
   107833 
   107834 
   107835 
   107836 #define GEN10_CACHE_MODE_0_DisableclockgatinginthepixelbackendMask_start  17
   107837 #define GEN9_CACHE_MODE_0_DisableclockgatinginthepixelbackendMask_start  17
   107838 
   107839 static inline uint32_t ATTRIBUTE_PURE
   107840 CACHE_MODE_0_DisableclockgatinginthepixelbackendMask_start(const struct gen_device_info *devinfo)
   107841 {
   107842    switch (devinfo->gen) {
   107843    case 10: return 17;
   107844    case 9: return 17;
   107845    case 8: return 0;
   107846    case 7:
   107847       if (devinfo->is_haswell) {
   107848          return 0;
   107849       } else {
   107850          return 0;
   107851       }
   107852    case 6: return 0;
   107853    case 5: return 0;
   107854    case 4:
   107855       if (devinfo->is_g4x) {
   107856          return 0;
   107857       } else {
   107858          return 0;
   107859       }
   107860    default:
   107861       unreachable("Invalid hardware generation");
   107862    }
   107863 }
   107864 
   107865 
   107866 
   107867 /* CACHE_MODE_0::Hierarchical Z RAW Stall Optimization Disable */
   107868 
   107869 
   107870 #define GEN10_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisable_bits  1
   107871 #define GEN9_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisable_bits  1
   107872 
   107873 static inline uint32_t ATTRIBUTE_PURE
   107874 CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisable_bits(const struct gen_device_info *devinfo)
   107875 {
   107876    switch (devinfo->gen) {
   107877    case 10: return 1;
   107878    case 9: return 1;
   107879    case 8: return 0;
   107880    case 7:
   107881       if (devinfo->is_haswell) {
   107882          return 0;
   107883       } else {
   107884          return 0;
   107885       }
   107886    case 6: return 0;
   107887    case 5: return 0;
   107888    case 4:
   107889       if (devinfo->is_g4x) {
   107890          return 0;
   107891       } else {
   107892          return 0;
   107893       }
   107894    default:
   107895       unreachable("Invalid hardware generation");
   107896    }
   107897 }
   107898 
   107899 
   107900 
   107901 #define GEN10_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisable_start  2
   107902 #define GEN9_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisable_start  2
   107903 
   107904 static inline uint32_t ATTRIBUTE_PURE
   107905 CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisable_start(const struct gen_device_info *devinfo)
   107906 {
   107907    switch (devinfo->gen) {
   107908    case 10: return 2;
   107909    case 9: return 2;
   107910    case 8: return 0;
   107911    case 7:
   107912       if (devinfo->is_haswell) {
   107913          return 0;
   107914       } else {
   107915          return 0;
   107916       }
   107917    case 6: return 0;
   107918    case 5: return 0;
   107919    case 4:
   107920       if (devinfo->is_g4x) {
   107921          return 0;
   107922       } else {
   107923          return 0;
   107924       }
   107925    default:
   107926       unreachable("Invalid hardware generation");
   107927    }
   107928 }
   107929 
   107930 
   107931 
   107932 /* CACHE_MODE_0::Hierarchical Z RAW Stall Optimization Disable Mask */
   107933 
   107934 
   107935 #define GEN10_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisableMask_bits  1
   107936 #define GEN9_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisableMask_bits  1
   107937 
   107938 static inline uint32_t ATTRIBUTE_PURE
   107939 CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisableMask_bits(const struct gen_device_info *devinfo)
   107940 {
   107941    switch (devinfo->gen) {
   107942    case 10: return 1;
   107943    case 9: return 1;
   107944    case 8: return 0;
   107945    case 7:
   107946       if (devinfo->is_haswell) {
   107947          return 0;
   107948       } else {
   107949          return 0;
   107950       }
   107951    case 6: return 0;
   107952    case 5: return 0;
   107953    case 4:
   107954       if (devinfo->is_g4x) {
   107955          return 0;
   107956       } else {
   107957          return 0;
   107958       }
   107959    default:
   107960       unreachable("Invalid hardware generation");
   107961    }
   107962 }
   107963 
   107964 
   107965 
   107966 #define GEN10_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisableMask_start  18
   107967 #define GEN9_CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisableMask_start  18
   107968 
   107969 static inline uint32_t ATTRIBUTE_PURE
   107970 CACHE_MODE_0_HierarchicalZRAWStallOptimizationDisableMask_start(const struct gen_device_info *devinfo)
   107971 {
   107972    switch (devinfo->gen) {
   107973    case 10: return 18;
   107974    case 9: return 18;
   107975    case 8: return 0;
   107976    case 7:
   107977       if (devinfo->is_haswell) {
   107978          return 0;
   107979       } else {
   107980          return 0;
   107981       }
   107982    case 6: return 0;
   107983    case 5: return 0;
   107984    case 4:
   107985       if (devinfo->is_g4x) {
   107986          return 0;
   107987       } else {
   107988          return 0;
   107989       }
   107990    default:
   107991       unreachable("Invalid hardware generation");
   107992    }
   107993 }
   107994 
   107995 
   107996 
   107997 /* CACHE_MODE_0::MSAA Compression Plane Number Threshold for eLLC */
   107998 
   107999 
   108000 #define GEN10_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLC_bits  3
   108001 #define GEN9_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLC_bits  3
   108002 
   108003 static inline uint32_t ATTRIBUTE_PURE
   108004 CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLC_bits(const struct gen_device_info *devinfo)
   108005 {
   108006    switch (devinfo->gen) {
   108007    case 10: return 3;
   108008    case 9: return 3;
   108009    case 8: return 0;
   108010    case 7:
   108011       if (devinfo->is_haswell) {
   108012          return 0;
   108013       } else {
   108014          return 0;
   108015       }
   108016    case 6: return 0;
   108017    case 5: return 0;
   108018    case 4:
   108019       if (devinfo->is_g4x) {
   108020          return 0;
   108021       } else {
   108022          return 0;
   108023       }
   108024    default:
   108025       unreachable("Invalid hardware generation");
   108026    }
   108027 }
   108028 
   108029 
   108030 
   108031 #define GEN10_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLC_start  12
   108032 #define GEN9_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLC_start  12
   108033 
   108034 static inline uint32_t ATTRIBUTE_PURE
   108035 CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLC_start(const struct gen_device_info *devinfo)
   108036 {
   108037    switch (devinfo->gen) {
   108038    case 10: return 12;
   108039    case 9: return 12;
   108040    case 8: return 0;
   108041    case 7:
   108042       if (devinfo->is_haswell) {
   108043          return 0;
   108044       } else {
   108045          return 0;
   108046       }
   108047    case 6: return 0;
   108048    case 5: return 0;
   108049    case 4:
   108050       if (devinfo->is_g4x) {
   108051          return 0;
   108052       } else {
   108053          return 0;
   108054       }
   108055    default:
   108056       unreachable("Invalid hardware generation");
   108057    }
   108058 }
   108059 
   108060 
   108061 
   108062 /* CACHE_MODE_0::MSAA Compression Plane Number Threshold for eLLC Mask */
   108063 
   108064 
   108065 #define GEN10_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLCMask_bits  3
   108066 #define GEN9_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLCMask_bits  3
   108067 
   108068 static inline uint32_t ATTRIBUTE_PURE
   108069 CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLCMask_bits(const struct gen_device_info *devinfo)
   108070 {
   108071    switch (devinfo->gen) {
   108072    case 10: return 3;
   108073    case 9: return 3;
   108074    case 8: return 0;
   108075    case 7:
   108076       if (devinfo->is_haswell) {
   108077          return 0;
   108078       } else {
   108079          return 0;
   108080       }
   108081    case 6: return 0;
   108082    case 5: return 0;
   108083    case 4:
   108084       if (devinfo->is_g4x) {
   108085          return 0;
   108086       } else {
   108087          return 0;
   108088       }
   108089    default:
   108090       unreachable("Invalid hardware generation");
   108091    }
   108092 }
   108093 
   108094 
   108095 
   108096 #define GEN10_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLCMask_start  28
   108097 #define GEN9_CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLCMask_start  28
   108098 
   108099 static inline uint32_t ATTRIBUTE_PURE
   108100 CACHE_MODE_0_MSAACompressionPlaneNumberThresholdforeLLCMask_start(const struct gen_device_info *devinfo)
   108101 {
   108102    switch (devinfo->gen) {
   108103    case 10: return 28;
   108104    case 9: return 28;
   108105    case 8: return 0;
   108106    case 7:
   108107       if (devinfo->is_haswell) {
   108108          return 0;
   108109       } else {
   108110          return 0;
   108111       }
   108112    case 6: return 0;
   108113    case 5: return 0;
   108114    case 4:
   108115       if (devinfo->is_g4x) {
   108116          return 0;
   108117       } else {
   108118          return 0;
   108119       }
   108120    default:
   108121       unreachable("Invalid hardware generation");
   108122    }
   108123 }
   108124 
   108125 
   108126 
   108127 /* CACHE_MODE_0::Null tile fix disable */
   108128 
   108129 
   108130 #define GEN10_CACHE_MODE_0_Nulltilefixdisable_bits  1
   108131 #define GEN9_CACHE_MODE_0_Nulltilefixdisable_bits  1
   108132 
   108133 static inline uint32_t ATTRIBUTE_PURE
   108134 CACHE_MODE_0_Nulltilefixdisable_bits(const struct gen_device_info *devinfo)
   108135 {
   108136    switch (devinfo->gen) {
   108137    case 10: return 1;
   108138    case 9: return 1;
   108139    case 8: return 0;
   108140    case 7:
   108141       if (devinfo->is_haswell) {
   108142          return 0;
   108143       } else {
   108144          return 0;
   108145       }
   108146    case 6: return 0;
   108147    case 5: return 0;
   108148    case 4:
   108149       if (devinfo->is_g4x) {
   108150          return 0;
   108151       } else {
   108152          return 0;
   108153       }
   108154    default:
   108155       unreachable("Invalid hardware generation");
   108156    }
   108157 }
   108158 
   108159 
   108160 
   108161 #define GEN10_CACHE_MODE_0_Nulltilefixdisable_start  0
   108162 #define GEN9_CACHE_MODE_0_Nulltilefixdisable_start  0
   108163 
   108164 static inline uint32_t ATTRIBUTE_PURE
   108165 CACHE_MODE_0_Nulltilefixdisable_start(const struct gen_device_info *devinfo)
   108166 {
   108167    switch (devinfo->gen) {
   108168    case 10: return 0;
   108169    case 9: return 0;
   108170    case 8: return 0;
   108171    case 7:
   108172       if (devinfo->is_haswell) {
   108173          return 0;
   108174       } else {
   108175          return 0;
   108176       }
   108177    case 6: return 0;
   108178    case 5: return 0;
   108179    case 4:
   108180       if (devinfo->is_g4x) {
   108181          return 0;
   108182       } else {
   108183          return 0;
   108184       }
   108185    default:
   108186       unreachable("Invalid hardware generation");
   108187    }
   108188 }
   108189 
   108190 
   108191 
   108192 /* CACHE_MODE_0::Null tile fix disable Mask */
   108193 
   108194 
   108195 #define GEN10_CACHE_MODE_0_NulltilefixdisableMask_bits  1
   108196 #define GEN9_CACHE_MODE_0_NulltilefixdisableMask_bits  1
   108197 
   108198 static inline uint32_t ATTRIBUTE_PURE
   108199 CACHE_MODE_0_NulltilefixdisableMask_bits(const struct gen_device_info *devinfo)
   108200 {
   108201    switch (devinfo->gen) {
   108202    case 10: return 1;
   108203    case 9: return 1;
   108204    case 8: return 0;
   108205    case 7:
   108206       if (devinfo->is_haswell) {
   108207          return 0;
   108208       } else {
   108209          return 0;
   108210       }
   108211    case 6: return 0;
   108212    case 5: return 0;
   108213    case 4:
   108214       if (devinfo->is_g4x) {
   108215          return 0;
   108216       } else {
   108217          return 0;
   108218       }
   108219    default:
   108220       unreachable("Invalid hardware generation");
   108221    }
   108222 }
   108223 
   108224 
   108225 
   108226 #define GEN10_CACHE_MODE_0_NulltilefixdisableMask_start  16
   108227 #define GEN9_CACHE_MODE_0_NulltilefixdisableMask_start  16
   108228 
   108229 static inline uint32_t ATTRIBUTE_PURE
   108230 CACHE_MODE_0_NulltilefixdisableMask_start(const struct gen_device_info *devinfo)
   108231 {
   108232    switch (devinfo->gen) {
   108233    case 10: return 16;
   108234    case 9: return 16;
   108235    case 8: return 0;
   108236    case 7:
   108237       if (devinfo->is_haswell) {
   108238          return 0;
   108239       } else {
   108240          return 0;
   108241       }
   108242    case 6: return 0;
   108243    case 5: return 0;
   108244    case 4:
   108245       if (devinfo->is_g4x) {
   108246          return 0;
   108247       } else {
   108248          return 0;
   108249       }
   108250    default:
   108251       unreachable("Invalid hardware generation");
   108252    }
   108253 }
   108254 
   108255 
   108256 
   108257 /* CACHE_MODE_0::RCC Eviction Policy */
   108258 
   108259 
   108260 #define GEN10_CACHE_MODE_0_RCCEvictionPolicy_bits  1
   108261 #define GEN9_CACHE_MODE_0_RCCEvictionPolicy_bits  1
   108262 
   108263 static inline uint32_t ATTRIBUTE_PURE
   108264 CACHE_MODE_0_RCCEvictionPolicy_bits(const struct gen_device_info *devinfo)
   108265 {
   108266    switch (devinfo->gen) {
   108267    case 10: return 1;
   108268    case 9: return 1;
   108269    case 8: return 0;
   108270    case 7:
   108271       if (devinfo->is_haswell) {
   108272          return 0;
   108273       } else {
   108274          return 0;
   108275       }
   108276    case 6: return 0;
   108277    case 5: return 0;
   108278    case 4:
   108279       if (devinfo->is_g4x) {
   108280          return 0;
   108281       } else {
   108282          return 0;
   108283       }
   108284    default:
   108285       unreachable("Invalid hardware generation");
   108286    }
   108287 }
   108288 
   108289 
   108290 
   108291 #define GEN10_CACHE_MODE_0_RCCEvictionPolicy_start  4
   108292 #define GEN9_CACHE_MODE_0_RCCEvictionPolicy_start  4
   108293 
   108294 static inline uint32_t ATTRIBUTE_PURE
   108295 CACHE_MODE_0_RCCEvictionPolicy_start(const struct gen_device_info *devinfo)
   108296 {
   108297    switch (devinfo->gen) {
   108298    case 10: return 4;
   108299    case 9: return 4;
   108300    case 8: return 0;
   108301    case 7:
   108302       if (devinfo->is_haswell) {
   108303          return 0;
   108304       } else {
   108305          return 0;
   108306       }
   108307    case 6: return 0;
   108308    case 5: return 0;
   108309    case 4:
   108310       if (devinfo->is_g4x) {
   108311          return 0;
   108312       } else {
   108313          return 0;
   108314       }
   108315    default:
   108316       unreachable("Invalid hardware generation");
   108317    }
   108318 }
   108319 
   108320 
   108321 
   108322 /* CACHE_MODE_0::RCC Eviction Policy Mask */
   108323 
   108324 
   108325 #define GEN10_CACHE_MODE_0_RCCEvictionPolicyMask_bits  1
   108326 #define GEN9_CACHE_MODE_0_RCCEvictionPolicyMask_bits  1
   108327 
   108328 static inline uint32_t ATTRIBUTE_PURE
   108329 CACHE_MODE_0_RCCEvictionPolicyMask_bits(const struct gen_device_info *devinfo)
   108330 {
   108331    switch (devinfo->gen) {
   108332    case 10: return 1;
   108333    case 9: return 1;
   108334    case 8: return 0;
   108335    case 7:
   108336       if (devinfo->is_haswell) {
   108337          return 0;
   108338       } else {
   108339          return 0;
   108340       }
   108341    case 6: return 0;
   108342    case 5: return 0;
   108343    case 4:
   108344       if (devinfo->is_g4x) {
   108345          return 0;
   108346       } else {
   108347          return 0;
   108348       }
   108349    default:
   108350       unreachable("Invalid hardware generation");
   108351    }
   108352 }
   108353 
   108354 
   108355 
   108356 #define GEN10_CACHE_MODE_0_RCCEvictionPolicyMask_start  20
   108357 #define GEN9_CACHE_MODE_0_RCCEvictionPolicyMask_start  20
   108358 
   108359 static inline uint32_t ATTRIBUTE_PURE
   108360 CACHE_MODE_0_RCCEvictionPolicyMask_start(const struct gen_device_info *devinfo)
   108361 {
   108362    switch (devinfo->gen) {
   108363    case 10: return 20;
   108364    case 9: return 20;
   108365    case 8: return 0;
   108366    case 7:
   108367       if (devinfo->is_haswell) {
   108368          return 0;
   108369       } else {
   108370          return 0;
   108371       }
   108372    case 6: return 0;
   108373    case 5: return 0;
   108374    case 4:
   108375       if (devinfo->is_g4x) {
   108376          return 0;
   108377       } else {
   108378          return 0;
   108379       }
   108380    default:
   108381       unreachable("Invalid hardware generation");
   108382    }
   108383 }
   108384 
   108385 
   108386 
   108387 /* CACHE_MODE_0::STC PMA Optimization Enable */
   108388 
   108389 
   108390 #define GEN10_CACHE_MODE_0_STCPMAOptimizationEnable_bits  1
   108391 #define GEN9_CACHE_MODE_0_STCPMAOptimizationEnable_bits  1
   108392 
   108393 static inline uint32_t ATTRIBUTE_PURE
   108394 CACHE_MODE_0_STCPMAOptimizationEnable_bits(const struct gen_device_info *devinfo)
   108395 {
   108396    switch (devinfo->gen) {
   108397    case 10: return 1;
   108398    case 9: return 1;
   108399    case 8: return 0;
   108400    case 7:
   108401       if (devinfo->is_haswell) {
   108402          return 0;
   108403       } else {
   108404          return 0;
   108405       }
   108406    case 6: return 0;
   108407    case 5: return 0;
   108408    case 4:
   108409       if (devinfo->is_g4x) {
   108410          return 0;
   108411       } else {
   108412          return 0;
   108413       }
   108414    default:
   108415       unreachable("Invalid hardware generation");
   108416    }
   108417 }
   108418 
   108419 
   108420 
   108421 #define GEN10_CACHE_MODE_0_STCPMAOptimizationEnable_start  5
   108422 #define GEN9_CACHE_MODE_0_STCPMAOptimizationEnable_start  5
   108423 
   108424 static inline uint32_t ATTRIBUTE_PURE
   108425 CACHE_MODE_0_STCPMAOptimizationEnable_start(const struct gen_device_info *devinfo)
   108426 {
   108427    switch (devinfo->gen) {
   108428    case 10: return 5;
   108429    case 9: return 5;
   108430    case 8: return 0;
   108431    case 7:
   108432       if (devinfo->is_haswell) {
   108433          return 0;
   108434       } else {
   108435          return 0;
   108436       }
   108437    case 6: return 0;
   108438    case 5: return 0;
   108439    case 4:
   108440       if (devinfo->is_g4x) {
   108441          return 0;
   108442       } else {
   108443          return 0;
   108444       }
   108445    default:
   108446       unreachable("Invalid hardware generation");
   108447    }
   108448 }
   108449 
   108450 
   108451 
   108452 /* CACHE_MODE_0::STC PMA Optimization Enable Mask */
   108453 
   108454 
   108455 #define GEN10_CACHE_MODE_0_STCPMAOptimizationEnableMask_bits  1
   108456 #define GEN9_CACHE_MODE_0_STCPMAOptimizationEnableMask_bits  1
   108457 
   108458 static inline uint32_t ATTRIBUTE_PURE
   108459 CACHE_MODE_0_STCPMAOptimizationEnableMask_bits(const struct gen_device_info *devinfo)
   108460 {
   108461    switch (devinfo->gen) {
   108462    case 10: return 1;
   108463    case 9: return 1;
   108464    case 8: return 0;
   108465    case 7:
   108466       if (devinfo->is_haswell) {
   108467          return 0;
   108468       } else {
   108469          return 0;
   108470       }
   108471    case 6: return 0;
   108472    case 5: return 0;
   108473    case 4:
   108474       if (devinfo->is_g4x) {
   108475          return 0;
   108476       } else {
   108477          return 0;
   108478       }
   108479    default:
   108480       unreachable("Invalid hardware generation");
   108481    }
   108482 }
   108483 
   108484 
   108485 
   108486 #define GEN10_CACHE_MODE_0_STCPMAOptimizationEnableMask_start  21
   108487 #define GEN9_CACHE_MODE_0_STCPMAOptimizationEnableMask_start  21
   108488 
   108489 static inline uint32_t ATTRIBUTE_PURE
   108490 CACHE_MODE_0_STCPMAOptimizationEnableMask_start(const struct gen_device_info *devinfo)
   108491 {
   108492    switch (devinfo->gen) {
   108493    case 10: return 21;
   108494    case 9: return 21;
   108495    case 8: return 0;
   108496    case 7:
   108497       if (devinfo->is_haswell) {
   108498          return 0;
   108499       } else {
   108500          return 0;
   108501       }
   108502    case 6: return 0;
   108503    case 5: return 0;
   108504    case 4:
   108505       if (devinfo->is_g4x) {
   108506          return 0;
   108507       } else {
   108508          return 0;
   108509       }
   108510    default:
   108511       unreachable("Invalid hardware generation");
   108512    }
   108513 }
   108514 
   108515 
   108516 
   108517 /* CACHE_MODE_0::Sampler L2 Disable */
   108518 
   108519 
   108520 #define GEN10_CACHE_MODE_0_SamplerL2Disable_bits  1
   108521 #define GEN9_CACHE_MODE_0_SamplerL2Disable_bits  1
   108522 
   108523 static inline uint32_t ATTRIBUTE_PURE
   108524 CACHE_MODE_0_SamplerL2Disable_bits(const struct gen_device_info *devinfo)
   108525 {
   108526    switch (devinfo->gen) {
   108527    case 10: return 1;
   108528    case 9: return 1;
   108529    case 8: return 0;
   108530    case 7:
   108531       if (devinfo->is_haswell) {
   108532          return 0;
   108533       } else {
   108534          return 0;
   108535       }
   108536    case 6: return 0;
   108537    case 5: return 0;
   108538    case 4:
   108539       if (devinfo->is_g4x) {
   108540          return 0;
   108541       } else {
   108542          return 0;
   108543       }
   108544    default:
   108545       unreachable("Invalid hardware generation");
   108546    }
   108547 }
   108548 
   108549 
   108550 
   108551 #define GEN10_CACHE_MODE_0_SamplerL2Disable_start  15
   108552 #define GEN9_CACHE_MODE_0_SamplerL2Disable_start  15
   108553 
   108554 static inline uint32_t ATTRIBUTE_PURE
   108555 CACHE_MODE_0_SamplerL2Disable_start(const struct gen_device_info *devinfo)
   108556 {
   108557    switch (devinfo->gen) {
   108558    case 10: return 15;
   108559    case 9: return 15;
   108560    case 8: return 0;
   108561    case 7:
   108562       if (devinfo->is_haswell) {
   108563          return 0;
   108564       } else {
   108565          return 0;
   108566       }
   108567    case 6: return 0;
   108568    case 5: return 0;
   108569    case 4:
   108570       if (devinfo->is_g4x) {
   108571          return 0;
   108572       } else {
   108573          return 0;
   108574       }
   108575    default:
   108576       unreachable("Invalid hardware generation");
   108577    }
   108578 }
   108579 
   108580 
   108581 
   108582 /* CACHE_MODE_0::Sampler L2 Disable Mask */
   108583 
   108584 
   108585 #define GEN10_CACHE_MODE_0_SamplerL2DisableMask_bits  1
   108586 #define GEN9_CACHE_MODE_0_SamplerL2DisableMask_bits  1
   108587 
   108588 static inline uint32_t ATTRIBUTE_PURE
   108589 CACHE_MODE_0_SamplerL2DisableMask_bits(const struct gen_device_info *devinfo)
   108590 {
   108591    switch (devinfo->gen) {
   108592    case 10: return 1;
   108593    case 9: return 1;
   108594    case 8: return 0;
   108595    case 7:
   108596       if (devinfo->is_haswell) {
   108597          return 0;
   108598       } else {
   108599          return 0;
   108600       }
   108601    case 6: return 0;
   108602    case 5: return 0;
   108603    case 4:
   108604       if (devinfo->is_g4x) {
   108605          return 0;
   108606       } else {
   108607          return 0;
   108608       }
   108609    default:
   108610       unreachable("Invalid hardware generation");
   108611    }
   108612 }
   108613 
   108614 
   108615 
   108616 #define GEN10_CACHE_MODE_0_SamplerL2DisableMask_start  31
   108617 #define GEN9_CACHE_MODE_0_SamplerL2DisableMask_start  31
   108618 
   108619 static inline uint32_t ATTRIBUTE_PURE
   108620 CACHE_MODE_0_SamplerL2DisableMask_start(const struct gen_device_info *devinfo)
   108621 {
   108622    switch (devinfo->gen) {
   108623    case 10: return 31;
   108624    case 9: return 31;
   108625    case 8: return 0;
   108626    case 7:
   108627       if (devinfo->is_haswell) {
   108628          return 0;
   108629       } else {
   108630          return 0;
   108631       }
   108632    case 6: return 0;
   108633    case 5: return 0;
   108634    case 4:
   108635       if (devinfo->is_g4x) {
   108636          return 0;
   108637       } else {
   108638          return 0;
   108639       }
   108640    default:
   108641       unreachable("Invalid hardware generation");
   108642    }
   108643 }
   108644 
   108645 
   108646 
   108647 /* CACHE_MODE_0::Sampler L2 Request Arbitration */
   108648 
   108649 
   108650 #define GEN10_CACHE_MODE_0_SamplerL2RequestArbitration_bits  2
   108651 #define GEN9_CACHE_MODE_0_SamplerL2RequestArbitration_bits  2
   108652 
   108653 static inline uint32_t ATTRIBUTE_PURE
   108654 CACHE_MODE_0_SamplerL2RequestArbitration_bits(const struct gen_device_info *devinfo)
   108655 {
   108656    switch (devinfo->gen) {
   108657    case 10: return 2;
   108658    case 9: return 2;
   108659    case 8: return 0;
   108660    case 7:
   108661       if (devinfo->is_haswell) {
   108662          return 0;
   108663       } else {
   108664          return 0;
   108665       }
   108666    case 6: return 0;
   108667    case 5: return 0;
   108668    case 4:
   108669       if (devinfo->is_g4x) {
   108670          return 0;
   108671       } else {
   108672          return 0;
   108673       }
   108674    default:
   108675       unreachable("Invalid hardware generation");
   108676    }
   108677 }
   108678 
   108679 
   108680 
   108681 #define GEN10_CACHE_MODE_0_SamplerL2RequestArbitration_start  6
   108682 #define GEN9_CACHE_MODE_0_SamplerL2RequestArbitration_start  6
   108683 
   108684 static inline uint32_t ATTRIBUTE_PURE
   108685 CACHE_MODE_0_SamplerL2RequestArbitration_start(const struct gen_device_info *devinfo)
   108686 {
   108687    switch (devinfo->gen) {
   108688    case 10: return 6;
   108689    case 9: return 6;
   108690    case 8: return 0;
   108691    case 7:
   108692       if (devinfo->is_haswell) {
   108693          return 0;
   108694       } else {
   108695          return 0;
   108696       }
   108697    case 6: return 0;
   108698    case 5: return 0;
   108699    case 4:
   108700       if (devinfo->is_g4x) {
   108701          return 0;
   108702       } else {
   108703          return 0;
   108704       }
   108705    default:
   108706       unreachable("Invalid hardware generation");
   108707    }
   108708 }
   108709 
   108710 
   108711 
   108712 /* CACHE_MODE_0::Sampler L2 Request Arbitration Mask */
   108713 
   108714 
   108715 #define GEN10_CACHE_MODE_0_SamplerL2RequestArbitrationMask_bits  2
   108716 #define GEN9_CACHE_MODE_0_SamplerL2RequestArbitrationMask_bits  2
   108717 
   108718 static inline uint32_t ATTRIBUTE_PURE
   108719 CACHE_MODE_0_SamplerL2RequestArbitrationMask_bits(const struct gen_device_info *devinfo)
   108720 {
   108721    switch (devinfo->gen) {
   108722    case 10: return 2;
   108723    case 9: return 2;
   108724    case 8: return 0;
   108725    case 7:
   108726       if (devinfo->is_haswell) {
   108727          return 0;
   108728       } else {
   108729          return 0;
   108730       }
   108731    case 6: return 0;
   108732    case 5: return 0;
   108733    case 4:
   108734       if (devinfo->is_g4x) {
   108735          return 0;
   108736       } else {
   108737          return 0;
   108738       }
   108739    default:
   108740       unreachable("Invalid hardware generation");
   108741    }
   108742 }
   108743 
   108744 
   108745 
   108746 #define GEN10_CACHE_MODE_0_SamplerL2RequestArbitrationMask_start  22
   108747 #define GEN9_CACHE_MODE_0_SamplerL2RequestArbitrationMask_start  22
   108748 
   108749 static inline uint32_t ATTRIBUTE_PURE
   108750 CACHE_MODE_0_SamplerL2RequestArbitrationMask_start(const struct gen_device_info *devinfo)
   108751 {
   108752    switch (devinfo->gen) {
   108753    case 10: return 22;
   108754    case 9: return 22;
   108755    case 8: return 0;
   108756    case 7:
   108757       if (devinfo->is_haswell) {
   108758          return 0;
   108759       } else {
   108760          return 0;
   108761       }
   108762    case 6: return 0;
   108763    case 5: return 0;
   108764    case 4:
   108765       if (devinfo->is_g4x) {
   108766          return 0;
   108767       } else {
   108768          return 0;
   108769       }
   108770    default:
   108771       unreachable("Invalid hardware generation");
   108772    }
   108773 }
   108774 
   108775 
   108776 
   108777 /* CACHE_MODE_0::Sampler L2 TLB Prefetch Enable */
   108778 
   108779 
   108780 #define GEN10_CACHE_MODE_0_SamplerL2TLBPrefetchEnable_bits  1
   108781 #define GEN9_CACHE_MODE_0_SamplerL2TLBPrefetchEnable_bits  1
   108782 
   108783 static inline uint32_t ATTRIBUTE_PURE
   108784 CACHE_MODE_0_SamplerL2TLBPrefetchEnable_bits(const struct gen_device_info *devinfo)
   108785 {
   108786    switch (devinfo->gen) {
   108787    case 10: return 1;
   108788    case 9: return 1;
   108789    case 8: return 0;
   108790    case 7:
   108791       if (devinfo->is_haswell) {
   108792          return 0;
   108793       } else {
   108794          return 0;
   108795       }
   108796    case 6: return 0;
   108797    case 5: return 0;
   108798    case 4:
   108799       if (devinfo->is_g4x) {
   108800          return 0;
   108801       } else {
   108802          return 0;
   108803       }
   108804    default:
   108805       unreachable("Invalid hardware generation");
   108806    }
   108807 }
   108808 
   108809 
   108810 
   108811 #define GEN10_CACHE_MODE_0_SamplerL2TLBPrefetchEnable_start  9
   108812 #define GEN9_CACHE_MODE_0_SamplerL2TLBPrefetchEnable_start  9
   108813 
   108814 static inline uint32_t ATTRIBUTE_PURE
   108815 CACHE_MODE_0_SamplerL2TLBPrefetchEnable_start(const struct gen_device_info *devinfo)
   108816 {
   108817    switch (devinfo->gen) {
   108818    case 10: return 9;
   108819    case 9: return 9;
   108820    case 8: return 0;
   108821    case 7:
   108822       if (devinfo->is_haswell) {
   108823          return 0;
   108824       } else {
   108825          return 0;
   108826       }
   108827    case 6: return 0;
   108828    case 5: return 0;
   108829    case 4:
   108830       if (devinfo->is_g4x) {
   108831          return 0;
   108832       } else {
   108833          return 0;
   108834       }
   108835    default:
   108836       unreachable("Invalid hardware generation");
   108837    }
   108838 }
   108839 
   108840 
   108841 
   108842 /* CACHE_MODE_0::Sampler L2 TLB Prefetch Enable Mask */
   108843 
   108844 
   108845 #define GEN10_CACHE_MODE_0_SamplerL2TLBPrefetchEnableMask_bits  1
   108846 #define GEN9_CACHE_MODE_0_SamplerL2TLBPrefetchEnableMask_bits  1
   108847 
   108848 static inline uint32_t ATTRIBUTE_PURE
   108849 CACHE_MODE_0_SamplerL2TLBPrefetchEnableMask_bits(const struct gen_device_info *devinfo)
   108850 {
   108851    switch (devinfo->gen) {
   108852    case 10: return 1;
   108853    case 9: return 1;
   108854    case 8: return 0;
   108855    case 7:
   108856       if (devinfo->is_haswell) {
   108857          return 0;
   108858       } else {
   108859          return 0;
   108860       }
   108861    case 6: return 0;
   108862    case 5: return 0;
   108863    case 4:
   108864       if (devinfo->is_g4x) {
   108865          return 0;
   108866       } else {
   108867          return 0;
   108868       }
   108869    default:
   108870       unreachable("Invalid hardware generation");
   108871    }
   108872 }
   108873 
   108874 
   108875 
   108876 #define GEN10_CACHE_MODE_0_SamplerL2TLBPrefetchEnableMask_start  25
   108877 #define GEN9_CACHE_MODE_0_SamplerL2TLBPrefetchEnableMask_start  25
   108878 
   108879 static inline uint32_t ATTRIBUTE_PURE
   108880 CACHE_MODE_0_SamplerL2TLBPrefetchEnableMask_start(const struct gen_device_info *devinfo)
   108881 {
   108882    switch (devinfo->gen) {
   108883    case 10: return 25;
   108884    case 9: return 25;
   108885    case 8: return 0;
   108886    case 7:
   108887       if (devinfo->is_haswell) {
   108888          return 0;
   108889       } else {
   108890          return 0;
   108891       }
   108892    case 6: return 0;
   108893    case 5: return 0;
   108894    case 4:
   108895       if (devinfo->is_g4x) {
   108896          return 0;
   108897       } else {
   108898          return 0;
   108899       }
   108900    default:
   108901       unreachable("Invalid hardware generation");
   108902    }
   108903 }
   108904 
   108905 
   108906 
   108907 /* CACHE_MODE_0::Sampler Set Remapping for 3D Disable */
   108908 
   108909 
   108910 #define GEN10_CACHE_MODE_0_SamplerSetRemappingfor3DDisable_bits  1
   108911 #define GEN9_CACHE_MODE_0_SamplerSetRemappingfor3DDisable_bits  1
   108912 
   108913 static inline uint32_t ATTRIBUTE_PURE
   108914 CACHE_MODE_0_SamplerSetRemappingfor3DDisable_bits(const struct gen_device_info *devinfo)
   108915 {
   108916    switch (devinfo->gen) {
   108917    case 10: return 1;
   108918    case 9: return 1;
   108919    case 8: return 0;
   108920    case 7:
   108921       if (devinfo->is_haswell) {
   108922          return 0;
   108923       } else {
   108924          return 0;
   108925       }
   108926    case 6: return 0;
   108927    case 5: return 0;
   108928    case 4:
   108929       if (devinfo->is_g4x) {
   108930          return 0;
   108931       } else {
   108932          return 0;
   108933       }
   108934    default:
   108935       unreachable("Invalid hardware generation");
   108936    }
   108937 }
   108938 
   108939 
   108940 
   108941 #define GEN10_CACHE_MODE_0_SamplerSetRemappingfor3DDisable_start  11
   108942 #define GEN9_CACHE_MODE_0_SamplerSetRemappingfor3DDisable_start  11
   108943 
   108944 static inline uint32_t ATTRIBUTE_PURE
   108945 CACHE_MODE_0_SamplerSetRemappingfor3DDisable_start(const struct gen_device_info *devinfo)
   108946 {
   108947    switch (devinfo->gen) {
   108948    case 10: return 11;
   108949    case 9: return 11;
   108950    case 8: return 0;
   108951    case 7:
   108952       if (devinfo->is_haswell) {
   108953          return 0;
   108954       } else {
   108955          return 0;
   108956       }
   108957    case 6: return 0;
   108958    case 5: return 0;
   108959    case 4:
   108960       if (devinfo->is_g4x) {
   108961          return 0;
   108962       } else {
   108963          return 0;
   108964       }
   108965    default:
   108966       unreachable("Invalid hardware generation");
   108967    }
   108968 }
   108969 
   108970 
   108971 
   108972 /* CACHE_MODE_0::Sampler Set Remapping for 3D Disable Mask */
   108973 
   108974 
   108975 #define GEN10_CACHE_MODE_0_SamplerSetRemappingfor3DDisableMask_bits  1
   108976 #define GEN9_CACHE_MODE_0_SamplerSetRemappingfor3DDisableMask_bits  1
   108977 
   108978 static inline uint32_t ATTRIBUTE_PURE
   108979 CACHE_MODE_0_SamplerSetRemappingfor3DDisableMask_bits(const struct gen_device_info *devinfo)
   108980 {
   108981    switch (devinfo->gen) {
   108982    case 10: return 1;
   108983    case 9: return 1;
   108984    case 8: return 0;
   108985    case 7:
   108986       if (devinfo->is_haswell) {
   108987          return 0;
   108988       } else {
   108989          return 0;
   108990       }
   108991    case 6: return 0;
   108992    case 5: return 0;
   108993    case 4:
   108994       if (devinfo->is_g4x) {
   108995          return 0;
   108996       } else {
   108997          return 0;
   108998       }
   108999    default:
   109000       unreachable("Invalid hardware generation");
   109001    }
   109002 }
   109003 
   109004 
   109005 
   109006 #define GEN10_CACHE_MODE_0_SamplerSetRemappingfor3DDisableMask_start  27
   109007 #define GEN9_CACHE_MODE_0_SamplerSetRemappingfor3DDisableMask_start  27
   109008 
   109009 static inline uint32_t ATTRIBUTE_PURE
   109010 CACHE_MODE_0_SamplerSetRemappingfor3DDisableMask_start(const struct gen_device_info *devinfo)
   109011 {
   109012    switch (devinfo->gen) {
   109013    case 10: return 27;
   109014    case 9: return 27;
   109015    case 8: return 0;
   109016    case 7:
   109017       if (devinfo->is_haswell) {
   109018          return 0;
   109019       } else {
   109020          return 0;
   109021       }
   109022    case 6: return 0;
   109023    case 5: return 0;
   109024    case 4:
   109025       if (devinfo->is_g4x) {
   109026          return 0;
   109027       } else {
   109028          return 0;
   109029       }
   109030    default:
   109031       unreachable("Invalid hardware generation");
   109032    }
   109033 }
   109034 
   109035 
   109036 
   109037 /* CACHE_MODE_1 */
   109038 
   109039 
   109040 #define GEN10_CACHE_MODE_1_length  1
   109041 #define GEN9_CACHE_MODE_1_length  1
   109042 #define GEN8_CACHE_MODE_1_length  1
   109043 
   109044 static inline uint32_t ATTRIBUTE_PURE
   109045 CACHE_MODE_1_length(const struct gen_device_info *devinfo)
   109046 {
   109047    switch (devinfo->gen) {
   109048    case 10: return 1;
   109049    case 9: return 1;
   109050    case 8: return 1;
   109051    case 7:
   109052       if (devinfo->is_haswell) {
   109053          return 0;
   109054       } else {
   109055          return 0;
   109056       }
   109057    case 6: return 0;
   109058    case 5: return 0;
   109059    case 4:
   109060       if (devinfo->is_g4x) {
   109061          return 0;
   109062       } else {
   109063          return 0;
   109064       }
   109065    default:
   109066       unreachable("Invalid hardware generation");
   109067    }
   109068 }
   109069 
   109070 
   109071 
   109072 /* CACHE_MODE_1::4X4 RCPFE-STC Optimization Disable */
   109073 
   109074 
   109075 #define GEN9_CACHE_MODE_1_4X4RCPFESTCOptimizationDisable_bits  1
   109076 #define GEN8_CACHE_MODE_1_4X4RCPFESTCOptimizationDisable_bits  1
   109077 
   109078 static inline uint32_t ATTRIBUTE_PURE
   109079 CACHE_MODE_1_4X4RCPFESTCOptimizationDisable_bits(const struct gen_device_info *devinfo)
   109080 {
   109081    switch (devinfo->gen) {
   109082    case 10: return 0;
   109083    case 9: return 1;
   109084    case 8: return 1;
   109085    case 7:
   109086       if (devinfo->is_haswell) {
   109087          return 0;
   109088       } else {
   109089          return 0;
   109090       }
   109091    case 6: return 0;
   109092    case 5: return 0;
   109093    case 4:
   109094       if (devinfo->is_g4x) {
   109095          return 0;
   109096       } else {
   109097          return 0;
   109098       }
   109099    default:
   109100       unreachable("Invalid hardware generation");
   109101    }
   109102 }
   109103 
   109104 
   109105 
   109106 #define GEN9_CACHE_MODE_1_4X4RCPFESTCOptimizationDisable_start  6
   109107 #define GEN8_CACHE_MODE_1_4X4RCPFESTCOptimizationDisable_start  6
   109108 
   109109 static inline uint32_t ATTRIBUTE_PURE
   109110 CACHE_MODE_1_4X4RCPFESTCOptimizationDisable_start(const struct gen_device_info *devinfo)
   109111 {
   109112    switch (devinfo->gen) {
   109113    case 10: return 0;
   109114    case 9: return 6;
   109115    case 8: return 6;
   109116    case 7:
   109117       if (devinfo->is_haswell) {
   109118          return 0;
   109119       } else {
   109120          return 0;
   109121       }
   109122    case 6: return 0;
   109123    case 5: return 0;
   109124    case 4:
   109125       if (devinfo->is_g4x) {
   109126          return 0;
   109127       } else {
   109128          return 0;
   109129       }
   109130    default:
   109131       unreachable("Invalid hardware generation");
   109132    }
   109133 }
   109134 
   109135 
   109136 
   109137 /* CACHE_MODE_1::4X4 RCPFE-STC Optimization Disable Mask */
   109138 
   109139 
   109140 #define GEN9_CACHE_MODE_1_4X4RCPFESTCOptimizationDisableMask_bits  1
   109141 #define GEN8_CACHE_MODE_1_4X4RCPFESTCOptimizationDisableMask_bits  1
   109142 
   109143 static inline uint32_t ATTRIBUTE_PURE
   109144 CACHE_MODE_1_4X4RCPFESTCOptimizationDisableMask_bits(const struct gen_device_info *devinfo)
   109145 {
   109146    switch (devinfo->gen) {
   109147    case 10: return 0;
   109148    case 9: return 1;
   109149    case 8: return 1;
   109150    case 7:
   109151       if (devinfo->is_haswell) {
   109152          return 0;
   109153       } else {
   109154          return 0;
   109155       }
   109156    case 6: return 0;
   109157    case 5: return 0;
   109158    case 4:
   109159       if (devinfo->is_g4x) {
   109160          return 0;
   109161       } else {
   109162          return 0;
   109163       }
   109164    default:
   109165       unreachable("Invalid hardware generation");
   109166    }
   109167 }
   109168 
   109169 
   109170 
   109171 #define GEN9_CACHE_MODE_1_4X4RCPFESTCOptimizationDisableMask_start  22
   109172 #define GEN8_CACHE_MODE_1_4X4RCPFESTCOptimizationDisableMask_start  22
   109173 
   109174 static inline uint32_t ATTRIBUTE_PURE
   109175 CACHE_MODE_1_4X4RCPFESTCOptimizationDisableMask_start(const struct gen_device_info *devinfo)
   109176 {
   109177    switch (devinfo->gen) {
   109178    case 10: return 0;
   109179    case 9: return 22;
   109180    case 8: return 22;
   109181    case 7:
   109182       if (devinfo->is_haswell) {
   109183          return 0;
   109184       } else {
   109185          return 0;
   109186       }
   109187    case 6: return 0;
   109188    case 5: return 0;
   109189    case 4:
   109190       if (devinfo->is_g4x) {
   109191          return 0;
   109192       } else {
   109193          return 0;
   109194       }
   109195    default:
   109196       unreachable("Invalid hardware generation");
   109197    }
   109198 }
   109199 
   109200 
   109201 
   109202 /* CACHE_MODE_1::Blend Optimization Fix Disable */
   109203 
   109204 
   109205 #define GEN10_CACHE_MODE_1_BlendOptimizationFixDisable_bits  1
   109206 #define GEN9_CACHE_MODE_1_BlendOptimizationFixDisable_bits  1
   109207 
   109208 static inline uint32_t ATTRIBUTE_PURE
   109209 CACHE_MODE_1_BlendOptimizationFixDisable_bits(const struct gen_device_info *devinfo)
   109210 {
   109211    switch (devinfo->gen) {
   109212    case 10: return 1;
   109213    case 9: return 1;
   109214    case 8: return 0;
   109215    case 7:
   109216       if (devinfo->is_haswell) {
   109217          return 0;
   109218       } else {
   109219          return 0;
   109220       }
   109221    case 6: return 0;
   109222    case 5: return 0;
   109223    case 4:
   109224       if (devinfo->is_g4x) {
   109225          return 0;
   109226       } else {
   109227          return 0;
   109228       }
   109229    default:
   109230       unreachable("Invalid hardware generation");
   109231    }
   109232 }
   109233 
   109234 
   109235 
   109236 #define GEN10_CACHE_MODE_1_BlendOptimizationFixDisable_start  14
   109237 #define GEN9_CACHE_MODE_1_BlendOptimizationFixDisable_start  14
   109238 
   109239 static inline uint32_t ATTRIBUTE_PURE
   109240 CACHE_MODE_1_BlendOptimizationFixDisable_start(const struct gen_device_info *devinfo)
   109241 {
   109242    switch (devinfo->gen) {
   109243    case 10: return 14;
   109244    case 9: return 14;
   109245    case 8: return 0;
   109246    case 7:
   109247       if (devinfo->is_haswell) {
   109248          return 0;
   109249       } else {
   109250          return 0;
   109251       }
   109252    case 6: return 0;
   109253    case 5: return 0;
   109254    case 4:
   109255       if (devinfo->is_g4x) {
   109256          return 0;
   109257       } else {
   109258          return 0;
   109259       }
   109260    default:
   109261       unreachable("Invalid hardware generation");
   109262    }
   109263 }
   109264 
   109265 
   109266 
   109267 /* CACHE_MODE_1::Blend Optimization Fix Disable Mask */
   109268 
   109269 
   109270 #define GEN10_CACHE_MODE_1_BlendOptimizationFixDisableMask_bits  1
   109271 #define GEN9_CACHE_MODE_1_BlendOptimizationFixDisableMask_bits  1
   109272 
   109273 static inline uint32_t ATTRIBUTE_PURE
   109274 CACHE_MODE_1_BlendOptimizationFixDisableMask_bits(const struct gen_device_info *devinfo)
   109275 {
   109276    switch (devinfo->gen) {
   109277    case 10: return 1;
   109278    case 9: return 1;
   109279    case 8: return 0;
   109280    case 7:
   109281       if (devinfo->is_haswell) {
   109282          return 0;
   109283       } else {
   109284          return 0;
   109285       }
   109286    case 6: return 0;
   109287    case 5: return 0;
   109288    case 4:
   109289       if (devinfo->is_g4x) {
   109290          return 0;
   109291       } else {
   109292          return 0;
   109293       }
   109294    default:
   109295       unreachable("Invalid hardware generation");
   109296    }
   109297 }
   109298 
   109299 
   109300 
   109301 #define GEN10_CACHE_MODE_1_BlendOptimizationFixDisableMask_start  30
   109302 #define GEN9_CACHE_MODE_1_BlendOptimizationFixDisableMask_start  30
   109303 
   109304 static inline uint32_t ATTRIBUTE_PURE
   109305 CACHE_MODE_1_BlendOptimizationFixDisableMask_start(const struct gen_device_info *devinfo)
   109306 {
   109307    switch (devinfo->gen) {
   109308    case 10: return 30;
   109309    case 9: return 30;
   109310    case 8: return 0;
   109311    case 7:
   109312       if (devinfo->is_haswell) {
   109313          return 0;
   109314       } else {
   109315          return 0;
   109316       }
   109317    case 6: return 0;
   109318    case 5: return 0;
   109319    case 4:
   109320       if (devinfo->is_g4x) {
   109321          return 0;
   109322       } else {
   109323          return 0;
   109324       }
   109325    default:
   109326       unreachable("Invalid hardware generation");
   109327    }
   109328 }
   109329 
   109330 
   109331 
   109332 /* CACHE_MODE_1::Color Compression Disable */
   109333 
   109334 
   109335 #define GEN10_CACHE_MODE_1_ColorCompressionDisable_bits  1
   109336 #define GEN9_CACHE_MODE_1_ColorCompressionDisable_bits  1
   109337 
   109338 static inline uint32_t ATTRIBUTE_PURE
   109339 CACHE_MODE_1_ColorCompressionDisable_bits(const struct gen_device_info *devinfo)
   109340 {
   109341    switch (devinfo->gen) {
   109342    case 10: return 1;
   109343    case 9: return 1;
   109344    case 8: return 0;
   109345    case 7:
   109346       if (devinfo->is_haswell) {
   109347          return 0;
   109348       } else {
   109349          return 0;
   109350       }
   109351    case 6: return 0;
   109352    case 5: return 0;
   109353    case 4:
   109354       if (devinfo->is_g4x) {
   109355          return 0;
   109356       } else {
   109357          return 0;
   109358       }
   109359    default:
   109360       unreachable("Invalid hardware generation");
   109361    }
   109362 }
   109363 
   109364 
   109365 
   109366 #define GEN10_CACHE_MODE_1_ColorCompressionDisable_start  15
   109367 #define GEN9_CACHE_MODE_1_ColorCompressionDisable_start  15
   109368 
   109369 static inline uint32_t ATTRIBUTE_PURE
   109370 CACHE_MODE_1_ColorCompressionDisable_start(const struct gen_device_info *devinfo)
   109371 {
   109372    switch (devinfo->gen) {
   109373    case 10: return 15;
   109374    case 9: return 15;
   109375    case 8: return 0;
   109376    case 7:
   109377       if (devinfo->is_haswell) {
   109378          return 0;
   109379       } else {
   109380          return 0;
   109381       }
   109382    case 6: return 0;
   109383    case 5: return 0;
   109384    case 4:
   109385       if (devinfo->is_g4x) {
   109386          return 0;
   109387       } else {
   109388          return 0;
   109389       }
   109390    default:
   109391       unreachable("Invalid hardware generation");
   109392    }
   109393 }
   109394 
   109395 
   109396 
   109397 /* CACHE_MODE_1::Color Compression Disable Mask */
   109398 
   109399 
   109400 #define GEN10_CACHE_MODE_1_ColorCompressionDisableMask_bits  1
   109401 #define GEN9_CACHE_MODE_1_ColorCompressionDisableMask_bits  1
   109402 
   109403 static inline uint32_t ATTRIBUTE_PURE
   109404 CACHE_MODE_1_ColorCompressionDisableMask_bits(const struct gen_device_info *devinfo)
   109405 {
   109406    switch (devinfo->gen) {
   109407    case 10: return 1;
   109408    case 9: return 1;
   109409    case 8: return 0;
   109410    case 7:
   109411       if (devinfo->is_haswell) {
   109412          return 0;
   109413       } else {
   109414          return 0;
   109415       }
   109416    case 6: return 0;
   109417    case 5: return 0;
   109418    case 4:
   109419       if (devinfo->is_g4x) {
   109420          return 0;
   109421       } else {
   109422          return 0;
   109423       }
   109424    default:
   109425       unreachable("Invalid hardware generation");
   109426    }
   109427 }
   109428 
   109429 
   109430 
   109431 #define GEN10_CACHE_MODE_1_ColorCompressionDisableMask_start  31
   109432 #define GEN9_CACHE_MODE_1_ColorCompressionDisableMask_start  31
   109433 
   109434 static inline uint32_t ATTRIBUTE_PURE
   109435 CACHE_MODE_1_ColorCompressionDisableMask_start(const struct gen_device_info *devinfo)
   109436 {
   109437    switch (devinfo->gen) {
   109438    case 10: return 31;
   109439    case 9: return 31;
   109440    case 8: return 0;
   109441    case 7:
   109442       if (devinfo->is_haswell) {
   109443          return 0;
   109444       } else {
   109445          return 0;
   109446       }
   109447    case 6: return 0;
   109448    case 5: return 0;
   109449    case 4:
   109450       if (devinfo->is_g4x) {
   109451          return 0;
   109452       } else {
   109453          return 0;
   109454       }
   109455    default:
   109456       unreachable("Invalid hardware generation");
   109457    }
   109458 }
   109459 
   109460 
   109461 
   109462 /* CACHE_MODE_1::Depth Read Hit Write-Only Optimization Disable */
   109463 
   109464 
   109465 #define GEN9_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisable_bits  1
   109466 #define GEN8_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisable_bits  1
   109467 
   109468 static inline uint32_t ATTRIBUTE_PURE
   109469 CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisable_bits(const struct gen_device_info *devinfo)
   109470 {
   109471    switch (devinfo->gen) {
   109472    case 10: return 0;
   109473    case 9: return 1;
   109474    case 8: return 1;
   109475    case 7:
   109476       if (devinfo->is_haswell) {
   109477          return 0;
   109478       } else {
   109479          return 0;
   109480       }
   109481    case 6: return 0;
   109482    case 5: return 0;
   109483    case 4:
   109484       if (devinfo->is_g4x) {
   109485          return 0;
   109486       } else {
   109487          return 0;
   109488       }
   109489    default:
   109490       unreachable("Invalid hardware generation");
   109491    }
   109492 }
   109493 
   109494 
   109495 
   109496 #define GEN9_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisable_start  3
   109497 #define GEN8_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisable_start  3
   109498 
   109499 static inline uint32_t ATTRIBUTE_PURE
   109500 CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisable_start(const struct gen_device_info *devinfo)
   109501 {
   109502    switch (devinfo->gen) {
   109503    case 10: return 0;
   109504    case 9: return 3;
   109505    case 8: return 3;
   109506    case 7:
   109507       if (devinfo->is_haswell) {
   109508          return 0;
   109509       } else {
   109510          return 0;
   109511       }
   109512    case 6: return 0;
   109513    case 5: return 0;
   109514    case 4:
   109515       if (devinfo->is_g4x) {
   109516          return 0;
   109517       } else {
   109518          return 0;
   109519       }
   109520    default:
   109521       unreachable("Invalid hardware generation");
   109522    }
   109523 }
   109524 
   109525 
   109526 
   109527 /* CACHE_MODE_1::Depth Read Hit Write-Only Optimization Disable Mask */
   109528 
   109529 
   109530 #define GEN9_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisableMask_bits  1
   109531 #define GEN8_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisableMask_bits  1
   109532 
   109533 static inline uint32_t ATTRIBUTE_PURE
   109534 CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisableMask_bits(const struct gen_device_info *devinfo)
   109535 {
   109536    switch (devinfo->gen) {
   109537    case 10: return 0;
   109538    case 9: return 1;
   109539    case 8: return 1;
   109540    case 7:
   109541       if (devinfo->is_haswell) {
   109542          return 0;
   109543       } else {
   109544          return 0;
   109545       }
   109546    case 6: return 0;
   109547    case 5: return 0;
   109548    case 4:
   109549       if (devinfo->is_g4x) {
   109550          return 0;
   109551       } else {
   109552          return 0;
   109553       }
   109554    default:
   109555       unreachable("Invalid hardware generation");
   109556    }
   109557 }
   109558 
   109559 
   109560 
   109561 #define GEN9_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisableMask_start  19
   109562 #define GEN8_CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisableMask_start  19
   109563 
   109564 static inline uint32_t ATTRIBUTE_PURE
   109565 CACHE_MODE_1_DepthReadHitWriteOnlyOptimizationDisableMask_start(const struct gen_device_info *devinfo)
   109566 {
   109567    switch (devinfo->gen) {
   109568    case 10: return 0;
   109569    case 9: return 19;
   109570    case 8: return 19;
   109571    case 7:
   109572       if (devinfo->is_haswell) {
   109573          return 0;
   109574       } else {
   109575          return 0;
   109576       }
   109577    case 6: return 0;
   109578    case 5: return 0;
   109579    case 4:
   109580       if (devinfo->is_g4x) {
   109581          return 0;
   109582       } else {
   109583          return 0;
   109584       }
   109585    default:
   109586       unreachable("Invalid hardware generation");
   109587    }
   109588 }
   109589 
   109590 
   109591 
   109592 /* CACHE_MODE_1::Float Blend Optimization Enable */
   109593 
   109594 
   109595 #define GEN9_CACHE_MODE_1_FloatBlendOptimizationEnable_bits  1
   109596 
   109597 static inline uint32_t ATTRIBUTE_PURE
   109598 CACHE_MODE_1_FloatBlendOptimizationEnable_bits(const struct gen_device_info *devinfo)
   109599 {
   109600    switch (devinfo->gen) {
   109601    case 10: return 0;
   109602    case 9: return 1;
   109603    case 8: return 0;
   109604    case 7:
   109605       if (devinfo->is_haswell) {
   109606          return 0;
   109607       } else {
   109608          return 0;
   109609       }
   109610    case 6: return 0;
   109611    case 5: return 0;
   109612    case 4:
   109613       if (devinfo->is_g4x) {
   109614          return 0;
   109615       } else {
   109616          return 0;
   109617       }
   109618    default:
   109619       unreachable("Invalid hardware generation");
   109620    }
   109621 }
   109622 
   109623 
   109624 
   109625 #define GEN9_CACHE_MODE_1_FloatBlendOptimizationEnable_start  4
   109626 
   109627 static inline uint32_t ATTRIBUTE_PURE
   109628 CACHE_MODE_1_FloatBlendOptimizationEnable_start(const struct gen_device_info *devinfo)
   109629 {
   109630    switch (devinfo->gen) {
   109631    case 10: return 0;
   109632    case 9: return 4;
   109633    case 8: return 0;
   109634    case 7:
   109635       if (devinfo->is_haswell) {
   109636          return 0;
   109637       } else {
   109638          return 0;
   109639       }
   109640    case 6: return 0;
   109641    case 5: return 0;
   109642    case 4:
   109643       if (devinfo->is_g4x) {
   109644          return 0;
   109645       } else {
   109646          return 0;
   109647       }
   109648    default:
   109649       unreachable("Invalid hardware generation");
   109650    }
   109651 }
   109652 
   109653 
   109654 
   109655 /* CACHE_MODE_1::Float Blend Optimization Enable Mask */
   109656 
   109657 
   109658 #define GEN9_CACHE_MODE_1_FloatBlendOptimizationEnableMask_bits  1
   109659 
   109660 static inline uint32_t ATTRIBUTE_PURE
   109661 CACHE_MODE_1_FloatBlendOptimizationEnableMask_bits(const struct gen_device_info *devinfo)
   109662 {
   109663    switch (devinfo->gen) {
   109664    case 10: return 0;
   109665    case 9: return 1;
   109666    case 8: return 0;
   109667    case 7:
   109668       if (devinfo->is_haswell) {
   109669          return 0;
   109670       } else {
   109671          return 0;
   109672       }
   109673    case 6: return 0;
   109674    case 5: return 0;
   109675    case 4:
   109676       if (devinfo->is_g4x) {
   109677          return 0;
   109678       } else {
   109679          return 0;
   109680       }
   109681    default:
   109682       unreachable("Invalid hardware generation");
   109683    }
   109684 }
   109685 
   109686 
   109687 
   109688 #define GEN9_CACHE_MODE_1_FloatBlendOptimizationEnableMask_start  20
   109689 
   109690 static inline uint32_t ATTRIBUTE_PURE
   109691 CACHE_MODE_1_FloatBlendOptimizationEnableMask_start(const struct gen_device_info *devinfo)
   109692 {
   109693    switch (devinfo->gen) {
   109694    case 10: return 0;
   109695    case 9: return 20;
   109696    case 8: return 0;
   109697    case 7:
   109698       if (devinfo->is_haswell) {
   109699          return 0;
   109700       } else {
   109701          return 0;
   109702       }
   109703    case 6: return 0;
   109704    case 5: return 0;
   109705    case 4:
   109706       if (devinfo->is_g4x) {
   109707          return 0;
   109708       } else {
   109709          return 0;
   109710       }
   109711    default:
   109712       unreachable("Invalid hardware generation");
   109713    }
   109714 }
   109715 
   109716 
   109717 
   109718 /* CACHE_MODE_1::HIZ Eviction Policy */
   109719 
   109720 
   109721 #define GEN9_CACHE_MODE_1_HIZEvictionPolicy_bits  1
   109722 #define GEN8_CACHE_MODE_1_HIZEvictionPolicy_bits  1
   109723 
   109724 static inline uint32_t ATTRIBUTE_PURE
   109725 CACHE_MODE_1_HIZEvictionPolicy_bits(const struct gen_device_info *devinfo)
   109726 {
   109727    switch (devinfo->gen) {
   109728    case 10: return 0;
   109729    case 9: return 1;
   109730    case 8: return 1;
   109731    case 7:
   109732       if (devinfo->is_haswell) {
   109733          return 0;
   109734       } else {
   109735          return 0;
   109736       }
   109737    case 6: return 0;
   109738    case 5: return 0;
   109739    case 4:
   109740       if (devinfo->is_g4x) {
   109741          return 0;
   109742       } else {
   109743          return 0;
   109744       }
   109745    default:
   109746       unreachable("Invalid hardware generation");
   109747    }
   109748 }
   109749 
   109750 
   109751 
   109752 #define GEN9_CACHE_MODE_1_HIZEvictionPolicy_start  12
   109753 #define GEN8_CACHE_MODE_1_HIZEvictionPolicy_start  12
   109754 
   109755 static inline uint32_t ATTRIBUTE_PURE
   109756 CACHE_MODE_1_HIZEvictionPolicy_start(const struct gen_device_info *devinfo)
   109757 {
   109758    switch (devinfo->gen) {
   109759    case 10: return 0;
   109760    case 9: return 12;
   109761    case 8: return 12;
   109762    case 7:
   109763       if (devinfo->is_haswell) {
   109764          return 0;
   109765       } else {
   109766          return 0;
   109767       }
   109768    case 6: return 0;
   109769    case 5: return 0;
   109770    case 4:
   109771       if (devinfo->is_g4x) {
   109772          return 0;
   109773       } else {
   109774          return 0;
   109775       }
   109776    default:
   109777       unreachable("Invalid hardware generation");
   109778    }
   109779 }
   109780 
   109781 
   109782 
   109783 /* CACHE_MODE_1::HIZ Eviction Policy Mask */
   109784 
   109785 
   109786 #define GEN9_CACHE_MODE_1_HIZEvictionPolicyMask_bits  1
   109787 #define GEN8_CACHE_MODE_1_HIZEvictionPolicyMask_bits  1
   109788 
   109789 static inline uint32_t ATTRIBUTE_PURE
   109790 CACHE_MODE_1_HIZEvictionPolicyMask_bits(const struct gen_device_info *devinfo)
   109791 {
   109792    switch (devinfo->gen) {
   109793    case 10: return 0;
   109794    case 9: return 1;
   109795    case 8: return 1;
   109796    case 7:
   109797       if (devinfo->is_haswell) {
   109798          return 0;
   109799       } else {
   109800          return 0;
   109801       }
   109802    case 6: return 0;
   109803    case 5: return 0;
   109804    case 4:
   109805       if (devinfo->is_g4x) {
   109806          return 0;
   109807       } else {
   109808          return 0;
   109809       }
   109810    default:
   109811       unreachable("Invalid hardware generation");
   109812    }
   109813 }
   109814 
   109815 
   109816 
   109817 #define GEN9_CACHE_MODE_1_HIZEvictionPolicyMask_start  28
   109818 #define GEN8_CACHE_MODE_1_HIZEvictionPolicyMask_start  28
   109819 
   109820 static inline uint32_t ATTRIBUTE_PURE
   109821 CACHE_MODE_1_HIZEvictionPolicyMask_start(const struct gen_device_info *devinfo)
   109822 {
   109823    switch (devinfo->gen) {
   109824    case 10: return 0;
   109825    case 9: return 28;
   109826    case 8: return 28;
   109827    case 7:
   109828       if (devinfo->is_haswell) {
   109829          return 0;
   109830       } else {
   109831          return 0;
   109832       }
   109833    case 6: return 0;
   109834    case 5: return 0;
   109835    case 4:
   109836       if (devinfo->is_g4x) {
   109837          return 0;
   109838       } else {
   109839          return 0;
   109840       }
   109841    default:
   109842       unreachable("Invalid hardware generation");
   109843    }
   109844 }
   109845 
   109846 
   109847 
   109848 /* CACHE_MODE_1::MCS Cache Disable */
   109849 
   109850 
   109851 #define GEN10_CACHE_MODE_1_MCSCacheDisable_bits  1
   109852 #define GEN9_CACHE_MODE_1_MCSCacheDisable_bits  1
   109853 #define GEN8_CACHE_MODE_1_MCSCacheDisable_bits  1
   109854 
   109855 static inline uint32_t ATTRIBUTE_PURE
   109856 CACHE_MODE_1_MCSCacheDisable_bits(const struct gen_device_info *devinfo)
   109857 {
   109858    switch (devinfo->gen) {
   109859    case 10: return 1;
   109860    case 9: return 1;
   109861    case 8: return 1;
   109862    case 7:
   109863       if (devinfo->is_haswell) {
   109864          return 0;
   109865       } else {
   109866          return 0;
   109867       }
   109868    case 6: return 0;
   109869    case 5: return 0;
   109870    case 4:
   109871       if (devinfo->is_g4x) {
   109872          return 0;
   109873       } else {
   109874          return 0;
   109875       }
   109876    default:
   109877       unreachable("Invalid hardware generation");
   109878    }
   109879 }
   109880 
   109881 
   109882 
   109883 #define GEN10_CACHE_MODE_1_MCSCacheDisable_start  5
   109884 #define GEN9_CACHE_MODE_1_MCSCacheDisable_start  5
   109885 #define GEN8_CACHE_MODE_1_MCSCacheDisable_start  5
   109886 
   109887 static inline uint32_t ATTRIBUTE_PURE
   109888 CACHE_MODE_1_MCSCacheDisable_start(const struct gen_device_info *devinfo)
   109889 {
   109890    switch (devinfo->gen) {
   109891    case 10: return 5;
   109892    case 9: return 5;
   109893    case 8: return 5;
   109894    case 7:
   109895       if (devinfo->is_haswell) {
   109896          return 0;
   109897       } else {
   109898          return 0;
   109899       }
   109900    case 6: return 0;
   109901    case 5: return 0;
   109902    case 4:
   109903       if (devinfo->is_g4x) {
   109904          return 0;
   109905       } else {
   109906          return 0;
   109907       }
   109908    default:
   109909       unreachable("Invalid hardware generation");
   109910    }
   109911 }
   109912 
   109913 
   109914 
   109915 /* CACHE_MODE_1::MCS Cache Disable Mask */
   109916 
   109917 
   109918 #define GEN10_CACHE_MODE_1_MCSCacheDisableMask_bits  1
   109919 #define GEN9_CACHE_MODE_1_MCSCacheDisableMask_bits  1
   109920 #define GEN8_CACHE_MODE_1_MCSCacheDisableMask_bits  1
   109921 
   109922 static inline uint32_t ATTRIBUTE_PURE
   109923 CACHE_MODE_1_MCSCacheDisableMask_bits(const struct gen_device_info *devinfo)
   109924 {
   109925    switch (devinfo->gen) {
   109926    case 10: return 1;
   109927    case 9: return 1;
   109928    case 8: return 1;
   109929    case 7:
   109930       if (devinfo->is_haswell) {
   109931          return 0;
   109932       } else {
   109933          return 0;
   109934       }
   109935    case 6: return 0;
   109936    case 5: return 0;
   109937    case 4:
   109938       if (devinfo->is_g4x) {
   109939          return 0;
   109940       } else {
   109941          return 0;
   109942       }
   109943    default:
   109944       unreachable("Invalid hardware generation");
   109945    }
   109946 }
   109947 
   109948 
   109949 
   109950 #define GEN10_CACHE_MODE_1_MCSCacheDisableMask_start  21
   109951 #define GEN9_CACHE_MODE_1_MCSCacheDisableMask_start  21
   109952 #define GEN8_CACHE_MODE_1_MCSCacheDisableMask_start  21
   109953 
   109954 static inline uint32_t ATTRIBUTE_PURE
   109955 CACHE_MODE_1_MCSCacheDisableMask_start(const struct gen_device_info *devinfo)
   109956 {
   109957    switch (devinfo->gen) {
   109958    case 10: return 21;
   109959    case 9: return 21;
   109960    case 8: return 21;
   109961    case 7:
   109962       if (devinfo->is_haswell) {
   109963          return 0;
   109964       } else {
   109965          return 0;
   109966       }
   109967    case 6: return 0;
   109968    case 5: return 0;
   109969    case 4:
   109970       if (devinfo->is_g4x) {
   109971          return 0;
   109972       } else {
   109973          return 0;
   109974       }
   109975    default:
   109976       unreachable("Invalid hardware generation");
   109977    }
   109978 }
   109979 
   109980 
   109981 
   109982 /* CACHE_MODE_1::MSC RAW Hazard Avoidance Bit */
   109983 
   109984 
   109985 #define GEN10_CACHE_MODE_1_MSCRAWHazardAvoidanceBit_bits  1
   109986 #define GEN9_CACHE_MODE_1_MSCRAWHazardAvoidanceBit_bits  1
   109987 
   109988 static inline uint32_t ATTRIBUTE_PURE
   109989 CACHE_MODE_1_MSCRAWHazardAvoidanceBit_bits(const struct gen_device_info *devinfo)
   109990 {
   109991    switch (devinfo->gen) {
   109992    case 10: return 1;
   109993    case 9: return 1;
   109994    case 8: return 0;
   109995    case 7:
   109996       if (devinfo->is_haswell) {
   109997          return 0;
   109998       } else {
   109999          return 0;
   110000       }
   110001    case 6: return 0;
   110002    case 5: return 0;
   110003    case 4:
   110004       if (devinfo->is_g4x) {
   110005          return 0;
   110006       } else {
   110007          return 0;
   110008       }
   110009    default:
   110010       unreachable("Invalid hardware generation");
   110011    }
   110012 }
   110013 
   110014 
   110015 
   110016 #define GEN10_CACHE_MODE_1_MSCRAWHazardAvoidanceBit_start  9
   110017 #define GEN9_CACHE_MODE_1_MSCRAWHazardAvoidanceBit_start  9
   110018 
   110019 static inline uint32_t ATTRIBUTE_PURE
   110020 CACHE_MODE_1_MSCRAWHazardAvoidanceBit_start(const struct gen_device_info *devinfo)
   110021 {
   110022    switch (devinfo->gen) {
   110023    case 10: return 9;
   110024    case 9: return 9;
   110025    case 8: return 0;
   110026    case 7:
   110027       if (devinfo->is_haswell) {
   110028          return 0;
   110029       } else {
   110030          return 0;
   110031       }
   110032    case 6: return 0;
   110033    case 5: return 0;
   110034    case 4:
   110035       if (devinfo->is_g4x) {
   110036          return 0;
   110037       } else {
   110038          return 0;
   110039       }
   110040    default:
   110041       unreachable("Invalid hardware generation");
   110042    }
   110043 }
   110044 
   110045 
   110046 
   110047 /* CACHE_MODE_1::MSC RAW Hazard Avoidance Bit Mask */
   110048 
   110049 
   110050 #define GEN10_CACHE_MODE_1_MSCRAWHazardAvoidanceBitMask_bits  1
   110051 #define GEN9_CACHE_MODE_1_MSCRAWHazardAvoidanceBitMask_bits  1
   110052 
   110053 static inline uint32_t ATTRIBUTE_PURE
   110054 CACHE_MODE_1_MSCRAWHazardAvoidanceBitMask_bits(const struct gen_device_info *devinfo)
   110055 {
   110056    switch (devinfo->gen) {
   110057    case 10: return 1;
   110058    case 9: return 1;
   110059    case 8: return 0;
   110060    case 7:
   110061       if (devinfo->is_haswell) {
   110062          return 0;
   110063       } else {
   110064          return 0;
   110065       }
   110066    case 6: return 0;
   110067    case 5: return 0;
   110068    case 4:
   110069       if (devinfo->is_g4x) {
   110070          return 0;
   110071       } else {
   110072          return 0;
   110073       }
   110074    default:
   110075       unreachable("Invalid hardware generation");
   110076    }
   110077 }
   110078 
   110079 
   110080 
   110081 #define GEN10_CACHE_MODE_1_MSCRAWHazardAvoidanceBitMask_start  25
   110082 #define GEN9_CACHE_MODE_1_MSCRAWHazardAvoidanceBitMask_start  25
   110083 
   110084 static inline uint32_t ATTRIBUTE_PURE
   110085 CACHE_MODE_1_MSCRAWHazardAvoidanceBitMask_start(const struct gen_device_info *devinfo)
   110086 {
   110087    switch (devinfo->gen) {
   110088    case 10: return 25;
   110089    case 9: return 25;
   110090    case 8: return 0;
   110091    case 7:
   110092       if (devinfo->is_haswell) {
   110093          return 0;
   110094       } else {
   110095          return 0;
   110096       }
   110097    case 6: return 0;
   110098    case 5: return 0;
   110099    case 4:
   110100       if (devinfo->is_g4x) {
   110101          return 0;
   110102       } else {
   110103          return 0;
   110104       }
   110105    default:
   110106       unreachable("Invalid hardware generation");
   110107    }
   110108 }
   110109 
   110110 
   110111 
   110112 /* CACHE_MODE_1::MSC Resolve Optimization Disable */
   110113 
   110114 
   110115 #define GEN8_CACHE_MODE_1_MSCResolveOptimizationDisable_bits  1
   110116 
   110117 static inline uint32_t ATTRIBUTE_PURE
   110118 CACHE_MODE_1_MSCResolveOptimizationDisable_bits(const struct gen_device_info *devinfo)
   110119 {
   110120    switch (devinfo->gen) {
   110121    case 10: return 0;
   110122    case 9: return 0;
   110123    case 8: return 1;
   110124    case 7:
   110125       if (devinfo->is_haswell) {
   110126          return 0;
   110127       } else {
   110128          return 0;
   110129       }
   110130    case 6: return 0;
   110131    case 5: return 0;
   110132    case 4:
   110133       if (devinfo->is_g4x) {
   110134          return 0;
   110135       } else {
   110136          return 0;
   110137       }
   110138    default:
   110139       unreachable("Invalid hardware generation");
   110140    }
   110141 }
   110142 
   110143 
   110144 
   110145 #define GEN8_CACHE_MODE_1_MSCResolveOptimizationDisable_start  14
   110146 
   110147 static inline uint32_t ATTRIBUTE_PURE
   110148 CACHE_MODE_1_MSCResolveOptimizationDisable_start(const struct gen_device_info *devinfo)
   110149 {
   110150    switch (devinfo->gen) {
   110151    case 10: return 0;
   110152    case 9: return 0;
   110153    case 8: return 14;
   110154    case 7:
   110155       if (devinfo->is_haswell) {
   110156          return 0;
   110157       } else {
   110158          return 0;
   110159       }
   110160    case 6: return 0;
   110161    case 5: return 0;
   110162    case 4:
   110163       if (devinfo->is_g4x) {
   110164          return 0;
   110165       } else {
   110166          return 0;
   110167       }
   110168    default:
   110169       unreachable("Invalid hardware generation");
   110170    }
   110171 }
   110172 
   110173 
   110174 
   110175 /* CACHE_MODE_1::MSC Resolve Optimization Disable Mask */
   110176 
   110177 
   110178 #define GEN8_CACHE_MODE_1_MSCResolveOptimizationDisableMask_bits  1
   110179 
   110180 static inline uint32_t ATTRIBUTE_PURE
   110181 CACHE_MODE_1_MSCResolveOptimizationDisableMask_bits(const struct gen_device_info *devinfo)
   110182 {
   110183    switch (devinfo->gen) {
   110184    case 10: return 0;
   110185    case 9: return 0;
   110186    case 8: return 1;
   110187    case 7:
   110188       if (devinfo->is_haswell) {
   110189          return 0;
   110190       } else {
   110191          return 0;
   110192       }
   110193    case 6: return 0;
   110194    case 5: return 0;
   110195    case 4:
   110196       if (devinfo->is_g4x) {
   110197          return 0;
   110198       } else {
   110199          return 0;
   110200       }
   110201    default:
   110202       unreachable("Invalid hardware generation");
   110203    }
   110204 }
   110205 
   110206 
   110207 
   110208 #define GEN8_CACHE_MODE_1_MSCResolveOptimizationDisableMask_start  30
   110209 
   110210 static inline uint32_t ATTRIBUTE_PURE
   110211 CACHE_MODE_1_MSCResolveOptimizationDisableMask_start(const struct gen_device_info *devinfo)
   110212 {
   110213    switch (devinfo->gen) {
   110214    case 10: return 0;
   110215    case 9: return 0;
   110216    case 8: return 30;
   110217    case 7:
   110218       if (devinfo->is_haswell) {
   110219          return 0;
   110220       } else {
   110221          return 0;
   110222       }
   110223    case 6: return 0;
   110224    case 5: return 0;
   110225    case 4:
   110226       if (devinfo->is_g4x) {
   110227          return 0;
   110228       } else {
   110229          return 0;
   110230       }
   110231    default:
   110232       unreachable("Invalid hardware generation");
   110233    }
   110234 }
   110235 
   110236 
   110237 
   110238 /* CACHE_MODE_1::NP Early Z Fails Disable */
   110239 
   110240 
   110241 #define GEN10_CACHE_MODE_1_NPEarlyZFailsDisable_bits  1
   110242 #define GEN9_CACHE_MODE_1_NPEarlyZFailsDisable_bits  1
   110243 #define GEN8_CACHE_MODE_1_NPEarlyZFailsDisable_bits  1
   110244 
   110245 static inline uint32_t ATTRIBUTE_PURE
   110246 CACHE_MODE_1_NPEarlyZFailsDisable_bits(const struct gen_device_info *devinfo)
   110247 {
   110248    switch (devinfo->gen) {
   110249    case 10: return 1;
   110250    case 9: return 1;
   110251    case 8: return 1;
   110252    case 7:
   110253       if (devinfo->is_haswell) {
   110254          return 0;
   110255       } else {
   110256          return 0;
   110257       }
   110258    case 6: return 0;
   110259    case 5: return 0;
   110260    case 4:
   110261       if (devinfo->is_g4x) {
   110262          return 0;
   110263       } else {
   110264          return 0;
   110265       }
   110266    default:
   110267       unreachable("Invalid hardware generation");
   110268    }
   110269 }
   110270 
   110271 
   110272 
   110273 #define GEN10_CACHE_MODE_1_NPEarlyZFailsDisable_start  13
   110274 #define GEN9_CACHE_MODE_1_NPEarlyZFailsDisable_start  13
   110275 #define GEN8_CACHE_MODE_1_NPEarlyZFailsDisable_start  13
   110276 
   110277 static inline uint32_t ATTRIBUTE_PURE
   110278 CACHE_MODE_1_NPEarlyZFailsDisable_start(const struct gen_device_info *devinfo)
   110279 {
   110280    switch (devinfo->gen) {
   110281    case 10: return 13;
   110282    case 9: return 13;
   110283    case 8: return 13;
   110284    case 7:
   110285       if (devinfo->is_haswell) {
   110286          return 0;
   110287       } else {
   110288          return 0;
   110289       }
   110290    case 6: return 0;
   110291    case 5: return 0;
   110292    case 4:
   110293       if (devinfo->is_g4x) {
   110294          return 0;
   110295       } else {
   110296          return 0;
   110297       }
   110298    default:
   110299       unreachable("Invalid hardware generation");
   110300    }
   110301 }
   110302 
   110303 
   110304 
   110305 /* CACHE_MODE_1::NP Early Z Fails Disable Mask */
   110306 
   110307 
   110308 #define GEN10_CACHE_MODE_1_NPEarlyZFailsDisableMask_bits  1
   110309 #define GEN9_CACHE_MODE_1_NPEarlyZFailsDisableMask_bits  1
   110310 #define GEN8_CACHE_MODE_1_NPEarlyZFailsDisableMask_bits  1
   110311 
   110312 static inline uint32_t ATTRIBUTE_PURE
   110313 CACHE_MODE_1_NPEarlyZFailsDisableMask_bits(const struct gen_device_info *devinfo)
   110314 {
   110315    switch (devinfo->gen) {
   110316    case 10: return 1;
   110317    case 9: return 1;
   110318    case 8: return 1;
   110319    case 7:
   110320       if (devinfo->is_haswell) {
   110321          return 0;
   110322       } else {
   110323          return 0;
   110324       }
   110325    case 6: return 0;
   110326    case 5: return 0;
   110327    case 4:
   110328       if (devinfo->is_g4x) {
   110329          return 0;
   110330       } else {
   110331          return 0;
   110332       }
   110333    default:
   110334       unreachable("Invalid hardware generation");
   110335    }
   110336 }
   110337 
   110338 
   110339 
   110340 #define GEN10_CACHE_MODE_1_NPEarlyZFailsDisableMask_start  29
   110341 #define GEN9_CACHE_MODE_1_NPEarlyZFailsDisableMask_start  29
   110342 #define GEN8_CACHE_MODE_1_NPEarlyZFailsDisableMask_start  29
   110343 
   110344 static inline uint32_t ATTRIBUTE_PURE
   110345 CACHE_MODE_1_NPEarlyZFailsDisableMask_start(const struct gen_device_info *devinfo)
   110346 {
   110347    switch (devinfo->gen) {
   110348    case 10: return 29;
   110349    case 9: return 29;
   110350    case 8: return 29;
   110351    case 7:
   110352       if (devinfo->is_haswell) {
   110353          return 0;
   110354       } else {
   110355          return 0;
   110356       }
   110357    case 6: return 0;
   110358    case 5: return 0;
   110359    case 4:
   110360       if (devinfo->is_g4x) {
   110361          return 0;
   110362       } else {
   110363          return 0;
   110364       }
   110365    default:
   110366       unreachable("Invalid hardware generation");
   110367    }
   110368 }
   110369 
   110370 
   110371 
   110372 /* CACHE_MODE_1::NP PMA Fix Enable */
   110373 
   110374 
   110375 #define GEN9_CACHE_MODE_1_NPPMAFixEnable_bits  1
   110376 #define GEN8_CACHE_MODE_1_NPPMAFixEnable_bits  1
   110377 
   110378 static inline uint32_t ATTRIBUTE_PURE
   110379 CACHE_MODE_1_NPPMAFixEnable_bits(const struct gen_device_info *devinfo)
   110380 {
   110381    switch (devinfo->gen) {
   110382    case 10: return 0;
   110383    case 9: return 1;
   110384    case 8: return 1;
   110385    case 7:
   110386       if (devinfo->is_haswell) {
   110387          return 0;
   110388       } else {
   110389          return 0;
   110390       }
   110391    case 6: return 0;
   110392    case 5: return 0;
   110393    case 4:
   110394       if (devinfo->is_g4x) {
   110395          return 0;
   110396       } else {
   110397          return 0;
   110398       }
   110399    default:
   110400       unreachable("Invalid hardware generation");
   110401    }
   110402 }
   110403 
   110404 
   110405 
   110406 #define GEN9_CACHE_MODE_1_NPPMAFixEnable_start  11
   110407 #define GEN8_CACHE_MODE_1_NPPMAFixEnable_start  11
   110408 
   110409 static inline uint32_t ATTRIBUTE_PURE
   110410 CACHE_MODE_1_NPPMAFixEnable_start(const struct gen_device_info *devinfo)
   110411 {
   110412    switch (devinfo->gen) {
   110413    case 10: return 0;
   110414    case 9: return 11;
   110415    case 8: return 11;
   110416    case 7:
   110417       if (devinfo->is_haswell) {
   110418          return 0;
   110419       } else {
   110420          return 0;
   110421       }
   110422    case 6: return 0;
   110423    case 5: return 0;
   110424    case 4:
   110425       if (devinfo->is_g4x) {
   110426          return 0;
   110427       } else {
   110428          return 0;
   110429       }
   110430    default:
   110431       unreachable("Invalid hardware generation");
   110432    }
   110433 }
   110434 
   110435 
   110436 
   110437 /* CACHE_MODE_1::NP PMA Fix Enable Mask */
   110438 
   110439 
   110440 #define GEN9_CACHE_MODE_1_NPPMAFixEnableMask_bits  1
   110441 #define GEN8_CACHE_MODE_1_NPPMAFixEnableMask_bits  1
   110442 
   110443 static inline uint32_t ATTRIBUTE_PURE
   110444 CACHE_MODE_1_NPPMAFixEnableMask_bits(const struct gen_device_info *devinfo)
   110445 {
   110446    switch (devinfo->gen) {
   110447    case 10: return 0;
   110448    case 9: return 1;
   110449    case 8: return 1;
   110450    case 7:
   110451       if (devinfo->is_haswell) {
   110452          return 0;
   110453       } else {
   110454          return 0;
   110455       }
   110456    case 6: return 0;
   110457    case 5: return 0;
   110458    case 4:
   110459       if (devinfo->is_g4x) {
   110460          return 0;
   110461       } else {
   110462          return 0;
   110463       }
   110464    default:
   110465       unreachable("Invalid hardware generation");
   110466    }
   110467 }
   110468 
   110469 
   110470 
   110471 #define GEN9_CACHE_MODE_1_NPPMAFixEnableMask_start  27
   110472 #define GEN8_CACHE_MODE_1_NPPMAFixEnableMask_start  27
   110473 
   110474 static inline uint32_t ATTRIBUTE_PURE
   110475 CACHE_MODE_1_NPPMAFixEnableMask_start(const struct gen_device_info *devinfo)
   110476 {
   110477    switch (devinfo->gen) {
   110478    case 10: return 0;
   110479    case 9: return 27;
   110480    case 8: return 27;
   110481    case 7:
   110482       if (devinfo->is_haswell) {
   110483          return 0;
   110484       } else {
   110485          return 0;
   110486       }
   110487    case 6: return 0;
   110488    case 5: return 0;
   110489    case 4:
   110490       if (devinfo->is_g4x) {
   110491          return 0;
   110492       } else {
   110493          return 0;
   110494       }
   110495    default:
   110496       unreachable("Invalid hardware generation");
   110497    }
   110498 }
   110499 
   110500 
   110501 
   110502 /* CACHE_MODE_1::Partial Resolve Disable In VC */
   110503 
   110504 
   110505 #define GEN10_CACHE_MODE_1_PartialResolveDisableInVC_bits  1
   110506 #define GEN9_CACHE_MODE_1_PartialResolveDisableInVC_bits  1
   110507 
   110508 static inline uint32_t ATTRIBUTE_PURE
   110509 CACHE_MODE_1_PartialResolveDisableInVC_bits(const struct gen_device_info *devinfo)
   110510 {
   110511    switch (devinfo->gen) {
   110512    case 10: return 1;
   110513    case 9: return 1;
   110514    case 8: return 0;
   110515    case 7:
   110516       if (devinfo->is_haswell) {
   110517          return 0;
   110518       } else {
   110519          return 0;
   110520       }
   110521    case 6: return 0;
   110522    case 5: return 0;
   110523    case 4:
   110524       if (devinfo->is_g4x) {
   110525          return 0;
   110526       } else {
   110527          return 0;
   110528       }
   110529    default:
   110530       unreachable("Invalid hardware generation");
   110531    }
   110532 }
   110533 
   110534 
   110535 
   110536 #define GEN10_CACHE_MODE_1_PartialResolveDisableInVC_start  1
   110537 #define GEN9_CACHE_MODE_1_PartialResolveDisableInVC_start  1
   110538 
   110539 static inline uint32_t ATTRIBUTE_PURE
   110540 CACHE_MODE_1_PartialResolveDisableInVC_start(const struct gen_device_info *devinfo)
   110541 {
   110542    switch (devinfo->gen) {
   110543    case 10: return 1;
   110544    case 9: return 1;
   110545    case 8: return 0;
   110546    case 7:
   110547       if (devinfo->is_haswell) {
   110548          return 0;
   110549       } else {
   110550          return 0;
   110551       }
   110552    case 6: return 0;
   110553    case 5: return 0;
   110554    case 4:
   110555       if (devinfo->is_g4x) {
   110556          return 0;
   110557       } else {
   110558          return 0;
   110559       }
   110560    default:
   110561       unreachable("Invalid hardware generation");
   110562    }
   110563 }
   110564 
   110565 
   110566 
   110567 /* CACHE_MODE_1::Partial Resolve Disable In VC Mask */
   110568 
   110569 
   110570 #define GEN10_CACHE_MODE_1_PartialResolveDisableInVCMask_bits  1
   110571 #define GEN9_CACHE_MODE_1_PartialResolveDisableInVCMask_bits  1
   110572 
   110573 static inline uint32_t ATTRIBUTE_PURE
   110574 CACHE_MODE_1_PartialResolveDisableInVCMask_bits(const struct gen_device_info *devinfo)
   110575 {
   110576    switch (devinfo->gen) {
   110577    case 10: return 1;
   110578    case 9: return 1;
   110579    case 8: return 0;
   110580    case 7:
   110581       if (devinfo->is_haswell) {
   110582          return 0;
   110583       } else {
   110584          return 0;
   110585       }
   110586    case 6: return 0;
   110587    case 5: return 0;
   110588    case 4:
   110589       if (devinfo->is_g4x) {
   110590          return 0;
   110591       } else {
   110592          return 0;
   110593       }
   110594    default:
   110595       unreachable("Invalid hardware generation");
   110596    }
   110597 }
   110598 
   110599 
   110600 
   110601 #define GEN10_CACHE_MODE_1_PartialResolveDisableInVCMask_start  17
   110602 #define GEN9_CACHE_MODE_1_PartialResolveDisableInVCMask_start  17
   110603 
   110604 static inline uint32_t ATTRIBUTE_PURE
   110605 CACHE_MODE_1_PartialResolveDisableInVCMask_start(const struct gen_device_info *devinfo)
   110606 {
   110607    switch (devinfo->gen) {
   110608    case 10: return 17;
   110609    case 9: return 17;
   110610    case 8: return 0;
   110611    case 7:
   110612       if (devinfo->is_haswell) {
   110613          return 0;
   110614       } else {
   110615          return 0;
   110616       }
   110617    case 6: return 0;
   110618    case 5: return 0;
   110619    case 4:
   110620       if (devinfo->is_g4x) {
   110621          return 0;
   110622       } else {
   110623          return 0;
   110624       }
   110625    default:
   110626       unreachable("Invalid hardware generation");
   110627    }
   110628 }
   110629 
   110630 
   110631 
   110632 /* CACHE_MODE_1::RCZ PMA Promoted 2 Not-Promoted Allocation stall optimization Disable */
   110633 
   110634 
   110635 #define GEN10_CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable_bits  1
   110636 
   110637 static inline uint32_t ATTRIBUTE_PURE
   110638 CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable_bits(const struct gen_device_info *devinfo)
   110639 {
   110640    switch (devinfo->gen) {
   110641    case 10: return 1;
   110642    case 9: return 0;
   110643    case 8: return 0;
   110644    case 7:
   110645       if (devinfo->is_haswell) {
   110646          return 0;
   110647       } else {
   110648          return 0;
   110649       }
   110650    case 6: return 0;
   110651    case 5: return 0;
   110652    case 4:
   110653       if (devinfo->is_g4x) {
   110654          return 0;
   110655       } else {
   110656          return 0;
   110657       }
   110658    default:
   110659       unreachable("Invalid hardware generation");
   110660    }
   110661 }
   110662 
   110663 
   110664 
   110665 #define GEN10_CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable_start  3
   110666 
   110667 static inline uint32_t ATTRIBUTE_PURE
   110668 CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable_start(const struct gen_device_info *devinfo)
   110669 {
   110670    switch (devinfo->gen) {
   110671    case 10: return 3;
   110672    case 9: return 0;
   110673    case 8: return 0;
   110674    case 7:
   110675       if (devinfo->is_haswell) {
   110676          return 0;
   110677       } else {
   110678          return 0;
   110679       }
   110680    case 6: return 0;
   110681    case 5: return 0;
   110682    case 4:
   110683       if (devinfo->is_g4x) {
   110684          return 0;
   110685       } else {
   110686          return 0;
   110687       }
   110688    default:
   110689       unreachable("Invalid hardware generation");
   110690    }
   110691 }
   110692 
   110693 
   110694 
   110695 /* CACHE_MODE_1::RCZ PMA Promoted 2 Not-Promoted Allocation stall optimization Disable Mask */
   110696 
   110697 
   110698 #define GEN10_CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask_bits  1
   110699 
   110700 static inline uint32_t ATTRIBUTE_PURE
   110701 CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask_bits(const struct gen_device_info *devinfo)
   110702 {
   110703    switch (devinfo->gen) {
   110704    case 10: return 1;
   110705    case 9: return 0;
   110706    case 8: return 0;
   110707    case 7:
   110708       if (devinfo->is_haswell) {
   110709          return 0;
   110710       } else {
   110711          return 0;
   110712       }
   110713    case 6: return 0;
   110714    case 5: return 0;
   110715    case 4:
   110716       if (devinfo->is_g4x) {
   110717          return 0;
   110718       } else {
   110719          return 0;
   110720       }
   110721    default:
   110722       unreachable("Invalid hardware generation");
   110723    }
   110724 }
   110725 
   110726 
   110727 
   110728 #define GEN10_CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask_start  19
   110729 
   110730 static inline uint32_t ATTRIBUTE_PURE
   110731 CACHE_MODE_1_RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask_start(const struct gen_device_info *devinfo)
   110732 {
   110733    switch (devinfo->gen) {
   110734    case 10: return 19;
   110735    case 9: return 0;
   110736    case 8: return 0;
   110737    case 7:
   110738       if (devinfo->is_haswell) {
   110739          return 0;
   110740       } else {
   110741          return 0;
   110742       }
   110743    case 6: return 0;
   110744    case 5: return 0;
   110745    case 4:
   110746       if (devinfo->is_g4x) {
   110747          return 0;
   110748       } else {
   110749          return 0;
   110750       }
   110751    default:
   110752       unreachable("Invalid hardware generation");
   110753    }
   110754 }
   110755 
   110756 
   110757 
   110758 /* CACHE_MODE_1::RCZ Read after expansion control fix 2 */
   110759 
   110760 
   110761 #define GEN9_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2_bits  1
   110762 #define GEN8_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2_bits  1
   110763 
   110764 static inline uint32_t ATTRIBUTE_PURE
   110765 CACHE_MODE_1_RCZReadafterexpansioncontrolfix2_bits(const struct gen_device_info *devinfo)
   110766 {
   110767    switch (devinfo->gen) {
   110768    case 10: return 0;
   110769    case 9: return 1;
   110770    case 8: return 1;
   110771    case 7:
   110772       if (devinfo->is_haswell) {
   110773          return 0;
   110774       } else {
   110775          return 0;
   110776       }
   110777    case 6: return 0;
   110778    case 5: return 0;
   110779    case 4:
   110780       if (devinfo->is_g4x) {
   110781          return 0;
   110782       } else {
   110783          return 0;
   110784       }
   110785    default:
   110786       unreachable("Invalid hardware generation");
   110787    }
   110788 }
   110789 
   110790 
   110791 
   110792 #define GEN9_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2_start  2
   110793 #define GEN8_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2_start  2
   110794 
   110795 static inline uint32_t ATTRIBUTE_PURE
   110796 CACHE_MODE_1_RCZReadafterexpansioncontrolfix2_start(const struct gen_device_info *devinfo)
   110797 {
   110798    switch (devinfo->gen) {
   110799    case 10: return 0;
   110800    case 9: return 2;
   110801    case 8: return 2;
   110802    case 7:
   110803       if (devinfo->is_haswell) {
   110804          return 0;
   110805       } else {
   110806          return 0;
   110807       }
   110808    case 6: return 0;
   110809    case 5: return 0;
   110810    case 4:
   110811       if (devinfo->is_g4x) {
   110812          return 0;
   110813       } else {
   110814          return 0;
   110815       }
   110816    default:
   110817       unreachable("Invalid hardware generation");
   110818    }
   110819 }
   110820 
   110821 
   110822 
   110823 /* CACHE_MODE_1::RCZ Read after expansion control fix 2 Mask */
   110824 
   110825 
   110826 #define GEN9_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2Mask_bits  1
   110827 #define GEN8_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2Mask_bits  1
   110828 
   110829 static inline uint32_t ATTRIBUTE_PURE
   110830 CACHE_MODE_1_RCZReadafterexpansioncontrolfix2Mask_bits(const struct gen_device_info *devinfo)
   110831 {
   110832    switch (devinfo->gen) {
   110833    case 10: return 0;
   110834    case 9: return 1;
   110835    case 8: return 1;
   110836    case 7:
   110837       if (devinfo->is_haswell) {
   110838          return 0;
   110839       } else {
   110840          return 0;
   110841       }
   110842    case 6: return 0;
   110843    case 5: return 0;
   110844    case 4:
   110845       if (devinfo->is_g4x) {
   110846          return 0;
   110847       } else {
   110848          return 0;
   110849       }
   110850    default:
   110851       unreachable("Invalid hardware generation");
   110852    }
   110853 }
   110854 
   110855 
   110856 
   110857 #define GEN9_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2Mask_start  18
   110858 #define GEN8_CACHE_MODE_1_RCZReadafterexpansioncontrolfix2Mask_start  18
   110859 
   110860 static inline uint32_t ATTRIBUTE_PURE
   110861 CACHE_MODE_1_RCZReadafterexpansioncontrolfix2Mask_start(const struct gen_device_info *devinfo)
   110862 {
   110863    switch (devinfo->gen) {
   110864    case 10: return 0;
   110865    case 9: return 18;
   110866    case 8: return 18;
   110867    case 7:
   110868       if (devinfo->is_haswell) {
   110869          return 0;
   110870       } else {
   110871          return 0;
   110872       }
   110873    case 6: return 0;
   110874    case 5: return 0;
   110875    case 4:
   110876       if (devinfo->is_g4x) {
   110877          return 0;
   110878       } else {
   110879          return 0;
   110880       }
   110881    default:
   110882       unreachable("Invalid hardware generation");
   110883    }
   110884 }
   110885 
   110886 
   110887 
   110888 /* CACHE_MODE_1::Sampler Cache Set XOR selection */
   110889 
   110890 
   110891 #define GEN9_CACHE_MODE_1_SamplerCacheSetXORselection_bits  2
   110892 #define GEN8_CACHE_MODE_1_SamplerCacheSetXORselection_bits  2
   110893 
   110894 static inline uint32_t ATTRIBUTE_PURE
   110895 CACHE_MODE_1_SamplerCacheSetXORselection_bits(const struct gen_device_info *devinfo)
   110896 {
   110897    switch (devinfo->gen) {
   110898    case 10: return 0;
   110899    case 9: return 2;
   110900    case 8: return 2;
   110901    case 7:
   110902       if (devinfo->is_haswell) {
   110903          return 0;
   110904       } else {
   110905          return 0;
   110906       }
   110907    case 6: return 0;
   110908    case 5: return 0;
   110909    case 4:
   110910       if (devinfo->is_g4x) {
   110911          return 0;
   110912       } else {
   110913          return 0;
   110914       }
   110915    default:
   110916       unreachable("Invalid hardware generation");
   110917    }
   110918 }
   110919 
   110920 
   110921 
   110922 #define GEN9_CACHE_MODE_1_SamplerCacheSetXORselection_start  7
   110923 #define GEN8_CACHE_MODE_1_SamplerCacheSetXORselection_start  7
   110924 
   110925 static inline uint32_t ATTRIBUTE_PURE
   110926 CACHE_MODE_1_SamplerCacheSetXORselection_start(const struct gen_device_info *devinfo)
   110927 {
   110928    switch (devinfo->gen) {
   110929    case 10: return 0;
   110930    case 9: return 7;
   110931    case 8: return 7;
   110932    case 7:
   110933       if (devinfo->is_haswell) {
   110934          return 0;
   110935       } else {
   110936          return 0;
   110937       }
   110938    case 6: return 0;
   110939    case 5: return 0;
   110940    case 4:
   110941       if (devinfo->is_g4x) {
   110942          return 0;
   110943       } else {
   110944          return 0;
   110945       }
   110946    default:
   110947       unreachable("Invalid hardware generation");
   110948    }
   110949 }
   110950 
   110951 
   110952 
   110953 /* CACHE_MODE_1::Sampler Cache Set XOR selection Mask */
   110954 
   110955 
   110956 #define GEN9_CACHE_MODE_1_SamplerCacheSetXORselectionMask_bits  2
   110957 #define GEN8_CACHE_MODE_1_SamplerCacheSetXORselectionMask_bits  2
   110958 
   110959 static inline uint32_t ATTRIBUTE_PURE
   110960 CACHE_MODE_1_SamplerCacheSetXORselectionMask_bits(const struct gen_device_info *devinfo)
   110961 {
   110962    switch (devinfo->gen) {
   110963    case 10: return 0;
   110964    case 9: return 2;
   110965    case 8: return 2;
   110966    case 7:
   110967       if (devinfo->is_haswell) {
   110968          return 0;
   110969       } else {
   110970          return 0;
   110971       }
   110972    case 6: return 0;
   110973    case 5: return 0;
   110974    case 4:
   110975       if (devinfo->is_g4x) {
   110976          return 0;
   110977       } else {
   110978          return 0;
   110979       }
   110980    default:
   110981       unreachable("Invalid hardware generation");
   110982    }
   110983 }
   110984 
   110985 
   110986 
   110987 #define GEN9_CACHE_MODE_1_SamplerCacheSetXORselectionMask_start  23
   110988 #define GEN8_CACHE_MODE_1_SamplerCacheSetXORselectionMask_start  23
   110989 
   110990 static inline uint32_t ATTRIBUTE_PURE
   110991 CACHE_MODE_1_SamplerCacheSetXORselectionMask_start(const struct gen_device_info *devinfo)
   110992 {
   110993    switch (devinfo->gen) {
   110994    case 10: return 0;
   110995    case 9: return 23;
   110996    case 8: return 23;
   110997    case 7:
   110998       if (devinfo->is_haswell) {
   110999          return 0;
   111000       } else {
   111001          return 0;
   111002       }
   111003    case 6: return 0;
   111004    case 5: return 0;
   111005    case 4:
   111006       if (devinfo->is_g4x) {
   111007          return 0;
   111008       } else {
   111009          return 0;
   111010       }
   111011    default:
   111012       unreachable("Invalid hardware generation");
   111013    }
   111014 }
   111015 
   111016 
   111017 
   111018 /* CACHE_MODE_SS */
   111019 
   111020 
   111021 #define GEN10_CACHE_MODE_SS_length  1
   111022 
   111023 static inline uint32_t ATTRIBUTE_PURE
   111024 CACHE_MODE_SS_length(const struct gen_device_info *devinfo)
   111025 {
   111026    switch (devinfo->gen) {
   111027    case 10: return 1;
   111028    case 9: return 0;
   111029    case 8: return 0;
   111030    case 7:
   111031       if (devinfo->is_haswell) {
   111032          return 0;
   111033       } else {
   111034          return 0;
   111035       }
   111036    case 6: return 0;
   111037    case 5: return 0;
   111038    case 4:
   111039       if (devinfo->is_g4x) {
   111040          return 0;
   111041       } else {
   111042          return 0;
   111043       }
   111044    default:
   111045       unreachable("Invalid hardware generation");
   111046    }
   111047 }
   111048 
   111049 
   111050 
   111051 /* CACHE_MODE_SS::Float Blend Optimization Enable */
   111052 
   111053 
   111054 #define GEN10_CACHE_MODE_SS_FloatBlendOptimizationEnable_bits  1
   111055 
   111056 static inline uint32_t ATTRIBUTE_PURE
   111057 CACHE_MODE_SS_FloatBlendOptimizationEnable_bits(const struct gen_device_info *devinfo)
   111058 {
   111059    switch (devinfo->gen) {
   111060    case 10: return 1;
   111061    case 9: return 0;
   111062    case 8: return 0;
   111063    case 7:
   111064       if (devinfo->is_haswell) {
   111065          return 0;
   111066       } else {
   111067          return 0;
   111068       }
   111069    case 6: return 0;
   111070    case 5: return 0;
   111071    case 4:
   111072       if (devinfo->is_g4x) {
   111073          return 0;
   111074       } else {
   111075          return 0;
   111076       }
   111077    default:
   111078       unreachable("Invalid hardware generation");
   111079    }
   111080 }
   111081 
   111082 
   111083 
   111084 #define GEN10_CACHE_MODE_SS_FloatBlendOptimizationEnable_start  4
   111085 
   111086 static inline uint32_t ATTRIBUTE_PURE
   111087 CACHE_MODE_SS_FloatBlendOptimizationEnable_start(const struct gen_device_info *devinfo)
   111088 {
   111089    switch (devinfo->gen) {
   111090    case 10: return 4;
   111091    case 9: return 0;
   111092    case 8: return 0;
   111093    case 7:
   111094       if (devinfo->is_haswell) {
   111095          return 0;
   111096       } else {
   111097          return 0;
   111098       }
   111099    case 6: return 0;
   111100    case 5: return 0;
   111101    case 4:
   111102       if (devinfo->is_g4x) {
   111103          return 0;
   111104       } else {
   111105          return 0;
   111106       }
   111107    default:
   111108       unreachable("Invalid hardware generation");
   111109    }
   111110 }
   111111 
   111112 
   111113 
   111114 /* CACHE_MODE_SS::Float Blend Optimization Enable Mask */
   111115 
   111116 
   111117 #define GEN10_CACHE_MODE_SS_FloatBlendOptimizationEnableMask_bits  1
   111118 
   111119 static inline uint32_t ATTRIBUTE_PURE
   111120 CACHE_MODE_SS_FloatBlendOptimizationEnableMask_bits(const struct gen_device_info *devinfo)
   111121 {
   111122    switch (devinfo->gen) {
   111123    case 10: return 1;
   111124    case 9: return 0;
   111125    case 8: return 0;
   111126    case 7:
   111127       if (devinfo->is_haswell) {
   111128          return 0;
   111129       } else {
   111130          return 0;
   111131       }
   111132    case 6: return 0;
   111133    case 5: return 0;
   111134    case 4:
   111135       if (devinfo->is_g4x) {
   111136          return 0;
   111137       } else {
   111138          return 0;
   111139       }
   111140    default:
   111141       unreachable("Invalid hardware generation");
   111142    }
   111143 }
   111144 
   111145 
   111146 
   111147 #define GEN10_CACHE_MODE_SS_FloatBlendOptimizationEnableMask_start  20
   111148 
   111149 static inline uint32_t ATTRIBUTE_PURE
   111150 CACHE_MODE_SS_FloatBlendOptimizationEnableMask_start(const struct gen_device_info *devinfo)
   111151 {
   111152    switch (devinfo->gen) {
   111153    case 10: return 20;
   111154    case 9: return 0;
   111155    case 8: return 0;
   111156    case 7:
   111157       if (devinfo->is_haswell) {
   111158          return 0;
   111159       } else {
   111160          return 0;
   111161       }
   111162    case 6: return 0;
   111163    case 5: return 0;
   111164    case 4:
   111165       if (devinfo->is_g4x) {
   111166          return 0;
   111167       } else {
   111168          return 0;
   111169       }
   111170    default:
   111171       unreachable("Invalid hardware generation");
   111172    }
   111173 }
   111174 
   111175 
   111176 
   111177 /* CACHE_MODE_SS::Instruction Level 1 Cache Disable */
   111178 
   111179 
   111180 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheDisable_bits  1
   111181 
   111182 static inline uint32_t ATTRIBUTE_PURE
   111183 CACHE_MODE_SS_InstructionLevel1CacheDisable_bits(const struct gen_device_info *devinfo)
   111184 {
   111185    switch (devinfo->gen) {
   111186    case 10: return 1;
   111187    case 9: return 0;
   111188    case 8: return 0;
   111189    case 7:
   111190       if (devinfo->is_haswell) {
   111191          return 0;
   111192       } else {
   111193          return 0;
   111194       }
   111195    case 6: return 0;
   111196    case 5: return 0;
   111197    case 4:
   111198       if (devinfo->is_g4x) {
   111199          return 0;
   111200       } else {
   111201          return 0;
   111202       }
   111203    default:
   111204       unreachable("Invalid hardware generation");
   111205    }
   111206 }
   111207 
   111208 
   111209 
   111210 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheDisable_start  0
   111211 
   111212 static inline uint32_t ATTRIBUTE_PURE
   111213 CACHE_MODE_SS_InstructionLevel1CacheDisable_start(const struct gen_device_info *devinfo)
   111214 {
   111215    switch (devinfo->gen) {
   111216    case 10: return 0;
   111217    case 9: return 0;
   111218    case 8: return 0;
   111219    case 7:
   111220       if (devinfo->is_haswell) {
   111221          return 0;
   111222       } else {
   111223          return 0;
   111224       }
   111225    case 6: return 0;
   111226    case 5: return 0;
   111227    case 4:
   111228       if (devinfo->is_g4x) {
   111229          return 0;
   111230       } else {
   111231          return 0;
   111232       }
   111233    default:
   111234       unreachable("Invalid hardware generation");
   111235    }
   111236 }
   111237 
   111238 
   111239 
   111240 /* CACHE_MODE_SS::Instruction Level 1 Cache Disable Mask */
   111241 
   111242 
   111243 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheDisableMask_bits  1
   111244 
   111245 static inline uint32_t ATTRIBUTE_PURE
   111246 CACHE_MODE_SS_InstructionLevel1CacheDisableMask_bits(const struct gen_device_info *devinfo)
   111247 {
   111248    switch (devinfo->gen) {
   111249    case 10: return 1;
   111250    case 9: return 0;
   111251    case 8: return 0;
   111252    case 7:
   111253       if (devinfo->is_haswell) {
   111254          return 0;
   111255       } else {
   111256          return 0;
   111257       }
   111258    case 6: return 0;
   111259    case 5: return 0;
   111260    case 4:
   111261       if (devinfo->is_g4x) {
   111262          return 0;
   111263       } else {
   111264          return 0;
   111265       }
   111266    default:
   111267       unreachable("Invalid hardware generation");
   111268    }
   111269 }
   111270 
   111271 
   111272 
   111273 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheDisableMask_start  16
   111274 
   111275 static inline uint32_t ATTRIBUTE_PURE
   111276 CACHE_MODE_SS_InstructionLevel1CacheDisableMask_start(const struct gen_device_info *devinfo)
   111277 {
   111278    switch (devinfo->gen) {
   111279    case 10: return 16;
   111280    case 9: return 0;
   111281    case 8: return 0;
   111282    case 7:
   111283       if (devinfo->is_haswell) {
   111284          return 0;
   111285       } else {
   111286          return 0;
   111287       }
   111288    case 6: return 0;
   111289    case 5: return 0;
   111290    case 4:
   111291       if (devinfo->is_g4x) {
   111292          return 0;
   111293       } else {
   111294          return 0;
   111295       }
   111296    default:
   111297       unreachable("Invalid hardware generation");
   111298    }
   111299 }
   111300 
   111301 
   111302 
   111303 /* CACHE_MODE_SS::Instruction Level 1 Cache and In-Flight Queue Disable  */
   111304 
   111305 
   111306 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisable_bits  1
   111307 
   111308 static inline uint32_t ATTRIBUTE_PURE
   111309 CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisable_bits(const struct gen_device_info *devinfo)
   111310 {
   111311    switch (devinfo->gen) {
   111312    case 10: return 1;
   111313    case 9: return 0;
   111314    case 8: return 0;
   111315    case 7:
   111316       if (devinfo->is_haswell) {
   111317          return 0;
   111318       } else {
   111319          return 0;
   111320       }
   111321    case 6: return 0;
   111322    case 5: return 0;
   111323    case 4:
   111324       if (devinfo->is_g4x) {
   111325          return 0;
   111326       } else {
   111327          return 0;
   111328       }
   111329    default:
   111330       unreachable("Invalid hardware generation");
   111331    }
   111332 }
   111333 
   111334 
   111335 
   111336 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisable_start  1
   111337 
   111338 static inline uint32_t ATTRIBUTE_PURE
   111339 CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisable_start(const struct gen_device_info *devinfo)
   111340 {
   111341    switch (devinfo->gen) {
   111342    case 10: return 1;
   111343    case 9: return 0;
   111344    case 8: return 0;
   111345    case 7:
   111346       if (devinfo->is_haswell) {
   111347          return 0;
   111348       } else {
   111349          return 0;
   111350       }
   111351    case 6: return 0;
   111352    case 5: return 0;
   111353    case 4:
   111354       if (devinfo->is_g4x) {
   111355          return 0;
   111356       } else {
   111357          return 0;
   111358       }
   111359    default:
   111360       unreachable("Invalid hardware generation");
   111361    }
   111362 }
   111363 
   111364 
   111365 
   111366 /* CACHE_MODE_SS::Instruction Level 1 Cache and In-Flight Queue Disable Mask */
   111367 
   111368 
   111369 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisableMask_bits  1
   111370 
   111371 static inline uint32_t ATTRIBUTE_PURE
   111372 CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisableMask_bits(const struct gen_device_info *devinfo)
   111373 {
   111374    switch (devinfo->gen) {
   111375    case 10: return 1;
   111376    case 9: return 0;
   111377    case 8: return 0;
   111378    case 7:
   111379       if (devinfo->is_haswell) {
   111380          return 0;
   111381       } else {
   111382          return 0;
   111383       }
   111384    case 6: return 0;
   111385    case 5: return 0;
   111386    case 4:
   111387       if (devinfo->is_g4x) {
   111388          return 0;
   111389       } else {
   111390          return 0;
   111391       }
   111392    default:
   111393       unreachable("Invalid hardware generation");
   111394    }
   111395 }
   111396 
   111397 
   111398 
   111399 #define GEN10_CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisableMask_start  17
   111400 
   111401 static inline uint32_t ATTRIBUTE_PURE
   111402 CACHE_MODE_SS_InstructionLevel1CacheandInFlightQueueDisableMask_start(const struct gen_device_info *devinfo)
   111403 {
   111404    switch (devinfo->gen) {
   111405    case 10: return 17;
   111406    case 9: return 0;
   111407    case 8: return 0;
   111408    case 7:
   111409       if (devinfo->is_haswell) {
   111410          return 0;
   111411       } else {
   111412          return 0;
   111413       }
   111414    case 6: return 0;
   111415    case 5: return 0;
   111416    case 4:
   111417       if (devinfo->is_g4x) {
   111418          return 0;
   111419       } else {
   111420          return 0;
   111421       }
   111422    default:
   111423       unreachable("Invalid hardware generation");
   111424    }
   111425 }
   111426 
   111427 
   111428 
   111429 /* CACHE_MODE_SS::Per Sample Blend Opt Disable */
   111430 
   111431 
   111432 #define GEN10_CACHE_MODE_SS_PerSampleBlendOptDisable_bits  1
   111433 
   111434 static inline uint32_t ATTRIBUTE_PURE
   111435 CACHE_MODE_SS_PerSampleBlendOptDisable_bits(const struct gen_device_info *devinfo)
   111436 {
   111437    switch (devinfo->gen) {
   111438    case 10: return 1;
   111439    case 9: return 0;
   111440    case 8: return 0;
   111441    case 7:
   111442       if (devinfo->is_haswell) {
   111443          return 0;
   111444       } else {
   111445          return 0;
   111446       }
   111447    case 6: return 0;
   111448    case 5: return 0;
   111449    case 4:
   111450       if (devinfo->is_g4x) {
   111451          return 0;
   111452       } else {
   111453          return 0;
   111454       }
   111455    default:
   111456       unreachable("Invalid hardware generation");
   111457    }
   111458 }
   111459 
   111460 
   111461 
   111462 #define GEN10_CACHE_MODE_SS_PerSampleBlendOptDisable_start  11
   111463 
   111464 static inline uint32_t ATTRIBUTE_PURE
   111465 CACHE_MODE_SS_PerSampleBlendOptDisable_start(const struct gen_device_info *devinfo)
   111466 {
   111467    switch (devinfo->gen) {
   111468    case 10: return 11;
   111469    case 9: return 0;
   111470    case 8: return 0;
   111471    case 7:
   111472       if (devinfo->is_haswell) {
   111473          return 0;
   111474       } else {
   111475          return 0;
   111476       }
   111477    case 6: return 0;
   111478    case 5: return 0;
   111479    case 4:
   111480       if (devinfo->is_g4x) {
   111481          return 0;
   111482       } else {
   111483          return 0;
   111484       }
   111485    default:
   111486       unreachable("Invalid hardware generation");
   111487    }
   111488 }
   111489 
   111490 
   111491 
   111492 /* CACHE_MODE_SS::Per Sample Blend Opt Disable Mask */
   111493 
   111494 
   111495 #define GEN10_CACHE_MODE_SS_PerSampleBlendOptDisableMask_bits  1
   111496 
   111497 static inline uint32_t ATTRIBUTE_PURE
   111498 CACHE_MODE_SS_PerSampleBlendOptDisableMask_bits(const struct gen_device_info *devinfo)
   111499 {
   111500    switch (devinfo->gen) {
   111501    case 10: return 1;
   111502    case 9: return 0;
   111503    case 8: return 0;
   111504    case 7:
   111505       if (devinfo->is_haswell) {
   111506          return 0;
   111507       } else {
   111508          return 0;
   111509       }
   111510    case 6: return 0;
   111511    case 5: return 0;
   111512    case 4:
   111513       if (devinfo->is_g4x) {
   111514          return 0;
   111515       } else {
   111516          return 0;
   111517       }
   111518    default:
   111519       unreachable("Invalid hardware generation");
   111520    }
   111521 }
   111522 
   111523 
   111524 
   111525 #define GEN10_CACHE_MODE_SS_PerSampleBlendOptDisableMask_start  27
   111526 
   111527 static inline uint32_t ATTRIBUTE_PURE
   111528 CACHE_MODE_SS_PerSampleBlendOptDisableMask_start(const struct gen_device_info *devinfo)
   111529 {
   111530    switch (devinfo->gen) {
   111531    case 10: return 27;
   111532    case 9: return 0;
   111533    case 8: return 0;
   111534    case 7:
   111535       if (devinfo->is_haswell) {
   111536          return 0;
   111537       } else {
   111538          return 0;
   111539       }
   111540    case 6: return 0;
   111541    case 5: return 0;
   111542    case 4:
   111543       if (devinfo->is_g4x) {
   111544          return 0;
   111545       } else {
   111546          return 0;
   111547       }
   111548    default:
   111549       unreachable("Invalid hardware generation");
   111550    }
   111551 }
   111552 
   111553 
   111554 
   111555 /* CC_VIEWPORT */
   111556 
   111557 
   111558 #define GEN10_CC_VIEWPORT_length  2
   111559 #define GEN9_CC_VIEWPORT_length  2
   111560 #define GEN8_CC_VIEWPORT_length  2
   111561 #define GEN75_CC_VIEWPORT_length  2
   111562 #define GEN7_CC_VIEWPORT_length  2
   111563 #define GEN6_CC_VIEWPORT_length  2
   111564 #define GEN5_CC_VIEWPORT_length  2
   111565 #define GEN45_CC_VIEWPORT_length  2
   111566 #define GEN4_CC_VIEWPORT_length  2
   111567 
   111568 static inline uint32_t ATTRIBUTE_PURE
   111569 CC_VIEWPORT_length(const struct gen_device_info *devinfo)
   111570 {
   111571    switch (devinfo->gen) {
   111572    case 10: return 2;
   111573    case 9: return 2;
   111574    case 8: return 2;
   111575    case 7:
   111576       if (devinfo->is_haswell) {
   111577          return 2;
   111578       } else {
   111579          return 2;
   111580       }
   111581    case 6: return 2;
   111582    case 5: return 2;
   111583    case 4:
   111584       if (devinfo->is_g4x) {
   111585          return 2;
   111586       } else {
   111587          return 2;
   111588       }
   111589    default:
   111590       unreachable("Invalid hardware generation");
   111591    }
   111592 }
   111593 
   111594 
   111595 
   111596 /* CC_VIEWPORT::Maximum Depth */
   111597 
   111598 
   111599 #define GEN10_CC_VIEWPORT_MaximumDepth_bits  32
   111600 #define GEN9_CC_VIEWPORT_MaximumDepth_bits  32
   111601 #define GEN8_CC_VIEWPORT_MaximumDepth_bits  32
   111602 #define GEN75_CC_VIEWPORT_MaximumDepth_bits  32
   111603 #define GEN7_CC_VIEWPORT_MaximumDepth_bits  32
   111604 #define GEN6_CC_VIEWPORT_MaximumDepth_bits  32
   111605 #define GEN5_CC_VIEWPORT_MaximumDepth_bits  32
   111606 #define GEN45_CC_VIEWPORT_MaximumDepth_bits  32
   111607 #define GEN4_CC_VIEWPORT_MaximumDepth_bits  32
   111608 
   111609 static inline uint32_t ATTRIBUTE_PURE
   111610 CC_VIEWPORT_MaximumDepth_bits(const struct gen_device_info *devinfo)
   111611 {
   111612    switch (devinfo->gen) {
   111613    case 10: return 32;
   111614    case 9: return 32;
   111615    case 8: return 32;
   111616    case 7:
   111617       if (devinfo->is_haswell) {
   111618          return 32;
   111619       } else {
   111620          return 32;
   111621       }
   111622    case 6: return 32;
   111623    case 5: return 32;
   111624    case 4:
   111625       if (devinfo->is_g4x) {
   111626          return 32;
   111627       } else {
   111628          return 32;
   111629       }
   111630    default:
   111631       unreachable("Invalid hardware generation");
   111632    }
   111633 }
   111634 
   111635 
   111636 
   111637 #define GEN10_CC_VIEWPORT_MaximumDepth_start  32
   111638 #define GEN9_CC_VIEWPORT_MaximumDepth_start  32
   111639 #define GEN8_CC_VIEWPORT_MaximumDepth_start  32
   111640 #define GEN75_CC_VIEWPORT_MaximumDepth_start  32
   111641 #define GEN7_CC_VIEWPORT_MaximumDepth_start  32
   111642 #define GEN6_CC_VIEWPORT_MaximumDepth_start  32
   111643 #define GEN5_CC_VIEWPORT_MaximumDepth_start  32
   111644 #define GEN45_CC_VIEWPORT_MaximumDepth_start  32
   111645 #define GEN4_CC_VIEWPORT_MaximumDepth_start  32
   111646 
   111647 static inline uint32_t ATTRIBUTE_PURE
   111648 CC_VIEWPORT_MaximumDepth_start(const struct gen_device_info *devinfo)
   111649 {
   111650    switch (devinfo->gen) {
   111651    case 10: return 32;
   111652    case 9: return 32;
   111653    case 8: return 32;
   111654    case 7:
   111655       if (devinfo->is_haswell) {
   111656          return 32;
   111657       } else {
   111658          return 32;
   111659       }
   111660    case 6: return 32;
   111661    case 5: return 32;
   111662    case 4:
   111663       if (devinfo->is_g4x) {
   111664          return 32;
   111665       } else {
   111666          return 32;
   111667       }
   111668    default:
   111669       unreachable("Invalid hardware generation");
   111670    }
   111671 }
   111672 
   111673 
   111674 
   111675 /* CC_VIEWPORT::Minimum Depth */
   111676 
   111677 
   111678 #define GEN10_CC_VIEWPORT_MinimumDepth_bits  32
   111679 #define GEN9_CC_VIEWPORT_MinimumDepth_bits  32
   111680 #define GEN8_CC_VIEWPORT_MinimumDepth_bits  32
   111681 #define GEN75_CC_VIEWPORT_MinimumDepth_bits  32
   111682 #define GEN7_CC_VIEWPORT_MinimumDepth_bits  32
   111683 #define GEN6_CC_VIEWPORT_MinimumDepth_bits  32
   111684 #define GEN5_CC_VIEWPORT_MinimumDepth_bits  32
   111685 #define GEN45_CC_VIEWPORT_MinimumDepth_bits  32
   111686 #define GEN4_CC_VIEWPORT_MinimumDepth_bits  32
   111687 
   111688 static inline uint32_t ATTRIBUTE_PURE
   111689 CC_VIEWPORT_MinimumDepth_bits(const struct gen_device_info *devinfo)
   111690 {
   111691    switch (devinfo->gen) {
   111692    case 10: return 32;
   111693    case 9: return 32;
   111694    case 8: return 32;
   111695    case 7:
   111696       if (devinfo->is_haswell) {
   111697          return 32;
   111698       } else {
   111699          return 32;
   111700       }
   111701    case 6: return 32;
   111702    case 5: return 32;
   111703    case 4:
   111704       if (devinfo->is_g4x) {
   111705          return 32;
   111706       } else {
   111707          return 32;
   111708       }
   111709    default:
   111710       unreachable("Invalid hardware generation");
   111711    }
   111712 }
   111713 
   111714 
   111715 
   111716 #define GEN10_CC_VIEWPORT_MinimumDepth_start  0
   111717 #define GEN9_CC_VIEWPORT_MinimumDepth_start  0
   111718 #define GEN8_CC_VIEWPORT_MinimumDepth_start  0
   111719 #define GEN75_CC_VIEWPORT_MinimumDepth_start  0
   111720 #define GEN7_CC_VIEWPORT_MinimumDepth_start  0
   111721 #define GEN6_CC_VIEWPORT_MinimumDepth_start  0
   111722 #define GEN5_CC_VIEWPORT_MinimumDepth_start  0
   111723 #define GEN45_CC_VIEWPORT_MinimumDepth_start  0
   111724 #define GEN4_CC_VIEWPORT_MinimumDepth_start  0
   111725 
   111726 static inline uint32_t ATTRIBUTE_PURE
   111727 CC_VIEWPORT_MinimumDepth_start(const struct gen_device_info *devinfo)
   111728 {
   111729    switch (devinfo->gen) {
   111730    case 10: return 0;
   111731    case 9: return 0;
   111732    case 8: return 0;
   111733    case 7:
   111734       if (devinfo->is_haswell) {
   111735          return 0;
   111736       } else {
   111737          return 0;
   111738       }
   111739    case 6: return 0;
   111740    case 5: return 0;
   111741    case 4:
   111742       if (devinfo->is_g4x) {
   111743          return 0;
   111744       } else {
   111745          return 0;
   111746       }
   111747    default:
   111748       unreachable("Invalid hardware generation");
   111749    }
   111750 }
   111751 
   111752 
   111753 
   111754 /* CHICKEN3 */
   111755 
   111756 
   111757 #define GEN75_CHICKEN3_length  1
   111758 
   111759 static inline uint32_t ATTRIBUTE_PURE
   111760 CHICKEN3_length(const struct gen_device_info *devinfo)
   111761 {
   111762    switch (devinfo->gen) {
   111763    case 10: return 0;
   111764    case 9: return 0;
   111765    case 8: return 0;
   111766    case 7:
   111767       if (devinfo->is_haswell) {
   111768          return 1;
   111769       } else {
   111770          return 0;
   111771       }
   111772    case 6: return 0;
   111773    case 5: return 0;
   111774    case 4:
   111775       if (devinfo->is_g4x) {
   111776          return 0;
   111777       } else {
   111778          return 0;
   111779       }
   111780    default:
   111781       unreachable("Invalid hardware generation");
   111782    }
   111783 }
   111784 
   111785 
   111786 
   111787 /* CHICKEN3::L3 Atomic Disable */
   111788 
   111789 
   111790 #define GEN75_CHICKEN3_L3AtomicDisable_bits  1
   111791 
   111792 static inline uint32_t ATTRIBUTE_PURE
   111793 CHICKEN3_L3AtomicDisable_bits(const struct gen_device_info *devinfo)
   111794 {
   111795    switch (devinfo->gen) {
   111796    case 10: return 0;
   111797    case 9: return 0;
   111798    case 8: return 0;
   111799    case 7:
   111800       if (devinfo->is_haswell) {
   111801          return 1;
   111802       } else {
   111803          return 0;
   111804       }
   111805    case 6: return 0;
   111806    case 5: return 0;
   111807    case 4:
   111808       if (devinfo->is_g4x) {
   111809          return 0;
   111810       } else {
   111811          return 0;
   111812       }
   111813    default:
   111814       unreachable("Invalid hardware generation");
   111815    }
   111816 }
   111817 
   111818 
   111819 
   111820 #define GEN75_CHICKEN3_L3AtomicDisable_start  6
   111821 
   111822 static inline uint32_t ATTRIBUTE_PURE
   111823 CHICKEN3_L3AtomicDisable_start(const struct gen_device_info *devinfo)
   111824 {
   111825    switch (devinfo->gen) {
   111826    case 10: return 0;
   111827    case 9: return 0;
   111828    case 8: return 0;
   111829    case 7:
   111830       if (devinfo->is_haswell) {
   111831          return 6;
   111832       } else {
   111833          return 0;
   111834       }
   111835    case 6: return 0;
   111836    case 5: return 0;
   111837    case 4:
   111838       if (devinfo->is_g4x) {
   111839          return 0;
   111840       } else {
   111841          return 0;
   111842       }
   111843    default:
   111844       unreachable("Invalid hardware generation");
   111845    }
   111846 }
   111847 
   111848 
   111849 
   111850 /* CHICKEN3::L3 Atomic Disable Mask */
   111851 
   111852 
   111853 #define GEN75_CHICKEN3_L3AtomicDisableMask_bits  1
   111854 
   111855 static inline uint32_t ATTRIBUTE_PURE
   111856 CHICKEN3_L3AtomicDisableMask_bits(const struct gen_device_info *devinfo)
   111857 {
   111858    switch (devinfo->gen) {
   111859    case 10: return 0;
   111860    case 9: return 0;
   111861    case 8: return 0;
   111862    case 7:
   111863       if (devinfo->is_haswell) {
   111864          return 1;
   111865       } else {
   111866          return 0;
   111867       }
   111868    case 6: return 0;
   111869    case 5: return 0;
   111870    case 4:
   111871       if (devinfo->is_g4x) {
   111872          return 0;
   111873       } else {
   111874          return 0;
   111875       }
   111876    default:
   111877       unreachable("Invalid hardware generation");
   111878    }
   111879 }
   111880 
   111881 
   111882 
   111883 #define GEN75_CHICKEN3_L3AtomicDisableMask_start  22
   111884 
   111885 static inline uint32_t ATTRIBUTE_PURE
   111886 CHICKEN3_L3AtomicDisableMask_start(const struct gen_device_info *devinfo)
   111887 {
   111888    switch (devinfo->gen) {
   111889    case 10: return 0;
   111890    case 9: return 0;
   111891    case 8: return 0;
   111892    case 7:
   111893       if (devinfo->is_haswell) {
   111894          return 22;
   111895       } else {
   111896          return 0;
   111897       }
   111898    case 6: return 0;
   111899    case 5: return 0;
   111900    case 4:
   111901       if (devinfo->is_g4x) {
   111902          return 0;
   111903       } else {
   111904          return 0;
   111905       }
   111906    default:
   111907       unreachable("Invalid hardware generation");
   111908    }
   111909 }
   111910 
   111911 
   111912 
   111913 /* CLIP_STATE */
   111914 
   111915 
   111916 #define GEN5_CLIP_STATE_length  11
   111917 #define GEN45_CLIP_STATE_length  11
   111918 #define GEN4_CLIP_STATE_length  11
   111919 
   111920 static inline uint32_t ATTRIBUTE_PURE
   111921 CLIP_STATE_length(const struct gen_device_info *devinfo)
   111922 {
   111923    switch (devinfo->gen) {
   111924    case 10: return 0;
   111925    case 9: return 0;
   111926    case 8: return 0;
   111927    case 7:
   111928       if (devinfo->is_haswell) {
   111929          return 0;
   111930       } else {
   111931          return 0;
   111932       }
   111933    case 6: return 0;
   111934    case 5: return 11;
   111935    case 4:
   111936       if (devinfo->is_g4x) {
   111937          return 11;
   111938       } else {
   111939          return 11;
   111940       }
   111941    default:
   111942       unreachable("Invalid hardware generation");
   111943    }
   111944 }
   111945 
   111946 
   111947 
   111948 /* CLIP_STATE::API Mode */
   111949 
   111950 
   111951 #define GEN5_CLIP_STATE_APIMode_bits  1
   111952 #define GEN45_CLIP_STATE_APIMode_bits  1
   111953 #define GEN4_CLIP_STATE_APIMode_bits  1
   111954 
   111955 static inline uint32_t ATTRIBUTE_PURE
   111956 CLIP_STATE_APIMode_bits(const struct gen_device_info *devinfo)
   111957 {
   111958    switch (devinfo->gen) {
   111959    case 10: return 0;
   111960    case 9: return 0;
   111961    case 8: return 0;
   111962    case 7:
   111963       if (devinfo->is_haswell) {
   111964          return 0;
   111965       } else {
   111966          return 0;
   111967       }
   111968    case 6: return 0;
   111969    case 5: return 1;
   111970    case 4:
   111971       if (devinfo->is_g4x) {
   111972          return 1;
   111973       } else {
   111974          return 1;
   111975       }
   111976    default:
   111977       unreachable("Invalid hardware generation");
   111978    }
   111979 }
   111980 
   111981 
   111982 
   111983 #define GEN5_CLIP_STATE_APIMode_start  190
   111984 #define GEN45_CLIP_STATE_APIMode_start  190
   111985 #define GEN4_CLIP_STATE_APIMode_start  190
   111986 
   111987 static inline uint32_t ATTRIBUTE_PURE
   111988 CLIP_STATE_APIMode_start(const struct gen_device_info *devinfo)
   111989 {
   111990    switch (devinfo->gen) {
   111991    case 10: return 0;
   111992    case 9: return 0;
   111993    case 8: return 0;
   111994    case 7:
   111995       if (devinfo->is_haswell) {
   111996          return 0;
   111997       } else {
   111998          return 0;
   111999       }
   112000    case 6: return 0;
   112001    case 5: return 190;
   112002    case 4:
   112003       if (devinfo->is_g4x) {
   112004          return 190;
   112005       } else {
   112006          return 190;
   112007       }
   112008    default:
   112009       unreachable("Invalid hardware generation");
   112010    }
   112011 }
   112012 
   112013 
   112014 
   112015 /* CLIP_STATE::Binding Table Entry Count */
   112016 
   112017 
   112018 #define GEN5_CLIP_STATE_BindingTableEntryCount_bits  8
   112019 #define GEN45_CLIP_STATE_BindingTableEntryCount_bits  8
   112020 #define GEN4_CLIP_STATE_BindingTableEntryCount_bits  8
   112021 
   112022 static inline uint32_t ATTRIBUTE_PURE
   112023 CLIP_STATE_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   112024 {
   112025    switch (devinfo->gen) {
   112026    case 10: return 0;
   112027    case 9: return 0;
   112028    case 8: return 0;
   112029    case 7:
   112030       if (devinfo->is_haswell) {
   112031          return 0;
   112032       } else {
   112033          return 0;
   112034       }
   112035    case 6: return 0;
   112036    case 5: return 8;
   112037    case 4:
   112038       if (devinfo->is_g4x) {
   112039          return 8;
   112040       } else {
   112041          return 8;
   112042       }
   112043    default:
   112044       unreachable("Invalid hardware generation");
   112045    }
   112046 }
   112047 
   112048 
   112049 
   112050 #define GEN5_CLIP_STATE_BindingTableEntryCount_start  50
   112051 #define GEN45_CLIP_STATE_BindingTableEntryCount_start  50
   112052 #define GEN4_CLIP_STATE_BindingTableEntryCount_start  50
   112053 
   112054 static inline uint32_t ATTRIBUTE_PURE
   112055 CLIP_STATE_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   112056 {
   112057    switch (devinfo->gen) {
   112058    case 10: return 0;
   112059    case 9: return 0;
   112060    case 8: return 0;
   112061    case 7:
   112062       if (devinfo->is_haswell) {
   112063          return 0;
   112064       } else {
   112065          return 0;
   112066       }
   112067    case 6: return 0;
   112068    case 5: return 50;
   112069    case 4:
   112070       if (devinfo->is_g4x) {
   112071          return 50;
   112072       } else {
   112073          return 50;
   112074       }
   112075    default:
   112076       unreachable("Invalid hardware generation");
   112077    }
   112078 }
   112079 
   112080 
   112081 
   112082 /* CLIP_STATE::Clip Mode */
   112083 
   112084 
   112085 #define GEN5_CLIP_STATE_ClipMode_bits  3
   112086 #define GEN45_CLIP_STATE_ClipMode_bits  3
   112087 #define GEN4_CLIP_STATE_ClipMode_bits  3
   112088 
   112089 static inline uint32_t ATTRIBUTE_PURE
   112090 CLIP_STATE_ClipMode_bits(const struct gen_device_info *devinfo)
   112091 {
   112092    switch (devinfo->gen) {
   112093    case 10: return 0;
   112094    case 9: return 0;
   112095    case 8: return 0;
   112096    case 7:
   112097       if (devinfo->is_haswell) {
   112098          return 0;
   112099       } else {
   112100          return 0;
   112101       }
   112102    case 6: return 0;
   112103    case 5: return 3;
   112104    case 4:
   112105       if (devinfo->is_g4x) {
   112106          return 3;
   112107       } else {
   112108          return 3;
   112109       }
   112110    default:
   112111       unreachable("Invalid hardware generation");
   112112    }
   112113 }
   112114 
   112115 
   112116 
   112117 #define GEN5_CLIP_STATE_ClipMode_start  173
   112118 #define GEN45_CLIP_STATE_ClipMode_start  173
   112119 #define GEN4_CLIP_STATE_ClipMode_start  173
   112120 
   112121 static inline uint32_t ATTRIBUTE_PURE
   112122 CLIP_STATE_ClipMode_start(const struct gen_device_info *devinfo)
   112123 {
   112124    switch (devinfo->gen) {
   112125    case 10: return 0;
   112126    case 9: return 0;
   112127    case 8: return 0;
   112128    case 7:
   112129       if (devinfo->is_haswell) {
   112130          return 0;
   112131       } else {
   112132          return 0;
   112133       }
   112134    case 6: return 0;
   112135    case 5: return 173;
   112136    case 4:
   112137       if (devinfo->is_g4x) {
   112138          return 173;
   112139       } else {
   112140          return 173;
   112141       }
   112142    default:
   112143       unreachable("Invalid hardware generation");
   112144    }
   112145 }
   112146 
   112147 
   112148 
   112149 /* CLIP_STATE::Clipper Statistics Enable */
   112150 
   112151 
   112152 #define GEN45_CLIP_STATE_ClipperStatisticsEnable_bits  1
   112153 #define GEN4_CLIP_STATE_ClipperStatisticsEnable_bits  1
   112154 
   112155 static inline uint32_t ATTRIBUTE_PURE
   112156 CLIP_STATE_ClipperStatisticsEnable_bits(const struct gen_device_info *devinfo)
   112157 {
   112158    switch (devinfo->gen) {
   112159    case 10: return 0;
   112160    case 9: return 0;
   112161    case 8: return 0;
   112162    case 7:
   112163       if (devinfo->is_haswell) {
   112164          return 0;
   112165       } else {
   112166          return 0;
   112167       }
   112168    case 6: return 0;
   112169    case 5: return 0;
   112170    case 4:
   112171       if (devinfo->is_g4x) {
   112172          return 1;
   112173       } else {
   112174          return 1;
   112175       }
   112176    default:
   112177       unreachable("Invalid hardware generation");
   112178    }
   112179 }
   112180 
   112181 
   112182 
   112183 #define GEN45_CLIP_STATE_ClipperStatisticsEnable_start  138
   112184 #define GEN4_CLIP_STATE_ClipperStatisticsEnable_start  138
   112185 
   112186 static inline uint32_t ATTRIBUTE_PURE
   112187 CLIP_STATE_ClipperStatisticsEnable_start(const struct gen_device_info *devinfo)
   112188 {
   112189    switch (devinfo->gen) {
   112190    case 10: return 0;
   112191    case 9: return 0;
   112192    case 8: return 0;
   112193    case 7:
   112194       if (devinfo->is_haswell) {
   112195          return 0;
   112196       } else {
   112197          return 0;
   112198       }
   112199    case 6: return 0;
   112200    case 5: return 0;
   112201    case 4:
   112202       if (devinfo->is_g4x) {
   112203          return 138;
   112204       } else {
   112205          return 138;
   112206       }
   112207    default:
   112208       unreachable("Invalid hardware generation");
   112209    }
   112210 }
   112211 
   112212 
   112213 
   112214 /* CLIP_STATE::Clipper Viewport State Pointer */
   112215 
   112216 
   112217 #define GEN5_CLIP_STATE_ClipperViewportStatePointer_bits  27
   112218 #define GEN45_CLIP_STATE_ClipperViewportStatePointer_bits  27
   112219 #define GEN4_CLIP_STATE_ClipperViewportStatePointer_bits  27
   112220 
   112221 static inline uint32_t ATTRIBUTE_PURE
   112222 CLIP_STATE_ClipperViewportStatePointer_bits(const struct gen_device_info *devinfo)
   112223 {
   112224    switch (devinfo->gen) {
   112225    case 10: return 0;
   112226    case 9: return 0;
   112227    case 8: return 0;
   112228    case 7:
   112229       if (devinfo->is_haswell) {
   112230          return 0;
   112231       } else {
   112232          return 0;
   112233       }
   112234    case 6: return 0;
   112235    case 5: return 27;
   112236    case 4:
   112237       if (devinfo->is_g4x) {
   112238          return 27;
   112239       } else {
   112240          return 27;
   112241       }
   112242    default:
   112243       unreachable("Invalid hardware generation");
   112244    }
   112245 }
   112246 
   112247 
   112248 
   112249 #define GEN5_CLIP_STATE_ClipperViewportStatePointer_start  197
   112250 #define GEN45_CLIP_STATE_ClipperViewportStatePointer_start  197
   112251 #define GEN4_CLIP_STATE_ClipperViewportStatePointer_start  197
   112252 
   112253 static inline uint32_t ATTRIBUTE_PURE
   112254 CLIP_STATE_ClipperViewportStatePointer_start(const struct gen_device_info *devinfo)
   112255 {
   112256    switch (devinfo->gen) {
   112257    case 10: return 0;
   112258    case 9: return 0;
   112259    case 8: return 0;
   112260    case 7:
   112261       if (devinfo->is_haswell) {
   112262          return 0;
   112263       } else {
   112264          return 0;
   112265       }
   112266    case 6: return 0;
   112267    case 5: return 197;
   112268    case 4:
   112269       if (devinfo->is_g4x) {
   112270          return 197;
   112271       } else {
   112272          return 197;
   112273       }
   112274    default:
   112275       unreachable("Invalid hardware generation");
   112276    }
   112277 }
   112278 
   112279 
   112280 
   112281 /* CLIP_STATE::Constant URB Entry Read Length */
   112282 
   112283 
   112284 #define GEN5_CLIP_STATE_ConstantURBEntryReadLength_bits  6
   112285 #define GEN45_CLIP_STATE_ConstantURBEntryReadLength_bits  6
   112286 #define GEN4_CLIP_STATE_ConstantURBEntryReadLength_bits  6
   112287 
   112288 static inline uint32_t ATTRIBUTE_PURE
   112289 CLIP_STATE_ConstantURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   112290 {
   112291    switch (devinfo->gen) {
   112292    case 10: return 0;
   112293    case 9: return 0;
   112294    case 8: return 0;
   112295    case 7:
   112296       if (devinfo->is_haswell) {
   112297          return 0;
   112298       } else {
   112299          return 0;
   112300       }
   112301    case 6: return 0;
   112302    case 5: return 6;
   112303    case 4:
   112304       if (devinfo->is_g4x) {
   112305          return 6;
   112306       } else {
   112307          return 6;
   112308       }
   112309    default:
   112310       unreachable("Invalid hardware generation");
   112311    }
   112312 }
   112313 
   112314 
   112315 
   112316 #define GEN5_CLIP_STATE_ConstantURBEntryReadLength_start  121
   112317 #define GEN45_CLIP_STATE_ConstantURBEntryReadLength_start  121
   112318 #define GEN4_CLIP_STATE_ConstantURBEntryReadLength_start  121
   112319 
   112320 static inline uint32_t ATTRIBUTE_PURE
   112321 CLIP_STATE_ConstantURBEntryReadLength_start(const struct gen_device_info *devinfo)
   112322 {
   112323    switch (devinfo->gen) {
   112324    case 10: return 0;
   112325    case 9: return 0;
   112326    case 8: return 0;
   112327    case 7:
   112328       if (devinfo->is_haswell) {
   112329          return 0;
   112330       } else {
   112331          return 0;
   112332       }
   112333    case 6: return 0;
   112334    case 5: return 121;
   112335    case 4:
   112336       if (devinfo->is_g4x) {
   112337          return 121;
   112338       } else {
   112339          return 121;
   112340       }
   112341    default:
   112342       unreachable("Invalid hardware generation");
   112343    }
   112344 }
   112345 
   112346 
   112347 
   112348 /* CLIP_STATE::Constant URB Entry Read Offset */
   112349 
   112350 
   112351 #define GEN5_CLIP_STATE_ConstantURBEntryReadOffset_bits  6
   112352 #define GEN45_CLIP_STATE_ConstantURBEntryReadOffset_bits  6
   112353 #define GEN4_CLIP_STATE_ConstantURBEntryReadOffset_bits  6
   112354 
   112355 static inline uint32_t ATTRIBUTE_PURE
   112356 CLIP_STATE_ConstantURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   112357 {
   112358    switch (devinfo->gen) {
   112359    case 10: return 0;
   112360    case 9: return 0;
   112361    case 8: return 0;
   112362    case 7:
   112363       if (devinfo->is_haswell) {
   112364          return 0;
   112365       } else {
   112366          return 0;
   112367       }
   112368    case 6: return 0;
   112369    case 5: return 6;
   112370    case 4:
   112371       if (devinfo->is_g4x) {
   112372          return 6;
   112373       } else {
   112374          return 6;
   112375       }
   112376    default:
   112377       unreachable("Invalid hardware generation");
   112378    }
   112379 }
   112380 
   112381 
   112382 
   112383 #define GEN5_CLIP_STATE_ConstantURBEntryReadOffset_start  114
   112384 #define GEN45_CLIP_STATE_ConstantURBEntryReadOffset_start  114
   112385 #define GEN4_CLIP_STATE_ConstantURBEntryReadOffset_start  114
   112386 
   112387 static inline uint32_t ATTRIBUTE_PURE
   112388 CLIP_STATE_ConstantURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   112389 {
   112390    switch (devinfo->gen) {
   112391    case 10: return 0;
   112392    case 9: return 0;
   112393    case 8: return 0;
   112394    case 7:
   112395       if (devinfo->is_haswell) {
   112396          return 0;
   112397       } else {
   112398          return 0;
   112399       }
   112400    case 6: return 0;
   112401    case 5: return 114;
   112402    case 4:
   112403       if (devinfo->is_g4x) {
   112404          return 114;
   112405       } else {
   112406          return 114;
   112407       }
   112408    default:
   112409       unreachable("Invalid hardware generation");
   112410    }
   112411 }
   112412 
   112413 
   112414 
   112415 /* CLIP_STATE::Dispatch GRF Start Register For URB Data */
   112416 
   112417 
   112418 #define GEN5_CLIP_STATE_DispatchGRFStartRegisterForURBData_bits  4
   112419 #define GEN45_CLIP_STATE_DispatchGRFStartRegisterForURBData_bits  4
   112420 #define GEN4_CLIP_STATE_DispatchGRFStartRegisterForURBData_bits  4
   112421 
   112422 static inline uint32_t ATTRIBUTE_PURE
   112423 CLIP_STATE_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   112424 {
   112425    switch (devinfo->gen) {
   112426    case 10: return 0;
   112427    case 9: return 0;
   112428    case 8: return 0;
   112429    case 7:
   112430       if (devinfo->is_haswell) {
   112431          return 0;
   112432       } else {
   112433          return 0;
   112434       }
   112435    case 6: return 0;
   112436    case 5: return 4;
   112437    case 4:
   112438       if (devinfo->is_g4x) {
   112439          return 4;
   112440       } else {
   112441          return 4;
   112442       }
   112443    default:
   112444       unreachable("Invalid hardware generation");
   112445    }
   112446 }
   112447 
   112448 
   112449 
   112450 #define GEN5_CLIP_STATE_DispatchGRFStartRegisterForURBData_start  96
   112451 #define GEN45_CLIP_STATE_DispatchGRFStartRegisterForURBData_start  96
   112452 #define GEN4_CLIP_STATE_DispatchGRFStartRegisterForURBData_start  96
   112453 
   112454 static inline uint32_t ATTRIBUTE_PURE
   112455 CLIP_STATE_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   112456 {
   112457    switch (devinfo->gen) {
   112458    case 10: return 0;
   112459    case 9: return 0;
   112460    case 8: return 0;
   112461    case 7:
   112462       if (devinfo->is_haswell) {
   112463          return 0;
   112464       } else {
   112465          return 0;
   112466       }
   112467    case 6: return 0;
   112468    case 5: return 96;
   112469    case 4:
   112470       if (devinfo->is_g4x) {
   112471          return 96;
   112472       } else {
   112473          return 96;
   112474       }
   112475    default:
   112476       unreachable("Invalid hardware generation");
   112477    }
   112478 }
   112479 
   112480 
   112481 
   112482 /* CLIP_STATE::Floating Point Mode */
   112483 
   112484 
   112485 #define GEN5_CLIP_STATE_FloatingPointMode_bits  1
   112486 #define GEN45_CLIP_STATE_FloatingPointMode_bits  1
   112487 #define GEN4_CLIP_STATE_FloatingPointMode_bits  1
   112488 
   112489 static inline uint32_t ATTRIBUTE_PURE
   112490 CLIP_STATE_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   112491 {
   112492    switch (devinfo->gen) {
   112493    case 10: return 0;
   112494    case 9: return 0;
   112495    case 8: return 0;
   112496    case 7:
   112497       if (devinfo->is_haswell) {
   112498          return 0;
   112499       } else {
   112500          return 0;
   112501       }
   112502    case 6: return 0;
   112503    case 5: return 1;
   112504    case 4:
   112505       if (devinfo->is_g4x) {
   112506          return 1;
   112507       } else {
   112508          return 1;
   112509       }
   112510    default:
   112511       unreachable("Invalid hardware generation");
   112512    }
   112513 }
   112514 
   112515 
   112516 
   112517 #define GEN5_CLIP_STATE_FloatingPointMode_start  48
   112518 #define GEN45_CLIP_STATE_FloatingPointMode_start  48
   112519 #define GEN4_CLIP_STATE_FloatingPointMode_start  48
   112520 
   112521 static inline uint32_t ATTRIBUTE_PURE
   112522 CLIP_STATE_FloatingPointMode_start(const struct gen_device_info *devinfo)
   112523 {
   112524    switch (devinfo->gen) {
   112525    case 10: return 0;
   112526    case 9: return 0;
   112527    case 8: return 0;
   112528    case 7:
   112529       if (devinfo->is_haswell) {
   112530          return 0;
   112531       } else {
   112532          return 0;
   112533       }
   112534    case 6: return 0;
   112535    case 5: return 48;
   112536    case 4:
   112537       if (devinfo->is_g4x) {
   112538          return 48;
   112539       } else {
   112540          return 48;
   112541       }
   112542    default:
   112543       unreachable("Invalid hardware generation");
   112544    }
   112545 }
   112546 
   112547 
   112548 
   112549 /* CLIP_STATE::GRF Register Count */
   112550 
   112551 
   112552 #define GEN5_CLIP_STATE_GRFRegisterCount_bits  3
   112553 #define GEN45_CLIP_STATE_GRFRegisterCount_bits  3
   112554 #define GEN4_CLIP_STATE_GRFRegisterCount_bits  3
   112555 
   112556 static inline uint32_t ATTRIBUTE_PURE
   112557 CLIP_STATE_GRFRegisterCount_bits(const struct gen_device_info *devinfo)
   112558 {
   112559    switch (devinfo->gen) {
   112560    case 10: return 0;
   112561    case 9: return 0;
   112562    case 8: return 0;
   112563    case 7:
   112564       if (devinfo->is_haswell) {
   112565          return 0;
   112566       } else {
   112567          return 0;
   112568       }
   112569    case 6: return 0;
   112570    case 5: return 3;
   112571    case 4:
   112572       if (devinfo->is_g4x) {
   112573          return 3;
   112574       } else {
   112575          return 3;
   112576       }
   112577    default:
   112578       unreachable("Invalid hardware generation");
   112579    }
   112580 }
   112581 
   112582 
   112583 
   112584 #define GEN5_CLIP_STATE_GRFRegisterCount_start  1
   112585 #define GEN45_CLIP_STATE_GRFRegisterCount_start  1
   112586 #define GEN4_CLIP_STATE_GRFRegisterCount_start  1
   112587 
   112588 static inline uint32_t ATTRIBUTE_PURE
   112589 CLIP_STATE_GRFRegisterCount_start(const struct gen_device_info *devinfo)
   112590 {
   112591    switch (devinfo->gen) {
   112592    case 10: return 0;
   112593    case 9: return 0;
   112594    case 8: return 0;
   112595    case 7:
   112596       if (devinfo->is_haswell) {
   112597          return 0;
   112598       } else {
   112599          return 0;
   112600       }
   112601    case 6: return 0;
   112602    case 5: return 1;
   112603    case 4:
   112604       if (devinfo->is_g4x) {
   112605          return 1;
   112606       } else {
   112607          return 1;
   112608       }
   112609    default:
   112610       unreachable("Invalid hardware generation");
   112611    }
   112612 }
   112613 
   112614 
   112615 
   112616 /* CLIP_STATE::GS Output Object Statistics Enable */
   112617 
   112618 
   112619 #define GEN45_CLIP_STATE_GSOutputObjectStatisticsEnable_bits  1
   112620 #define GEN4_CLIP_STATE_GSOutputObjectStatisticsEnable_bits  1
   112621 
   112622 static inline uint32_t ATTRIBUTE_PURE
   112623 CLIP_STATE_GSOutputObjectStatisticsEnable_bits(const struct gen_device_info *devinfo)
   112624 {
   112625    switch (devinfo->gen) {
   112626    case 10: return 0;
   112627    case 9: return 0;
   112628    case 8: return 0;
   112629    case 7:
   112630       if (devinfo->is_haswell) {
   112631          return 0;
   112632       } else {
   112633          return 0;
   112634       }
   112635    case 6: return 0;
   112636    case 5: return 0;
   112637    case 4:
   112638       if (devinfo->is_g4x) {
   112639          return 1;
   112640       } else {
   112641          return 1;
   112642       }
   112643    default:
   112644       unreachable("Invalid hardware generation");
   112645    }
   112646 }
   112647 
   112648 
   112649 
   112650 #define GEN45_CLIP_STATE_GSOutputObjectStatisticsEnable_start  138
   112651 #define GEN4_CLIP_STATE_GSOutputObjectStatisticsEnable_start  138
   112652 
   112653 static inline uint32_t ATTRIBUTE_PURE
   112654 CLIP_STATE_GSOutputObjectStatisticsEnable_start(const struct gen_device_info *devinfo)
   112655 {
   112656    switch (devinfo->gen) {
   112657    case 10: return 0;
   112658    case 9: return 0;
   112659    case 8: return 0;
   112660    case 7:
   112661       if (devinfo->is_haswell) {
   112662          return 0;
   112663       } else {
   112664          return 0;
   112665       }
   112666    case 6: return 0;
   112667    case 5: return 0;
   112668    case 4:
   112669       if (devinfo->is_g4x) {
   112670          return 138;
   112671       } else {
   112672          return 138;
   112673       }
   112674    default:
   112675       unreachable("Invalid hardware generation");
   112676    }
   112677 }
   112678 
   112679 
   112680 
   112681 /* CLIP_STATE::Guardband ClipTest Enable */
   112682 
   112683 
   112684 #define GEN5_CLIP_STATE_GuardbandClipTestEnable_bits  1
   112685 #define GEN45_CLIP_STATE_GuardbandClipTestEnable_bits  1
   112686 #define GEN4_CLIP_STATE_GuardbandClipTestEnable_bits  1
   112687 
   112688 static inline uint32_t ATTRIBUTE_PURE
   112689 CLIP_STATE_GuardbandClipTestEnable_bits(const struct gen_device_info *devinfo)
   112690 {
   112691    switch (devinfo->gen) {
   112692    case 10: return 0;
   112693    case 9: return 0;
   112694    case 8: return 0;
   112695    case 7:
   112696       if (devinfo->is_haswell) {
   112697          return 0;
   112698       } else {
   112699          return 0;
   112700       }
   112701    case 6: return 0;
   112702    case 5: return 1;
   112703    case 4:
   112704       if (devinfo->is_g4x) {
   112705          return 1;
   112706       } else {
   112707          return 1;
   112708       }
   112709    default:
   112710       unreachable("Invalid hardware generation");
   112711    }
   112712 }
   112713 
   112714 
   112715 
   112716 #define GEN5_CLIP_STATE_GuardbandClipTestEnable_start  186
   112717 #define GEN45_CLIP_STATE_GuardbandClipTestEnable_start  186
   112718 #define GEN4_CLIP_STATE_GuardbandClipTestEnable_start  186
   112719 
   112720 static inline uint32_t ATTRIBUTE_PURE
   112721 CLIP_STATE_GuardbandClipTestEnable_start(const struct gen_device_info *devinfo)
   112722 {
   112723    switch (devinfo->gen) {
   112724    case 10: return 0;
   112725    case 9: return 0;
   112726    case 8: return 0;
   112727    case 7:
   112728       if (devinfo->is_haswell) {
   112729          return 0;
   112730       } else {
   112731          return 0;
   112732       }
   112733    case 6: return 0;
   112734    case 5: return 186;
   112735    case 4:
   112736       if (devinfo->is_g4x) {
   112737          return 186;
   112738       } else {
   112739          return 186;
   112740       }
   112741    default:
   112742       unreachable("Invalid hardware generation");
   112743    }
   112744 }
   112745 
   112746 
   112747 
   112748 /* CLIP_STATE::Illegal Opcode Exception Enable */
   112749 
   112750 
   112751 #define GEN5_CLIP_STATE_IllegalOpcodeExceptionEnable_bits  1
   112752 #define GEN45_CLIP_STATE_IllegalOpcodeExceptionEnable_bits  1
   112753 #define GEN4_CLIP_STATE_IllegalOpcodeExceptionEnable_bits  1
   112754 
   112755 static inline uint32_t ATTRIBUTE_PURE
   112756 CLIP_STATE_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   112757 {
   112758    switch (devinfo->gen) {
   112759    case 10: return 0;
   112760    case 9: return 0;
   112761    case 8: return 0;
   112762    case 7:
   112763       if (devinfo->is_haswell) {
   112764          return 0;
   112765       } else {
   112766          return 0;
   112767       }
   112768    case 6: return 0;
   112769    case 5: return 1;
   112770    case 4:
   112771       if (devinfo->is_g4x) {
   112772          return 1;
   112773       } else {
   112774          return 1;
   112775       }
   112776    default:
   112777       unreachable("Invalid hardware generation");
   112778    }
   112779 }
   112780 
   112781 
   112782 
   112783 #define GEN5_CLIP_STATE_IllegalOpcodeExceptionEnable_start  45
   112784 #define GEN45_CLIP_STATE_IllegalOpcodeExceptionEnable_start  45
   112785 #define GEN4_CLIP_STATE_IllegalOpcodeExceptionEnable_start  45
   112786 
   112787 static inline uint32_t ATTRIBUTE_PURE
   112788 CLIP_STATE_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   112789 {
   112790    switch (devinfo->gen) {
   112791    case 10: return 0;
   112792    case 9: return 0;
   112793    case 8: return 0;
   112794    case 7:
   112795       if (devinfo->is_haswell) {
   112796          return 0;
   112797       } else {
   112798          return 0;
   112799       }
   112800    case 6: return 0;
   112801    case 5: return 45;
   112802    case 4:
   112803       if (devinfo->is_g4x) {
   112804          return 45;
   112805       } else {
   112806          return 45;
   112807       }
   112808    default:
   112809       unreachable("Invalid hardware generation");
   112810    }
   112811 }
   112812 
   112813 
   112814 
   112815 /* CLIP_STATE::Kernel Start Pointer */
   112816 
   112817 
   112818 #define GEN5_CLIP_STATE_KernelStartPointer_bits  26
   112819 #define GEN45_CLIP_STATE_KernelStartPointer_bits  26
   112820 #define GEN4_CLIP_STATE_KernelStartPointer_bits  26
   112821 
   112822 static inline uint32_t ATTRIBUTE_PURE
   112823 CLIP_STATE_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   112824 {
   112825    switch (devinfo->gen) {
   112826    case 10: return 0;
   112827    case 9: return 0;
   112828    case 8: return 0;
   112829    case 7:
   112830       if (devinfo->is_haswell) {
   112831          return 0;
   112832       } else {
   112833          return 0;
   112834       }
   112835    case 6: return 0;
   112836    case 5: return 26;
   112837    case 4:
   112838       if (devinfo->is_g4x) {
   112839          return 26;
   112840       } else {
   112841          return 26;
   112842       }
   112843    default:
   112844       unreachable("Invalid hardware generation");
   112845    }
   112846 }
   112847 
   112848 
   112849 
   112850 #define GEN5_CLIP_STATE_KernelStartPointer_start  6
   112851 #define GEN45_CLIP_STATE_KernelStartPointer_start  6
   112852 #define GEN4_CLIP_STATE_KernelStartPointer_start  6
   112853 
   112854 static inline uint32_t ATTRIBUTE_PURE
   112855 CLIP_STATE_KernelStartPointer_start(const struct gen_device_info *devinfo)
   112856 {
   112857    switch (devinfo->gen) {
   112858    case 10: return 0;
   112859    case 9: return 0;
   112860    case 8: return 0;
   112861    case 7:
   112862       if (devinfo->is_haswell) {
   112863          return 0;
   112864       } else {
   112865          return 0;
   112866       }
   112867    case 6: return 0;
   112868    case 5: return 6;
   112869    case 4:
   112870       if (devinfo->is_g4x) {
   112871          return 6;
   112872       } else {
   112873          return 6;
   112874       }
   112875    default:
   112876       unreachable("Invalid hardware generation");
   112877    }
   112878 }
   112879 
   112880 
   112881 
   112882 /* CLIP_STATE::Mask Stack Exception Enable */
   112883 
   112884 
   112885 #define GEN5_CLIP_STATE_MaskStackExceptionEnable_bits  1
   112886 #define GEN45_CLIP_STATE_MaskStackExceptionEnable_bits  1
   112887 #define GEN4_CLIP_STATE_MaskStackExceptionEnable_bits  1
   112888 
   112889 static inline uint32_t ATTRIBUTE_PURE
   112890 CLIP_STATE_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   112891 {
   112892    switch (devinfo->gen) {
   112893    case 10: return 0;
   112894    case 9: return 0;
   112895    case 8: return 0;
   112896    case 7:
   112897       if (devinfo->is_haswell) {
   112898          return 0;
   112899       } else {
   112900          return 0;
   112901       }
   112902    case 6: return 0;
   112903    case 5: return 1;
   112904    case 4:
   112905       if (devinfo->is_g4x) {
   112906          return 1;
   112907       } else {
   112908          return 1;
   112909       }
   112910    default:
   112911       unreachable("Invalid hardware generation");
   112912    }
   112913 }
   112914 
   112915 
   112916 
   112917 #define GEN5_CLIP_STATE_MaskStackExceptionEnable_start  43
   112918 #define GEN45_CLIP_STATE_MaskStackExceptionEnable_start  43
   112919 #define GEN4_CLIP_STATE_MaskStackExceptionEnable_start  43
   112920 
   112921 static inline uint32_t ATTRIBUTE_PURE
   112922 CLIP_STATE_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   112923 {
   112924    switch (devinfo->gen) {
   112925    case 10: return 0;
   112926    case 9: return 0;
   112927    case 8: return 0;
   112928    case 7:
   112929       if (devinfo->is_haswell) {
   112930          return 0;
   112931       } else {
   112932          return 0;
   112933       }
   112934    case 6: return 0;
   112935    case 5: return 43;
   112936    case 4:
   112937       if (devinfo->is_g4x) {
   112938          return 43;
   112939       } else {
   112940          return 43;
   112941       }
   112942    default:
   112943       unreachable("Invalid hardware generation");
   112944    }
   112945 }
   112946 
   112947 
   112948 
   112949 /* CLIP_STATE::Maximum Number of Threads */
   112950 
   112951 
   112952 #define GEN5_CLIP_STATE_MaximumNumberofThreads_bits  6
   112953 #define GEN45_CLIP_STATE_MaximumNumberofThreads_bits  6
   112954 #define GEN4_CLIP_STATE_MaximumNumberofThreads_bits  6
   112955 
   112956 static inline uint32_t ATTRIBUTE_PURE
   112957 CLIP_STATE_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   112958 {
   112959    switch (devinfo->gen) {
   112960    case 10: return 0;
   112961    case 9: return 0;
   112962    case 8: return 0;
   112963    case 7:
   112964       if (devinfo->is_haswell) {
   112965          return 0;
   112966       } else {
   112967          return 0;
   112968       }
   112969    case 6: return 0;
   112970    case 5: return 6;
   112971    case 4:
   112972       if (devinfo->is_g4x) {
   112973          return 6;
   112974       } else {
   112975          return 6;
   112976       }
   112977    default:
   112978       unreachable("Invalid hardware generation");
   112979    }
   112980 }
   112981 
   112982 
   112983 
   112984 #define GEN5_CLIP_STATE_MaximumNumberofThreads_start  153
   112985 #define GEN45_CLIP_STATE_MaximumNumberofThreads_start  153
   112986 #define GEN4_CLIP_STATE_MaximumNumberofThreads_start  153
   112987 
   112988 static inline uint32_t ATTRIBUTE_PURE
   112989 CLIP_STATE_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   112990 {
   112991    switch (devinfo->gen) {
   112992    case 10: return 0;
   112993    case 9: return 0;
   112994    case 8: return 0;
   112995    case 7:
   112996       if (devinfo->is_haswell) {
   112997          return 0;
   112998       } else {
   112999          return 0;
   113000       }
   113001    case 6: return 0;
   113002    case 5: return 153;
   113003    case 4:
   113004       if (devinfo->is_g4x) {
   113005          return 153;
   113006       } else {
   113007          return 153;
   113008       }
   113009    default:
   113010       unreachable("Invalid hardware generation");
   113011    }
   113012 }
   113013 
   113014 
   113015 
   113016 /* CLIP_STATE::Negative W ClipTest Enable */
   113017 
   113018 
   113019 #define GEN5_CLIP_STATE_NegativeWClipTestEnable_bits  1
   113020 #define GEN45_CLIP_STATE_NegativeWClipTestEnable_bits  1
   113021 
   113022 static inline uint32_t ATTRIBUTE_PURE
   113023 CLIP_STATE_NegativeWClipTestEnable_bits(const struct gen_device_info *devinfo)
   113024 {
   113025    switch (devinfo->gen) {
   113026    case 10: return 0;
   113027    case 9: return 0;
   113028    case 8: return 0;
   113029    case 7:
   113030       if (devinfo->is_haswell) {
   113031          return 0;
   113032       } else {
   113033          return 0;
   113034       }
   113035    case 6: return 0;
   113036    case 5: return 1;
   113037    case 4:
   113038       if (devinfo->is_g4x) {
   113039          return 1;
   113040       } else {
   113041          return 0;
   113042       }
   113043    default:
   113044       unreachable("Invalid hardware generation");
   113045    }
   113046 }
   113047 
   113048 
   113049 
   113050 #define GEN5_CLIP_STATE_NegativeWClipTestEnable_start  185
   113051 #define GEN45_CLIP_STATE_NegativeWClipTestEnable_start  185
   113052 
   113053 static inline uint32_t ATTRIBUTE_PURE
   113054 CLIP_STATE_NegativeWClipTestEnable_start(const struct gen_device_info *devinfo)
   113055 {
   113056    switch (devinfo->gen) {
   113057    case 10: return 0;
   113058    case 9: return 0;
   113059    case 8: return 0;
   113060    case 7:
   113061       if (devinfo->is_haswell) {
   113062          return 0;
   113063       } else {
   113064          return 0;
   113065       }
   113066    case 6: return 0;
   113067    case 5: return 185;
   113068    case 4:
   113069       if (devinfo->is_g4x) {
   113070          return 185;
   113071       } else {
   113072          return 0;
   113073       }
   113074    default:
   113075       unreachable("Invalid hardware generation");
   113076    }
   113077 }
   113078 
   113079 
   113080 
   113081 /* CLIP_STATE::Number of URB Entries */
   113082 
   113083 
   113084 #define GEN5_CLIP_STATE_NumberofURBEntries_bits  8
   113085 #define GEN45_CLIP_STATE_NumberofURBEntries_bits  8
   113086 #define GEN4_CLIP_STATE_NumberofURBEntries_bits  8
   113087 
   113088 static inline uint32_t ATTRIBUTE_PURE
   113089 CLIP_STATE_NumberofURBEntries_bits(const struct gen_device_info *devinfo)
   113090 {
   113091    switch (devinfo->gen) {
   113092    case 10: return 0;
   113093    case 9: return 0;
   113094    case 8: return 0;
   113095    case 7:
   113096       if (devinfo->is_haswell) {
   113097          return 0;
   113098       } else {
   113099          return 0;
   113100       }
   113101    case 6: return 0;
   113102    case 5: return 8;
   113103    case 4:
   113104       if (devinfo->is_g4x) {
   113105          return 8;
   113106       } else {
   113107          return 8;
   113108       }
   113109    default:
   113110       unreachable("Invalid hardware generation");
   113111    }
   113112 }
   113113 
   113114 
   113115 
   113116 #define GEN5_CLIP_STATE_NumberofURBEntries_start  139
   113117 #define GEN45_CLIP_STATE_NumberofURBEntries_start  139
   113118 #define GEN4_CLIP_STATE_NumberofURBEntries_start  139
   113119 
   113120 static inline uint32_t ATTRIBUTE_PURE
   113121 CLIP_STATE_NumberofURBEntries_start(const struct gen_device_info *devinfo)
   113122 {
   113123    switch (devinfo->gen) {
   113124    case 10: return 0;
   113125    case 9: return 0;
   113126    case 8: return 0;
   113127    case 7:
   113128       if (devinfo->is_haswell) {
   113129          return 0;
   113130       } else {
   113131          return 0;
   113132       }
   113133    case 6: return 0;
   113134    case 5: return 139;
   113135    case 4:
   113136       if (devinfo->is_g4x) {
   113137          return 139;
   113138       } else {
   113139          return 139;
   113140       }
   113141    default:
   113142       unreachable("Invalid hardware generation");
   113143    }
   113144 }
   113145 
   113146 
   113147 
   113148 /* CLIP_STATE::Per-Thread Scratch Space */
   113149 
   113150 
   113151 #define GEN5_CLIP_STATE_PerThreadScratchSpace_bits  4
   113152 #define GEN45_CLIP_STATE_PerThreadScratchSpace_bits  4
   113153 #define GEN4_CLIP_STATE_PerThreadScratchSpace_bits  4
   113154 
   113155 static inline uint32_t ATTRIBUTE_PURE
   113156 CLIP_STATE_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   113157 {
   113158    switch (devinfo->gen) {
   113159    case 10: return 0;
   113160    case 9: return 0;
   113161    case 8: return 0;
   113162    case 7:
   113163       if (devinfo->is_haswell) {
   113164          return 0;
   113165       } else {
   113166          return 0;
   113167       }
   113168    case 6: return 0;
   113169    case 5: return 4;
   113170    case 4:
   113171       if (devinfo->is_g4x) {
   113172          return 4;
   113173       } else {
   113174          return 4;
   113175       }
   113176    default:
   113177       unreachable("Invalid hardware generation");
   113178    }
   113179 }
   113180 
   113181 
   113182 
   113183 #define GEN5_CLIP_STATE_PerThreadScratchSpace_start  64
   113184 #define GEN45_CLIP_STATE_PerThreadScratchSpace_start  64
   113185 #define GEN4_CLIP_STATE_PerThreadScratchSpace_start  64
   113186 
   113187 static inline uint32_t ATTRIBUTE_PURE
   113188 CLIP_STATE_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   113189 {
   113190    switch (devinfo->gen) {
   113191    case 10: return 0;
   113192    case 9: return 0;
   113193    case 8: return 0;
   113194    case 7:
   113195       if (devinfo->is_haswell) {
   113196          return 0;
   113197       } else {
   113198          return 0;
   113199       }
   113200    case 6: return 0;
   113201    case 5: return 64;
   113202    case 4:
   113203       if (devinfo->is_g4x) {
   113204          return 64;
   113205       } else {
   113206          return 64;
   113207       }
   113208    default:
   113209       unreachable("Invalid hardware generation");
   113210    }
   113211 }
   113212 
   113213 
   113214 
   113215 /* CLIP_STATE::Scratch Space Base Pointer */
   113216 
   113217 
   113218 #define GEN5_CLIP_STATE_ScratchSpaceBasePointer_bits  22
   113219 #define GEN45_CLIP_STATE_ScratchSpaceBasePointer_bits  22
   113220 #define GEN4_CLIP_STATE_ScratchSpaceBasePointer_bits  22
   113221 
   113222 static inline uint32_t ATTRIBUTE_PURE
   113223 CLIP_STATE_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   113224 {
   113225    switch (devinfo->gen) {
   113226    case 10: return 0;
   113227    case 9: return 0;
   113228    case 8: return 0;
   113229    case 7:
   113230       if (devinfo->is_haswell) {
   113231          return 0;
   113232       } else {
   113233          return 0;
   113234       }
   113235    case 6: return 0;
   113236    case 5: return 22;
   113237    case 4:
   113238       if (devinfo->is_g4x) {
   113239          return 22;
   113240       } else {
   113241          return 22;
   113242       }
   113243    default:
   113244       unreachable("Invalid hardware generation");
   113245    }
   113246 }
   113247 
   113248 
   113249 
   113250 #define GEN5_CLIP_STATE_ScratchSpaceBasePointer_start  74
   113251 #define GEN45_CLIP_STATE_ScratchSpaceBasePointer_start  74
   113252 #define GEN4_CLIP_STATE_ScratchSpaceBasePointer_start  74
   113253 
   113254 static inline uint32_t ATTRIBUTE_PURE
   113255 CLIP_STATE_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   113256 {
   113257    switch (devinfo->gen) {
   113258    case 10: return 0;
   113259    case 9: return 0;
   113260    case 8: return 0;
   113261    case 7:
   113262       if (devinfo->is_haswell) {
   113263          return 0;
   113264       } else {
   113265          return 0;
   113266       }
   113267    case 6: return 0;
   113268    case 5: return 74;
   113269    case 4:
   113270       if (devinfo->is_g4x) {
   113271          return 74;
   113272       } else {
   113273          return 74;
   113274       }
   113275    default:
   113276       unreachable("Invalid hardware generation");
   113277    }
   113278 }
   113279 
   113280 
   113281 
   113282 /* CLIP_STATE::Screen Space Viewport X Max */
   113283 
   113284 
   113285 #define GEN5_CLIP_STATE_ScreenSpaceViewportXMax_bits  32
   113286 #define GEN45_CLIP_STATE_ScreenSpaceViewportXMax_bits  32
   113287 #define GEN4_CLIP_STATE_ScreenSpaceViewportXMax_bits  32
   113288 
   113289 static inline uint32_t ATTRIBUTE_PURE
   113290 CLIP_STATE_ScreenSpaceViewportXMax_bits(const struct gen_device_info *devinfo)
   113291 {
   113292    switch (devinfo->gen) {
   113293    case 10: return 0;
   113294    case 9: return 0;
   113295    case 8: return 0;
   113296    case 7:
   113297       if (devinfo->is_haswell) {
   113298          return 0;
   113299       } else {
   113300          return 0;
   113301       }
   113302    case 6: return 0;
   113303    case 5: return 32;
   113304    case 4:
   113305       if (devinfo->is_g4x) {
   113306          return 32;
   113307       } else {
   113308          return 32;
   113309       }
   113310    default:
   113311       unreachable("Invalid hardware generation");
   113312    }
   113313 }
   113314 
   113315 
   113316 
   113317 #define GEN5_CLIP_STATE_ScreenSpaceViewportXMax_start  256
   113318 #define GEN45_CLIP_STATE_ScreenSpaceViewportXMax_start  256
   113319 #define GEN4_CLIP_STATE_ScreenSpaceViewportXMax_start  256
   113320 
   113321 static inline uint32_t ATTRIBUTE_PURE
   113322 CLIP_STATE_ScreenSpaceViewportXMax_start(const struct gen_device_info *devinfo)
   113323 {
   113324    switch (devinfo->gen) {
   113325    case 10: return 0;
   113326    case 9: return 0;
   113327    case 8: return 0;
   113328    case 7:
   113329       if (devinfo->is_haswell) {
   113330          return 0;
   113331       } else {
   113332          return 0;
   113333       }
   113334    case 6: return 0;
   113335    case 5: return 256;
   113336    case 4:
   113337       if (devinfo->is_g4x) {
   113338          return 256;
   113339       } else {
   113340          return 256;
   113341       }
   113342    default:
   113343       unreachable("Invalid hardware generation");
   113344    }
   113345 }
   113346 
   113347 
   113348 
   113349 /* CLIP_STATE::Screen Space Viewport X Min */
   113350 
   113351 
   113352 #define GEN5_CLIP_STATE_ScreenSpaceViewportXMin_bits  32
   113353 #define GEN45_CLIP_STATE_ScreenSpaceViewportXMin_bits  32
   113354 #define GEN4_CLIP_STATE_ScreenSpaceViewportXMin_bits  32
   113355 
   113356 static inline uint32_t ATTRIBUTE_PURE
   113357 CLIP_STATE_ScreenSpaceViewportXMin_bits(const struct gen_device_info *devinfo)
   113358 {
   113359    switch (devinfo->gen) {
   113360    case 10: return 0;
   113361    case 9: return 0;
   113362    case 8: return 0;
   113363    case 7:
   113364       if (devinfo->is_haswell) {
   113365          return 0;
   113366       } else {
   113367          return 0;
   113368       }
   113369    case 6: return 0;
   113370    case 5: return 32;
   113371    case 4:
   113372       if (devinfo->is_g4x) {
   113373          return 32;
   113374       } else {
   113375          return 32;
   113376       }
   113377    default:
   113378       unreachable("Invalid hardware generation");
   113379    }
   113380 }
   113381 
   113382 
   113383 
   113384 #define GEN5_CLIP_STATE_ScreenSpaceViewportXMin_start  224
   113385 #define GEN45_CLIP_STATE_ScreenSpaceViewportXMin_start  224
   113386 #define GEN4_CLIP_STATE_ScreenSpaceViewportXMin_start  224
   113387 
   113388 static inline uint32_t ATTRIBUTE_PURE
   113389 CLIP_STATE_ScreenSpaceViewportXMin_start(const struct gen_device_info *devinfo)
   113390 {
   113391    switch (devinfo->gen) {
   113392    case 10: return 0;
   113393    case 9: return 0;
   113394    case 8: return 0;
   113395    case 7:
   113396       if (devinfo->is_haswell) {
   113397          return 0;
   113398       } else {
   113399          return 0;
   113400       }
   113401    case 6: return 0;
   113402    case 5: return 224;
   113403    case 4:
   113404       if (devinfo->is_g4x) {
   113405          return 224;
   113406       } else {
   113407          return 224;
   113408       }
   113409    default:
   113410       unreachable("Invalid hardware generation");
   113411    }
   113412 }
   113413 
   113414 
   113415 
   113416 /* CLIP_STATE::Screen Space Viewport Y Max */
   113417 
   113418 
   113419 #define GEN5_CLIP_STATE_ScreenSpaceViewportYMax_bits  32
   113420 #define GEN45_CLIP_STATE_ScreenSpaceViewportYMax_bits  32
   113421 #define GEN4_CLIP_STATE_ScreenSpaceViewportYMax_bits  32
   113422 
   113423 static inline uint32_t ATTRIBUTE_PURE
   113424 CLIP_STATE_ScreenSpaceViewportYMax_bits(const struct gen_device_info *devinfo)
   113425 {
   113426    switch (devinfo->gen) {
   113427    case 10: return 0;
   113428    case 9: return 0;
   113429    case 8: return 0;
   113430    case 7:
   113431       if (devinfo->is_haswell) {
   113432          return 0;
   113433       } else {
   113434          return 0;
   113435       }
   113436    case 6: return 0;
   113437    case 5: return 32;
   113438    case 4:
   113439       if (devinfo->is_g4x) {
   113440          return 32;
   113441       } else {
   113442          return 32;
   113443       }
   113444    default:
   113445       unreachable("Invalid hardware generation");
   113446    }
   113447 }
   113448 
   113449 
   113450 
   113451 #define GEN5_CLIP_STATE_ScreenSpaceViewportYMax_start  320
   113452 #define GEN45_CLIP_STATE_ScreenSpaceViewportYMax_start  320
   113453 #define GEN4_CLIP_STATE_ScreenSpaceViewportYMax_start  320
   113454 
   113455 static inline uint32_t ATTRIBUTE_PURE
   113456 CLIP_STATE_ScreenSpaceViewportYMax_start(const struct gen_device_info *devinfo)
   113457 {
   113458    switch (devinfo->gen) {
   113459    case 10: return 0;
   113460    case 9: return 0;
   113461    case 8: return 0;
   113462    case 7:
   113463       if (devinfo->is_haswell) {
   113464          return 0;
   113465       } else {
   113466          return 0;
   113467       }
   113468    case 6: return 0;
   113469    case 5: return 320;
   113470    case 4:
   113471       if (devinfo->is_g4x) {
   113472          return 320;
   113473       } else {
   113474          return 320;
   113475       }
   113476    default:
   113477       unreachable("Invalid hardware generation");
   113478    }
   113479 }
   113480 
   113481 
   113482 
   113483 /* CLIP_STATE::Screen Space Viewport Y Min */
   113484 
   113485 
   113486 #define GEN5_CLIP_STATE_ScreenSpaceViewportYMin_bits  32
   113487 #define GEN45_CLIP_STATE_ScreenSpaceViewportYMin_bits  32
   113488 #define GEN4_CLIP_STATE_ScreenSpaceViewportYMin_bits  32
   113489 
   113490 static inline uint32_t ATTRIBUTE_PURE
   113491 CLIP_STATE_ScreenSpaceViewportYMin_bits(const struct gen_device_info *devinfo)
   113492 {
   113493    switch (devinfo->gen) {
   113494    case 10: return 0;
   113495    case 9: return 0;
   113496    case 8: return 0;
   113497    case 7:
   113498       if (devinfo->is_haswell) {
   113499          return 0;
   113500       } else {
   113501          return 0;
   113502       }
   113503    case 6: return 0;
   113504    case 5: return 32;
   113505    case 4:
   113506       if (devinfo->is_g4x) {
   113507          return 32;
   113508       } else {
   113509          return 32;
   113510       }
   113511    default:
   113512       unreachable("Invalid hardware generation");
   113513    }
   113514 }
   113515 
   113516 
   113517 
   113518 #define GEN5_CLIP_STATE_ScreenSpaceViewportYMin_start  288
   113519 #define GEN45_CLIP_STATE_ScreenSpaceViewportYMin_start  288
   113520 #define GEN4_CLIP_STATE_ScreenSpaceViewportYMin_start  288
   113521 
   113522 static inline uint32_t ATTRIBUTE_PURE
   113523 CLIP_STATE_ScreenSpaceViewportYMin_start(const struct gen_device_info *devinfo)
   113524 {
   113525    switch (devinfo->gen) {
   113526    case 10: return 0;
   113527    case 9: return 0;
   113528    case 8: return 0;
   113529    case 7:
   113530       if (devinfo->is_haswell) {
   113531          return 0;
   113532       } else {
   113533          return 0;
   113534       }
   113535    case 6: return 0;
   113536    case 5: return 288;
   113537    case 4:
   113538       if (devinfo->is_g4x) {
   113539          return 288;
   113540       } else {
   113541          return 288;
   113542       }
   113543    default:
   113544       unreachable("Invalid hardware generation");
   113545    }
   113546 }
   113547 
   113548 
   113549 
   113550 /* CLIP_STATE::Single Program Flow */
   113551 
   113552 
   113553 #define GEN5_CLIP_STATE_SingleProgramFlow_bits  1
   113554 #define GEN45_CLIP_STATE_SingleProgramFlow_bits  1
   113555 #define GEN4_CLIP_STATE_SingleProgramFlow_bits  1
   113556 
   113557 static inline uint32_t ATTRIBUTE_PURE
   113558 CLIP_STATE_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   113559 {
   113560    switch (devinfo->gen) {
   113561    case 10: return 0;
   113562    case 9: return 0;
   113563    case 8: return 0;
   113564    case 7:
   113565       if (devinfo->is_haswell) {
   113566          return 0;
   113567       } else {
   113568          return 0;
   113569       }
   113570    case 6: return 0;
   113571    case 5: return 1;
   113572    case 4:
   113573       if (devinfo->is_g4x) {
   113574          return 1;
   113575       } else {
   113576          return 1;
   113577       }
   113578    default:
   113579       unreachable("Invalid hardware generation");
   113580    }
   113581 }
   113582 
   113583 
   113584 
   113585 #define GEN5_CLIP_STATE_SingleProgramFlow_start  63
   113586 #define GEN45_CLIP_STATE_SingleProgramFlow_start  63
   113587 #define GEN4_CLIP_STATE_SingleProgramFlow_start  63
   113588 
   113589 static inline uint32_t ATTRIBUTE_PURE
   113590 CLIP_STATE_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   113591 {
   113592    switch (devinfo->gen) {
   113593    case 10: return 0;
   113594    case 9: return 0;
   113595    case 8: return 0;
   113596    case 7:
   113597       if (devinfo->is_haswell) {
   113598          return 0;
   113599       } else {
   113600          return 0;
   113601       }
   113602    case 6: return 0;
   113603    case 5: return 63;
   113604    case 4:
   113605       if (devinfo->is_g4x) {
   113606          return 63;
   113607       } else {
   113608          return 63;
   113609       }
   113610    default:
   113611       unreachable("Invalid hardware generation");
   113612    }
   113613 }
   113614 
   113615 
   113616 
   113617 /* CLIP_STATE::Software  Exception Enable */
   113618 
   113619 
   113620 #define GEN5_CLIP_STATE_SoftwareExceptionEnable_bits  1
   113621 #define GEN45_CLIP_STATE_SoftwareExceptionEnable_bits  1
   113622 #define GEN4_CLIP_STATE_SoftwareExceptionEnable_bits  1
   113623 
   113624 static inline uint32_t ATTRIBUTE_PURE
   113625 CLIP_STATE_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   113626 {
   113627    switch (devinfo->gen) {
   113628    case 10: return 0;
   113629    case 9: return 0;
   113630    case 8: return 0;
   113631    case 7:
   113632       if (devinfo->is_haswell) {
   113633          return 0;
   113634       } else {
   113635          return 0;
   113636       }
   113637    case 6: return 0;
   113638    case 5: return 1;
   113639    case 4:
   113640       if (devinfo->is_g4x) {
   113641          return 1;
   113642       } else {
   113643          return 1;
   113644       }
   113645    default:
   113646       unreachable("Invalid hardware generation");
   113647    }
   113648 }
   113649 
   113650 
   113651 
   113652 #define GEN5_CLIP_STATE_SoftwareExceptionEnable_start  39
   113653 #define GEN45_CLIP_STATE_SoftwareExceptionEnable_start  39
   113654 #define GEN4_CLIP_STATE_SoftwareExceptionEnable_start  39
   113655 
   113656 static inline uint32_t ATTRIBUTE_PURE
   113657 CLIP_STATE_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   113658 {
   113659    switch (devinfo->gen) {
   113660    case 10: return 0;
   113661    case 9: return 0;
   113662    case 8: return 0;
   113663    case 7:
   113664       if (devinfo->is_haswell) {
   113665          return 0;
   113666       } else {
   113667          return 0;
   113668       }
   113669    case 6: return 0;
   113670    case 5: return 39;
   113671    case 4:
   113672       if (devinfo->is_g4x) {
   113673          return 39;
   113674       } else {
   113675          return 39;
   113676       }
   113677    default:
   113678       unreachable("Invalid hardware generation");
   113679    }
   113680 }
   113681 
   113682 
   113683 
   113684 /* CLIP_STATE::Thread Priority */
   113685 
   113686 
   113687 #define GEN5_CLIP_STATE_ThreadPriority_bits  1
   113688 #define GEN45_CLIP_STATE_ThreadPriority_bits  1
   113689 #define GEN4_CLIP_STATE_ThreadPriority_bits  1
   113690 
   113691 static inline uint32_t ATTRIBUTE_PURE
   113692 CLIP_STATE_ThreadPriority_bits(const struct gen_device_info *devinfo)
   113693 {
   113694    switch (devinfo->gen) {
   113695    case 10: return 0;
   113696    case 9: return 0;
   113697    case 8: return 0;
   113698    case 7:
   113699       if (devinfo->is_haswell) {
   113700          return 0;
   113701       } else {
   113702          return 0;
   113703       }
   113704    case 6: return 0;
   113705    case 5: return 1;
   113706    case 4:
   113707       if (devinfo->is_g4x) {
   113708          return 1;
   113709       } else {
   113710          return 1;
   113711       }
   113712    default:
   113713       unreachable("Invalid hardware generation");
   113714    }
   113715 }
   113716 
   113717 
   113718 
   113719 #define GEN5_CLIP_STATE_ThreadPriority_start  49
   113720 #define GEN45_CLIP_STATE_ThreadPriority_start  49
   113721 #define GEN4_CLIP_STATE_ThreadPriority_start  49
   113722 
   113723 static inline uint32_t ATTRIBUTE_PURE
   113724 CLIP_STATE_ThreadPriority_start(const struct gen_device_info *devinfo)
   113725 {
   113726    switch (devinfo->gen) {
   113727    case 10: return 0;
   113728    case 9: return 0;
   113729    case 8: return 0;
   113730    case 7:
   113731       if (devinfo->is_haswell) {
   113732          return 0;
   113733       } else {
   113734          return 0;
   113735       }
   113736    case 6: return 0;
   113737    case 5: return 49;
   113738    case 4:
   113739       if (devinfo->is_g4x) {
   113740          return 49;
   113741       } else {
   113742          return 49;
   113743       }
   113744    default:
   113745       unreachable("Invalid hardware generation");
   113746    }
   113747 }
   113748 
   113749 
   113750 
   113751 /* CLIP_STATE::URB Entry Allocation Size */
   113752 
   113753 
   113754 #define GEN5_CLIP_STATE_URBEntryAllocationSize_bits  5
   113755 #define GEN45_CLIP_STATE_URBEntryAllocationSize_bits  5
   113756 #define GEN4_CLIP_STATE_URBEntryAllocationSize_bits  5
   113757 
   113758 static inline uint32_t ATTRIBUTE_PURE
   113759 CLIP_STATE_URBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   113760 {
   113761    switch (devinfo->gen) {
   113762    case 10: return 0;
   113763    case 9: return 0;
   113764    case 8: return 0;
   113765    case 7:
   113766       if (devinfo->is_haswell) {
   113767          return 0;
   113768       } else {
   113769          return 0;
   113770       }
   113771    case 6: return 0;
   113772    case 5: return 5;
   113773    case 4:
   113774       if (devinfo->is_g4x) {
   113775          return 5;
   113776       } else {
   113777          return 5;
   113778       }
   113779    default:
   113780       unreachable("Invalid hardware generation");
   113781    }
   113782 }
   113783 
   113784 
   113785 
   113786 #define GEN5_CLIP_STATE_URBEntryAllocationSize_start  147
   113787 #define GEN45_CLIP_STATE_URBEntryAllocationSize_start  147
   113788 #define GEN4_CLIP_STATE_URBEntryAllocationSize_start  147
   113789 
   113790 static inline uint32_t ATTRIBUTE_PURE
   113791 CLIP_STATE_URBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   113792 {
   113793    switch (devinfo->gen) {
   113794    case 10: return 0;
   113795    case 9: return 0;
   113796    case 8: return 0;
   113797    case 7:
   113798       if (devinfo->is_haswell) {
   113799          return 0;
   113800       } else {
   113801          return 0;
   113802       }
   113803    case 6: return 0;
   113804    case 5: return 147;
   113805    case 4:
   113806       if (devinfo->is_g4x) {
   113807          return 147;
   113808       } else {
   113809          return 147;
   113810       }
   113811    default:
   113812       unreachable("Invalid hardware generation");
   113813    }
   113814 }
   113815 
   113816 
   113817 
   113818 /* CLIP_STATE::UserClipDistance ClipTest Enable Bitmask */
   113819 
   113820 
   113821 #define GEN5_CLIP_STATE_UserClipDistanceClipTestEnableBitmask_bits  8
   113822 #define GEN45_CLIP_STATE_UserClipDistanceClipTestEnableBitmask_bits  8
   113823 #define GEN4_CLIP_STATE_UserClipDistanceClipTestEnableBitmask_bits  8
   113824 
   113825 static inline uint32_t ATTRIBUTE_PURE
   113826 CLIP_STATE_UserClipDistanceClipTestEnableBitmask_bits(const struct gen_device_info *devinfo)
   113827 {
   113828    switch (devinfo->gen) {
   113829    case 10: return 0;
   113830    case 9: return 0;
   113831    case 8: return 0;
   113832    case 7:
   113833       if (devinfo->is_haswell) {
   113834          return 0;
   113835       } else {
   113836          return 0;
   113837       }
   113838    case 6: return 0;
   113839    case 5: return 8;
   113840    case 4:
   113841       if (devinfo->is_g4x) {
   113842          return 8;
   113843       } else {
   113844          return 8;
   113845       }
   113846    default:
   113847       unreachable("Invalid hardware generation");
   113848    }
   113849 }
   113850 
   113851 
   113852 
   113853 #define GEN5_CLIP_STATE_UserClipDistanceClipTestEnableBitmask_start  176
   113854 #define GEN45_CLIP_STATE_UserClipDistanceClipTestEnableBitmask_start  176
   113855 #define GEN4_CLIP_STATE_UserClipDistanceClipTestEnableBitmask_start  176
   113856 
   113857 static inline uint32_t ATTRIBUTE_PURE
   113858 CLIP_STATE_UserClipDistanceClipTestEnableBitmask_start(const struct gen_device_info *devinfo)
   113859 {
   113860    switch (devinfo->gen) {
   113861    case 10: return 0;
   113862    case 9: return 0;
   113863    case 8: return 0;
   113864    case 7:
   113865       if (devinfo->is_haswell) {
   113866          return 0;
   113867       } else {
   113868          return 0;
   113869       }
   113870    case 6: return 0;
   113871    case 5: return 176;
   113872    case 4:
   113873       if (devinfo->is_g4x) {
   113874          return 176;
   113875       } else {
   113876          return 176;
   113877       }
   113878    default:
   113879       unreachable("Invalid hardware generation");
   113880    }
   113881 }
   113882 
   113883 
   113884 
   113885 /* CLIP_STATE::UserClipFlags MustClip Enable */
   113886 
   113887 
   113888 #define GEN5_CLIP_STATE_UserClipFlagsMustClipEnable_bits  1
   113889 #define GEN45_CLIP_STATE_UserClipFlagsMustClipEnable_bits  1
   113890 #define GEN4_CLIP_STATE_UserClipFlagsMustClipEnable_bits  1
   113891 
   113892 static inline uint32_t ATTRIBUTE_PURE
   113893 CLIP_STATE_UserClipFlagsMustClipEnable_bits(const struct gen_device_info *devinfo)
   113894 {
   113895    switch (devinfo->gen) {
   113896    case 10: return 0;
   113897    case 9: return 0;
   113898    case 8: return 0;
   113899    case 7:
   113900       if (devinfo->is_haswell) {
   113901          return 0;
   113902       } else {
   113903          return 0;
   113904       }
   113905    case 6: return 0;
   113906    case 5: return 1;
   113907    case 4:
   113908       if (devinfo->is_g4x) {
   113909          return 1;
   113910       } else {
   113911          return 1;
   113912       }
   113913    default:
   113914       unreachable("Invalid hardware generation");
   113915    }
   113916 }
   113917 
   113918 
   113919 
   113920 #define GEN5_CLIP_STATE_UserClipFlagsMustClipEnable_start  184
   113921 #define GEN45_CLIP_STATE_UserClipFlagsMustClipEnable_start  184
   113922 #define GEN4_CLIP_STATE_UserClipFlagsMustClipEnable_start  184
   113923 
   113924 static inline uint32_t ATTRIBUTE_PURE
   113925 CLIP_STATE_UserClipFlagsMustClipEnable_start(const struct gen_device_info *devinfo)
   113926 {
   113927    switch (devinfo->gen) {
   113928    case 10: return 0;
   113929    case 9: return 0;
   113930    case 8: return 0;
   113931    case 7:
   113932       if (devinfo->is_haswell) {
   113933          return 0;
   113934       } else {
   113935          return 0;
   113936       }
   113937    case 6: return 0;
   113938    case 5: return 184;
   113939    case 4:
   113940       if (devinfo->is_g4x) {
   113941          return 184;
   113942       } else {
   113943          return 184;
   113944       }
   113945    default:
   113946       unreachable("Invalid hardware generation");
   113947    }
   113948 }
   113949 
   113950 
   113951 
   113952 /* CLIP_STATE::Vertex Position Space */
   113953 
   113954 
   113955 #define GEN5_CLIP_STATE_VertexPositionSpace_bits  1
   113956 #define GEN45_CLIP_STATE_VertexPositionSpace_bits  1
   113957 #define GEN4_CLIP_STATE_VertexPositionSpace_bits  1
   113958 
   113959 static inline uint32_t ATTRIBUTE_PURE
   113960 CLIP_STATE_VertexPositionSpace_bits(const struct gen_device_info *devinfo)
   113961 {
   113962    switch (devinfo->gen) {
   113963    case 10: return 0;
   113964    case 9: return 0;
   113965    case 8: return 0;
   113966    case 7:
   113967       if (devinfo->is_haswell) {
   113968          return 0;
   113969       } else {
   113970          return 0;
   113971       }
   113972    case 6: return 0;
   113973    case 5: return 1;
   113974    case 4:
   113975       if (devinfo->is_g4x) {
   113976          return 1;
   113977       } else {
   113978          return 1;
   113979       }
   113980    default:
   113981       unreachable("Invalid hardware generation");
   113982    }
   113983 }
   113984 
   113985 
   113986 
   113987 #define GEN5_CLIP_STATE_VertexPositionSpace_start  189
   113988 #define GEN45_CLIP_STATE_VertexPositionSpace_start  189
   113989 #define GEN4_CLIP_STATE_VertexPositionSpace_start  189
   113990 
   113991 static inline uint32_t ATTRIBUTE_PURE
   113992 CLIP_STATE_VertexPositionSpace_start(const struct gen_device_info *devinfo)
   113993 {
   113994    switch (devinfo->gen) {
   113995    case 10: return 0;
   113996    case 9: return 0;
   113997    case 8: return 0;
   113998    case 7:
   113999       if (devinfo->is_haswell) {
   114000          return 0;
   114001       } else {
   114002          return 0;
   114003       }
   114004    case 6: return 0;
   114005    case 5: return 189;
   114006    case 4:
   114007       if (devinfo->is_g4x) {
   114008          return 189;
   114009       } else {
   114010          return 189;
   114011       }
   114012    default:
   114013       unreachable("Invalid hardware generation");
   114014    }
   114015 }
   114016 
   114017 
   114018 
   114019 /* CLIP_STATE::Vertex URB Entry Read Length */
   114020 
   114021 
   114022 #define GEN5_CLIP_STATE_VertexURBEntryReadLength_bits  6
   114023 #define GEN45_CLIP_STATE_VertexURBEntryReadLength_bits  6
   114024 #define GEN4_CLIP_STATE_VertexURBEntryReadLength_bits  6
   114025 
   114026 static inline uint32_t ATTRIBUTE_PURE
   114027 CLIP_STATE_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   114028 {
   114029    switch (devinfo->gen) {
   114030    case 10: return 0;
   114031    case 9: return 0;
   114032    case 8: return 0;
   114033    case 7:
   114034       if (devinfo->is_haswell) {
   114035          return 0;
   114036       } else {
   114037          return 0;
   114038       }
   114039    case 6: return 0;
   114040    case 5: return 6;
   114041    case 4:
   114042       if (devinfo->is_g4x) {
   114043          return 6;
   114044       } else {
   114045          return 6;
   114046       }
   114047    default:
   114048       unreachable("Invalid hardware generation");
   114049    }
   114050 }
   114051 
   114052 
   114053 
   114054 #define GEN5_CLIP_STATE_VertexURBEntryReadLength_start  107
   114055 #define GEN45_CLIP_STATE_VertexURBEntryReadLength_start  107
   114056 #define GEN4_CLIP_STATE_VertexURBEntryReadLength_start  107
   114057 
   114058 static inline uint32_t ATTRIBUTE_PURE
   114059 CLIP_STATE_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   114060 {
   114061    switch (devinfo->gen) {
   114062    case 10: return 0;
   114063    case 9: return 0;
   114064    case 8: return 0;
   114065    case 7:
   114066       if (devinfo->is_haswell) {
   114067          return 0;
   114068       } else {
   114069          return 0;
   114070       }
   114071    case 6: return 0;
   114072    case 5: return 107;
   114073    case 4:
   114074       if (devinfo->is_g4x) {
   114075          return 107;
   114076       } else {
   114077          return 107;
   114078       }
   114079    default:
   114080       unreachable("Invalid hardware generation");
   114081    }
   114082 }
   114083 
   114084 
   114085 
   114086 /* CLIP_STATE::Vertex URB Entry Read Offset */
   114087 
   114088 
   114089 #define GEN5_CLIP_STATE_VertexURBEntryReadOffset_bits  6
   114090 #define GEN45_CLIP_STATE_VertexURBEntryReadOffset_bits  6
   114091 #define GEN4_CLIP_STATE_VertexURBEntryReadOffset_bits  6
   114092 
   114093 static inline uint32_t ATTRIBUTE_PURE
   114094 CLIP_STATE_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   114095 {
   114096    switch (devinfo->gen) {
   114097    case 10: return 0;
   114098    case 9: return 0;
   114099    case 8: return 0;
   114100    case 7:
   114101       if (devinfo->is_haswell) {
   114102          return 0;
   114103       } else {
   114104          return 0;
   114105       }
   114106    case 6: return 0;
   114107    case 5: return 6;
   114108    case 4:
   114109       if (devinfo->is_g4x) {
   114110          return 6;
   114111       } else {
   114112          return 6;
   114113       }
   114114    default:
   114115       unreachable("Invalid hardware generation");
   114116    }
   114117 }
   114118 
   114119 
   114120 
   114121 #define GEN5_CLIP_STATE_VertexURBEntryReadOffset_start  100
   114122 #define GEN45_CLIP_STATE_VertexURBEntryReadOffset_start  100
   114123 #define GEN4_CLIP_STATE_VertexURBEntryReadOffset_start  100
   114124 
   114125 static inline uint32_t ATTRIBUTE_PURE
   114126 CLIP_STATE_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   114127 {
   114128    switch (devinfo->gen) {
   114129    case 10: return 0;
   114130    case 9: return 0;
   114131    case 8: return 0;
   114132    case 7:
   114133       if (devinfo->is_haswell) {
   114134          return 0;
   114135       } else {
   114136          return 0;
   114137       }
   114138    case 6: return 0;
   114139    case 5: return 100;
   114140    case 4:
   114141       if (devinfo->is_g4x) {
   114142          return 100;
   114143       } else {
   114144          return 100;
   114145       }
   114146    default:
   114147       unreachable("Invalid hardware generation");
   114148    }
   114149 }
   114150 
   114151 
   114152 
   114153 /* CLIP_STATE::Viewport XY ClipTest Enable */
   114154 
   114155 
   114156 #define GEN5_CLIP_STATE_ViewportXYClipTestEnable_bits  1
   114157 #define GEN45_CLIP_STATE_ViewportXYClipTestEnable_bits  1
   114158 #define GEN4_CLIP_STATE_ViewportXYClipTestEnable_bits  1
   114159 
   114160 static inline uint32_t ATTRIBUTE_PURE
   114161 CLIP_STATE_ViewportXYClipTestEnable_bits(const struct gen_device_info *devinfo)
   114162 {
   114163    switch (devinfo->gen) {
   114164    case 10: return 0;
   114165    case 9: return 0;
   114166    case 8: return 0;
   114167    case 7:
   114168       if (devinfo->is_haswell) {
   114169          return 0;
   114170       } else {
   114171          return 0;
   114172       }
   114173    case 6: return 0;
   114174    case 5: return 1;
   114175    case 4:
   114176       if (devinfo->is_g4x) {
   114177          return 1;
   114178       } else {
   114179          return 1;
   114180       }
   114181    default:
   114182       unreachable("Invalid hardware generation");
   114183    }
   114184 }
   114185 
   114186 
   114187 
   114188 #define GEN5_CLIP_STATE_ViewportXYClipTestEnable_start  188
   114189 #define GEN45_CLIP_STATE_ViewportXYClipTestEnable_start  188
   114190 #define GEN4_CLIP_STATE_ViewportXYClipTestEnable_start  188
   114191 
   114192 static inline uint32_t ATTRIBUTE_PURE
   114193 CLIP_STATE_ViewportXYClipTestEnable_start(const struct gen_device_info *devinfo)
   114194 {
   114195    switch (devinfo->gen) {
   114196    case 10: return 0;
   114197    case 9: return 0;
   114198    case 8: return 0;
   114199    case 7:
   114200       if (devinfo->is_haswell) {
   114201          return 0;
   114202       } else {
   114203          return 0;
   114204       }
   114205    case 6: return 0;
   114206    case 5: return 188;
   114207    case 4:
   114208       if (devinfo->is_g4x) {
   114209          return 188;
   114210       } else {
   114211          return 188;
   114212       }
   114213    default:
   114214       unreachable("Invalid hardware generation");
   114215    }
   114216 }
   114217 
   114218 
   114219 
   114220 /* CLIP_STATE::Viewport Z ClipTest Enable */
   114221 
   114222 
   114223 #define GEN5_CLIP_STATE_ViewportZClipTestEnable_bits  1
   114224 #define GEN45_CLIP_STATE_ViewportZClipTestEnable_bits  1
   114225 #define GEN4_CLIP_STATE_ViewportZClipTestEnable_bits  1
   114226 
   114227 static inline uint32_t ATTRIBUTE_PURE
   114228 CLIP_STATE_ViewportZClipTestEnable_bits(const struct gen_device_info *devinfo)
   114229 {
   114230    switch (devinfo->gen) {
   114231    case 10: return 0;
   114232    case 9: return 0;
   114233    case 8: return 0;
   114234    case 7:
   114235       if (devinfo->is_haswell) {
   114236          return 0;
   114237       } else {
   114238          return 0;
   114239       }
   114240    case 6: return 0;
   114241    case 5: return 1;
   114242    case 4:
   114243       if (devinfo->is_g4x) {
   114244          return 1;
   114245       } else {
   114246          return 1;
   114247       }
   114248    default:
   114249       unreachable("Invalid hardware generation");
   114250    }
   114251 }
   114252 
   114253 
   114254 
   114255 #define GEN5_CLIP_STATE_ViewportZClipTestEnable_start  187
   114256 #define GEN45_CLIP_STATE_ViewportZClipTestEnable_start  187
   114257 #define GEN4_CLIP_STATE_ViewportZClipTestEnable_start  187
   114258 
   114259 static inline uint32_t ATTRIBUTE_PURE
   114260 CLIP_STATE_ViewportZClipTestEnable_start(const struct gen_device_info *devinfo)
   114261 {
   114262    switch (devinfo->gen) {
   114263    case 10: return 0;
   114264    case 9: return 0;
   114265    case 8: return 0;
   114266    case 7:
   114267       if (devinfo->is_haswell) {
   114268          return 0;
   114269       } else {
   114270          return 0;
   114271       }
   114272    case 6: return 0;
   114273    case 5: return 187;
   114274    case 4:
   114275       if (devinfo->is_g4x) {
   114276          return 187;
   114277       } else {
   114278          return 187;
   114279       }
   114280    default:
   114281       unreachable("Invalid hardware generation");
   114282    }
   114283 }
   114284 
   114285 
   114286 
   114287 /* CLIP_VIEWPORT */
   114288 
   114289 
   114290 #define GEN6_CLIP_VIEWPORT_length  4
   114291 #define GEN5_CLIP_VIEWPORT_length  4
   114292 #define GEN45_CLIP_VIEWPORT_length  4
   114293 #define GEN4_CLIP_VIEWPORT_length  4
   114294 
   114295 static inline uint32_t ATTRIBUTE_PURE
   114296 CLIP_VIEWPORT_length(const struct gen_device_info *devinfo)
   114297 {
   114298    switch (devinfo->gen) {
   114299    case 10: return 0;
   114300    case 9: return 0;
   114301    case 8: return 0;
   114302    case 7:
   114303       if (devinfo->is_haswell) {
   114304          return 0;
   114305       } else {
   114306          return 0;
   114307       }
   114308    case 6: return 4;
   114309    case 5: return 4;
   114310    case 4:
   114311       if (devinfo->is_g4x) {
   114312          return 4;
   114313       } else {
   114314          return 4;
   114315       }
   114316    default:
   114317       unreachable("Invalid hardware generation");
   114318    }
   114319 }
   114320 
   114321 
   114322 
   114323 /* CLIP_VIEWPORT::XMax Clip Guardband */
   114324 
   114325 
   114326 #define GEN6_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   114327 #define GEN5_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   114328 #define GEN45_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   114329 #define GEN4_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   114330 
   114331 static inline uint32_t ATTRIBUTE_PURE
   114332 CLIP_VIEWPORT_XMaxClipGuardband_bits(const struct gen_device_info *devinfo)
   114333 {
   114334    switch (devinfo->gen) {
   114335    case 10: return 0;
   114336    case 9: return 0;
   114337    case 8: return 0;
   114338    case 7:
   114339       if (devinfo->is_haswell) {
   114340          return 0;
   114341       } else {
   114342          return 0;
   114343       }
   114344    case 6: return 32;
   114345    case 5: return 32;
   114346    case 4:
   114347       if (devinfo->is_g4x) {
   114348          return 32;
   114349       } else {
   114350          return 32;
   114351       }
   114352    default:
   114353       unreachable("Invalid hardware generation");
   114354    }
   114355 }
   114356 
   114357 
   114358 
   114359 #define GEN6_CLIP_VIEWPORT_XMaxClipGuardband_start  32
   114360 #define GEN5_CLIP_VIEWPORT_XMaxClipGuardband_start  32
   114361 #define GEN45_CLIP_VIEWPORT_XMaxClipGuardband_start  32
   114362 #define GEN4_CLIP_VIEWPORT_XMaxClipGuardband_start  32
   114363 
   114364 static inline uint32_t ATTRIBUTE_PURE
   114365 CLIP_VIEWPORT_XMaxClipGuardband_start(const struct gen_device_info *devinfo)
   114366 {
   114367    switch (devinfo->gen) {
   114368    case 10: return 0;
   114369    case 9: return 0;
   114370    case 8: return 0;
   114371    case 7:
   114372       if (devinfo->is_haswell) {
   114373          return 0;
   114374       } else {
   114375          return 0;
   114376       }
   114377    case 6: return 32;
   114378    case 5: return 32;
   114379    case 4:
   114380       if (devinfo->is_g4x) {
   114381          return 32;
   114382       } else {
   114383          return 32;
   114384       }
   114385    default:
   114386       unreachable("Invalid hardware generation");
   114387    }
   114388 }
   114389 
   114390 
   114391 
   114392 /* CLIP_VIEWPORT::XMin Clip Guardband */
   114393 
   114394 
   114395 #define GEN6_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   114396 #define GEN5_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   114397 #define GEN45_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   114398 #define GEN4_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   114399 
   114400 static inline uint32_t ATTRIBUTE_PURE
   114401 CLIP_VIEWPORT_XMinClipGuardband_bits(const struct gen_device_info *devinfo)
   114402 {
   114403    switch (devinfo->gen) {
   114404    case 10: return 0;
   114405    case 9: return 0;
   114406    case 8: return 0;
   114407    case 7:
   114408       if (devinfo->is_haswell) {
   114409          return 0;
   114410       } else {
   114411          return 0;
   114412       }
   114413    case 6: return 32;
   114414    case 5: return 32;
   114415    case 4:
   114416       if (devinfo->is_g4x) {
   114417          return 32;
   114418       } else {
   114419          return 32;
   114420       }
   114421    default:
   114422       unreachable("Invalid hardware generation");
   114423    }
   114424 }
   114425 
   114426 
   114427 
   114428 #define GEN6_CLIP_VIEWPORT_XMinClipGuardband_start  0
   114429 #define GEN5_CLIP_VIEWPORT_XMinClipGuardband_start  0
   114430 #define GEN45_CLIP_VIEWPORT_XMinClipGuardband_start  0
   114431 #define GEN4_CLIP_VIEWPORT_XMinClipGuardband_start  0
   114432 
   114433 static inline uint32_t ATTRIBUTE_PURE
   114434 CLIP_VIEWPORT_XMinClipGuardband_start(const struct gen_device_info *devinfo)
   114435 {
   114436    switch (devinfo->gen) {
   114437    case 10: return 0;
   114438    case 9: return 0;
   114439    case 8: return 0;
   114440    case 7:
   114441       if (devinfo->is_haswell) {
   114442          return 0;
   114443       } else {
   114444          return 0;
   114445       }
   114446    case 6: return 0;
   114447    case 5: return 0;
   114448    case 4:
   114449       if (devinfo->is_g4x) {
   114450          return 0;
   114451       } else {
   114452          return 0;
   114453       }
   114454    default:
   114455       unreachable("Invalid hardware generation");
   114456    }
   114457 }
   114458 
   114459 
   114460 
   114461 /* CLIP_VIEWPORT::YMax Clip Guardband */
   114462 
   114463 
   114464 #define GEN6_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   114465 #define GEN5_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   114466 #define GEN45_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   114467 #define GEN4_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   114468 
   114469 static inline uint32_t ATTRIBUTE_PURE
   114470 CLIP_VIEWPORT_YMaxClipGuardband_bits(const struct gen_device_info *devinfo)
   114471 {
   114472    switch (devinfo->gen) {
   114473    case 10: return 0;
   114474    case 9: return 0;
   114475    case 8: return 0;
   114476    case 7:
   114477       if (devinfo->is_haswell) {
   114478          return 0;
   114479       } else {
   114480          return 0;
   114481       }
   114482    case 6: return 32;
   114483    case 5: return 32;
   114484    case 4:
   114485       if (devinfo->is_g4x) {
   114486          return 32;
   114487       } else {
   114488          return 32;
   114489       }
   114490    default:
   114491       unreachable("Invalid hardware generation");
   114492    }
   114493 }
   114494 
   114495 
   114496 
   114497 #define GEN6_CLIP_VIEWPORT_YMaxClipGuardband_start  96
   114498 #define GEN5_CLIP_VIEWPORT_YMaxClipGuardband_start  96
   114499 #define GEN45_CLIP_VIEWPORT_YMaxClipGuardband_start  96
   114500 #define GEN4_CLIP_VIEWPORT_YMaxClipGuardband_start  96
   114501 
   114502 static inline uint32_t ATTRIBUTE_PURE
   114503 CLIP_VIEWPORT_YMaxClipGuardband_start(const struct gen_device_info *devinfo)
   114504 {
   114505    switch (devinfo->gen) {
   114506    case 10: return 0;
   114507    case 9: return 0;
   114508    case 8: return 0;
   114509    case 7:
   114510       if (devinfo->is_haswell) {
   114511          return 0;
   114512       } else {
   114513          return 0;
   114514       }
   114515    case 6: return 96;
   114516    case 5: return 96;
   114517    case 4:
   114518       if (devinfo->is_g4x) {
   114519          return 96;
   114520       } else {
   114521          return 96;
   114522       }
   114523    default:
   114524       unreachable("Invalid hardware generation");
   114525    }
   114526 }
   114527 
   114528 
   114529 
   114530 /* CLIP_VIEWPORT::YMin Clip Guardband */
   114531 
   114532 
   114533 #define GEN6_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   114534 #define GEN5_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   114535 #define GEN45_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   114536 #define GEN4_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   114537 
   114538 static inline uint32_t ATTRIBUTE_PURE
   114539 CLIP_VIEWPORT_YMinClipGuardband_bits(const struct gen_device_info *devinfo)
   114540 {
   114541    switch (devinfo->gen) {
   114542    case 10: return 0;
   114543    case 9: return 0;
   114544    case 8: return 0;
   114545    case 7:
   114546       if (devinfo->is_haswell) {
   114547          return 0;
   114548       } else {
   114549          return 0;
   114550       }
   114551    case 6: return 32;
   114552    case 5: return 32;
   114553    case 4:
   114554       if (devinfo->is_g4x) {
   114555          return 32;
   114556       } else {
   114557          return 32;
   114558       }
   114559    default:
   114560       unreachable("Invalid hardware generation");
   114561    }
   114562 }
   114563 
   114564 
   114565 
   114566 #define GEN6_CLIP_VIEWPORT_YMinClipGuardband_start  64
   114567 #define GEN5_CLIP_VIEWPORT_YMinClipGuardband_start  64
   114568 #define GEN45_CLIP_VIEWPORT_YMinClipGuardband_start  64
   114569 #define GEN4_CLIP_VIEWPORT_YMinClipGuardband_start  64
   114570 
   114571 static inline uint32_t ATTRIBUTE_PURE
   114572 CLIP_VIEWPORT_YMinClipGuardband_start(const struct gen_device_info *devinfo)
   114573 {
   114574    switch (devinfo->gen) {
   114575    case 10: return 0;
   114576    case 9: return 0;
   114577    case 8: return 0;
   114578    case 7:
   114579       if (devinfo->is_haswell) {
   114580          return 0;
   114581       } else {
   114582          return 0;
   114583       }
   114584    case 6: return 64;
   114585    case 5: return 64;
   114586    case 4:
   114587       if (devinfo->is_g4x) {
   114588          return 64;
   114589       } else {
   114590          return 64;
   114591       }
   114592    default:
   114593       unreachable("Invalid hardware generation");
   114594    }
   114595 }
   114596 
   114597 
   114598 
   114599 /* CL_INVOCATION_COUNT */
   114600 
   114601 
   114602 #define GEN10_CL_INVOCATION_COUNT_length  2
   114603 #define GEN9_CL_INVOCATION_COUNT_length  2
   114604 #define GEN8_CL_INVOCATION_COUNT_length  2
   114605 #define GEN75_CL_INVOCATION_COUNT_length  2
   114606 #define GEN7_CL_INVOCATION_COUNT_length  2
   114607 
   114608 static inline uint32_t ATTRIBUTE_PURE
   114609 CL_INVOCATION_COUNT_length(const struct gen_device_info *devinfo)
   114610 {
   114611    switch (devinfo->gen) {
   114612    case 10: return 2;
   114613    case 9: return 2;
   114614    case 8: return 2;
   114615    case 7:
   114616       if (devinfo->is_haswell) {
   114617          return 2;
   114618       } else {
   114619          return 2;
   114620       }
   114621    case 6: return 0;
   114622    case 5: return 0;
   114623    case 4:
   114624       if (devinfo->is_g4x) {
   114625          return 0;
   114626       } else {
   114627          return 0;
   114628       }
   114629    default:
   114630       unreachable("Invalid hardware generation");
   114631    }
   114632 }
   114633 
   114634 
   114635 
   114636 /* CL_INVOCATION_COUNT::CL Invocation Count Report */
   114637 
   114638 
   114639 #define GEN10_CL_INVOCATION_COUNT_CLInvocationCountReport_bits  64
   114640 #define GEN9_CL_INVOCATION_COUNT_CLInvocationCountReport_bits  64
   114641 #define GEN8_CL_INVOCATION_COUNT_CLInvocationCountReport_bits  64
   114642 #define GEN75_CL_INVOCATION_COUNT_CLInvocationCountReport_bits  64
   114643 #define GEN7_CL_INVOCATION_COUNT_CLInvocationCountReport_bits  64
   114644 
   114645 static inline uint32_t ATTRIBUTE_PURE
   114646 CL_INVOCATION_COUNT_CLInvocationCountReport_bits(const struct gen_device_info *devinfo)
   114647 {
   114648    switch (devinfo->gen) {
   114649    case 10: return 64;
   114650    case 9: return 64;
   114651    case 8: return 64;
   114652    case 7:
   114653       if (devinfo->is_haswell) {
   114654          return 64;
   114655       } else {
   114656          return 64;
   114657       }
   114658    case 6: return 0;
   114659    case 5: return 0;
   114660    case 4:
   114661       if (devinfo->is_g4x) {
   114662          return 0;
   114663       } else {
   114664          return 0;
   114665       }
   114666    default:
   114667       unreachable("Invalid hardware generation");
   114668    }
   114669 }
   114670 
   114671 
   114672 
   114673 #define GEN10_CL_INVOCATION_COUNT_CLInvocationCountReport_start  0
   114674 #define GEN9_CL_INVOCATION_COUNT_CLInvocationCountReport_start  0
   114675 #define GEN8_CL_INVOCATION_COUNT_CLInvocationCountReport_start  0
   114676 #define GEN75_CL_INVOCATION_COUNT_CLInvocationCountReport_start  0
   114677 #define GEN7_CL_INVOCATION_COUNT_CLInvocationCountReport_start  0
   114678 
   114679 static inline uint32_t ATTRIBUTE_PURE
   114680 CL_INVOCATION_COUNT_CLInvocationCountReport_start(const struct gen_device_info *devinfo)
   114681 {
   114682    switch (devinfo->gen) {
   114683    case 10: return 0;
   114684    case 9: return 0;
   114685    case 8: return 0;
   114686    case 7:
   114687       if (devinfo->is_haswell) {
   114688          return 0;
   114689       } else {
   114690          return 0;
   114691       }
   114692    case 6: return 0;
   114693    case 5: return 0;
   114694    case 4:
   114695       if (devinfo->is_g4x) {
   114696          return 0;
   114697       } else {
   114698          return 0;
   114699       }
   114700    default:
   114701       unreachable("Invalid hardware generation");
   114702    }
   114703 }
   114704 
   114705 
   114706 
   114707 /* CL_PRIMITIVES_COUNT */
   114708 
   114709 
   114710 #define GEN10_CL_PRIMITIVES_COUNT_length  2
   114711 #define GEN9_CL_PRIMITIVES_COUNT_length  2
   114712 #define GEN8_CL_PRIMITIVES_COUNT_length  2
   114713 #define GEN75_CL_PRIMITIVES_COUNT_length  2
   114714 #define GEN7_CL_PRIMITIVES_COUNT_length  2
   114715 
   114716 static inline uint32_t ATTRIBUTE_PURE
   114717 CL_PRIMITIVES_COUNT_length(const struct gen_device_info *devinfo)
   114718 {
   114719    switch (devinfo->gen) {
   114720    case 10: return 2;
   114721    case 9: return 2;
   114722    case 8: return 2;
   114723    case 7:
   114724       if (devinfo->is_haswell) {
   114725          return 2;
   114726       } else {
   114727          return 2;
   114728       }
   114729    case 6: return 0;
   114730    case 5: return 0;
   114731    case 4:
   114732       if (devinfo->is_g4x) {
   114733          return 0;
   114734       } else {
   114735          return 0;
   114736       }
   114737    default:
   114738       unreachable("Invalid hardware generation");
   114739    }
   114740 }
   114741 
   114742 
   114743 
   114744 /* CL_PRIMITIVES_COUNT::CL Primitives Count Report */
   114745 
   114746 
   114747 #define GEN10_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_bits  64
   114748 #define GEN9_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_bits  64
   114749 #define GEN8_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_bits  64
   114750 #define GEN75_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_bits  64
   114751 #define GEN7_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_bits  64
   114752 
   114753 static inline uint32_t ATTRIBUTE_PURE
   114754 CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_bits(const struct gen_device_info *devinfo)
   114755 {
   114756    switch (devinfo->gen) {
   114757    case 10: return 64;
   114758    case 9: return 64;
   114759    case 8: return 64;
   114760    case 7:
   114761       if (devinfo->is_haswell) {
   114762          return 64;
   114763       } else {
   114764          return 64;
   114765       }
   114766    case 6: return 0;
   114767    case 5: return 0;
   114768    case 4:
   114769       if (devinfo->is_g4x) {
   114770          return 0;
   114771       } else {
   114772          return 0;
   114773       }
   114774    default:
   114775       unreachable("Invalid hardware generation");
   114776    }
   114777 }
   114778 
   114779 
   114780 
   114781 #define GEN10_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_start  0
   114782 #define GEN9_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_start  0
   114783 #define GEN8_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_start  0
   114784 #define GEN75_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_start  0
   114785 #define GEN7_CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_start  0
   114786 
   114787 static inline uint32_t ATTRIBUTE_PURE
   114788 CL_PRIMITIVES_COUNT_CLPrimitivesCountReport_start(const struct gen_device_info *devinfo)
   114789 {
   114790    switch (devinfo->gen) {
   114791    case 10: return 0;
   114792    case 9: return 0;
   114793    case 8: return 0;
   114794    case 7:
   114795       if (devinfo->is_haswell) {
   114796          return 0;
   114797       } else {
   114798          return 0;
   114799       }
   114800    case 6: return 0;
   114801    case 5: return 0;
   114802    case 4:
   114803       if (devinfo->is_g4x) {
   114804          return 0;
   114805       } else {
   114806          return 0;
   114807       }
   114808    default:
   114809       unreachable("Invalid hardware generation");
   114810    }
   114811 }
   114812 
   114813 
   114814 
   114815 /* COLOR_CALC_STATE */
   114816 
   114817 
   114818 #define GEN10_COLOR_CALC_STATE_length  6
   114819 #define GEN9_COLOR_CALC_STATE_length  6
   114820 #define GEN8_COLOR_CALC_STATE_length  6
   114821 #define GEN75_COLOR_CALC_STATE_length  6
   114822 #define GEN7_COLOR_CALC_STATE_length  6
   114823 #define GEN6_COLOR_CALC_STATE_length  6
   114824 #define GEN5_COLOR_CALC_STATE_length  8
   114825 #define GEN45_COLOR_CALC_STATE_length  8
   114826 #define GEN4_COLOR_CALC_STATE_length  8
   114827 
   114828 static inline uint32_t ATTRIBUTE_PURE
   114829 COLOR_CALC_STATE_length(const struct gen_device_info *devinfo)
   114830 {
   114831    switch (devinfo->gen) {
   114832    case 10: return 6;
   114833    case 9: return 6;
   114834    case 8: return 6;
   114835    case 7:
   114836       if (devinfo->is_haswell) {
   114837          return 6;
   114838       } else {
   114839          return 6;
   114840       }
   114841    case 6: return 6;
   114842    case 5: return 8;
   114843    case 4:
   114844       if (devinfo->is_g4x) {
   114845          return 8;
   114846       } else {
   114847          return 8;
   114848       }
   114849    default:
   114850       unreachable("Invalid hardware generation");
   114851    }
   114852 }
   114853 
   114854 
   114855 
   114856 /* COLOR_CALC_STATE::Alpha Blend Function */
   114857 
   114858 
   114859 #define GEN5_COLOR_CALC_STATE_AlphaBlendFunction_bits  3
   114860 #define GEN45_COLOR_CALC_STATE_AlphaBlendFunction_bits  3
   114861 #define GEN4_COLOR_CALC_STATE_AlphaBlendFunction_bits  3
   114862 
   114863 static inline uint32_t ATTRIBUTE_PURE
   114864 COLOR_CALC_STATE_AlphaBlendFunction_bits(const struct gen_device_info *devinfo)
   114865 {
   114866    switch (devinfo->gen) {
   114867    case 10: return 0;
   114868    case 9: return 0;
   114869    case 8: return 0;
   114870    case 7:
   114871       if (devinfo->is_haswell) {
   114872          return 0;
   114873       } else {
   114874          return 0;
   114875       }
   114876    case 6: return 0;
   114877    case 5: return 3;
   114878    case 4:
   114879       if (devinfo->is_g4x) {
   114880          return 3;
   114881       } else {
   114882          return 3;
   114883       }
   114884    default:
   114885       unreachable("Invalid hardware generation");
   114886    }
   114887 }
   114888 
   114889 
   114890 
   114891 #define GEN5_COLOR_CALC_STATE_AlphaBlendFunction_start  172
   114892 #define GEN45_COLOR_CALC_STATE_AlphaBlendFunction_start  172
   114893 #define GEN4_COLOR_CALC_STATE_AlphaBlendFunction_start  172
   114894 
   114895 static inline uint32_t ATTRIBUTE_PURE
   114896 COLOR_CALC_STATE_AlphaBlendFunction_start(const struct gen_device_info *devinfo)
   114897 {
   114898    switch (devinfo->gen) {
   114899    case 10: return 0;
   114900    case 9: return 0;
   114901    case 8: return 0;
   114902    case 7:
   114903       if (devinfo->is_haswell) {
   114904          return 0;
   114905       } else {
   114906          return 0;
   114907       }
   114908    case 6: return 0;
   114909    case 5: return 172;
   114910    case 4:
   114911       if (devinfo->is_g4x) {
   114912          return 172;
   114913       } else {
   114914          return 172;
   114915       }
   114916    default:
   114917       unreachable("Invalid hardware generation");
   114918    }
   114919 }
   114920 
   114921 
   114922 
   114923 /* COLOR_CALC_STATE::Alpha Reference Value As FLOAT32 */
   114924 
   114925 
   114926 #define GEN10_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114927 #define GEN9_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114928 #define GEN8_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114929 #define GEN75_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114930 #define GEN7_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114931 #define GEN6_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114932 #define GEN5_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114933 #define GEN45_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114934 #define GEN4_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits  32
   114935 
   114936 static inline uint32_t ATTRIBUTE_PURE
   114937 COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_bits(const struct gen_device_info *devinfo)
   114938 {
   114939    switch (devinfo->gen) {
   114940    case 10: return 32;
   114941    case 9: return 32;
   114942    case 8: return 32;
   114943    case 7:
   114944       if (devinfo->is_haswell) {
   114945          return 32;
   114946       } else {
   114947          return 32;
   114948       }
   114949    case 6: return 32;
   114950    case 5: return 32;
   114951    case 4:
   114952       if (devinfo->is_g4x) {
   114953          return 32;
   114954       } else {
   114955          return 32;
   114956       }
   114957    default:
   114958       unreachable("Invalid hardware generation");
   114959    }
   114960 }
   114961 
   114962 
   114963 
   114964 #define GEN10_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  32
   114965 #define GEN9_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  32
   114966 #define GEN8_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  32
   114967 #define GEN75_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  32
   114968 #define GEN7_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  32
   114969 #define GEN6_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  32
   114970 #define GEN5_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  224
   114971 #define GEN45_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  224
   114972 #define GEN4_COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start  224
   114973 
   114974 static inline uint32_t ATTRIBUTE_PURE
   114975 COLOR_CALC_STATE_AlphaReferenceValueAsFLOAT32_start(const struct gen_device_info *devinfo)
   114976 {
   114977    switch (devinfo->gen) {
   114978    case 10: return 32;
   114979    case 9: return 32;
   114980    case 8: return 32;
   114981    case 7:
   114982       if (devinfo->is_haswell) {
   114983          return 32;
   114984       } else {
   114985          return 32;
   114986       }
   114987    case 6: return 32;
   114988    case 5: return 224;
   114989    case 4:
   114990       if (devinfo->is_g4x) {
   114991          return 224;
   114992       } else {
   114993          return 224;
   114994       }
   114995    default:
   114996       unreachable("Invalid hardware generation");
   114997    }
   114998 }
   114999 
   115000 
   115001 
   115002 /* COLOR_CALC_STATE::Alpha Reference Value As UNORM8 */
   115003 
   115004 
   115005 #define GEN10_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115006 #define GEN9_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115007 #define GEN8_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115008 #define GEN75_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115009 #define GEN7_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115010 #define GEN6_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115011 #define GEN5_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115012 #define GEN45_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115013 #define GEN4_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits  32
   115014 
   115015 static inline uint32_t ATTRIBUTE_PURE
   115016 COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_bits(const struct gen_device_info *devinfo)
   115017 {
   115018    switch (devinfo->gen) {
   115019    case 10: return 32;
   115020    case 9: return 32;
   115021    case 8: return 32;
   115022    case 7:
   115023       if (devinfo->is_haswell) {
   115024          return 32;
   115025       } else {
   115026          return 32;
   115027       }
   115028    case 6: return 32;
   115029    case 5: return 32;
   115030    case 4:
   115031       if (devinfo->is_g4x) {
   115032          return 32;
   115033       } else {
   115034          return 32;
   115035       }
   115036    default:
   115037       unreachable("Invalid hardware generation");
   115038    }
   115039 }
   115040 
   115041 
   115042 
   115043 #define GEN10_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  32
   115044 #define GEN9_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  32
   115045 #define GEN8_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  32
   115046 #define GEN75_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  32
   115047 #define GEN7_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  32
   115048 #define GEN6_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  32
   115049 #define GEN5_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  224
   115050 #define GEN45_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  224
   115051 #define GEN4_COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start  224
   115052 
   115053 static inline uint32_t ATTRIBUTE_PURE
   115054 COLOR_CALC_STATE_AlphaReferenceValueAsUNORM8_start(const struct gen_device_info *devinfo)
   115055 {
   115056    switch (devinfo->gen) {
   115057    case 10: return 32;
   115058    case 9: return 32;
   115059    case 8: return 32;
   115060    case 7:
   115061       if (devinfo->is_haswell) {
   115062          return 32;
   115063       } else {
   115064          return 32;
   115065       }
   115066    case 6: return 32;
   115067    case 5: return 224;
   115068    case 4:
   115069       if (devinfo->is_g4x) {
   115070          return 224;
   115071       } else {
   115072          return 224;
   115073       }
   115074    default:
   115075       unreachable("Invalid hardware generation");
   115076    }
   115077 }
   115078 
   115079 
   115080 
   115081 /* COLOR_CALC_STATE::Alpha Test Enable */
   115082 
   115083 
   115084 #define GEN5_COLOR_CALC_STATE_AlphaTestEnable_bits  1
   115085 #define GEN45_COLOR_CALC_STATE_AlphaTestEnable_bits  1
   115086 #define GEN4_COLOR_CALC_STATE_AlphaTestEnable_bits  1
   115087 
   115088 static inline uint32_t ATTRIBUTE_PURE
   115089 COLOR_CALC_STATE_AlphaTestEnable_bits(const struct gen_device_info *devinfo)
   115090 {
   115091    switch (devinfo->gen) {
   115092    case 10: return 0;
   115093    case 9: return 0;
   115094    case 8: return 0;
   115095    case 7:
   115096       if (devinfo->is_haswell) {
   115097          return 0;
   115098       } else {
   115099          return 0;
   115100       }
   115101    case 6: return 0;
   115102    case 5: return 1;
   115103    case 4:
   115104       if (devinfo->is_g4x) {
   115105          return 1;
   115106       } else {
   115107          return 1;
   115108       }
   115109    default:
   115110       unreachable("Invalid hardware generation");
   115111    }
   115112 }
   115113 
   115114 
   115115 
   115116 #define GEN5_COLOR_CALC_STATE_AlphaTestEnable_start  107
   115117 #define GEN45_COLOR_CALC_STATE_AlphaTestEnable_start  107
   115118 #define GEN4_COLOR_CALC_STATE_AlphaTestEnable_start  107
   115119 
   115120 static inline uint32_t ATTRIBUTE_PURE
   115121 COLOR_CALC_STATE_AlphaTestEnable_start(const struct gen_device_info *devinfo)
   115122 {
   115123    switch (devinfo->gen) {
   115124    case 10: return 0;
   115125    case 9: return 0;
   115126    case 8: return 0;
   115127    case 7:
   115128       if (devinfo->is_haswell) {
   115129          return 0;
   115130       } else {
   115131          return 0;
   115132       }
   115133    case 6: return 0;
   115134    case 5: return 107;
   115135    case 4:
   115136       if (devinfo->is_g4x) {
   115137          return 107;
   115138       } else {
   115139          return 107;
   115140       }
   115141    default:
   115142       unreachable("Invalid hardware generation");
   115143    }
   115144 }
   115145 
   115146 
   115147 
   115148 /* COLOR_CALC_STATE::Alpha Test Format */
   115149 
   115150 
   115151 #define GEN10_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115152 #define GEN9_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115153 #define GEN8_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115154 #define GEN75_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115155 #define GEN7_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115156 #define GEN6_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115157 #define GEN5_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115158 #define GEN45_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115159 #define GEN4_COLOR_CALC_STATE_AlphaTestFormat_bits  1
   115160 
   115161 static inline uint32_t ATTRIBUTE_PURE
   115162 COLOR_CALC_STATE_AlphaTestFormat_bits(const struct gen_device_info *devinfo)
   115163 {
   115164    switch (devinfo->gen) {
   115165    case 10: return 1;
   115166    case 9: return 1;
   115167    case 8: return 1;
   115168    case 7:
   115169       if (devinfo->is_haswell) {
   115170          return 1;
   115171       } else {
   115172          return 1;
   115173       }
   115174    case 6: return 1;
   115175    case 5: return 1;
   115176    case 4:
   115177       if (devinfo->is_g4x) {
   115178          return 1;
   115179       } else {
   115180          return 1;
   115181       }
   115182    default:
   115183       unreachable("Invalid hardware generation");
   115184    }
   115185 }
   115186 
   115187 
   115188 
   115189 #define GEN10_COLOR_CALC_STATE_AlphaTestFormat_start  0
   115190 #define GEN9_COLOR_CALC_STATE_AlphaTestFormat_start  0
   115191 #define GEN8_COLOR_CALC_STATE_AlphaTestFormat_start  0
   115192 #define GEN75_COLOR_CALC_STATE_AlphaTestFormat_start  0
   115193 #define GEN7_COLOR_CALC_STATE_AlphaTestFormat_start  0
   115194 #define GEN6_COLOR_CALC_STATE_AlphaTestFormat_start  0
   115195 #define GEN5_COLOR_CALC_STATE_AlphaTestFormat_start  111
   115196 #define GEN45_COLOR_CALC_STATE_AlphaTestFormat_start  111
   115197 #define GEN4_COLOR_CALC_STATE_AlphaTestFormat_start  111
   115198 
   115199 static inline uint32_t ATTRIBUTE_PURE
   115200 COLOR_CALC_STATE_AlphaTestFormat_start(const struct gen_device_info *devinfo)
   115201 {
   115202    switch (devinfo->gen) {
   115203    case 10: return 0;
   115204    case 9: return 0;
   115205    case 8: return 0;
   115206    case 7:
   115207       if (devinfo->is_haswell) {
   115208          return 0;
   115209       } else {
   115210          return 0;
   115211       }
   115212    case 6: return 0;
   115213    case 5: return 111;
   115214    case 4:
   115215       if (devinfo->is_g4x) {
   115216          return 111;
   115217       } else {
   115218          return 111;
   115219       }
   115220    default:
   115221       unreachable("Invalid hardware generation");
   115222    }
   115223 }
   115224 
   115225 
   115226 
   115227 /* COLOR_CALC_STATE::Alpha Test Function */
   115228 
   115229 
   115230 #define GEN5_COLOR_CALC_STATE_AlphaTestFunction_bits  3
   115231 #define GEN45_COLOR_CALC_STATE_AlphaTestFunction_bits  3
   115232 #define GEN4_COLOR_CALC_STATE_AlphaTestFunction_bits  3
   115233 
   115234 static inline uint32_t ATTRIBUTE_PURE
   115235 COLOR_CALC_STATE_AlphaTestFunction_bits(const struct gen_device_info *devinfo)
   115236 {
   115237    switch (devinfo->gen) {
   115238    case 10: return 0;
   115239    case 9: return 0;
   115240    case 8: return 0;
   115241    case 7:
   115242       if (devinfo->is_haswell) {
   115243          return 0;
   115244       } else {
   115245          return 0;
   115246       }
   115247    case 6: return 0;
   115248    case 5: return 3;
   115249    case 4:
   115250       if (devinfo->is_g4x) {
   115251          return 3;
   115252       } else {
   115253          return 3;
   115254       }
   115255    default:
   115256       unreachable("Invalid hardware generation");
   115257    }
   115258 }
   115259 
   115260 
   115261 
   115262 #define GEN5_COLOR_CALC_STATE_AlphaTestFunction_start  104
   115263 #define GEN45_COLOR_CALC_STATE_AlphaTestFunction_start  104
   115264 #define GEN4_COLOR_CALC_STATE_AlphaTestFunction_start  104
   115265 
   115266 static inline uint32_t ATTRIBUTE_PURE
   115267 COLOR_CALC_STATE_AlphaTestFunction_start(const struct gen_device_info *devinfo)
   115268 {
   115269    switch (devinfo->gen) {
   115270    case 10: return 0;
   115271    case 9: return 0;
   115272    case 8: return 0;
   115273    case 7:
   115274       if (devinfo->is_haswell) {
   115275          return 0;
   115276       } else {
   115277          return 0;
   115278       }
   115279    case 6: return 0;
   115280    case 5: return 104;
   115281    case 4:
   115282       if (devinfo->is_g4x) {
   115283          return 104;
   115284       } else {
   115285          return 104;
   115286       }
   115287    default:
   115288       unreachable("Invalid hardware generation");
   115289    }
   115290 }
   115291 
   115292 
   115293 
   115294 /* COLOR_CALC_STATE::Backface Stencil Fail Op */
   115295 
   115296 
   115297 #define GEN5_COLOR_CALC_STATE_BackfaceStencilFailOp_bits  3
   115298 #define GEN45_COLOR_CALC_STATE_BackfaceStencilFailOp_bits  3
   115299 #define GEN4_COLOR_CALC_STATE_BackfaceStencilFailOp_bits  3
   115300 
   115301 static inline uint32_t ATTRIBUTE_PURE
   115302 COLOR_CALC_STATE_BackfaceStencilFailOp_bits(const struct gen_device_info *devinfo)
   115303 {
   115304    switch (devinfo->gen) {
   115305    case 10: return 0;
   115306    case 9: return 0;
   115307    case 8: return 0;
   115308    case 7:
   115309       if (devinfo->is_haswell) {
   115310          return 0;
   115311       } else {
   115312          return 0;
   115313       }
   115314    case 6: return 0;
   115315    case 5: return 3;
   115316    case 4:
   115317       if (devinfo->is_g4x) {
   115318          return 3;
   115319       } else {
   115320          return 3;
   115321       }
   115322    default:
   115323       unreachable("Invalid hardware generation");
   115324    }
   115325 }
   115326 
   115327 
   115328 
   115329 #define GEN5_COLOR_CALC_STATE_BackfaceStencilFailOp_start  9
   115330 #define GEN45_COLOR_CALC_STATE_BackfaceStencilFailOp_start  9
   115331 #define GEN4_COLOR_CALC_STATE_BackfaceStencilFailOp_start  9
   115332 
   115333 static inline uint32_t ATTRIBUTE_PURE
   115334 COLOR_CALC_STATE_BackfaceStencilFailOp_start(const struct gen_device_info *devinfo)
   115335 {
   115336    switch (devinfo->gen) {
   115337    case 10: return 0;
   115338    case 9: return 0;
   115339    case 8: return 0;
   115340    case 7:
   115341       if (devinfo->is_haswell) {
   115342          return 0;
   115343       } else {
   115344          return 0;
   115345       }
   115346    case 6: return 0;
   115347    case 5: return 9;
   115348    case 4:
   115349       if (devinfo->is_g4x) {
   115350          return 9;
   115351       } else {
   115352          return 9;
   115353       }
   115354    default:
   115355       unreachable("Invalid hardware generation");
   115356    }
   115357 }
   115358 
   115359 
   115360 
   115361 /* COLOR_CALC_STATE::Backface Stencil Pass Depth Fail Op */
   115362 
   115363 
   115364 #define GEN5_COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_bits  3
   115365 #define GEN45_COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_bits  3
   115366 #define GEN4_COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_bits  3
   115367 
   115368 static inline uint32_t ATTRIBUTE_PURE
   115369 COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_bits(const struct gen_device_info *devinfo)
   115370 {
   115371    switch (devinfo->gen) {
   115372    case 10: return 0;
   115373    case 9: return 0;
   115374    case 8: return 0;
   115375    case 7:
   115376       if (devinfo->is_haswell) {
   115377          return 0;
   115378       } else {
   115379          return 0;
   115380       }
   115381    case 6: return 0;
   115382    case 5: return 3;
   115383    case 4:
   115384       if (devinfo->is_g4x) {
   115385          return 3;
   115386       } else {
   115387          return 3;
   115388       }
   115389    default:
   115390       unreachable("Invalid hardware generation");
   115391    }
   115392 }
   115393 
   115394 
   115395 
   115396 #define GEN5_COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_start  6
   115397 #define GEN45_COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_start  6
   115398 #define GEN4_COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_start  6
   115399 
   115400 static inline uint32_t ATTRIBUTE_PURE
   115401 COLOR_CALC_STATE_BackfaceStencilPassDepthFailOp_start(const struct gen_device_info *devinfo)
   115402 {
   115403    switch (devinfo->gen) {
   115404    case 10: return 0;
   115405    case 9: return 0;
   115406    case 8: return 0;
   115407    case 7:
   115408       if (devinfo->is_haswell) {
   115409          return 0;
   115410       } else {
   115411          return 0;
   115412       }
   115413    case 6: return 0;
   115414    case 5: return 6;
   115415    case 4:
   115416       if (devinfo->is_g4x) {
   115417          return 6;
   115418       } else {
   115419          return 6;
   115420       }
   115421    default:
   115422       unreachable("Invalid hardware generation");
   115423    }
   115424 }
   115425 
   115426 
   115427 
   115428 /* COLOR_CALC_STATE::Backface Stencil Pass Depth Pass Op */
   115429 
   115430 
   115431 #define GEN5_COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_bits  3
   115432 #define GEN45_COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_bits  3
   115433 #define GEN4_COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_bits  3
   115434 
   115435 static inline uint32_t ATTRIBUTE_PURE
   115436 COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_bits(const struct gen_device_info *devinfo)
   115437 {
   115438    switch (devinfo->gen) {
   115439    case 10: return 0;
   115440    case 9: return 0;
   115441    case 8: return 0;
   115442    case 7:
   115443       if (devinfo->is_haswell) {
   115444          return 0;
   115445       } else {
   115446          return 0;
   115447       }
   115448    case 6: return 0;
   115449    case 5: return 3;
   115450    case 4:
   115451       if (devinfo->is_g4x) {
   115452          return 3;
   115453       } else {
   115454          return 3;
   115455       }
   115456    default:
   115457       unreachable("Invalid hardware generation");
   115458    }
   115459 }
   115460 
   115461 
   115462 
   115463 #define GEN5_COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_start  3
   115464 #define GEN45_COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_start  3
   115465 #define GEN4_COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_start  3
   115466 
   115467 static inline uint32_t ATTRIBUTE_PURE
   115468 COLOR_CALC_STATE_BackfaceStencilPassDepthPassOp_start(const struct gen_device_info *devinfo)
   115469 {
   115470    switch (devinfo->gen) {
   115471    case 10: return 0;
   115472    case 9: return 0;
   115473    case 8: return 0;
   115474    case 7:
   115475       if (devinfo->is_haswell) {
   115476          return 0;
   115477       } else {
   115478          return 0;
   115479       }
   115480    case 6: return 0;
   115481    case 5: return 3;
   115482    case 4:
   115483       if (devinfo->is_g4x) {
   115484          return 3;
   115485       } else {
   115486          return 3;
   115487       }
   115488    default:
   115489       unreachable("Invalid hardware generation");
   115490    }
   115491 }
   115492 
   115493 
   115494 
   115495 /* COLOR_CALC_STATE::Backface Stencil Reference Value */
   115496 
   115497 
   115498 #define GEN8_COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits  8
   115499 #define GEN75_COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits  8
   115500 #define GEN7_COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits  8
   115501 #define GEN6_COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits  8
   115502 #define GEN5_COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits  8
   115503 #define GEN45_COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits  8
   115504 #define GEN4_COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits  8
   115505 
   115506 static inline uint32_t ATTRIBUTE_PURE
   115507 COLOR_CALC_STATE_BackfaceStencilReferenceValue_bits(const struct gen_device_info *devinfo)
   115508 {
   115509    switch (devinfo->gen) {
   115510    case 10: return 0;
   115511    case 9: return 0;
   115512    case 8: return 8;
   115513    case 7:
   115514       if (devinfo->is_haswell) {
   115515          return 8;
   115516       } else {
   115517          return 8;
   115518       }
   115519    case 6: return 8;
   115520    case 5: return 8;
   115521    case 4:
   115522       if (devinfo->is_g4x) {
   115523          return 8;
   115524       } else {
   115525          return 8;
   115526       }
   115527    default:
   115528       unreachable("Invalid hardware generation");
   115529    }
   115530 }
   115531 
   115532 
   115533 
   115534 #define GEN8_COLOR_CALC_STATE_BackfaceStencilReferenceValue_start  16
   115535 #define GEN75_COLOR_CALC_STATE_BackfaceStencilReferenceValue_start  16
   115536 #define GEN7_COLOR_CALC_STATE_BackfaceStencilReferenceValue_start  16
   115537 #define GEN6_COLOR_CALC_STATE_BackfaceStencilReferenceValue_start  16
   115538 #define GEN5_COLOR_CALC_STATE_BackfaceStencilReferenceValue_start  32
   115539 #define GEN45_COLOR_CALC_STATE_BackfaceStencilReferenceValue_start  32
   115540 #define GEN4_COLOR_CALC_STATE_BackfaceStencilReferenceValue_start  32
   115541 
   115542 static inline uint32_t ATTRIBUTE_PURE
   115543 COLOR_CALC_STATE_BackfaceStencilReferenceValue_start(const struct gen_device_info *devinfo)
   115544 {
   115545    switch (devinfo->gen) {
   115546    case 10: return 0;
   115547    case 9: return 0;
   115548    case 8: return 16;
   115549    case 7:
   115550       if (devinfo->is_haswell) {
   115551          return 16;
   115552       } else {
   115553          return 16;
   115554       }
   115555    case 6: return 16;
   115556    case 5: return 32;
   115557    case 4:
   115558       if (devinfo->is_g4x) {
   115559          return 32;
   115560       } else {
   115561          return 32;
   115562       }
   115563    default:
   115564       unreachable("Invalid hardware generation");
   115565    }
   115566 }
   115567 
   115568 
   115569 
   115570 /* COLOR_CALC_STATE::Backface Stencil Test Function */
   115571 
   115572 
   115573 #define GEN5_COLOR_CALC_STATE_BackfaceStencilTestFunction_bits  3
   115574 #define GEN45_COLOR_CALC_STATE_BackfaceStencilTestFunction_bits  3
   115575 #define GEN4_COLOR_CALC_STATE_BackfaceStencilTestFunction_bits  3
   115576 
   115577 static inline uint32_t ATTRIBUTE_PURE
   115578 COLOR_CALC_STATE_BackfaceStencilTestFunction_bits(const struct gen_device_info *devinfo)
   115579 {
   115580    switch (devinfo->gen) {
   115581    case 10: return 0;
   115582    case 9: return 0;
   115583    case 8: return 0;
   115584    case 7:
   115585       if (devinfo->is_haswell) {
   115586          return 0;
   115587       } else {
   115588          return 0;
   115589       }
   115590    case 6: return 0;
   115591    case 5: return 3;
   115592    case 4:
   115593       if (devinfo->is_g4x) {
   115594          return 3;
   115595       } else {
   115596          return 3;
   115597       }
   115598    default:
   115599       unreachable("Invalid hardware generation");
   115600    }
   115601 }
   115602 
   115603 
   115604 
   115605 #define GEN5_COLOR_CALC_STATE_BackfaceStencilTestFunction_start  12
   115606 #define GEN45_COLOR_CALC_STATE_BackfaceStencilTestFunction_start  12
   115607 #define GEN4_COLOR_CALC_STATE_BackfaceStencilTestFunction_start  12
   115608 
   115609 static inline uint32_t ATTRIBUTE_PURE
   115610 COLOR_CALC_STATE_BackfaceStencilTestFunction_start(const struct gen_device_info *devinfo)
   115611 {
   115612    switch (devinfo->gen) {
   115613    case 10: return 0;
   115614    case 9: return 0;
   115615    case 8: return 0;
   115616    case 7:
   115617       if (devinfo->is_haswell) {
   115618          return 0;
   115619       } else {
   115620          return 0;
   115621       }
   115622    case 6: return 0;
   115623    case 5: return 12;
   115624    case 4:
   115625       if (devinfo->is_g4x) {
   115626          return 12;
   115627       } else {
   115628          return 12;
   115629       }
   115630    default:
   115631       unreachable("Invalid hardware generation");
   115632    }
   115633 }
   115634 
   115635 
   115636 
   115637 /* COLOR_CALC_STATE::Backface Stencil Test Mask */
   115638 
   115639 
   115640 #define GEN5_COLOR_CALC_STATE_BackfaceStencilTestMask_bits  8
   115641 #define GEN45_COLOR_CALC_STATE_BackfaceStencilTestMask_bits  8
   115642 #define GEN4_COLOR_CALC_STATE_BackfaceStencilTestMask_bits  8
   115643 
   115644 static inline uint32_t ATTRIBUTE_PURE
   115645 COLOR_CALC_STATE_BackfaceStencilTestMask_bits(const struct gen_device_info *devinfo)
   115646 {
   115647    switch (devinfo->gen) {
   115648    case 10: return 0;
   115649    case 9: return 0;
   115650    case 8: return 0;
   115651    case 7:
   115652       if (devinfo->is_haswell) {
   115653          return 0;
   115654       } else {
   115655          return 0;
   115656       }
   115657    case 6: return 0;
   115658    case 5: return 8;
   115659    case 4:
   115660       if (devinfo->is_g4x) {
   115661          return 8;
   115662       } else {
   115663          return 8;
   115664       }
   115665    default:
   115666       unreachable("Invalid hardware generation");
   115667    }
   115668 }
   115669 
   115670 
   115671 
   115672 #define GEN5_COLOR_CALC_STATE_BackfaceStencilTestMask_start  88
   115673 #define GEN45_COLOR_CALC_STATE_BackfaceStencilTestMask_start  88
   115674 #define GEN4_COLOR_CALC_STATE_BackfaceStencilTestMask_start  88
   115675 
   115676 static inline uint32_t ATTRIBUTE_PURE
   115677 COLOR_CALC_STATE_BackfaceStencilTestMask_start(const struct gen_device_info *devinfo)
   115678 {
   115679    switch (devinfo->gen) {
   115680    case 10: return 0;
   115681    case 9: return 0;
   115682    case 8: return 0;
   115683    case 7:
   115684       if (devinfo->is_haswell) {
   115685          return 0;
   115686       } else {
   115687          return 0;
   115688       }
   115689    case 6: return 0;
   115690    case 5: return 88;
   115691    case 4:
   115692       if (devinfo->is_g4x) {
   115693          return 88;
   115694       } else {
   115695          return 88;
   115696       }
   115697    default:
   115698       unreachable("Invalid hardware generation");
   115699    }
   115700 }
   115701 
   115702 
   115703 
   115704 /* COLOR_CALC_STATE::Backface Stencil Write Mask */
   115705 
   115706 
   115707 #define GEN5_COLOR_CALC_STATE_BackfaceStencilWriteMask_bits  8
   115708 #define GEN45_COLOR_CALC_STATE_BackfaceStencilWriteMask_bits  8
   115709 #define GEN4_COLOR_CALC_STATE_BackfaceStencilWriteMask_bits  8
   115710 
   115711 static inline uint32_t ATTRIBUTE_PURE
   115712 COLOR_CALC_STATE_BackfaceStencilWriteMask_bits(const struct gen_device_info *devinfo)
   115713 {
   115714    switch (devinfo->gen) {
   115715    case 10: return 0;
   115716    case 9: return 0;
   115717    case 8: return 0;
   115718    case 7:
   115719       if (devinfo->is_haswell) {
   115720          return 0;
   115721       } else {
   115722          return 0;
   115723       }
   115724    case 6: return 0;
   115725    case 5: return 8;
   115726    case 4:
   115727       if (devinfo->is_g4x) {
   115728          return 8;
   115729       } else {
   115730          return 8;
   115731       }
   115732    default:
   115733       unreachable("Invalid hardware generation");
   115734    }
   115735 }
   115736 
   115737 
   115738 
   115739 #define GEN5_COLOR_CALC_STATE_BackfaceStencilWriteMask_start  80
   115740 #define GEN45_COLOR_CALC_STATE_BackfaceStencilWriteMask_start  80
   115741 #define GEN4_COLOR_CALC_STATE_BackfaceStencilWriteMask_start  80
   115742 
   115743 static inline uint32_t ATTRIBUTE_PURE
   115744 COLOR_CALC_STATE_BackfaceStencilWriteMask_start(const struct gen_device_info *devinfo)
   115745 {
   115746    switch (devinfo->gen) {
   115747    case 10: return 0;
   115748    case 9: return 0;
   115749    case 8: return 0;
   115750    case 7:
   115751       if (devinfo->is_haswell) {
   115752          return 0;
   115753       } else {
   115754          return 0;
   115755       }
   115756    case 6: return 0;
   115757    case 5: return 80;
   115758    case 4:
   115759       if (devinfo->is_g4x) {
   115760          return 80;
   115761       } else {
   115762          return 80;
   115763       }
   115764    default:
   115765       unreachable("Invalid hardware generation");
   115766    }
   115767 }
   115768 
   115769 
   115770 
   115771 /* COLOR_CALC_STATE::Blend Constant Color Alpha */
   115772 
   115773 
   115774 #define GEN10_COLOR_CALC_STATE_BlendConstantColorAlpha_bits  32
   115775 #define GEN9_COLOR_CALC_STATE_BlendConstantColorAlpha_bits  32
   115776 #define GEN8_COLOR_CALC_STATE_BlendConstantColorAlpha_bits  32
   115777 #define GEN75_COLOR_CALC_STATE_BlendConstantColorAlpha_bits  32
   115778 #define GEN7_COLOR_CALC_STATE_BlendConstantColorAlpha_bits  32
   115779 #define GEN6_COLOR_CALC_STATE_BlendConstantColorAlpha_bits  32
   115780 
   115781 static inline uint32_t ATTRIBUTE_PURE
   115782 COLOR_CALC_STATE_BlendConstantColorAlpha_bits(const struct gen_device_info *devinfo)
   115783 {
   115784    switch (devinfo->gen) {
   115785    case 10: return 32;
   115786    case 9: return 32;
   115787    case 8: return 32;
   115788    case 7:
   115789       if (devinfo->is_haswell) {
   115790          return 32;
   115791       } else {
   115792          return 32;
   115793       }
   115794    case 6: return 32;
   115795    case 5: return 0;
   115796    case 4:
   115797       if (devinfo->is_g4x) {
   115798          return 0;
   115799       } else {
   115800          return 0;
   115801       }
   115802    default:
   115803       unreachable("Invalid hardware generation");
   115804    }
   115805 }
   115806 
   115807 
   115808 
   115809 #define GEN10_COLOR_CALC_STATE_BlendConstantColorAlpha_start  160
   115810 #define GEN9_COLOR_CALC_STATE_BlendConstantColorAlpha_start  160
   115811 #define GEN8_COLOR_CALC_STATE_BlendConstantColorAlpha_start  160
   115812 #define GEN75_COLOR_CALC_STATE_BlendConstantColorAlpha_start  160
   115813 #define GEN7_COLOR_CALC_STATE_BlendConstantColorAlpha_start  160
   115814 #define GEN6_COLOR_CALC_STATE_BlendConstantColorAlpha_start  160
   115815 
   115816 static inline uint32_t ATTRIBUTE_PURE
   115817 COLOR_CALC_STATE_BlendConstantColorAlpha_start(const struct gen_device_info *devinfo)
   115818 {
   115819    switch (devinfo->gen) {
   115820    case 10: return 160;
   115821    case 9: return 160;
   115822    case 8: return 160;
   115823    case 7:
   115824       if (devinfo->is_haswell) {
   115825          return 160;
   115826       } else {
   115827          return 160;
   115828       }
   115829    case 6: return 160;
   115830    case 5: return 0;
   115831    case 4:
   115832       if (devinfo->is_g4x) {
   115833          return 0;
   115834       } else {
   115835          return 0;
   115836       }
   115837    default:
   115838       unreachable("Invalid hardware generation");
   115839    }
   115840 }
   115841 
   115842 
   115843 
   115844 /* COLOR_CALC_STATE::Blend Constant Color Blue */
   115845 
   115846 
   115847 #define GEN10_COLOR_CALC_STATE_BlendConstantColorBlue_bits  32
   115848 #define GEN9_COLOR_CALC_STATE_BlendConstantColorBlue_bits  32
   115849 #define GEN8_COLOR_CALC_STATE_BlendConstantColorBlue_bits  32
   115850 #define GEN75_COLOR_CALC_STATE_BlendConstantColorBlue_bits  32
   115851 #define GEN7_COLOR_CALC_STATE_BlendConstantColorBlue_bits  32
   115852 #define GEN6_COLOR_CALC_STATE_BlendConstantColorBlue_bits  32
   115853 
   115854 static inline uint32_t ATTRIBUTE_PURE
   115855 COLOR_CALC_STATE_BlendConstantColorBlue_bits(const struct gen_device_info *devinfo)
   115856 {
   115857    switch (devinfo->gen) {
   115858    case 10: return 32;
   115859    case 9: return 32;
   115860    case 8: return 32;
   115861    case 7:
   115862       if (devinfo->is_haswell) {
   115863          return 32;
   115864       } else {
   115865          return 32;
   115866       }
   115867    case 6: return 32;
   115868    case 5: return 0;
   115869    case 4:
   115870       if (devinfo->is_g4x) {
   115871          return 0;
   115872       } else {
   115873          return 0;
   115874       }
   115875    default:
   115876       unreachable("Invalid hardware generation");
   115877    }
   115878 }
   115879 
   115880 
   115881 
   115882 #define GEN10_COLOR_CALC_STATE_BlendConstantColorBlue_start  128
   115883 #define GEN9_COLOR_CALC_STATE_BlendConstantColorBlue_start  128
   115884 #define GEN8_COLOR_CALC_STATE_BlendConstantColorBlue_start  128
   115885 #define GEN75_COLOR_CALC_STATE_BlendConstantColorBlue_start  128
   115886 #define GEN7_COLOR_CALC_STATE_BlendConstantColorBlue_start  128
   115887 #define GEN6_COLOR_CALC_STATE_BlendConstantColorBlue_start  128
   115888 
   115889 static inline uint32_t ATTRIBUTE_PURE
   115890 COLOR_CALC_STATE_BlendConstantColorBlue_start(const struct gen_device_info *devinfo)
   115891 {
   115892    switch (devinfo->gen) {
   115893    case 10: return 128;
   115894    case 9: return 128;
   115895    case 8: return 128;
   115896    case 7:
   115897       if (devinfo->is_haswell) {
   115898          return 128;
   115899       } else {
   115900          return 128;
   115901       }
   115902    case 6: return 128;
   115903    case 5: return 0;
   115904    case 4:
   115905       if (devinfo->is_g4x) {
   115906          return 0;
   115907       } else {
   115908          return 0;
   115909       }
   115910    default:
   115911       unreachable("Invalid hardware generation");
   115912    }
   115913 }
   115914 
   115915 
   115916 
   115917 /* COLOR_CALC_STATE::Blend Constant Color Green */
   115918 
   115919 
   115920 #define GEN10_COLOR_CALC_STATE_BlendConstantColorGreen_bits  32
   115921 #define GEN9_COLOR_CALC_STATE_BlendConstantColorGreen_bits  32
   115922 #define GEN8_COLOR_CALC_STATE_BlendConstantColorGreen_bits  32
   115923 #define GEN75_COLOR_CALC_STATE_BlendConstantColorGreen_bits  32
   115924 #define GEN7_COLOR_CALC_STATE_BlendConstantColorGreen_bits  32
   115925 #define GEN6_COLOR_CALC_STATE_BlendConstantColorGreen_bits  32
   115926 
   115927 static inline uint32_t ATTRIBUTE_PURE
   115928 COLOR_CALC_STATE_BlendConstantColorGreen_bits(const struct gen_device_info *devinfo)
   115929 {
   115930    switch (devinfo->gen) {
   115931    case 10: return 32;
   115932    case 9: return 32;
   115933    case 8: return 32;
   115934    case 7:
   115935       if (devinfo->is_haswell) {
   115936          return 32;
   115937       } else {
   115938          return 32;
   115939       }
   115940    case 6: return 32;
   115941    case 5: return 0;
   115942    case 4:
   115943       if (devinfo->is_g4x) {
   115944          return 0;
   115945       } else {
   115946          return 0;
   115947       }
   115948    default:
   115949       unreachable("Invalid hardware generation");
   115950    }
   115951 }
   115952 
   115953 
   115954 
   115955 #define GEN10_COLOR_CALC_STATE_BlendConstantColorGreen_start  96
   115956 #define GEN9_COLOR_CALC_STATE_BlendConstantColorGreen_start  96
   115957 #define GEN8_COLOR_CALC_STATE_BlendConstantColorGreen_start  96
   115958 #define GEN75_COLOR_CALC_STATE_BlendConstantColorGreen_start  96
   115959 #define GEN7_COLOR_CALC_STATE_BlendConstantColorGreen_start  96
   115960 #define GEN6_COLOR_CALC_STATE_BlendConstantColorGreen_start  96
   115961 
   115962 static inline uint32_t ATTRIBUTE_PURE
   115963 COLOR_CALC_STATE_BlendConstantColorGreen_start(const struct gen_device_info *devinfo)
   115964 {
   115965    switch (devinfo->gen) {
   115966    case 10: return 96;
   115967    case 9: return 96;
   115968    case 8: return 96;
   115969    case 7:
   115970       if (devinfo->is_haswell) {
   115971          return 96;
   115972       } else {
   115973          return 96;
   115974       }
   115975    case 6: return 96;
   115976    case 5: return 0;
   115977    case 4:
   115978       if (devinfo->is_g4x) {
   115979          return 0;
   115980       } else {
   115981          return 0;
   115982       }
   115983    default:
   115984       unreachable("Invalid hardware generation");
   115985    }
   115986 }
   115987 
   115988 
   115989 
   115990 /* COLOR_CALC_STATE::Blend Constant Color Red */
   115991 
   115992 
   115993 #define GEN10_COLOR_CALC_STATE_BlendConstantColorRed_bits  32
   115994 #define GEN9_COLOR_CALC_STATE_BlendConstantColorRed_bits  32
   115995 #define GEN8_COLOR_CALC_STATE_BlendConstantColorRed_bits  32
   115996 #define GEN75_COLOR_CALC_STATE_BlendConstantColorRed_bits  32
   115997 #define GEN7_COLOR_CALC_STATE_BlendConstantColorRed_bits  32
   115998 #define GEN6_COLOR_CALC_STATE_BlendConstantColorRed_bits  32
   115999 
   116000 static inline uint32_t ATTRIBUTE_PURE
   116001 COLOR_CALC_STATE_BlendConstantColorRed_bits(const struct gen_device_info *devinfo)
   116002 {
   116003    switch (devinfo->gen) {
   116004    case 10: return 32;
   116005    case 9: return 32;
   116006    case 8: return 32;
   116007    case 7:
   116008       if (devinfo->is_haswell) {
   116009          return 32;
   116010       } else {
   116011          return 32;
   116012       }
   116013    case 6: return 32;
   116014    case 5: return 0;
   116015    case 4:
   116016       if (devinfo->is_g4x) {
   116017          return 0;
   116018       } else {
   116019          return 0;
   116020       }
   116021    default:
   116022       unreachable("Invalid hardware generation");
   116023    }
   116024 }
   116025 
   116026 
   116027 
   116028 #define GEN10_COLOR_CALC_STATE_BlendConstantColorRed_start  64
   116029 #define GEN9_COLOR_CALC_STATE_BlendConstantColorRed_start  64
   116030 #define GEN8_COLOR_CALC_STATE_BlendConstantColorRed_start  64
   116031 #define GEN75_COLOR_CALC_STATE_BlendConstantColorRed_start  64
   116032 #define GEN7_COLOR_CALC_STATE_BlendConstantColorRed_start  64
   116033 #define GEN6_COLOR_CALC_STATE_BlendConstantColorRed_start  64
   116034 
   116035 static inline uint32_t ATTRIBUTE_PURE
   116036 COLOR_CALC_STATE_BlendConstantColorRed_start(const struct gen_device_info *devinfo)
   116037 {
   116038    switch (devinfo->gen) {
   116039    case 10: return 64;
   116040    case 9: return 64;
   116041    case 8: return 64;
   116042    case 7:
   116043       if (devinfo->is_haswell) {
   116044          return 64;
   116045       } else {
   116046          return 64;
   116047       }
   116048    case 6: return 64;
   116049    case 5: return 0;
   116050    case 4:
   116051       if (devinfo->is_g4x) {
   116052          return 0;
   116053       } else {
   116054          return 0;
   116055       }
   116056    default:
   116057       unreachable("Invalid hardware generation");
   116058    }
   116059 }
   116060 
   116061 
   116062 
   116063 /* COLOR_CALC_STATE::CC Viewport State Pointer */
   116064 
   116065 
   116066 #define GEN5_COLOR_CALC_STATE_CCViewportStatePointer_bits  27
   116067 #define GEN45_COLOR_CALC_STATE_CCViewportStatePointer_bits  27
   116068 #define GEN4_COLOR_CALC_STATE_CCViewportStatePointer_bits  27
   116069 
   116070 static inline uint32_t ATTRIBUTE_PURE
   116071 COLOR_CALC_STATE_CCViewportStatePointer_bits(const struct gen_device_info *devinfo)
   116072 {
   116073    switch (devinfo->gen) {
   116074    case 10: return 0;
   116075    case 9: return 0;
   116076    case 8: return 0;
   116077    case 7:
   116078       if (devinfo->is_haswell) {
   116079          return 0;
   116080       } else {
   116081          return 0;
   116082       }
   116083    case 6: return 0;
   116084    case 5: return 27;
   116085    case 4:
   116086       if (devinfo->is_g4x) {
   116087          return 27;
   116088       } else {
   116089          return 27;
   116090       }
   116091    default:
   116092       unreachable("Invalid hardware generation");
   116093    }
   116094 }
   116095 
   116096 
   116097 
   116098 #define GEN5_COLOR_CALC_STATE_CCViewportStatePointer_start  133
   116099 #define GEN45_COLOR_CALC_STATE_CCViewportStatePointer_start  133
   116100 #define GEN4_COLOR_CALC_STATE_CCViewportStatePointer_start  133
   116101 
   116102 static inline uint32_t ATTRIBUTE_PURE
   116103 COLOR_CALC_STATE_CCViewportStatePointer_start(const struct gen_device_info *devinfo)
   116104 {
   116105    switch (devinfo->gen) {
   116106    case 10: return 0;
   116107    case 9: return 0;
   116108    case 8: return 0;
   116109    case 7:
   116110       if (devinfo->is_haswell) {
   116111          return 0;
   116112       } else {
   116113          return 0;
   116114       }
   116115    case 6: return 0;
   116116    case 5: return 133;
   116117    case 4:
   116118       if (devinfo->is_g4x) {
   116119          return 133;
   116120       } else {
   116121          return 133;
   116122       }
   116123    default:
   116124       unreachable("Invalid hardware generation");
   116125    }
   116126 }
   116127 
   116128 
   116129 
   116130 /* COLOR_CALC_STATE::Color Blend Function */
   116131 
   116132 
   116133 #define GEN5_COLOR_CALC_STATE_ColorBlendFunction_bits  3
   116134 #define GEN45_COLOR_CALC_STATE_ColorBlendFunction_bits  3
   116135 #define GEN4_COLOR_CALC_STATE_ColorBlendFunction_bits  3
   116136 
   116137 static inline uint32_t ATTRIBUTE_PURE
   116138 COLOR_CALC_STATE_ColorBlendFunction_bits(const struct gen_device_info *devinfo)
   116139 {
   116140    switch (devinfo->gen) {
   116141    case 10: return 0;
   116142    case 9: return 0;
   116143    case 8: return 0;
   116144    case 7:
   116145       if (devinfo->is_haswell) {
   116146          return 0;
   116147       } else {
   116148          return 0;
   116149       }
   116150    case 6: return 0;
   116151    case 5: return 3;
   116152    case 4:
   116153       if (devinfo->is_g4x) {
   116154          return 3;
   116155       } else {
   116156          return 3;
   116157       }
   116158    default:
   116159       unreachable("Invalid hardware generation");
   116160    }
   116161 }
   116162 
   116163 
   116164 
   116165 #define GEN5_COLOR_CALC_STATE_ColorBlendFunction_start  221
   116166 #define GEN45_COLOR_CALC_STATE_ColorBlendFunction_start  221
   116167 #define GEN4_COLOR_CALC_STATE_ColorBlendFunction_start  221
   116168 
   116169 static inline uint32_t ATTRIBUTE_PURE
   116170 COLOR_CALC_STATE_ColorBlendFunction_start(const struct gen_device_info *devinfo)
   116171 {
   116172    switch (devinfo->gen) {
   116173    case 10: return 0;
   116174    case 9: return 0;
   116175    case 8: return 0;
   116176    case 7:
   116177       if (devinfo->is_haswell) {
   116178          return 0;
   116179       } else {
   116180          return 0;
   116181       }
   116182    case 6: return 0;
   116183    case 5: return 221;
   116184    case 4:
   116185       if (devinfo->is_g4x) {
   116186          return 221;
   116187       } else {
   116188          return 221;
   116189       }
   116190    default:
   116191       unreachable("Invalid hardware generation");
   116192    }
   116193 }
   116194 
   116195 
   116196 
   116197 /* COLOR_CALC_STATE::Color Buffer Blend Enable */
   116198 
   116199 
   116200 #define GEN5_COLOR_CALC_STATE_ColorBufferBlendEnable_bits  1
   116201 #define GEN45_COLOR_CALC_STATE_ColorBufferBlendEnable_bits  1
   116202 #define GEN4_COLOR_CALC_STATE_ColorBufferBlendEnable_bits  1
   116203 
   116204 static inline uint32_t ATTRIBUTE_PURE
   116205 COLOR_CALC_STATE_ColorBufferBlendEnable_bits(const struct gen_device_info *devinfo)
   116206 {
   116207    switch (devinfo->gen) {
   116208    case 10: return 0;
   116209    case 9: return 0;
   116210    case 8: return 0;
   116211    case 7:
   116212       if (devinfo->is_haswell) {
   116213          return 0;
   116214       } else {
   116215          return 0;
   116216       }
   116217    case 6: return 0;
   116218    case 5: return 1;
   116219    case 4:
   116220       if (devinfo->is_g4x) {
   116221          return 1;
   116222       } else {
   116223          return 1;
   116224       }
   116225    default:
   116226       unreachable("Invalid hardware generation");
   116227    }
   116228 }
   116229 
   116230 
   116231 
   116232 #define GEN5_COLOR_CALC_STATE_ColorBufferBlendEnable_start  108
   116233 #define GEN45_COLOR_CALC_STATE_ColorBufferBlendEnable_start  108
   116234 #define GEN4_COLOR_CALC_STATE_ColorBufferBlendEnable_start  108
   116235 
   116236 static inline uint32_t ATTRIBUTE_PURE
   116237 COLOR_CALC_STATE_ColorBufferBlendEnable_start(const struct gen_device_info *devinfo)
   116238 {
   116239    switch (devinfo->gen) {
   116240    case 10: return 0;
   116241    case 9: return 0;
   116242    case 8: return 0;
   116243    case 7:
   116244       if (devinfo->is_haswell) {
   116245          return 0;
   116246       } else {
   116247          return 0;
   116248       }
   116249    case 6: return 0;
   116250    case 5: return 108;
   116251    case 4:
   116252       if (devinfo->is_g4x) {
   116253          return 108;
   116254       } else {
   116255          return 108;
   116256       }
   116257    default:
   116258       unreachable("Invalid hardware generation");
   116259    }
   116260 }
   116261 
   116262 
   116263 
   116264 /* COLOR_CALC_STATE::Color Clamp Range */
   116265 
   116266 
   116267 #define GEN5_COLOR_CALC_STATE_ColorClampRange_bits  2
   116268 #define GEN45_COLOR_CALC_STATE_ColorClampRange_bits  2
   116269 #define GEN4_COLOR_CALC_STATE_ColorClampRange_bits  2
   116270 
   116271 static inline uint32_t ATTRIBUTE_PURE
   116272 COLOR_CALC_STATE_ColorClampRange_bits(const struct gen_device_info *devinfo)
   116273 {
   116274    switch (devinfo->gen) {
   116275    case 10: return 0;
   116276    case 9: return 0;
   116277    case 8: return 0;
   116278    case 7:
   116279       if (devinfo->is_haswell) {
   116280          return 0;
   116281       } else {
   116282          return 0;
   116283       }
   116284    case 6: return 0;
   116285    case 5: return 2;
   116286    case 4:
   116287       if (devinfo->is_g4x) {
   116288          return 2;
   116289       } else {
   116290          return 2;
   116291       }
   116292    default:
   116293       unreachable("Invalid hardware generation");
   116294    }
   116295 }
   116296 
   116297 
   116298 
   116299 #define GEN5_COLOR_CALC_STATE_ColorClampRange_start  194
   116300 #define GEN45_COLOR_CALC_STATE_ColorClampRange_start  194
   116301 #define GEN4_COLOR_CALC_STATE_ColorClampRange_start  194
   116302 
   116303 static inline uint32_t ATTRIBUTE_PURE
   116304 COLOR_CALC_STATE_ColorClampRange_start(const struct gen_device_info *devinfo)
   116305 {
   116306    switch (devinfo->gen) {
   116307    case 10: return 0;
   116308    case 9: return 0;
   116309    case 8: return 0;
   116310    case 7:
   116311       if (devinfo->is_haswell) {
   116312          return 0;
   116313       } else {
   116314          return 0;
   116315       }
   116316    case 6: return 0;
   116317    case 5: return 194;
   116318    case 4:
   116319       if (devinfo->is_g4x) {
   116320          return 194;
   116321       } else {
   116322          return 194;
   116323       }
   116324    default:
   116325       unreachable("Invalid hardware generation");
   116326    }
   116327 }
   116328 
   116329 
   116330 
   116331 /* COLOR_CALC_STATE::Color Dither Enable */
   116332 
   116333 
   116334 #define GEN5_COLOR_CALC_STATE_ColorDitherEnable_bits  1
   116335 #define GEN45_COLOR_CALC_STATE_ColorDitherEnable_bits  1
   116336 #define GEN4_COLOR_CALC_STATE_ColorDitherEnable_bits  1
   116337 
   116338 static inline uint32_t ATTRIBUTE_PURE
   116339 COLOR_CALC_STATE_ColorDitherEnable_bits(const struct gen_device_info *devinfo)
   116340 {
   116341    switch (devinfo->gen) {
   116342    case 10: return 0;
   116343    case 9: return 0;
   116344    case 8: return 0;
   116345    case 7:
   116346       if (devinfo->is_haswell) {
   116347          return 0;
   116348       } else {
   116349          return 0;
   116350       }
   116351    case 6: return 0;
   116352    case 5: return 1;
   116353    case 4:
   116354       if (devinfo->is_g4x) {
   116355          return 1;
   116356       } else {
   116357          return 1;
   116358       }
   116359    default:
   116360       unreachable("Invalid hardware generation");
   116361    }
   116362 }
   116363 
   116364 
   116365 
   116366 #define GEN5_COLOR_CALC_STATE_ColorDitherEnable_start  191
   116367 #define GEN45_COLOR_CALC_STATE_ColorDitherEnable_start  191
   116368 #define GEN4_COLOR_CALC_STATE_ColorDitherEnable_start  191
   116369 
   116370 static inline uint32_t ATTRIBUTE_PURE
   116371 COLOR_CALC_STATE_ColorDitherEnable_start(const struct gen_device_info *devinfo)
   116372 {
   116373    switch (devinfo->gen) {
   116374    case 10: return 0;
   116375    case 9: return 0;
   116376    case 8: return 0;
   116377    case 7:
   116378       if (devinfo->is_haswell) {
   116379          return 0;
   116380       } else {
   116381          return 0;
   116382       }
   116383    case 6: return 0;
   116384    case 5: return 191;
   116385    case 4:
   116386       if (devinfo->is_g4x) {
   116387          return 191;
   116388       } else {
   116389          return 191;
   116390       }
   116391    default:
   116392       unreachable("Invalid hardware generation");
   116393    }
   116394 }
   116395 
   116396 
   116397 
   116398 /* COLOR_CALC_STATE::Depth Buffer Write Enable */
   116399 
   116400 
   116401 #define GEN5_COLOR_CALC_STATE_DepthBufferWriteEnable_bits  1
   116402 #define GEN45_COLOR_CALC_STATE_DepthBufferWriteEnable_bits  1
   116403 #define GEN4_COLOR_CALC_STATE_DepthBufferWriteEnable_bits  1
   116404 
   116405 static inline uint32_t ATTRIBUTE_PURE
   116406 COLOR_CALC_STATE_DepthBufferWriteEnable_bits(const struct gen_device_info *devinfo)
   116407 {
   116408    switch (devinfo->gen) {
   116409    case 10: return 0;
   116410    case 9: return 0;
   116411    case 8: return 0;
   116412    case 7:
   116413       if (devinfo->is_haswell) {
   116414          return 0;
   116415       } else {
   116416          return 0;
   116417       }
   116418    case 6: return 0;
   116419    case 5: return 1;
   116420    case 4:
   116421       if (devinfo->is_g4x) {
   116422          return 1;
   116423       } else {
   116424          return 1;
   116425       }
   116426    default:
   116427       unreachable("Invalid hardware generation");
   116428    }
   116429 }
   116430 
   116431 
   116432 
   116433 #define GEN5_COLOR_CALC_STATE_DepthBufferWriteEnable_start  75
   116434 #define GEN45_COLOR_CALC_STATE_DepthBufferWriteEnable_start  75
   116435 #define GEN4_COLOR_CALC_STATE_DepthBufferWriteEnable_start  75
   116436 
   116437 static inline uint32_t ATTRIBUTE_PURE
   116438 COLOR_CALC_STATE_DepthBufferWriteEnable_start(const struct gen_device_info *devinfo)
   116439 {
   116440    switch (devinfo->gen) {
   116441    case 10: return 0;
   116442    case 9: return 0;
   116443    case 8: return 0;
   116444    case 7:
   116445       if (devinfo->is_haswell) {
   116446          return 0;
   116447       } else {
   116448          return 0;
   116449       }
   116450    case 6: return 0;
   116451    case 5: return 75;
   116452    case 4:
   116453       if (devinfo->is_g4x) {
   116454          return 75;
   116455       } else {
   116456          return 75;
   116457       }
   116458    default:
   116459       unreachable("Invalid hardware generation");
   116460    }
   116461 }
   116462 
   116463 
   116464 
   116465 /* COLOR_CALC_STATE::Depth Test Enable */
   116466 
   116467 
   116468 #define GEN5_COLOR_CALC_STATE_DepthTestEnable_bits  1
   116469 #define GEN45_COLOR_CALC_STATE_DepthTestEnable_bits  1
   116470 #define GEN4_COLOR_CALC_STATE_DepthTestEnable_bits  1
   116471 
   116472 static inline uint32_t ATTRIBUTE_PURE
   116473 COLOR_CALC_STATE_DepthTestEnable_bits(const struct gen_device_info *devinfo)
   116474 {
   116475    switch (devinfo->gen) {
   116476    case 10: return 0;
   116477    case 9: return 0;
   116478    case 8: return 0;
   116479    case 7:
   116480       if (devinfo->is_haswell) {
   116481          return 0;
   116482       } else {
   116483          return 0;
   116484       }
   116485    case 6: return 0;
   116486    case 5: return 1;
   116487    case 4:
   116488       if (devinfo->is_g4x) {
   116489          return 1;
   116490       } else {
   116491          return 1;
   116492       }
   116493    default:
   116494       unreachable("Invalid hardware generation");
   116495    }
   116496 }
   116497 
   116498 
   116499 
   116500 #define GEN5_COLOR_CALC_STATE_DepthTestEnable_start  79
   116501 #define GEN45_COLOR_CALC_STATE_DepthTestEnable_start  79
   116502 #define GEN4_COLOR_CALC_STATE_DepthTestEnable_start  79
   116503 
   116504 static inline uint32_t ATTRIBUTE_PURE
   116505 COLOR_CALC_STATE_DepthTestEnable_start(const struct gen_device_info *devinfo)
   116506 {
   116507    switch (devinfo->gen) {
   116508    case 10: return 0;
   116509    case 9: return 0;
   116510    case 8: return 0;
   116511    case 7:
   116512       if (devinfo->is_haswell) {
   116513          return 0;
   116514       } else {
   116515          return 0;
   116516       }
   116517    case 6: return 0;
   116518    case 5: return 79;
   116519    case 4:
   116520       if (devinfo->is_g4x) {
   116521          return 79;
   116522       } else {
   116523          return 79;
   116524       }
   116525    default:
   116526       unreachable("Invalid hardware generation");
   116527    }
   116528 }
   116529 
   116530 
   116531 
   116532 /* COLOR_CALC_STATE::Depth Test Function */
   116533 
   116534 
   116535 #define GEN5_COLOR_CALC_STATE_DepthTestFunction_bits  3
   116536 #define GEN45_COLOR_CALC_STATE_DepthTestFunction_bits  3
   116537 #define GEN4_COLOR_CALC_STATE_DepthTestFunction_bits  3
   116538 
   116539 static inline uint32_t ATTRIBUTE_PURE
   116540 COLOR_CALC_STATE_DepthTestFunction_bits(const struct gen_device_info *devinfo)
   116541 {
   116542    switch (devinfo->gen) {
   116543    case 10: return 0;
   116544    case 9: return 0;
   116545    case 8: return 0;
   116546    case 7:
   116547       if (devinfo->is_haswell) {
   116548          return 0;
   116549       } else {
   116550          return 0;
   116551       }
   116552    case 6: return 0;
   116553    case 5: return 3;
   116554    case 4:
   116555       if (devinfo->is_g4x) {
   116556          return 3;
   116557       } else {
   116558          return 3;
   116559       }
   116560    default:
   116561       unreachable("Invalid hardware generation");
   116562    }
   116563 }
   116564 
   116565 
   116566 
   116567 #define GEN5_COLOR_CALC_STATE_DepthTestFunction_start  76
   116568 #define GEN45_COLOR_CALC_STATE_DepthTestFunction_start  76
   116569 #define GEN4_COLOR_CALC_STATE_DepthTestFunction_start  76
   116570 
   116571 static inline uint32_t ATTRIBUTE_PURE
   116572 COLOR_CALC_STATE_DepthTestFunction_start(const struct gen_device_info *devinfo)
   116573 {
   116574    switch (devinfo->gen) {
   116575    case 10: return 0;
   116576    case 9: return 0;
   116577    case 8: return 0;
   116578    case 7:
   116579       if (devinfo->is_haswell) {
   116580          return 0;
   116581       } else {
   116582          return 0;
   116583       }
   116584    case 6: return 0;
   116585    case 5: return 76;
   116586    case 4:
   116587       if (devinfo->is_g4x) {
   116588          return 76;
   116589       } else {
   116590          return 76;
   116591       }
   116592    default:
   116593       unreachable("Invalid hardware generation");
   116594    }
   116595 }
   116596 
   116597 
   116598 
   116599 /* COLOR_CALC_STATE::Destination Alpha Blend Factor */
   116600 
   116601 
   116602 #define GEN5_COLOR_CALC_STATE_DestinationAlphaBlendFactor_bits  5
   116603 #define GEN45_COLOR_CALC_STATE_DestinationAlphaBlendFactor_bits  5
   116604 #define GEN4_COLOR_CALC_STATE_DestinationAlphaBlendFactor_bits  5
   116605 
   116606 static inline uint32_t ATTRIBUTE_PURE
   116607 COLOR_CALC_STATE_DestinationAlphaBlendFactor_bits(const struct gen_device_info *devinfo)
   116608 {
   116609    switch (devinfo->gen) {
   116610    case 10: return 0;
   116611    case 9: return 0;
   116612    case 8: return 0;
   116613    case 7:
   116614       if (devinfo->is_haswell) {
   116615          return 0;
   116616       } else {
   116617          return 0;
   116618       }
   116619    case 6: return 0;
   116620    case 5: return 5;
   116621    case 4:
   116622       if (devinfo->is_g4x) {
   116623          return 5;
   116624       } else {
   116625          return 5;
   116626       }
   116627    default:
   116628       unreachable("Invalid hardware generation");
   116629    }
   116630 }
   116631 
   116632 
   116633 
   116634 #define GEN5_COLOR_CALC_STATE_DestinationAlphaBlendFactor_start  162
   116635 #define GEN45_COLOR_CALC_STATE_DestinationAlphaBlendFactor_start  162
   116636 #define GEN4_COLOR_CALC_STATE_DestinationAlphaBlendFactor_start  162
   116637 
   116638 static inline uint32_t ATTRIBUTE_PURE
   116639 COLOR_CALC_STATE_DestinationAlphaBlendFactor_start(const struct gen_device_info *devinfo)
   116640 {
   116641    switch (devinfo->gen) {
   116642    case 10: return 0;
   116643    case 9: return 0;
   116644    case 8: return 0;
   116645    case 7:
   116646       if (devinfo->is_haswell) {
   116647          return 0;
   116648       } else {
   116649          return 0;
   116650       }
   116651    case 6: return 0;
   116652    case 5: return 162;
   116653    case 4:
   116654       if (devinfo->is_g4x) {
   116655          return 162;
   116656       } else {
   116657          return 162;
   116658       }
   116659    default:
   116660       unreachable("Invalid hardware generation");
   116661    }
   116662 }
   116663 
   116664 
   116665 
   116666 /* COLOR_CALC_STATE::Destination Blend Factor */
   116667 
   116668 
   116669 #define GEN5_COLOR_CALC_STATE_DestinationBlendFactor_bits  5
   116670 #define GEN45_COLOR_CALC_STATE_DestinationBlendFactor_bits  5
   116671 #define GEN4_COLOR_CALC_STATE_DestinationBlendFactor_bits  5
   116672 
   116673 static inline uint32_t ATTRIBUTE_PURE
   116674 COLOR_CALC_STATE_DestinationBlendFactor_bits(const struct gen_device_info *devinfo)
   116675 {
   116676    switch (devinfo->gen) {
   116677    case 10: return 0;
   116678    case 9: return 0;
   116679    case 8: return 0;
   116680    case 7:
   116681       if (devinfo->is_haswell) {
   116682          return 0;
   116683       } else {
   116684          return 0;
   116685       }
   116686    case 6: return 0;
   116687    case 5: return 5;
   116688    case 4:
   116689       if (devinfo->is_g4x) {
   116690          return 5;
   116691       } else {
   116692          return 5;
   116693       }
   116694    default:
   116695       unreachable("Invalid hardware generation");
   116696    }
   116697 }
   116698 
   116699 
   116700 
   116701 #define GEN5_COLOR_CALC_STATE_DestinationBlendFactor_start  211
   116702 #define GEN45_COLOR_CALC_STATE_DestinationBlendFactor_start  211
   116703 #define GEN4_COLOR_CALC_STATE_DestinationBlendFactor_start  211
   116704 
   116705 static inline uint32_t ATTRIBUTE_PURE
   116706 COLOR_CALC_STATE_DestinationBlendFactor_start(const struct gen_device_info *devinfo)
   116707 {
   116708    switch (devinfo->gen) {
   116709    case 10: return 0;
   116710    case 9: return 0;
   116711    case 8: return 0;
   116712    case 7:
   116713       if (devinfo->is_haswell) {
   116714          return 0;
   116715       } else {
   116716          return 0;
   116717       }
   116718    case 6: return 0;
   116719    case 5: return 211;
   116720    case 4:
   116721       if (devinfo->is_g4x) {
   116722          return 211;
   116723       } else {
   116724          return 211;
   116725       }
   116726    default:
   116727       unreachable("Invalid hardware generation");
   116728    }
   116729 }
   116730 
   116731 
   116732 
   116733 /* COLOR_CALC_STATE::Double Sided Stencil Enable */
   116734 
   116735 
   116736 #define GEN5_COLOR_CALC_STATE_DoubleSidedStencilEnable_bits  1
   116737 #define GEN45_COLOR_CALC_STATE_DoubleSidedStencilEnable_bits  1
   116738 #define GEN4_COLOR_CALC_STATE_DoubleSidedStencilEnable_bits  1
   116739 
   116740 static inline uint32_t ATTRIBUTE_PURE
   116741 COLOR_CALC_STATE_DoubleSidedStencilEnable_bits(const struct gen_device_info *devinfo)
   116742 {
   116743    switch (devinfo->gen) {
   116744    case 10: return 0;
   116745    case 9: return 0;
   116746    case 8: return 0;
   116747    case 7:
   116748       if (devinfo->is_haswell) {
   116749          return 0;
   116750       } else {
   116751          return 0;
   116752       }
   116753    case 6: return 0;
   116754    case 5: return 1;
   116755    case 4:
   116756       if (devinfo->is_g4x) {
   116757          return 1;
   116758       } else {
   116759          return 1;
   116760       }
   116761    default:
   116762       unreachable("Invalid hardware generation");
   116763    }
   116764 }
   116765 
   116766 
   116767 
   116768 #define GEN5_COLOR_CALC_STATE_DoubleSidedStencilEnable_start  15
   116769 #define GEN45_COLOR_CALC_STATE_DoubleSidedStencilEnable_start  15
   116770 #define GEN4_COLOR_CALC_STATE_DoubleSidedStencilEnable_start  15
   116771 
   116772 static inline uint32_t ATTRIBUTE_PURE
   116773 COLOR_CALC_STATE_DoubleSidedStencilEnable_start(const struct gen_device_info *devinfo)
   116774 {
   116775    switch (devinfo->gen) {
   116776    case 10: return 0;
   116777    case 9: return 0;
   116778    case 8: return 0;
   116779    case 7:
   116780       if (devinfo->is_haswell) {
   116781          return 0;
   116782       } else {
   116783          return 0;
   116784       }
   116785    case 6: return 0;
   116786    case 5: return 15;
   116787    case 4:
   116788       if (devinfo->is_g4x) {
   116789          return 15;
   116790       } else {
   116791          return 15;
   116792       }
   116793    default:
   116794       unreachable("Invalid hardware generation");
   116795    }
   116796 }
   116797 
   116798 
   116799 
   116800 /* COLOR_CALC_STATE::Independent Alpha Blend Enable */
   116801 
   116802 
   116803 #define GEN5_COLOR_CALC_STATE_IndependentAlphaBlendEnable_bits  1
   116804 #define GEN45_COLOR_CALC_STATE_IndependentAlphaBlendEnable_bits  1
   116805 #define GEN4_COLOR_CALC_STATE_IndependentAlphaBlendEnable_bits  1
   116806 
   116807 static inline uint32_t ATTRIBUTE_PURE
   116808 COLOR_CALC_STATE_IndependentAlphaBlendEnable_bits(const struct gen_device_info *devinfo)
   116809 {
   116810    switch (devinfo->gen) {
   116811    case 10: return 0;
   116812    case 9: return 0;
   116813    case 8: return 0;
   116814    case 7:
   116815       if (devinfo->is_haswell) {
   116816          return 0;
   116817       } else {
   116818          return 0;
   116819       }
   116820    case 6: return 0;
   116821    case 5: return 1;
   116822    case 4:
   116823       if (devinfo->is_g4x) {
   116824          return 1;
   116825       } else {
   116826          return 1;
   116827       }
   116828    default:
   116829       unreachable("Invalid hardware generation");
   116830    }
   116831 }
   116832 
   116833 
   116834 
   116835 #define GEN5_COLOR_CALC_STATE_IndependentAlphaBlendEnable_start  109
   116836 #define GEN45_COLOR_CALC_STATE_IndependentAlphaBlendEnable_start  109
   116837 #define GEN4_COLOR_CALC_STATE_IndependentAlphaBlendEnable_start  109
   116838 
   116839 static inline uint32_t ATTRIBUTE_PURE
   116840 COLOR_CALC_STATE_IndependentAlphaBlendEnable_start(const struct gen_device_info *devinfo)
   116841 {
   116842    switch (devinfo->gen) {
   116843    case 10: return 0;
   116844    case 9: return 0;
   116845    case 8: return 0;
   116846    case 7:
   116847       if (devinfo->is_haswell) {
   116848          return 0;
   116849       } else {
   116850          return 0;
   116851       }
   116852    case 6: return 0;
   116853    case 5: return 109;
   116854    case 4:
   116855       if (devinfo->is_g4x) {
   116856          return 109;
   116857       } else {
   116858          return 109;
   116859       }
   116860    default:
   116861       unreachable("Invalid hardware generation");
   116862    }
   116863 }
   116864 
   116865 
   116866 
   116867 /* COLOR_CALC_STATE::Logic Op Enable */
   116868 
   116869 
   116870 #define GEN5_COLOR_CALC_STATE_LogicOpEnable_bits  1
   116871 #define GEN45_COLOR_CALC_STATE_LogicOpEnable_bits  1
   116872 #define GEN4_COLOR_CALC_STATE_LogicOpEnable_bits  1
   116873 
   116874 static inline uint32_t ATTRIBUTE_PURE
   116875 COLOR_CALC_STATE_LogicOpEnable_bits(const struct gen_device_info *devinfo)
   116876 {
   116877    switch (devinfo->gen) {
   116878    case 10: return 0;
   116879    case 9: return 0;
   116880    case 8: return 0;
   116881    case 7:
   116882       if (devinfo->is_haswell) {
   116883          return 0;
   116884       } else {
   116885          return 0;
   116886       }
   116887    case 6: return 0;
   116888    case 5: return 1;
   116889    case 4:
   116890       if (devinfo->is_g4x) {
   116891          return 1;
   116892       } else {
   116893          return 1;
   116894       }
   116895    default:
   116896       unreachable("Invalid hardware generation");
   116897    }
   116898 }
   116899 
   116900 
   116901 
   116902 #define GEN5_COLOR_CALC_STATE_LogicOpEnable_start  64
   116903 #define GEN45_COLOR_CALC_STATE_LogicOpEnable_start  64
   116904 #define GEN4_COLOR_CALC_STATE_LogicOpEnable_start  64
   116905 
   116906 static inline uint32_t ATTRIBUTE_PURE
   116907 COLOR_CALC_STATE_LogicOpEnable_start(const struct gen_device_info *devinfo)
   116908 {
   116909    switch (devinfo->gen) {
   116910    case 10: return 0;
   116911    case 9: return 0;
   116912    case 8: return 0;
   116913    case 7:
   116914       if (devinfo->is_haswell) {
   116915          return 0;
   116916       } else {
   116917          return 0;
   116918       }
   116919    case 6: return 0;
   116920    case 5: return 64;
   116921    case 4:
   116922       if (devinfo->is_g4x) {
   116923          return 64;
   116924       } else {
   116925          return 64;
   116926       }
   116927    default:
   116928       unreachable("Invalid hardware generation");
   116929    }
   116930 }
   116931 
   116932 
   116933 
   116934 /* COLOR_CALC_STATE::Logic Op Function */
   116935 
   116936 
   116937 #define GEN5_COLOR_CALC_STATE_LogicOpFunction_bits  4
   116938 #define GEN45_COLOR_CALC_STATE_LogicOpFunction_bits  4
   116939 #define GEN4_COLOR_CALC_STATE_LogicOpFunction_bits  4
   116940 
   116941 static inline uint32_t ATTRIBUTE_PURE
   116942 COLOR_CALC_STATE_LogicOpFunction_bits(const struct gen_device_info *devinfo)
   116943 {
   116944    switch (devinfo->gen) {
   116945    case 10: return 0;
   116946    case 9: return 0;
   116947    case 8: return 0;
   116948    case 7:
   116949       if (devinfo->is_haswell) {
   116950          return 0;
   116951       } else {
   116952          return 0;
   116953       }
   116954    case 6: return 0;
   116955    case 5: return 4;
   116956    case 4:
   116957       if (devinfo->is_g4x) {
   116958          return 4;
   116959       } else {
   116960          return 4;
   116961       }
   116962    default:
   116963       unreachable("Invalid hardware generation");
   116964    }
   116965 }
   116966 
   116967 
   116968 
   116969 #define GEN5_COLOR_CALC_STATE_LogicOpFunction_start  176
   116970 #define GEN45_COLOR_CALC_STATE_LogicOpFunction_start  176
   116971 #define GEN4_COLOR_CALC_STATE_LogicOpFunction_start  176
   116972 
   116973 static inline uint32_t ATTRIBUTE_PURE
   116974 COLOR_CALC_STATE_LogicOpFunction_start(const struct gen_device_info *devinfo)
   116975 {
   116976    switch (devinfo->gen) {
   116977    case 10: return 0;
   116978    case 9: return 0;
   116979    case 8: return 0;
   116980    case 7:
   116981       if (devinfo->is_haswell) {
   116982          return 0;
   116983       } else {
   116984          return 0;
   116985       }
   116986    case 6: return 0;
   116987    case 5: return 176;
   116988    case 4:
   116989       if (devinfo->is_g4x) {
   116990          return 176;
   116991       } else {
   116992          return 176;
   116993       }
   116994    default:
   116995       unreachable("Invalid hardware generation");
   116996    }
   116997 }
   116998 
   116999 
   117000 
   117001 /* COLOR_CALC_STATE::Post-Blend Color Clamp Enable */
   117002 
   117003 
   117004 #define GEN5_COLOR_CALC_STATE_PostBlendColorClampEnable_bits  1
   117005 #define GEN45_COLOR_CALC_STATE_PostBlendColorClampEnable_bits  1
   117006 #define GEN4_COLOR_CALC_STATE_PostBlendColorClampEnable_bits  1
   117007 
   117008 static inline uint32_t ATTRIBUTE_PURE
   117009 COLOR_CALC_STATE_PostBlendColorClampEnable_bits(const struct gen_device_info *devinfo)
   117010 {
   117011    switch (devinfo->gen) {
   117012    case 10: return 0;
   117013    case 9: return 0;
   117014    case 8: return 0;
   117015    case 7:
   117016       if (devinfo->is_haswell) {
   117017          return 0;
   117018       } else {
   117019          return 0;
   117020       }
   117021    case 6: return 0;
   117022    case 5: return 1;
   117023    case 4:
   117024       if (devinfo->is_g4x) {
   117025          return 1;
   117026       } else {
   117027          return 1;
   117028       }
   117029    default:
   117030       unreachable("Invalid hardware generation");
   117031    }
   117032 }
   117033 
   117034 
   117035 
   117036 #define GEN5_COLOR_CALC_STATE_PostBlendColorClampEnable_start  192
   117037 #define GEN45_COLOR_CALC_STATE_PostBlendColorClampEnable_start  192
   117038 #define GEN4_COLOR_CALC_STATE_PostBlendColorClampEnable_start  192
   117039 
   117040 static inline uint32_t ATTRIBUTE_PURE
   117041 COLOR_CALC_STATE_PostBlendColorClampEnable_start(const struct gen_device_info *devinfo)
   117042 {
   117043    switch (devinfo->gen) {
   117044    case 10: return 0;
   117045    case 9: return 0;
   117046    case 8: return 0;
   117047    case 7:
   117048       if (devinfo->is_haswell) {
   117049          return 0;
   117050       } else {
   117051          return 0;
   117052       }
   117053    case 6: return 0;
   117054    case 5: return 192;
   117055    case 4:
   117056       if (devinfo->is_g4x) {
   117057          return 192;
   117058       } else {
   117059          return 192;
   117060       }
   117061    default:
   117062       unreachable("Invalid hardware generation");
   117063    }
   117064 }
   117065 
   117066 
   117067 
   117068 /* COLOR_CALC_STATE::Pre-Blend Color Clamp Enable */
   117069 
   117070 
   117071 #define GEN5_COLOR_CALC_STATE_PreBlendColorClampEnable_bits  1
   117072 #define GEN45_COLOR_CALC_STATE_PreBlendColorClampEnable_bits  1
   117073 #define GEN4_COLOR_CALC_STATE_PreBlendColorClampEnable_bits  1
   117074 
   117075 static inline uint32_t ATTRIBUTE_PURE
   117076 COLOR_CALC_STATE_PreBlendColorClampEnable_bits(const struct gen_device_info *devinfo)
   117077 {
   117078    switch (devinfo->gen) {
   117079    case 10: return 0;
   117080    case 9: return 0;
   117081    case 8: return 0;
   117082    case 7:
   117083       if (devinfo->is_haswell) {
   117084          return 0;
   117085       } else {
   117086          return 0;
   117087       }
   117088    case 6: return 0;
   117089    case 5: return 1;
   117090    case 4:
   117091       if (devinfo->is_g4x) {
   117092          return 1;
   117093       } else {
   117094          return 1;
   117095       }
   117096    default:
   117097       unreachable("Invalid hardware generation");
   117098    }
   117099 }
   117100 
   117101 
   117102 
   117103 #define GEN5_COLOR_CALC_STATE_PreBlendColorClampEnable_start  193
   117104 #define GEN45_COLOR_CALC_STATE_PreBlendColorClampEnable_start  193
   117105 #define GEN4_COLOR_CALC_STATE_PreBlendColorClampEnable_start  193
   117106 
   117107 static inline uint32_t ATTRIBUTE_PURE
   117108 COLOR_CALC_STATE_PreBlendColorClampEnable_start(const struct gen_device_info *devinfo)
   117109 {
   117110    switch (devinfo->gen) {
   117111    case 10: return 0;
   117112    case 9: return 0;
   117113    case 8: return 0;
   117114    case 7:
   117115       if (devinfo->is_haswell) {
   117116          return 0;
   117117       } else {
   117118          return 0;
   117119       }
   117120    case 6: return 0;
   117121    case 5: return 193;
   117122    case 4:
   117123       if (devinfo->is_g4x) {
   117124          return 193;
   117125       } else {
   117126          return 193;
   117127       }
   117128    default:
   117129       unreachable("Invalid hardware generation");
   117130    }
   117131 }
   117132 
   117133 
   117134 
   117135 /* COLOR_CALC_STATE::Round Disable Function Disable */
   117136 
   117137 
   117138 #define GEN10_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117139 #define GEN9_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117140 #define GEN8_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117141 #define GEN75_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117142 #define GEN7_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117143 #define GEN6_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117144 #define GEN5_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117145 #define GEN45_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117146 #define GEN4_COLOR_CALC_STATE_RoundDisableFunctionDisable_bits  1
   117147 
   117148 static inline uint32_t ATTRIBUTE_PURE
   117149 COLOR_CALC_STATE_RoundDisableFunctionDisable_bits(const struct gen_device_info *devinfo)
   117150 {
   117151    switch (devinfo->gen) {
   117152    case 10: return 1;
   117153    case 9: return 1;
   117154    case 8: return 1;
   117155    case 7:
   117156       if (devinfo->is_haswell) {
   117157          return 1;
   117158       } else {
   117159          return 1;
   117160       }
   117161    case 6: return 1;
   117162    case 5: return 1;
   117163    case 4:
   117164       if (devinfo->is_g4x) {
   117165          return 1;
   117166       } else {
   117167          return 1;
   117168       }
   117169    default:
   117170       unreachable("Invalid hardware generation");
   117171    }
   117172 }
   117173 
   117174 
   117175 
   117176 #define GEN10_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  15
   117177 #define GEN9_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  15
   117178 #define GEN8_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  15
   117179 #define GEN75_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  15
   117180 #define GEN7_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  15
   117181 #define GEN6_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  15
   117182 #define GEN5_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  190
   117183 #define GEN45_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  190
   117184 #define GEN4_COLOR_CALC_STATE_RoundDisableFunctionDisable_start  190
   117185 
   117186 static inline uint32_t ATTRIBUTE_PURE
   117187 COLOR_CALC_STATE_RoundDisableFunctionDisable_start(const struct gen_device_info *devinfo)
   117188 {
   117189    switch (devinfo->gen) {
   117190    case 10: return 15;
   117191    case 9: return 15;
   117192    case 8: return 15;
   117193    case 7:
   117194       if (devinfo->is_haswell) {
   117195          return 15;
   117196       } else {
   117197          return 15;
   117198       }
   117199    case 6: return 15;
   117200    case 5: return 190;
   117201    case 4:
   117202       if (devinfo->is_g4x) {
   117203          return 190;
   117204       } else {
   117205          return 190;
   117206       }
   117207    default:
   117208       unreachable("Invalid hardware generation");
   117209    }
   117210 }
   117211 
   117212 
   117213 
   117214 /* COLOR_CALC_STATE::Source Alpha Blend Factor */
   117215 
   117216 
   117217 #define GEN5_COLOR_CALC_STATE_SourceAlphaBlendFactor_bits  5
   117218 #define GEN45_COLOR_CALC_STATE_SourceAlphaBlendFactor_bits  5
   117219 #define GEN4_COLOR_CALC_STATE_SourceAlphaBlendFactor_bits  5
   117220 
   117221 static inline uint32_t ATTRIBUTE_PURE
   117222 COLOR_CALC_STATE_SourceAlphaBlendFactor_bits(const struct gen_device_info *devinfo)
   117223 {
   117224    switch (devinfo->gen) {
   117225    case 10: return 0;
   117226    case 9: return 0;
   117227    case 8: return 0;
   117228    case 7:
   117229       if (devinfo->is_haswell) {
   117230          return 0;
   117231       } else {
   117232          return 0;
   117233       }
   117234    case 6: return 0;
   117235    case 5: return 5;
   117236    case 4:
   117237       if (devinfo->is_g4x) {
   117238          return 5;
   117239       } else {
   117240          return 5;
   117241       }
   117242    default:
   117243       unreachable("Invalid hardware generation");
   117244    }
   117245 }
   117246 
   117247 
   117248 
   117249 #define GEN5_COLOR_CALC_STATE_SourceAlphaBlendFactor_start  167
   117250 #define GEN45_COLOR_CALC_STATE_SourceAlphaBlendFactor_start  167
   117251 #define GEN4_COLOR_CALC_STATE_SourceAlphaBlendFactor_start  167
   117252 
   117253 static inline uint32_t ATTRIBUTE_PURE
   117254 COLOR_CALC_STATE_SourceAlphaBlendFactor_start(const struct gen_device_info *devinfo)
   117255 {
   117256    switch (devinfo->gen) {
   117257    case 10: return 0;
   117258    case 9: return 0;
   117259    case 8: return 0;
   117260    case 7:
   117261       if (devinfo->is_haswell) {
   117262          return 0;
   117263       } else {
   117264          return 0;
   117265       }
   117266    case 6: return 0;
   117267    case 5: return 167;
   117268    case 4:
   117269       if (devinfo->is_g4x) {
   117270          return 167;
   117271       } else {
   117272          return 167;
   117273       }
   117274    default:
   117275       unreachable("Invalid hardware generation");
   117276    }
   117277 }
   117278 
   117279 
   117280 
   117281 /* COLOR_CALC_STATE::Source Blend Factor */
   117282 
   117283 
   117284 #define GEN5_COLOR_CALC_STATE_SourceBlendFactor_bits  5
   117285 #define GEN45_COLOR_CALC_STATE_SourceBlendFactor_bits  5
   117286 #define GEN4_COLOR_CALC_STATE_SourceBlendFactor_bits  5
   117287 
   117288 static inline uint32_t ATTRIBUTE_PURE
   117289 COLOR_CALC_STATE_SourceBlendFactor_bits(const struct gen_device_info *devinfo)
   117290 {
   117291    switch (devinfo->gen) {
   117292    case 10: return 0;
   117293    case 9: return 0;
   117294    case 8: return 0;
   117295    case 7:
   117296       if (devinfo->is_haswell) {
   117297          return 0;
   117298       } else {
   117299          return 0;
   117300       }
   117301    case 6: return 0;
   117302    case 5: return 5;
   117303    case 4:
   117304       if (devinfo->is_g4x) {
   117305          return 5;
   117306       } else {
   117307          return 5;
   117308       }
   117309    default:
   117310       unreachable("Invalid hardware generation");
   117311    }
   117312 }
   117313 
   117314 
   117315 
   117316 #define GEN5_COLOR_CALC_STATE_SourceBlendFactor_start  216
   117317 #define GEN45_COLOR_CALC_STATE_SourceBlendFactor_start  216
   117318 #define GEN4_COLOR_CALC_STATE_SourceBlendFactor_start  216
   117319 
   117320 static inline uint32_t ATTRIBUTE_PURE
   117321 COLOR_CALC_STATE_SourceBlendFactor_start(const struct gen_device_info *devinfo)
   117322 {
   117323    switch (devinfo->gen) {
   117324    case 10: return 0;
   117325    case 9: return 0;
   117326    case 8: return 0;
   117327    case 7:
   117328       if (devinfo->is_haswell) {
   117329          return 0;
   117330       } else {
   117331          return 0;
   117332       }
   117333    case 6: return 0;
   117334    case 5: return 216;
   117335    case 4:
   117336       if (devinfo->is_g4x) {
   117337          return 216;
   117338       } else {
   117339          return 216;
   117340       }
   117341    default:
   117342       unreachable("Invalid hardware generation");
   117343    }
   117344 }
   117345 
   117346 
   117347 
   117348 /* COLOR_CALC_STATE::Statistics Enable */
   117349 
   117350 
   117351 #define GEN5_COLOR_CALC_STATE_StatisticsEnable_bits  1
   117352 #define GEN45_COLOR_CALC_STATE_StatisticsEnable_bits  1
   117353 #define GEN4_COLOR_CALC_STATE_StatisticsEnable_bits  1
   117354 
   117355 static inline uint32_t ATTRIBUTE_PURE
   117356 COLOR_CALC_STATE_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   117357 {
   117358    switch (devinfo->gen) {
   117359    case 10: return 0;
   117360    case 9: return 0;
   117361    case 8: return 0;
   117362    case 7:
   117363       if (devinfo->is_haswell) {
   117364          return 0;
   117365       } else {
   117366          return 0;
   117367       }
   117368    case 6: return 0;
   117369    case 5: return 1;
   117370    case 4:
   117371       if (devinfo->is_g4x) {
   117372          return 1;
   117373       } else {
   117374          return 1;
   117375       }
   117376    default:
   117377       unreachable("Invalid hardware generation");
   117378    }
   117379 }
   117380 
   117381 
   117382 
   117383 #define GEN5_COLOR_CALC_STATE_StatisticsEnable_start  175
   117384 #define GEN45_COLOR_CALC_STATE_StatisticsEnable_start  175
   117385 #define GEN4_COLOR_CALC_STATE_StatisticsEnable_start  175
   117386 
   117387 static inline uint32_t ATTRIBUTE_PURE
   117388 COLOR_CALC_STATE_StatisticsEnable_start(const struct gen_device_info *devinfo)
   117389 {
   117390    switch (devinfo->gen) {
   117391    case 10: return 0;
   117392    case 9: return 0;
   117393    case 8: return 0;
   117394    case 7:
   117395       if (devinfo->is_haswell) {
   117396          return 0;
   117397       } else {
   117398          return 0;
   117399       }
   117400    case 6: return 0;
   117401    case 5: return 175;
   117402    case 4:
   117403       if (devinfo->is_g4x) {
   117404          return 175;
   117405       } else {
   117406          return 175;
   117407       }
   117408    default:
   117409       unreachable("Invalid hardware generation");
   117410    }
   117411 }
   117412 
   117413 
   117414 
   117415 /* COLOR_CALC_STATE::Stencil Buffer Write Enable */
   117416 
   117417 
   117418 #define GEN5_COLOR_CALC_STATE_StencilBufferWriteEnable_bits  1
   117419 #define GEN45_COLOR_CALC_STATE_StencilBufferWriteEnable_bits  1
   117420 #define GEN4_COLOR_CALC_STATE_StencilBufferWriteEnable_bits  1
   117421 
   117422 static inline uint32_t ATTRIBUTE_PURE
   117423 COLOR_CALC_STATE_StencilBufferWriteEnable_bits(const struct gen_device_info *devinfo)
   117424 {
   117425    switch (devinfo->gen) {
   117426    case 10: return 0;
   117427    case 9: return 0;
   117428    case 8: return 0;
   117429    case 7:
   117430       if (devinfo->is_haswell) {
   117431          return 0;
   117432       } else {
   117433          return 0;
   117434       }
   117435    case 6: return 0;
   117436    case 5: return 1;
   117437    case 4:
   117438       if (devinfo->is_g4x) {
   117439          return 1;
   117440       } else {
   117441          return 1;
   117442       }
   117443    default:
   117444       unreachable("Invalid hardware generation");
   117445    }
   117446 }
   117447 
   117448 
   117449 
   117450 #define GEN5_COLOR_CALC_STATE_StencilBufferWriteEnable_start  18
   117451 #define GEN45_COLOR_CALC_STATE_StencilBufferWriteEnable_start  18
   117452 #define GEN4_COLOR_CALC_STATE_StencilBufferWriteEnable_start  18
   117453 
   117454 static inline uint32_t ATTRIBUTE_PURE
   117455 COLOR_CALC_STATE_StencilBufferWriteEnable_start(const struct gen_device_info *devinfo)
   117456 {
   117457    switch (devinfo->gen) {
   117458    case 10: return 0;
   117459    case 9: return 0;
   117460    case 8: return 0;
   117461    case 7:
   117462       if (devinfo->is_haswell) {
   117463          return 0;
   117464       } else {
   117465          return 0;
   117466       }
   117467    case 6: return 0;
   117468    case 5: return 18;
   117469    case 4:
   117470       if (devinfo->is_g4x) {
   117471          return 18;
   117472       } else {
   117473          return 18;
   117474       }
   117475    default:
   117476       unreachable("Invalid hardware generation");
   117477    }
   117478 }
   117479 
   117480 
   117481 
   117482 /* COLOR_CALC_STATE::Stencil Fail Op */
   117483 
   117484 
   117485 #define GEN5_COLOR_CALC_STATE_StencilFailOp_bits  3
   117486 #define GEN45_COLOR_CALC_STATE_StencilFailOp_bits  3
   117487 #define GEN4_COLOR_CALC_STATE_StencilFailOp_bits  3
   117488 
   117489 static inline uint32_t ATTRIBUTE_PURE
   117490 COLOR_CALC_STATE_StencilFailOp_bits(const struct gen_device_info *devinfo)
   117491 {
   117492    switch (devinfo->gen) {
   117493    case 10: return 0;
   117494    case 9: return 0;
   117495    case 8: return 0;
   117496    case 7:
   117497       if (devinfo->is_haswell) {
   117498          return 0;
   117499       } else {
   117500          return 0;
   117501       }
   117502    case 6: return 0;
   117503    case 5: return 3;
   117504    case 4:
   117505       if (devinfo->is_g4x) {
   117506          return 3;
   117507       } else {
   117508          return 3;
   117509       }
   117510    default:
   117511       unreachable("Invalid hardware generation");
   117512    }
   117513 }
   117514 
   117515 
   117516 
   117517 #define GEN5_COLOR_CALC_STATE_StencilFailOp_start  25
   117518 #define GEN45_COLOR_CALC_STATE_StencilFailOp_start  25
   117519 #define GEN4_COLOR_CALC_STATE_StencilFailOp_start  25
   117520 
   117521 static inline uint32_t ATTRIBUTE_PURE
   117522 COLOR_CALC_STATE_StencilFailOp_start(const struct gen_device_info *devinfo)
   117523 {
   117524    switch (devinfo->gen) {
   117525    case 10: return 0;
   117526    case 9: return 0;
   117527    case 8: return 0;
   117528    case 7:
   117529       if (devinfo->is_haswell) {
   117530          return 0;
   117531       } else {
   117532          return 0;
   117533       }
   117534    case 6: return 0;
   117535    case 5: return 25;
   117536    case 4:
   117537       if (devinfo->is_g4x) {
   117538          return 25;
   117539       } else {
   117540          return 25;
   117541       }
   117542    default:
   117543       unreachable("Invalid hardware generation");
   117544    }
   117545 }
   117546 
   117547 
   117548 
   117549 /* COLOR_CALC_STATE::Stencil Pass Depth Fail Op */
   117550 
   117551 
   117552 #define GEN5_COLOR_CALC_STATE_StencilPassDepthFailOp_bits  3
   117553 #define GEN45_COLOR_CALC_STATE_StencilPassDepthFailOp_bits  3
   117554 #define GEN4_COLOR_CALC_STATE_StencilPassDepthFailOp_bits  3
   117555 
   117556 static inline uint32_t ATTRIBUTE_PURE
   117557 COLOR_CALC_STATE_StencilPassDepthFailOp_bits(const struct gen_device_info *devinfo)
   117558 {
   117559    switch (devinfo->gen) {
   117560    case 10: return 0;
   117561    case 9: return 0;
   117562    case 8: return 0;
   117563    case 7:
   117564       if (devinfo->is_haswell) {
   117565          return 0;
   117566       } else {
   117567          return 0;
   117568       }
   117569    case 6: return 0;
   117570    case 5: return 3;
   117571    case 4:
   117572       if (devinfo->is_g4x) {
   117573          return 3;
   117574       } else {
   117575          return 3;
   117576       }
   117577    default:
   117578       unreachable("Invalid hardware generation");
   117579    }
   117580 }
   117581 
   117582 
   117583 
   117584 #define GEN5_COLOR_CALC_STATE_StencilPassDepthFailOp_start  22
   117585 #define GEN45_COLOR_CALC_STATE_StencilPassDepthFailOp_start  22
   117586 #define GEN4_COLOR_CALC_STATE_StencilPassDepthFailOp_start  22
   117587 
   117588 static inline uint32_t ATTRIBUTE_PURE
   117589 COLOR_CALC_STATE_StencilPassDepthFailOp_start(const struct gen_device_info *devinfo)
   117590 {
   117591    switch (devinfo->gen) {
   117592    case 10: return 0;
   117593    case 9: return 0;
   117594    case 8: return 0;
   117595    case 7:
   117596       if (devinfo->is_haswell) {
   117597          return 0;
   117598       } else {
   117599          return 0;
   117600       }
   117601    case 6: return 0;
   117602    case 5: return 22;
   117603    case 4:
   117604       if (devinfo->is_g4x) {
   117605          return 22;
   117606       } else {
   117607          return 22;
   117608       }
   117609    default:
   117610       unreachable("Invalid hardware generation");
   117611    }
   117612 }
   117613 
   117614 
   117615 
   117616 /* COLOR_CALC_STATE::Stencil Pass Depth Pass Op */
   117617 
   117618 
   117619 #define GEN5_COLOR_CALC_STATE_StencilPassDepthPassOp_bits  3
   117620 #define GEN45_COLOR_CALC_STATE_StencilPassDepthPassOp_bits  3
   117621 #define GEN4_COLOR_CALC_STATE_StencilPassDepthPassOp_bits  3
   117622 
   117623 static inline uint32_t ATTRIBUTE_PURE
   117624 COLOR_CALC_STATE_StencilPassDepthPassOp_bits(const struct gen_device_info *devinfo)
   117625 {
   117626    switch (devinfo->gen) {
   117627    case 10: return 0;
   117628    case 9: return 0;
   117629    case 8: return 0;
   117630    case 7:
   117631       if (devinfo->is_haswell) {
   117632          return 0;
   117633       } else {
   117634          return 0;
   117635       }
   117636    case 6: return 0;
   117637    case 5: return 3;
   117638    case 4:
   117639       if (devinfo->is_g4x) {
   117640          return 3;
   117641       } else {
   117642          return 3;
   117643       }
   117644    default:
   117645       unreachable("Invalid hardware generation");
   117646    }
   117647 }
   117648 
   117649 
   117650 
   117651 #define GEN5_COLOR_CALC_STATE_StencilPassDepthPassOp_start  19
   117652 #define GEN45_COLOR_CALC_STATE_StencilPassDepthPassOp_start  19
   117653 #define GEN4_COLOR_CALC_STATE_StencilPassDepthPassOp_start  19
   117654 
   117655 static inline uint32_t ATTRIBUTE_PURE
   117656 COLOR_CALC_STATE_StencilPassDepthPassOp_start(const struct gen_device_info *devinfo)
   117657 {
   117658    switch (devinfo->gen) {
   117659    case 10: return 0;
   117660    case 9: return 0;
   117661    case 8: return 0;
   117662    case 7:
   117663       if (devinfo->is_haswell) {
   117664          return 0;
   117665       } else {
   117666          return 0;
   117667       }
   117668    case 6: return 0;
   117669    case 5: return 19;
   117670    case 4:
   117671       if (devinfo->is_g4x) {
   117672          return 19;
   117673       } else {
   117674          return 19;
   117675       }
   117676    default:
   117677       unreachable("Invalid hardware generation");
   117678    }
   117679 }
   117680 
   117681 
   117682 
   117683 /* COLOR_CALC_STATE::Stencil Reference Value */
   117684 
   117685 
   117686 #define GEN8_COLOR_CALC_STATE_StencilReferenceValue_bits  8
   117687 #define GEN75_COLOR_CALC_STATE_StencilReferenceValue_bits  8
   117688 #define GEN7_COLOR_CALC_STATE_StencilReferenceValue_bits  8
   117689 #define GEN6_COLOR_CALC_STATE_StencilReferenceValue_bits  8
   117690 #define GEN5_COLOR_CALC_STATE_StencilReferenceValue_bits  8
   117691 #define GEN45_COLOR_CALC_STATE_StencilReferenceValue_bits  8
   117692 #define GEN4_COLOR_CALC_STATE_StencilReferenceValue_bits  8
   117693 
   117694 static inline uint32_t ATTRIBUTE_PURE
   117695 COLOR_CALC_STATE_StencilReferenceValue_bits(const struct gen_device_info *devinfo)
   117696 {
   117697    switch (devinfo->gen) {
   117698    case 10: return 0;
   117699    case 9: return 0;
   117700    case 8: return 8;
   117701    case 7:
   117702       if (devinfo->is_haswell) {
   117703          return 8;
   117704       } else {
   117705          return 8;
   117706       }
   117707    case 6: return 8;
   117708    case 5: return 8;
   117709    case 4:
   117710       if (devinfo->is_g4x) {
   117711          return 8;
   117712       } else {
   117713          return 8;
   117714       }
   117715    default:
   117716       unreachable("Invalid hardware generation");
   117717    }
   117718 }
   117719 
   117720 
   117721 
   117722 #define GEN8_COLOR_CALC_STATE_StencilReferenceValue_start  24
   117723 #define GEN75_COLOR_CALC_STATE_StencilReferenceValue_start  24
   117724 #define GEN7_COLOR_CALC_STATE_StencilReferenceValue_start  24
   117725 #define GEN6_COLOR_CALC_STATE_StencilReferenceValue_start  24
   117726 #define GEN5_COLOR_CALC_STATE_StencilReferenceValue_start  56
   117727 #define GEN45_COLOR_CALC_STATE_StencilReferenceValue_start  56
   117728 #define GEN4_COLOR_CALC_STATE_StencilReferenceValue_start  56
   117729 
   117730 static inline uint32_t ATTRIBUTE_PURE
   117731 COLOR_CALC_STATE_StencilReferenceValue_start(const struct gen_device_info *devinfo)
   117732 {
   117733    switch (devinfo->gen) {
   117734    case 10: return 0;
   117735    case 9: return 0;
   117736    case 8: return 24;
   117737    case 7:
   117738       if (devinfo->is_haswell) {
   117739          return 24;
   117740       } else {
   117741          return 24;
   117742       }
   117743    case 6: return 24;
   117744    case 5: return 56;
   117745    case 4:
   117746       if (devinfo->is_g4x) {
   117747          return 56;
   117748       } else {
   117749          return 56;
   117750       }
   117751    default:
   117752       unreachable("Invalid hardware generation");
   117753    }
   117754 }
   117755 
   117756 
   117757 
   117758 /* COLOR_CALC_STATE::Stencil Test Enable */
   117759 
   117760 
   117761 #define GEN5_COLOR_CALC_STATE_StencilTestEnable_bits  1
   117762 #define GEN45_COLOR_CALC_STATE_StencilTestEnable_bits  1
   117763 #define GEN4_COLOR_CALC_STATE_StencilTestEnable_bits  1
   117764 
   117765 static inline uint32_t ATTRIBUTE_PURE
   117766 COLOR_CALC_STATE_StencilTestEnable_bits(const struct gen_device_info *devinfo)
   117767 {
   117768    switch (devinfo->gen) {
   117769    case 10: return 0;
   117770    case 9: return 0;
   117771    case 8: return 0;
   117772    case 7:
   117773       if (devinfo->is_haswell) {
   117774          return 0;
   117775       } else {
   117776          return 0;
   117777       }
   117778    case 6: return 0;
   117779    case 5: return 1;
   117780    case 4:
   117781       if (devinfo->is_g4x) {
   117782          return 1;
   117783       } else {
   117784          return 1;
   117785       }
   117786    default:
   117787       unreachable("Invalid hardware generation");
   117788    }
   117789 }
   117790 
   117791 
   117792 
   117793 #define GEN5_COLOR_CALC_STATE_StencilTestEnable_start  31
   117794 #define GEN45_COLOR_CALC_STATE_StencilTestEnable_start  31
   117795 #define GEN4_COLOR_CALC_STATE_StencilTestEnable_start  31
   117796 
   117797 static inline uint32_t ATTRIBUTE_PURE
   117798 COLOR_CALC_STATE_StencilTestEnable_start(const struct gen_device_info *devinfo)
   117799 {
   117800    switch (devinfo->gen) {
   117801    case 10: return 0;
   117802    case 9: return 0;
   117803    case 8: return 0;
   117804    case 7:
   117805       if (devinfo->is_haswell) {
   117806          return 0;
   117807       } else {
   117808          return 0;
   117809       }
   117810    case 6: return 0;
   117811    case 5: return 31;
   117812    case 4:
   117813       if (devinfo->is_g4x) {
   117814          return 31;
   117815       } else {
   117816          return 31;
   117817       }
   117818    default:
   117819       unreachable("Invalid hardware generation");
   117820    }
   117821 }
   117822 
   117823 
   117824 
   117825 /* COLOR_CALC_STATE::Stencil Test Function */
   117826 
   117827 
   117828 #define GEN5_COLOR_CALC_STATE_StencilTestFunction_bits  3
   117829 #define GEN45_COLOR_CALC_STATE_StencilTestFunction_bits  3
   117830 #define GEN4_COLOR_CALC_STATE_StencilTestFunction_bits  3
   117831 
   117832 static inline uint32_t ATTRIBUTE_PURE
   117833 COLOR_CALC_STATE_StencilTestFunction_bits(const struct gen_device_info *devinfo)
   117834 {
   117835    switch (devinfo->gen) {
   117836    case 10: return 0;
   117837    case 9: return 0;
   117838    case 8: return 0;
   117839    case 7:
   117840       if (devinfo->is_haswell) {
   117841          return 0;
   117842       } else {
   117843          return 0;
   117844       }
   117845    case 6: return 0;
   117846    case 5: return 3;
   117847    case 4:
   117848       if (devinfo->is_g4x) {
   117849          return 3;
   117850       } else {
   117851          return 3;
   117852       }
   117853    default:
   117854       unreachable("Invalid hardware generation");
   117855    }
   117856 }
   117857 
   117858 
   117859 
   117860 #define GEN5_COLOR_CALC_STATE_StencilTestFunction_start  28
   117861 #define GEN45_COLOR_CALC_STATE_StencilTestFunction_start  28
   117862 #define GEN4_COLOR_CALC_STATE_StencilTestFunction_start  28
   117863 
   117864 static inline uint32_t ATTRIBUTE_PURE
   117865 COLOR_CALC_STATE_StencilTestFunction_start(const struct gen_device_info *devinfo)
   117866 {
   117867    switch (devinfo->gen) {
   117868    case 10: return 0;
   117869    case 9: return 0;
   117870    case 8: return 0;
   117871    case 7:
   117872       if (devinfo->is_haswell) {
   117873          return 0;
   117874       } else {
   117875          return 0;
   117876       }
   117877    case 6: return 0;
   117878    case 5: return 28;
   117879    case 4:
   117880       if (devinfo->is_g4x) {
   117881          return 28;
   117882       } else {
   117883          return 28;
   117884       }
   117885    default:
   117886       unreachable("Invalid hardware generation");
   117887    }
   117888 }
   117889 
   117890 
   117891 
   117892 /* COLOR_CALC_STATE::Stencil Test Mask */
   117893 
   117894 
   117895 #define GEN5_COLOR_CALC_STATE_StencilTestMask_bits  8
   117896 #define GEN45_COLOR_CALC_STATE_StencilTestMask_bits  8
   117897 #define GEN4_COLOR_CALC_STATE_StencilTestMask_bits  8
   117898 
   117899 static inline uint32_t ATTRIBUTE_PURE
   117900 COLOR_CALC_STATE_StencilTestMask_bits(const struct gen_device_info *devinfo)
   117901 {
   117902    switch (devinfo->gen) {
   117903    case 10: return 0;
   117904    case 9: return 0;
   117905    case 8: return 0;
   117906    case 7:
   117907       if (devinfo->is_haswell) {
   117908          return 0;
   117909       } else {
   117910          return 0;
   117911       }
   117912    case 6: return 0;
   117913    case 5: return 8;
   117914    case 4:
   117915       if (devinfo->is_g4x) {
   117916          return 8;
   117917       } else {
   117918          return 8;
   117919       }
   117920    default:
   117921       unreachable("Invalid hardware generation");
   117922    }
   117923 }
   117924 
   117925 
   117926 
   117927 #define GEN5_COLOR_CALC_STATE_StencilTestMask_start  48
   117928 #define GEN45_COLOR_CALC_STATE_StencilTestMask_start  48
   117929 #define GEN4_COLOR_CALC_STATE_StencilTestMask_start  48
   117930 
   117931 static inline uint32_t ATTRIBUTE_PURE
   117932 COLOR_CALC_STATE_StencilTestMask_start(const struct gen_device_info *devinfo)
   117933 {
   117934    switch (devinfo->gen) {
   117935    case 10: return 0;
   117936    case 9: return 0;
   117937    case 8: return 0;
   117938    case 7:
   117939       if (devinfo->is_haswell) {
   117940          return 0;
   117941       } else {
   117942          return 0;
   117943       }
   117944    case 6: return 0;
   117945    case 5: return 48;
   117946    case 4:
   117947       if (devinfo->is_g4x) {
   117948          return 48;
   117949       } else {
   117950          return 48;
   117951       }
   117952    default:
   117953       unreachable("Invalid hardware generation");
   117954    }
   117955 }
   117956 
   117957 
   117958 
   117959 /* COLOR_CALC_STATE::Stencil Write Mask */
   117960 
   117961 
   117962 #define GEN5_COLOR_CALC_STATE_StencilWriteMask_bits  8
   117963 #define GEN45_COLOR_CALC_STATE_StencilWriteMask_bits  8
   117964 #define GEN4_COLOR_CALC_STATE_StencilWriteMask_bits  8
   117965 
   117966 static inline uint32_t ATTRIBUTE_PURE
   117967 COLOR_CALC_STATE_StencilWriteMask_bits(const struct gen_device_info *devinfo)
   117968 {
   117969    switch (devinfo->gen) {
   117970    case 10: return 0;
   117971    case 9: return 0;
   117972    case 8: return 0;
   117973    case 7:
   117974       if (devinfo->is_haswell) {
   117975          return 0;
   117976       } else {
   117977          return 0;
   117978       }
   117979    case 6: return 0;
   117980    case 5: return 8;
   117981    case 4:
   117982       if (devinfo->is_g4x) {
   117983          return 8;
   117984       } else {
   117985          return 8;
   117986       }
   117987    default:
   117988       unreachable("Invalid hardware generation");
   117989    }
   117990 }
   117991 
   117992 
   117993 
   117994 #define GEN5_COLOR_CALC_STATE_StencilWriteMask_start  40
   117995 #define GEN45_COLOR_CALC_STATE_StencilWriteMask_start  40
   117996 #define GEN4_COLOR_CALC_STATE_StencilWriteMask_start  40
   117997 
   117998 static inline uint32_t ATTRIBUTE_PURE
   117999 COLOR_CALC_STATE_StencilWriteMask_start(const struct gen_device_info *devinfo)
   118000 {
   118001    switch (devinfo->gen) {
   118002    case 10: return 0;
   118003    case 9: return 0;
   118004    case 8: return 0;
   118005    case 7:
   118006       if (devinfo->is_haswell) {
   118007          return 0;
   118008       } else {
   118009          return 0;
   118010       }
   118011    case 6: return 0;
   118012    case 5: return 40;
   118013    case 4:
   118014       if (devinfo->is_g4x) {
   118015          return 40;
   118016       } else {
   118017          return 40;
   118018       }
   118019    default:
   118020       unreachable("Invalid hardware generation");
   118021    }
   118022 }
   118023 
   118024 
   118025 
   118026 /* COLOR_CALC_STATE::X Dither Offset */
   118027 
   118028 
   118029 #define GEN5_COLOR_CALC_STATE_XDitherOffset_bits  2
   118030 #define GEN45_COLOR_CALC_STATE_XDitherOffset_bits  2
   118031 #define GEN4_COLOR_CALC_STATE_XDitherOffset_bits  2
   118032 
   118033 static inline uint32_t ATTRIBUTE_PURE
   118034 COLOR_CALC_STATE_XDitherOffset_bits(const struct gen_device_info *devinfo)
   118035 {
   118036    switch (devinfo->gen) {
   118037    case 10: return 0;
   118038    case 9: return 0;
   118039    case 8: return 0;
   118040    case 7:
   118041       if (devinfo->is_haswell) {
   118042          return 0;
   118043       } else {
   118044          return 0;
   118045       }
   118046    case 6: return 0;
   118047    case 5: return 2;
   118048    case 4:
   118049       if (devinfo->is_g4x) {
   118050          return 2;
   118051       } else {
   118052          return 2;
   118053       }
   118054    default:
   118055       unreachable("Invalid hardware generation");
   118056    }
   118057 }
   118058 
   118059 
   118060 
   118061 #define GEN5_COLOR_CALC_STATE_XDitherOffset_start  209
   118062 #define GEN45_COLOR_CALC_STATE_XDitherOffset_start  209
   118063 #define GEN4_COLOR_CALC_STATE_XDitherOffset_start  209
   118064 
   118065 static inline uint32_t ATTRIBUTE_PURE
   118066 COLOR_CALC_STATE_XDitherOffset_start(const struct gen_device_info *devinfo)
   118067 {
   118068    switch (devinfo->gen) {
   118069    case 10: return 0;
   118070    case 9: return 0;
   118071    case 8: return 0;
   118072    case 7:
   118073       if (devinfo->is_haswell) {
   118074          return 0;
   118075       } else {
   118076          return 0;
   118077       }
   118078    case 6: return 0;
   118079    case 5: return 209;
   118080    case 4:
   118081       if (devinfo->is_g4x) {
   118082          return 209;
   118083       } else {
   118084          return 209;
   118085       }
   118086    default:
   118087       unreachable("Invalid hardware generation");
   118088    }
   118089 }
   118090 
   118091 
   118092 
   118093 /* COLOR_CALC_STATE::Y Dither Offset */
   118094 
   118095 
   118096 #define GEN5_COLOR_CALC_STATE_YDitherOffset_bits  2
   118097 #define GEN45_COLOR_CALC_STATE_YDitherOffset_bits  2
   118098 #define GEN4_COLOR_CALC_STATE_YDitherOffset_bits  2
   118099 
   118100 static inline uint32_t ATTRIBUTE_PURE
   118101 COLOR_CALC_STATE_YDitherOffset_bits(const struct gen_device_info *devinfo)
   118102 {
   118103    switch (devinfo->gen) {
   118104    case 10: return 0;
   118105    case 9: return 0;
   118106    case 8: return 0;
   118107    case 7:
   118108       if (devinfo->is_haswell) {
   118109          return 0;
   118110       } else {
   118111          return 0;
   118112       }
   118113    case 6: return 0;
   118114    case 5: return 2;
   118115    case 4:
   118116       if (devinfo->is_g4x) {
   118117          return 2;
   118118       } else {
   118119          return 2;
   118120       }
   118121    default:
   118122       unreachable("Invalid hardware generation");
   118123    }
   118124 }
   118125 
   118126 
   118127 
   118128 #define GEN5_COLOR_CALC_STATE_YDitherOffset_start  207
   118129 #define GEN45_COLOR_CALC_STATE_YDitherOffset_start  207
   118130 #define GEN4_COLOR_CALC_STATE_YDitherOffset_start  207
   118131 
   118132 static inline uint32_t ATTRIBUTE_PURE
   118133 COLOR_CALC_STATE_YDitherOffset_start(const struct gen_device_info *devinfo)
   118134 {
   118135    switch (devinfo->gen) {
   118136    case 10: return 0;
   118137    case 9: return 0;
   118138    case 8: return 0;
   118139    case 7:
   118140       if (devinfo->is_haswell) {
   118141          return 0;
   118142       } else {
   118143          return 0;
   118144       }
   118145    case 6: return 0;
   118146    case 5: return 207;
   118147    case 4:
   118148       if (devinfo->is_g4x) {
   118149          return 207;
   118150       } else {
   118151          return 207;
   118152       }
   118153    default:
   118154       unreachable("Invalid hardware generation");
   118155    }
   118156 }
   118157 
   118158 
   118159 
   118160 /* CONSTANT_BUFFER */
   118161 
   118162 
   118163 #define GEN5_CONSTANT_BUFFER_length  2
   118164 #define GEN45_CONSTANT_BUFFER_length  2
   118165 #define GEN4_CONSTANT_BUFFER_length  2
   118166 
   118167 static inline uint32_t ATTRIBUTE_PURE
   118168 CONSTANT_BUFFER_length(const struct gen_device_info *devinfo)
   118169 {
   118170    switch (devinfo->gen) {
   118171    case 10: return 0;
   118172    case 9: return 0;
   118173    case 8: return 0;
   118174    case 7:
   118175       if (devinfo->is_haswell) {
   118176          return 0;
   118177       } else {
   118178          return 0;
   118179       }
   118180    case 6: return 0;
   118181    case 5: return 2;
   118182    case 4:
   118183       if (devinfo->is_g4x) {
   118184          return 2;
   118185       } else {
   118186          return 2;
   118187       }
   118188    default:
   118189       unreachable("Invalid hardware generation");
   118190    }
   118191 }
   118192 
   118193 
   118194 
   118195 /* CONSTANT_BUFFER::3D Command Opcode */
   118196 
   118197 
   118198 #define GEN5_CONSTANT_BUFFER_3DCommandOpcode_bits  3
   118199 #define GEN45_CONSTANT_BUFFER_3DCommandOpcode_bits  3
   118200 #define GEN4_CONSTANT_BUFFER_3DCommandOpcode_bits  3
   118201 
   118202 static inline uint32_t ATTRIBUTE_PURE
   118203 CONSTANT_BUFFER_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   118204 {
   118205    switch (devinfo->gen) {
   118206    case 10: return 0;
   118207    case 9: return 0;
   118208    case 8: return 0;
   118209    case 7:
   118210       if (devinfo->is_haswell) {
   118211          return 0;
   118212       } else {
   118213          return 0;
   118214       }
   118215    case 6: return 0;
   118216    case 5: return 3;
   118217    case 4:
   118218       if (devinfo->is_g4x) {
   118219          return 3;
   118220       } else {
   118221          return 3;
   118222       }
   118223    default:
   118224       unreachable("Invalid hardware generation");
   118225    }
   118226 }
   118227 
   118228 
   118229 
   118230 #define GEN5_CONSTANT_BUFFER_3DCommandOpcode_start  24
   118231 #define GEN45_CONSTANT_BUFFER_3DCommandOpcode_start  24
   118232 #define GEN4_CONSTANT_BUFFER_3DCommandOpcode_start  24
   118233 
   118234 static inline uint32_t ATTRIBUTE_PURE
   118235 CONSTANT_BUFFER_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   118236 {
   118237    switch (devinfo->gen) {
   118238    case 10: return 0;
   118239    case 9: return 0;
   118240    case 8: return 0;
   118241    case 7:
   118242       if (devinfo->is_haswell) {
   118243          return 0;
   118244       } else {
   118245          return 0;
   118246       }
   118247    case 6: return 0;
   118248    case 5: return 24;
   118249    case 4:
   118250       if (devinfo->is_g4x) {
   118251          return 24;
   118252       } else {
   118253          return 24;
   118254       }
   118255    default:
   118256       unreachable("Invalid hardware generation");
   118257    }
   118258 }
   118259 
   118260 
   118261 
   118262 /* CONSTANT_BUFFER::3D Command Sub Opcode */
   118263 
   118264 
   118265 #define GEN5_CONSTANT_BUFFER_3DCommandSubOpcode_bits  8
   118266 #define GEN45_CONSTANT_BUFFER_3DCommandSubOpcode_bits  8
   118267 #define GEN4_CONSTANT_BUFFER_3DCommandSubOpcode_bits  8
   118268 
   118269 static inline uint32_t ATTRIBUTE_PURE
   118270 CONSTANT_BUFFER_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   118271 {
   118272    switch (devinfo->gen) {
   118273    case 10: return 0;
   118274    case 9: return 0;
   118275    case 8: return 0;
   118276    case 7:
   118277       if (devinfo->is_haswell) {
   118278          return 0;
   118279       } else {
   118280          return 0;
   118281       }
   118282    case 6: return 0;
   118283    case 5: return 8;
   118284    case 4:
   118285       if (devinfo->is_g4x) {
   118286          return 8;
   118287       } else {
   118288          return 8;
   118289       }
   118290    default:
   118291       unreachable("Invalid hardware generation");
   118292    }
   118293 }
   118294 
   118295 
   118296 
   118297 #define GEN5_CONSTANT_BUFFER_3DCommandSubOpcode_start  16
   118298 #define GEN45_CONSTANT_BUFFER_3DCommandSubOpcode_start  16
   118299 #define GEN4_CONSTANT_BUFFER_3DCommandSubOpcode_start  16
   118300 
   118301 static inline uint32_t ATTRIBUTE_PURE
   118302 CONSTANT_BUFFER_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   118303 {
   118304    switch (devinfo->gen) {
   118305    case 10: return 0;
   118306    case 9: return 0;
   118307    case 8: return 0;
   118308    case 7:
   118309       if (devinfo->is_haswell) {
   118310          return 0;
   118311       } else {
   118312          return 0;
   118313       }
   118314    case 6: return 0;
   118315    case 5: return 16;
   118316    case 4:
   118317       if (devinfo->is_g4x) {
   118318          return 16;
   118319       } else {
   118320          return 16;
   118321       }
   118322    default:
   118323       unreachable("Invalid hardware generation");
   118324    }
   118325 }
   118326 
   118327 
   118328 
   118329 /* CONSTANT_BUFFER::Buffer Length */
   118330 
   118331 
   118332 #define GEN5_CONSTANT_BUFFER_BufferLength_bits  6
   118333 #define GEN45_CONSTANT_BUFFER_BufferLength_bits  6
   118334 #define GEN4_CONSTANT_BUFFER_BufferLength_bits  6
   118335 
   118336 static inline uint32_t ATTRIBUTE_PURE
   118337 CONSTANT_BUFFER_BufferLength_bits(const struct gen_device_info *devinfo)
   118338 {
   118339    switch (devinfo->gen) {
   118340    case 10: return 0;
   118341    case 9: return 0;
   118342    case 8: return 0;
   118343    case 7:
   118344       if (devinfo->is_haswell) {
   118345          return 0;
   118346       } else {
   118347          return 0;
   118348       }
   118349    case 6: return 0;
   118350    case 5: return 6;
   118351    case 4:
   118352       if (devinfo->is_g4x) {
   118353          return 6;
   118354       } else {
   118355          return 6;
   118356       }
   118357    default:
   118358       unreachable("Invalid hardware generation");
   118359    }
   118360 }
   118361 
   118362 
   118363 
   118364 #define GEN5_CONSTANT_BUFFER_BufferLength_start  32
   118365 #define GEN45_CONSTANT_BUFFER_BufferLength_start  32
   118366 #define GEN4_CONSTANT_BUFFER_BufferLength_start  32
   118367 
   118368 static inline uint32_t ATTRIBUTE_PURE
   118369 CONSTANT_BUFFER_BufferLength_start(const struct gen_device_info *devinfo)
   118370 {
   118371    switch (devinfo->gen) {
   118372    case 10: return 0;
   118373    case 9: return 0;
   118374    case 8: return 0;
   118375    case 7:
   118376       if (devinfo->is_haswell) {
   118377          return 0;
   118378       } else {
   118379          return 0;
   118380       }
   118381    case 6: return 0;
   118382    case 5: return 32;
   118383    case 4:
   118384       if (devinfo->is_g4x) {
   118385          return 32;
   118386       } else {
   118387          return 32;
   118388       }
   118389    default:
   118390       unreachable("Invalid hardware generation");
   118391    }
   118392 }
   118393 
   118394 
   118395 
   118396 /* CONSTANT_BUFFER::Buffer Starting Address */
   118397 
   118398 
   118399 #define GEN5_CONSTANT_BUFFER_BufferStartingAddress_bits  26
   118400 #define GEN45_CONSTANT_BUFFER_BufferStartingAddress_bits  26
   118401 #define GEN4_CONSTANT_BUFFER_BufferStartingAddress_bits  26
   118402 
   118403 static inline uint32_t ATTRIBUTE_PURE
   118404 CONSTANT_BUFFER_BufferStartingAddress_bits(const struct gen_device_info *devinfo)
   118405 {
   118406    switch (devinfo->gen) {
   118407    case 10: return 0;
   118408    case 9: return 0;
   118409    case 8: return 0;
   118410    case 7:
   118411       if (devinfo->is_haswell) {
   118412          return 0;
   118413       } else {
   118414          return 0;
   118415       }
   118416    case 6: return 0;
   118417    case 5: return 26;
   118418    case 4:
   118419       if (devinfo->is_g4x) {
   118420          return 26;
   118421       } else {
   118422          return 26;
   118423       }
   118424    default:
   118425       unreachable("Invalid hardware generation");
   118426    }
   118427 }
   118428 
   118429 
   118430 
   118431 #define GEN5_CONSTANT_BUFFER_BufferStartingAddress_start  38
   118432 #define GEN45_CONSTANT_BUFFER_BufferStartingAddress_start  38
   118433 #define GEN4_CONSTANT_BUFFER_BufferStartingAddress_start  38
   118434 
   118435 static inline uint32_t ATTRIBUTE_PURE
   118436 CONSTANT_BUFFER_BufferStartingAddress_start(const struct gen_device_info *devinfo)
   118437 {
   118438    switch (devinfo->gen) {
   118439    case 10: return 0;
   118440    case 9: return 0;
   118441    case 8: return 0;
   118442    case 7:
   118443       if (devinfo->is_haswell) {
   118444          return 0;
   118445       } else {
   118446          return 0;
   118447       }
   118448    case 6: return 0;
   118449    case 5: return 38;
   118450    case 4:
   118451       if (devinfo->is_g4x) {
   118452          return 38;
   118453       } else {
   118454          return 38;
   118455       }
   118456    default:
   118457       unreachable("Invalid hardware generation");
   118458    }
   118459 }
   118460 
   118461 
   118462 
   118463 /* CONSTANT_BUFFER::Command SubType */
   118464 
   118465 
   118466 #define GEN5_CONSTANT_BUFFER_CommandSubType_bits  2
   118467 #define GEN45_CONSTANT_BUFFER_CommandSubType_bits  2
   118468 #define GEN4_CONSTANT_BUFFER_CommandSubType_bits  2
   118469 
   118470 static inline uint32_t ATTRIBUTE_PURE
   118471 CONSTANT_BUFFER_CommandSubType_bits(const struct gen_device_info *devinfo)
   118472 {
   118473    switch (devinfo->gen) {
   118474    case 10: return 0;
   118475    case 9: return 0;
   118476    case 8: return 0;
   118477    case 7:
   118478       if (devinfo->is_haswell) {
   118479          return 0;
   118480       } else {
   118481          return 0;
   118482       }
   118483    case 6: return 0;
   118484    case 5: return 2;
   118485    case 4:
   118486       if (devinfo->is_g4x) {
   118487          return 2;
   118488       } else {
   118489          return 2;
   118490       }
   118491    default:
   118492       unreachable("Invalid hardware generation");
   118493    }
   118494 }
   118495 
   118496 
   118497 
   118498 #define GEN5_CONSTANT_BUFFER_CommandSubType_start  27
   118499 #define GEN45_CONSTANT_BUFFER_CommandSubType_start  27
   118500 #define GEN4_CONSTANT_BUFFER_CommandSubType_start  27
   118501 
   118502 static inline uint32_t ATTRIBUTE_PURE
   118503 CONSTANT_BUFFER_CommandSubType_start(const struct gen_device_info *devinfo)
   118504 {
   118505    switch (devinfo->gen) {
   118506    case 10: return 0;
   118507    case 9: return 0;
   118508    case 8: return 0;
   118509    case 7:
   118510       if (devinfo->is_haswell) {
   118511          return 0;
   118512       } else {
   118513          return 0;
   118514       }
   118515    case 6: return 0;
   118516    case 5: return 27;
   118517    case 4:
   118518       if (devinfo->is_g4x) {
   118519          return 27;
   118520       } else {
   118521          return 27;
   118522       }
   118523    default:
   118524       unreachable("Invalid hardware generation");
   118525    }
   118526 }
   118527 
   118528 
   118529 
   118530 /* CONSTANT_BUFFER::Command Type */
   118531 
   118532 
   118533 #define GEN5_CONSTANT_BUFFER_CommandType_bits  3
   118534 #define GEN45_CONSTANT_BUFFER_CommandType_bits  3
   118535 #define GEN4_CONSTANT_BUFFER_CommandType_bits  3
   118536 
   118537 static inline uint32_t ATTRIBUTE_PURE
   118538 CONSTANT_BUFFER_CommandType_bits(const struct gen_device_info *devinfo)
   118539 {
   118540    switch (devinfo->gen) {
   118541    case 10: return 0;
   118542    case 9: return 0;
   118543    case 8: return 0;
   118544    case 7:
   118545       if (devinfo->is_haswell) {
   118546          return 0;
   118547       } else {
   118548          return 0;
   118549       }
   118550    case 6: return 0;
   118551    case 5: return 3;
   118552    case 4:
   118553       if (devinfo->is_g4x) {
   118554          return 3;
   118555       } else {
   118556          return 3;
   118557       }
   118558    default:
   118559       unreachable("Invalid hardware generation");
   118560    }
   118561 }
   118562 
   118563 
   118564 
   118565 #define GEN5_CONSTANT_BUFFER_CommandType_start  29
   118566 #define GEN45_CONSTANT_BUFFER_CommandType_start  29
   118567 #define GEN4_CONSTANT_BUFFER_CommandType_start  29
   118568 
   118569 static inline uint32_t ATTRIBUTE_PURE
   118570 CONSTANT_BUFFER_CommandType_start(const struct gen_device_info *devinfo)
   118571 {
   118572    switch (devinfo->gen) {
   118573    case 10: return 0;
   118574    case 9: return 0;
   118575    case 8: return 0;
   118576    case 7:
   118577       if (devinfo->is_haswell) {
   118578          return 0;
   118579       } else {
   118580          return 0;
   118581       }
   118582    case 6: return 0;
   118583    case 5: return 29;
   118584    case 4:
   118585       if (devinfo->is_g4x) {
   118586          return 29;
   118587       } else {
   118588          return 29;
   118589       }
   118590    default:
   118591       unreachable("Invalid hardware generation");
   118592    }
   118593 }
   118594 
   118595 
   118596 
   118597 /* CONSTANT_BUFFER::DWord Length */
   118598 
   118599 
   118600 #define GEN5_CONSTANT_BUFFER_DWordLength_bits  8
   118601 #define GEN45_CONSTANT_BUFFER_DWordLength_bits  8
   118602 #define GEN4_CONSTANT_BUFFER_DWordLength_bits  8
   118603 
   118604 static inline uint32_t ATTRIBUTE_PURE
   118605 CONSTANT_BUFFER_DWordLength_bits(const struct gen_device_info *devinfo)
   118606 {
   118607    switch (devinfo->gen) {
   118608    case 10: return 0;
   118609    case 9: return 0;
   118610    case 8: return 0;
   118611    case 7:
   118612       if (devinfo->is_haswell) {
   118613          return 0;
   118614       } else {
   118615          return 0;
   118616       }
   118617    case 6: return 0;
   118618    case 5: return 8;
   118619    case 4:
   118620       if (devinfo->is_g4x) {
   118621          return 8;
   118622       } else {
   118623          return 8;
   118624       }
   118625    default:
   118626       unreachable("Invalid hardware generation");
   118627    }
   118628 }
   118629 
   118630 
   118631 
   118632 #define GEN5_CONSTANT_BUFFER_DWordLength_start  0
   118633 #define GEN45_CONSTANT_BUFFER_DWordLength_start  0
   118634 #define GEN4_CONSTANT_BUFFER_DWordLength_start  0
   118635 
   118636 static inline uint32_t ATTRIBUTE_PURE
   118637 CONSTANT_BUFFER_DWordLength_start(const struct gen_device_info *devinfo)
   118638 {
   118639    switch (devinfo->gen) {
   118640    case 10: return 0;
   118641    case 9: return 0;
   118642    case 8: return 0;
   118643    case 7:
   118644       if (devinfo->is_haswell) {
   118645          return 0;
   118646       } else {
   118647          return 0;
   118648       }
   118649    case 6: return 0;
   118650    case 5: return 0;
   118651    case 4:
   118652       if (devinfo->is_g4x) {
   118653          return 0;
   118654       } else {
   118655          return 0;
   118656       }
   118657    default:
   118658       unreachable("Invalid hardware generation");
   118659    }
   118660 }
   118661 
   118662 
   118663 
   118664 /* CONSTANT_BUFFER::Valid */
   118665 
   118666 
   118667 #define GEN5_CONSTANT_BUFFER_Valid_bits  1
   118668 #define GEN45_CONSTANT_BUFFER_Valid_bits  1
   118669 #define GEN4_CONSTANT_BUFFER_Valid_bits  1
   118670 
   118671 static inline uint32_t ATTRIBUTE_PURE
   118672 CONSTANT_BUFFER_Valid_bits(const struct gen_device_info *devinfo)
   118673 {
   118674    switch (devinfo->gen) {
   118675    case 10: return 0;
   118676    case 9: return 0;
   118677    case 8: return 0;
   118678    case 7:
   118679       if (devinfo->is_haswell) {
   118680          return 0;
   118681       } else {
   118682          return 0;
   118683       }
   118684    case 6: return 0;
   118685    case 5: return 1;
   118686    case 4:
   118687       if (devinfo->is_g4x) {
   118688          return 1;
   118689       } else {
   118690          return 1;
   118691       }
   118692    default:
   118693       unreachable("Invalid hardware generation");
   118694    }
   118695 }
   118696 
   118697 
   118698 
   118699 #define GEN5_CONSTANT_BUFFER_Valid_start  8
   118700 #define GEN45_CONSTANT_BUFFER_Valid_start  8
   118701 #define GEN4_CONSTANT_BUFFER_Valid_start  8
   118702 
   118703 static inline uint32_t ATTRIBUTE_PURE
   118704 CONSTANT_BUFFER_Valid_start(const struct gen_device_info *devinfo)
   118705 {
   118706    switch (devinfo->gen) {
   118707    case 10: return 0;
   118708    case 9: return 0;
   118709    case 8: return 0;
   118710    case 7:
   118711       if (devinfo->is_haswell) {
   118712          return 0;
   118713       } else {
   118714          return 0;
   118715       }
   118716    case 6: return 0;
   118717    case 5: return 8;
   118718    case 4:
   118719       if (devinfo->is_g4x) {
   118720          return 8;
   118721       } else {
   118722          return 8;
   118723       }
   118724    default:
   118725       unreachable("Invalid hardware generation");
   118726    }
   118727 }
   118728 
   118729 
   118730 
   118731 /* CS_INVOCATION_COUNT */
   118732 
   118733 
   118734 #define GEN10_CS_INVOCATION_COUNT_length  2
   118735 #define GEN9_CS_INVOCATION_COUNT_length  2
   118736 #define GEN8_CS_INVOCATION_COUNT_length  2
   118737 #define GEN75_CS_INVOCATION_COUNT_length  2
   118738 #define GEN7_CS_INVOCATION_COUNT_length  2
   118739 
   118740 static inline uint32_t ATTRIBUTE_PURE
   118741 CS_INVOCATION_COUNT_length(const struct gen_device_info *devinfo)
   118742 {
   118743    switch (devinfo->gen) {
   118744    case 10: return 2;
   118745    case 9: return 2;
   118746    case 8: return 2;
   118747    case 7:
   118748       if (devinfo->is_haswell) {
   118749          return 2;
   118750       } else {
   118751          return 2;
   118752       }
   118753    case 6: return 0;
   118754    case 5: return 0;
   118755    case 4:
   118756       if (devinfo->is_g4x) {
   118757          return 0;
   118758       } else {
   118759          return 0;
   118760       }
   118761    default:
   118762       unreachable("Invalid hardware generation");
   118763    }
   118764 }
   118765 
   118766 
   118767 
   118768 /* CS_INVOCATION_COUNT::CS Invocation Count Report */
   118769 
   118770 
   118771 #define GEN10_CS_INVOCATION_COUNT_CSInvocationCountReport_bits  64
   118772 #define GEN9_CS_INVOCATION_COUNT_CSInvocationCountReport_bits  64
   118773 #define GEN8_CS_INVOCATION_COUNT_CSInvocationCountReport_bits  64
   118774 #define GEN75_CS_INVOCATION_COUNT_CSInvocationCountReport_bits  64
   118775 #define GEN7_CS_INVOCATION_COUNT_CSInvocationCountReport_bits  64
   118776 
   118777 static inline uint32_t ATTRIBUTE_PURE
   118778 CS_INVOCATION_COUNT_CSInvocationCountReport_bits(const struct gen_device_info *devinfo)
   118779 {
   118780    switch (devinfo->gen) {
   118781    case 10: return 64;
   118782    case 9: return 64;
   118783    case 8: return 64;
   118784    case 7:
   118785       if (devinfo->is_haswell) {
   118786          return 64;
   118787       } else {
   118788          return 64;
   118789       }
   118790    case 6: return 0;
   118791    case 5: return 0;
   118792    case 4:
   118793       if (devinfo->is_g4x) {
   118794          return 0;
   118795       } else {
   118796          return 0;
   118797       }
   118798    default:
   118799       unreachable("Invalid hardware generation");
   118800    }
   118801 }
   118802 
   118803 
   118804 
   118805 #define GEN10_CS_INVOCATION_COUNT_CSInvocationCountReport_start  0
   118806 #define GEN9_CS_INVOCATION_COUNT_CSInvocationCountReport_start  0
   118807 #define GEN8_CS_INVOCATION_COUNT_CSInvocationCountReport_start  0
   118808 #define GEN75_CS_INVOCATION_COUNT_CSInvocationCountReport_start  0
   118809 #define GEN7_CS_INVOCATION_COUNT_CSInvocationCountReport_start  0
   118810 
   118811 static inline uint32_t ATTRIBUTE_PURE
   118812 CS_INVOCATION_COUNT_CSInvocationCountReport_start(const struct gen_device_info *devinfo)
   118813 {
   118814    switch (devinfo->gen) {
   118815    case 10: return 0;
   118816    case 9: return 0;
   118817    case 8: return 0;
   118818    case 7:
   118819       if (devinfo->is_haswell) {
   118820          return 0;
   118821       } else {
   118822          return 0;
   118823       }
   118824    case 6: return 0;
   118825    case 5: return 0;
   118826    case 4:
   118827       if (devinfo->is_g4x) {
   118828          return 0;
   118829       } else {
   118830          return 0;
   118831       }
   118832    default:
   118833       unreachable("Invalid hardware generation");
   118834    }
   118835 }
   118836 
   118837 
   118838 
   118839 /* CS_URB_STATE */
   118840 
   118841 
   118842 #define GEN5_CS_URB_STATE_length  2
   118843 #define GEN45_CS_URB_STATE_length  2
   118844 #define GEN4_CS_URB_STATE_length  2
   118845 
   118846 static inline uint32_t ATTRIBUTE_PURE
   118847 CS_URB_STATE_length(const struct gen_device_info *devinfo)
   118848 {
   118849    switch (devinfo->gen) {
   118850    case 10: return 0;
   118851    case 9: return 0;
   118852    case 8: return 0;
   118853    case 7:
   118854       if (devinfo->is_haswell) {
   118855          return 0;
   118856       } else {
   118857          return 0;
   118858       }
   118859    case 6: return 0;
   118860    case 5: return 2;
   118861    case 4:
   118862       if (devinfo->is_g4x) {
   118863          return 2;
   118864       } else {
   118865          return 2;
   118866       }
   118867    default:
   118868       unreachable("Invalid hardware generation");
   118869    }
   118870 }
   118871 
   118872 
   118873 
   118874 /* CS_URB_STATE::3D Command Opcode */
   118875 
   118876 
   118877 #define GEN5_CS_URB_STATE_3DCommandOpcode_bits  3
   118878 #define GEN45_CS_URB_STATE_3DCommandOpcode_bits  3
   118879 #define GEN4_CS_URB_STATE_3DCommandOpcode_bits  3
   118880 
   118881 static inline uint32_t ATTRIBUTE_PURE
   118882 CS_URB_STATE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   118883 {
   118884    switch (devinfo->gen) {
   118885    case 10: return 0;
   118886    case 9: return 0;
   118887    case 8: return 0;
   118888    case 7:
   118889       if (devinfo->is_haswell) {
   118890          return 0;
   118891       } else {
   118892          return 0;
   118893       }
   118894    case 6: return 0;
   118895    case 5: return 3;
   118896    case 4:
   118897       if (devinfo->is_g4x) {
   118898          return 3;
   118899       } else {
   118900          return 3;
   118901       }
   118902    default:
   118903       unreachable("Invalid hardware generation");
   118904    }
   118905 }
   118906 
   118907 
   118908 
   118909 #define GEN5_CS_URB_STATE_3DCommandOpcode_start  24
   118910 #define GEN45_CS_URB_STATE_3DCommandOpcode_start  24
   118911 #define GEN4_CS_URB_STATE_3DCommandOpcode_start  24
   118912 
   118913 static inline uint32_t ATTRIBUTE_PURE
   118914 CS_URB_STATE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   118915 {
   118916    switch (devinfo->gen) {
   118917    case 10: return 0;
   118918    case 9: return 0;
   118919    case 8: return 0;
   118920    case 7:
   118921       if (devinfo->is_haswell) {
   118922          return 0;
   118923       } else {
   118924          return 0;
   118925       }
   118926    case 6: return 0;
   118927    case 5: return 24;
   118928    case 4:
   118929       if (devinfo->is_g4x) {
   118930          return 24;
   118931       } else {
   118932          return 24;
   118933       }
   118934    default:
   118935       unreachable("Invalid hardware generation");
   118936    }
   118937 }
   118938 
   118939 
   118940 
   118941 /* CS_URB_STATE::3D Command Sub Opcode */
   118942 
   118943 
   118944 #define GEN5_CS_URB_STATE_3DCommandSubOpcode_bits  8
   118945 #define GEN45_CS_URB_STATE_3DCommandSubOpcode_bits  8
   118946 #define GEN4_CS_URB_STATE_3DCommandSubOpcode_bits  8
   118947 
   118948 static inline uint32_t ATTRIBUTE_PURE
   118949 CS_URB_STATE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   118950 {
   118951    switch (devinfo->gen) {
   118952    case 10: return 0;
   118953    case 9: return 0;
   118954    case 8: return 0;
   118955    case 7:
   118956       if (devinfo->is_haswell) {
   118957          return 0;
   118958       } else {
   118959          return 0;
   118960       }
   118961    case 6: return 0;
   118962    case 5: return 8;
   118963    case 4:
   118964       if (devinfo->is_g4x) {
   118965          return 8;
   118966       } else {
   118967          return 8;
   118968       }
   118969    default:
   118970       unreachable("Invalid hardware generation");
   118971    }
   118972 }
   118973 
   118974 
   118975 
   118976 #define GEN5_CS_URB_STATE_3DCommandSubOpcode_start  16
   118977 #define GEN45_CS_URB_STATE_3DCommandSubOpcode_start  16
   118978 #define GEN4_CS_URB_STATE_3DCommandSubOpcode_start  16
   118979 
   118980 static inline uint32_t ATTRIBUTE_PURE
   118981 CS_URB_STATE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   118982 {
   118983    switch (devinfo->gen) {
   118984    case 10: return 0;
   118985    case 9: return 0;
   118986    case 8: return 0;
   118987    case 7:
   118988       if (devinfo->is_haswell) {
   118989          return 0;
   118990       } else {
   118991          return 0;
   118992       }
   118993    case 6: return 0;
   118994    case 5: return 16;
   118995    case 4:
   118996       if (devinfo->is_g4x) {
   118997          return 16;
   118998       } else {
   118999          return 16;
   119000       }
   119001    default:
   119002       unreachable("Invalid hardware generation");
   119003    }
   119004 }
   119005 
   119006 
   119007 
   119008 /* CS_URB_STATE::Command SubType */
   119009 
   119010 
   119011 #define GEN5_CS_URB_STATE_CommandSubType_bits  2
   119012 #define GEN45_CS_URB_STATE_CommandSubType_bits  2
   119013 #define GEN4_CS_URB_STATE_CommandSubType_bits  2
   119014 
   119015 static inline uint32_t ATTRIBUTE_PURE
   119016 CS_URB_STATE_CommandSubType_bits(const struct gen_device_info *devinfo)
   119017 {
   119018    switch (devinfo->gen) {
   119019    case 10: return 0;
   119020    case 9: return 0;
   119021    case 8: return 0;
   119022    case 7:
   119023       if (devinfo->is_haswell) {
   119024          return 0;
   119025       } else {
   119026          return 0;
   119027       }
   119028    case 6: return 0;
   119029    case 5: return 2;
   119030    case 4:
   119031       if (devinfo->is_g4x) {
   119032          return 2;
   119033       } else {
   119034          return 2;
   119035       }
   119036    default:
   119037       unreachable("Invalid hardware generation");
   119038    }
   119039 }
   119040 
   119041 
   119042 
   119043 #define GEN5_CS_URB_STATE_CommandSubType_start  27
   119044 #define GEN45_CS_URB_STATE_CommandSubType_start  27
   119045 #define GEN4_CS_URB_STATE_CommandSubType_start  27
   119046 
   119047 static inline uint32_t ATTRIBUTE_PURE
   119048 CS_URB_STATE_CommandSubType_start(const struct gen_device_info *devinfo)
   119049 {
   119050    switch (devinfo->gen) {
   119051    case 10: return 0;
   119052    case 9: return 0;
   119053    case 8: return 0;
   119054    case 7:
   119055       if (devinfo->is_haswell) {
   119056          return 0;
   119057       } else {
   119058          return 0;
   119059       }
   119060    case 6: return 0;
   119061    case 5: return 27;
   119062    case 4:
   119063       if (devinfo->is_g4x) {
   119064          return 27;
   119065       } else {
   119066          return 27;
   119067       }
   119068    default:
   119069       unreachable("Invalid hardware generation");
   119070    }
   119071 }
   119072 
   119073 
   119074 
   119075 /* CS_URB_STATE::Command Type */
   119076 
   119077 
   119078 #define GEN5_CS_URB_STATE_CommandType_bits  3
   119079 #define GEN45_CS_URB_STATE_CommandType_bits  3
   119080 #define GEN4_CS_URB_STATE_CommandType_bits  3
   119081 
   119082 static inline uint32_t ATTRIBUTE_PURE
   119083 CS_URB_STATE_CommandType_bits(const struct gen_device_info *devinfo)
   119084 {
   119085    switch (devinfo->gen) {
   119086    case 10: return 0;
   119087    case 9: return 0;
   119088    case 8: return 0;
   119089    case 7:
   119090       if (devinfo->is_haswell) {
   119091          return 0;
   119092       } else {
   119093          return 0;
   119094       }
   119095    case 6: return 0;
   119096    case 5: return 3;
   119097    case 4:
   119098       if (devinfo->is_g4x) {
   119099          return 3;
   119100       } else {
   119101          return 3;
   119102       }
   119103    default:
   119104       unreachable("Invalid hardware generation");
   119105    }
   119106 }
   119107 
   119108 
   119109 
   119110 #define GEN5_CS_URB_STATE_CommandType_start  29
   119111 #define GEN45_CS_URB_STATE_CommandType_start  29
   119112 #define GEN4_CS_URB_STATE_CommandType_start  29
   119113 
   119114 static inline uint32_t ATTRIBUTE_PURE
   119115 CS_URB_STATE_CommandType_start(const struct gen_device_info *devinfo)
   119116 {
   119117    switch (devinfo->gen) {
   119118    case 10: return 0;
   119119    case 9: return 0;
   119120    case 8: return 0;
   119121    case 7:
   119122       if (devinfo->is_haswell) {
   119123          return 0;
   119124       } else {
   119125          return 0;
   119126       }
   119127    case 6: return 0;
   119128    case 5: return 29;
   119129    case 4:
   119130       if (devinfo->is_g4x) {
   119131          return 29;
   119132       } else {
   119133          return 29;
   119134       }
   119135    default:
   119136       unreachable("Invalid hardware generation");
   119137    }
   119138 }
   119139 
   119140 
   119141 
   119142 /* CS_URB_STATE::DWord Length */
   119143 
   119144 
   119145 #define GEN5_CS_URB_STATE_DWordLength_bits  8
   119146 #define GEN45_CS_URB_STATE_DWordLength_bits  8
   119147 #define GEN4_CS_URB_STATE_DWordLength_bits  8
   119148 
   119149 static inline uint32_t ATTRIBUTE_PURE
   119150 CS_URB_STATE_DWordLength_bits(const struct gen_device_info *devinfo)
   119151 {
   119152    switch (devinfo->gen) {
   119153    case 10: return 0;
   119154    case 9: return 0;
   119155    case 8: return 0;
   119156    case 7:
   119157       if (devinfo->is_haswell) {
   119158          return 0;
   119159       } else {
   119160          return 0;
   119161       }
   119162    case 6: return 0;
   119163    case 5: return 8;
   119164    case 4:
   119165       if (devinfo->is_g4x) {
   119166          return 8;
   119167       } else {
   119168          return 8;
   119169       }
   119170    default:
   119171       unreachable("Invalid hardware generation");
   119172    }
   119173 }
   119174 
   119175 
   119176 
   119177 #define GEN5_CS_URB_STATE_DWordLength_start  0
   119178 #define GEN45_CS_URB_STATE_DWordLength_start  0
   119179 #define GEN4_CS_URB_STATE_DWordLength_start  0
   119180 
   119181 static inline uint32_t ATTRIBUTE_PURE
   119182 CS_URB_STATE_DWordLength_start(const struct gen_device_info *devinfo)
   119183 {
   119184    switch (devinfo->gen) {
   119185    case 10: return 0;
   119186    case 9: return 0;
   119187    case 8: return 0;
   119188    case 7:
   119189       if (devinfo->is_haswell) {
   119190          return 0;
   119191       } else {
   119192          return 0;
   119193       }
   119194    case 6: return 0;
   119195    case 5: return 0;
   119196    case 4:
   119197       if (devinfo->is_g4x) {
   119198          return 0;
   119199       } else {
   119200          return 0;
   119201       }
   119202    default:
   119203       unreachable("Invalid hardware generation");
   119204    }
   119205 }
   119206 
   119207 
   119208 
   119209 /* CS_URB_STATE::Number of URB Entries */
   119210 
   119211 
   119212 #define GEN5_CS_URB_STATE_NumberofURBEntries_bits  3
   119213 #define GEN45_CS_URB_STATE_NumberofURBEntries_bits  3
   119214 #define GEN4_CS_URB_STATE_NumberofURBEntries_bits  3
   119215 
   119216 static inline uint32_t ATTRIBUTE_PURE
   119217 CS_URB_STATE_NumberofURBEntries_bits(const struct gen_device_info *devinfo)
   119218 {
   119219    switch (devinfo->gen) {
   119220    case 10: return 0;
   119221    case 9: return 0;
   119222    case 8: return 0;
   119223    case 7:
   119224       if (devinfo->is_haswell) {
   119225          return 0;
   119226       } else {
   119227          return 0;
   119228       }
   119229    case 6: return 0;
   119230    case 5: return 3;
   119231    case 4:
   119232       if (devinfo->is_g4x) {
   119233          return 3;
   119234       } else {
   119235          return 3;
   119236       }
   119237    default:
   119238       unreachable("Invalid hardware generation");
   119239    }
   119240 }
   119241 
   119242 
   119243 
   119244 #define GEN5_CS_URB_STATE_NumberofURBEntries_start  32
   119245 #define GEN45_CS_URB_STATE_NumberofURBEntries_start  32
   119246 #define GEN4_CS_URB_STATE_NumberofURBEntries_start  32
   119247 
   119248 static inline uint32_t ATTRIBUTE_PURE
   119249 CS_URB_STATE_NumberofURBEntries_start(const struct gen_device_info *devinfo)
   119250 {
   119251    switch (devinfo->gen) {
   119252    case 10: return 0;
   119253    case 9: return 0;
   119254    case 8: return 0;
   119255    case 7:
   119256       if (devinfo->is_haswell) {
   119257          return 0;
   119258       } else {
   119259          return 0;
   119260       }
   119261    case 6: return 0;
   119262    case 5: return 32;
   119263    case 4:
   119264       if (devinfo->is_g4x) {
   119265          return 32;
   119266       } else {
   119267          return 32;
   119268       }
   119269    default:
   119270       unreachable("Invalid hardware generation");
   119271    }
   119272 }
   119273 
   119274 
   119275 
   119276 /* CS_URB_STATE::URB Entry Allocation Size */
   119277 
   119278 
   119279 #define GEN5_CS_URB_STATE_URBEntryAllocationSize_bits  5
   119280 #define GEN45_CS_URB_STATE_URBEntryAllocationSize_bits  5
   119281 #define GEN4_CS_URB_STATE_URBEntryAllocationSize_bits  5
   119282 
   119283 static inline uint32_t ATTRIBUTE_PURE
   119284 CS_URB_STATE_URBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   119285 {
   119286    switch (devinfo->gen) {
   119287    case 10: return 0;
   119288    case 9: return 0;
   119289    case 8: return 0;
   119290    case 7:
   119291       if (devinfo->is_haswell) {
   119292          return 0;
   119293       } else {
   119294          return 0;
   119295       }
   119296    case 6: return 0;
   119297    case 5: return 5;
   119298    case 4:
   119299       if (devinfo->is_g4x) {
   119300          return 5;
   119301       } else {
   119302          return 5;
   119303       }
   119304    default:
   119305       unreachable("Invalid hardware generation");
   119306    }
   119307 }
   119308 
   119309 
   119310 
   119311 #define GEN5_CS_URB_STATE_URBEntryAllocationSize_start  36
   119312 #define GEN45_CS_URB_STATE_URBEntryAllocationSize_start  36
   119313 #define GEN4_CS_URB_STATE_URBEntryAllocationSize_start  36
   119314 
   119315 static inline uint32_t ATTRIBUTE_PURE
   119316 CS_URB_STATE_URBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   119317 {
   119318    switch (devinfo->gen) {
   119319    case 10: return 0;
   119320    case 9: return 0;
   119321    case 8: return 0;
   119322    case 7:
   119323       if (devinfo->is_haswell) {
   119324          return 0;
   119325       } else {
   119326          return 0;
   119327       }
   119328    case 6: return 0;
   119329    case 5: return 36;
   119330    case 4:
   119331       if (devinfo->is_g4x) {
   119332          return 36;
   119333       } else {
   119334          return 36;
   119335       }
   119336    default:
   119337       unreachable("Invalid hardware generation");
   119338    }
   119339 }
   119340 
   119341 
   119342 
   119343 /* DEPTH_STENCIL_STATE */
   119344 
   119345 
   119346 #define GEN75_DEPTH_STENCIL_STATE_length  3
   119347 #define GEN7_DEPTH_STENCIL_STATE_length  3
   119348 #define GEN6_DEPTH_STENCIL_STATE_length  3
   119349 
   119350 static inline uint32_t ATTRIBUTE_PURE
   119351 DEPTH_STENCIL_STATE_length(const struct gen_device_info *devinfo)
   119352 {
   119353    switch (devinfo->gen) {
   119354    case 10: return 0;
   119355    case 9: return 0;
   119356    case 8: return 0;
   119357    case 7:
   119358       if (devinfo->is_haswell) {
   119359          return 3;
   119360       } else {
   119361          return 3;
   119362       }
   119363    case 6: return 3;
   119364    case 5: return 0;
   119365    case 4:
   119366       if (devinfo->is_g4x) {
   119367          return 0;
   119368       } else {
   119369          return 0;
   119370       }
   119371    default:
   119372       unreachable("Invalid hardware generation");
   119373    }
   119374 }
   119375 
   119376 
   119377 
   119378 /* DEPTH_STENCIL_STATE::Backface Stencil Fail Op */
   119379 
   119380 
   119381 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilFailOp_bits  3
   119382 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilFailOp_bits  3
   119383 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilFailOp_bits  3
   119384 
   119385 static inline uint32_t ATTRIBUTE_PURE
   119386 DEPTH_STENCIL_STATE_BackfaceStencilFailOp_bits(const struct gen_device_info *devinfo)
   119387 {
   119388    switch (devinfo->gen) {
   119389    case 10: return 0;
   119390    case 9: return 0;
   119391    case 8: return 0;
   119392    case 7:
   119393       if (devinfo->is_haswell) {
   119394          return 3;
   119395       } else {
   119396          return 3;
   119397       }
   119398    case 6: return 3;
   119399    case 5: return 0;
   119400    case 4:
   119401       if (devinfo->is_g4x) {
   119402          return 0;
   119403       } else {
   119404          return 0;
   119405       }
   119406    default:
   119407       unreachable("Invalid hardware generation");
   119408    }
   119409 }
   119410 
   119411 
   119412 
   119413 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilFailOp_start  9
   119414 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilFailOp_start  9
   119415 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilFailOp_start  9
   119416 
   119417 static inline uint32_t ATTRIBUTE_PURE
   119418 DEPTH_STENCIL_STATE_BackfaceStencilFailOp_start(const struct gen_device_info *devinfo)
   119419 {
   119420    switch (devinfo->gen) {
   119421    case 10: return 0;
   119422    case 9: return 0;
   119423    case 8: return 0;
   119424    case 7:
   119425       if (devinfo->is_haswell) {
   119426          return 9;
   119427       } else {
   119428          return 9;
   119429       }
   119430    case 6: return 9;
   119431    case 5: return 0;
   119432    case 4:
   119433       if (devinfo->is_g4x) {
   119434          return 0;
   119435       } else {
   119436          return 0;
   119437       }
   119438    default:
   119439       unreachable("Invalid hardware generation");
   119440    }
   119441 }
   119442 
   119443 
   119444 
   119445 /* DEPTH_STENCIL_STATE::Backface Stencil Pass Depth Fail Op */
   119446 
   119447 
   119448 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_bits  3
   119449 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_bits  3
   119450 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_bits  3
   119451 
   119452 static inline uint32_t ATTRIBUTE_PURE
   119453 DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_bits(const struct gen_device_info *devinfo)
   119454 {
   119455    switch (devinfo->gen) {
   119456    case 10: return 0;
   119457    case 9: return 0;
   119458    case 8: return 0;
   119459    case 7:
   119460       if (devinfo->is_haswell) {
   119461          return 3;
   119462       } else {
   119463          return 3;
   119464       }
   119465    case 6: return 3;
   119466    case 5: return 0;
   119467    case 4:
   119468       if (devinfo->is_g4x) {
   119469          return 0;
   119470       } else {
   119471          return 0;
   119472       }
   119473    default:
   119474       unreachable("Invalid hardware generation");
   119475    }
   119476 }
   119477 
   119478 
   119479 
   119480 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_start  6
   119481 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_start  6
   119482 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_start  6
   119483 
   119484 static inline uint32_t ATTRIBUTE_PURE
   119485 DEPTH_STENCIL_STATE_BackfaceStencilPassDepthFailOp_start(const struct gen_device_info *devinfo)
   119486 {
   119487    switch (devinfo->gen) {
   119488    case 10: return 0;
   119489    case 9: return 0;
   119490    case 8: return 0;
   119491    case 7:
   119492       if (devinfo->is_haswell) {
   119493          return 6;
   119494       } else {
   119495          return 6;
   119496       }
   119497    case 6: return 6;
   119498    case 5: return 0;
   119499    case 4:
   119500       if (devinfo->is_g4x) {
   119501          return 0;
   119502       } else {
   119503          return 0;
   119504       }
   119505    default:
   119506       unreachable("Invalid hardware generation");
   119507    }
   119508 }
   119509 
   119510 
   119511 
   119512 /* DEPTH_STENCIL_STATE::Backface Stencil Pass Depth Pass Op */
   119513 
   119514 
   119515 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_bits  3
   119516 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_bits  3
   119517 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_bits  3
   119518 
   119519 static inline uint32_t ATTRIBUTE_PURE
   119520 DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_bits(const struct gen_device_info *devinfo)
   119521 {
   119522    switch (devinfo->gen) {
   119523    case 10: return 0;
   119524    case 9: return 0;
   119525    case 8: return 0;
   119526    case 7:
   119527       if (devinfo->is_haswell) {
   119528          return 3;
   119529       } else {
   119530          return 3;
   119531       }
   119532    case 6: return 3;
   119533    case 5: return 0;
   119534    case 4:
   119535       if (devinfo->is_g4x) {
   119536          return 0;
   119537       } else {
   119538          return 0;
   119539       }
   119540    default:
   119541       unreachable("Invalid hardware generation");
   119542    }
   119543 }
   119544 
   119545 
   119546 
   119547 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_start  3
   119548 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_start  3
   119549 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_start  3
   119550 
   119551 static inline uint32_t ATTRIBUTE_PURE
   119552 DEPTH_STENCIL_STATE_BackfaceStencilPassDepthPassOp_start(const struct gen_device_info *devinfo)
   119553 {
   119554    switch (devinfo->gen) {
   119555    case 10: return 0;
   119556    case 9: return 0;
   119557    case 8: return 0;
   119558    case 7:
   119559       if (devinfo->is_haswell) {
   119560          return 3;
   119561       } else {
   119562          return 3;
   119563       }
   119564    case 6: return 3;
   119565    case 5: return 0;
   119566    case 4:
   119567       if (devinfo->is_g4x) {
   119568          return 0;
   119569       } else {
   119570          return 0;
   119571       }
   119572    default:
   119573       unreachable("Invalid hardware generation");
   119574    }
   119575 }
   119576 
   119577 
   119578 
   119579 /* DEPTH_STENCIL_STATE::Backface Stencil Test Function */
   119580 
   119581 
   119582 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_bits  3
   119583 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_bits  3
   119584 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_bits  3
   119585 
   119586 static inline uint32_t ATTRIBUTE_PURE
   119587 DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_bits(const struct gen_device_info *devinfo)
   119588 {
   119589    switch (devinfo->gen) {
   119590    case 10: return 0;
   119591    case 9: return 0;
   119592    case 8: return 0;
   119593    case 7:
   119594       if (devinfo->is_haswell) {
   119595          return 3;
   119596       } else {
   119597          return 3;
   119598       }
   119599    case 6: return 3;
   119600    case 5: return 0;
   119601    case 4:
   119602       if (devinfo->is_g4x) {
   119603          return 0;
   119604       } else {
   119605          return 0;
   119606       }
   119607    default:
   119608       unreachable("Invalid hardware generation");
   119609    }
   119610 }
   119611 
   119612 
   119613 
   119614 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_start  12
   119615 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_start  12
   119616 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_start  12
   119617 
   119618 static inline uint32_t ATTRIBUTE_PURE
   119619 DEPTH_STENCIL_STATE_BackfaceStencilTestFunction_start(const struct gen_device_info *devinfo)
   119620 {
   119621    switch (devinfo->gen) {
   119622    case 10: return 0;
   119623    case 9: return 0;
   119624    case 8: return 0;
   119625    case 7:
   119626       if (devinfo->is_haswell) {
   119627          return 12;
   119628       } else {
   119629          return 12;
   119630       }
   119631    case 6: return 12;
   119632    case 5: return 0;
   119633    case 4:
   119634       if (devinfo->is_g4x) {
   119635          return 0;
   119636       } else {
   119637          return 0;
   119638       }
   119639    default:
   119640       unreachable("Invalid hardware generation");
   119641    }
   119642 }
   119643 
   119644 
   119645 
   119646 /* DEPTH_STENCIL_STATE::Backface Stencil Test Mask */
   119647 
   119648 
   119649 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilTestMask_bits  8
   119650 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilTestMask_bits  8
   119651 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilTestMask_bits  8
   119652 
   119653 static inline uint32_t ATTRIBUTE_PURE
   119654 DEPTH_STENCIL_STATE_BackfaceStencilTestMask_bits(const struct gen_device_info *devinfo)
   119655 {
   119656    switch (devinfo->gen) {
   119657    case 10: return 0;
   119658    case 9: return 0;
   119659    case 8: return 0;
   119660    case 7:
   119661       if (devinfo->is_haswell) {
   119662          return 8;
   119663       } else {
   119664          return 8;
   119665       }
   119666    case 6: return 8;
   119667    case 5: return 0;
   119668    case 4:
   119669       if (devinfo->is_g4x) {
   119670          return 0;
   119671       } else {
   119672          return 0;
   119673       }
   119674    default:
   119675       unreachable("Invalid hardware generation");
   119676    }
   119677 }
   119678 
   119679 
   119680 
   119681 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilTestMask_start  40
   119682 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilTestMask_start  40
   119683 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilTestMask_start  40
   119684 
   119685 static inline uint32_t ATTRIBUTE_PURE
   119686 DEPTH_STENCIL_STATE_BackfaceStencilTestMask_start(const struct gen_device_info *devinfo)
   119687 {
   119688    switch (devinfo->gen) {
   119689    case 10: return 0;
   119690    case 9: return 0;
   119691    case 8: return 0;
   119692    case 7:
   119693       if (devinfo->is_haswell) {
   119694          return 40;
   119695       } else {
   119696          return 40;
   119697       }
   119698    case 6: return 40;
   119699    case 5: return 0;
   119700    case 4:
   119701       if (devinfo->is_g4x) {
   119702          return 0;
   119703       } else {
   119704          return 0;
   119705       }
   119706    default:
   119707       unreachable("Invalid hardware generation");
   119708    }
   119709 }
   119710 
   119711 
   119712 
   119713 /* DEPTH_STENCIL_STATE::Backface Stencil Write Mask */
   119714 
   119715 
   119716 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_bits  8
   119717 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_bits  8
   119718 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_bits  8
   119719 
   119720 static inline uint32_t ATTRIBUTE_PURE
   119721 DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_bits(const struct gen_device_info *devinfo)
   119722 {
   119723    switch (devinfo->gen) {
   119724    case 10: return 0;
   119725    case 9: return 0;
   119726    case 8: return 0;
   119727    case 7:
   119728       if (devinfo->is_haswell) {
   119729          return 8;
   119730       } else {
   119731          return 8;
   119732       }
   119733    case 6: return 8;
   119734    case 5: return 0;
   119735    case 4:
   119736       if (devinfo->is_g4x) {
   119737          return 0;
   119738       } else {
   119739          return 0;
   119740       }
   119741    default:
   119742       unreachable("Invalid hardware generation");
   119743    }
   119744 }
   119745 
   119746 
   119747 
   119748 #define GEN75_DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_start  32
   119749 #define GEN7_DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_start  32
   119750 #define GEN6_DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_start  32
   119751 
   119752 static inline uint32_t ATTRIBUTE_PURE
   119753 DEPTH_STENCIL_STATE_BackfaceStencilWriteMask_start(const struct gen_device_info *devinfo)
   119754 {
   119755    switch (devinfo->gen) {
   119756    case 10: return 0;
   119757    case 9: return 0;
   119758    case 8: return 0;
   119759    case 7:
   119760       if (devinfo->is_haswell) {
   119761          return 32;
   119762       } else {
   119763          return 32;
   119764       }
   119765    case 6: return 32;
   119766    case 5: return 0;
   119767    case 4:
   119768       if (devinfo->is_g4x) {
   119769          return 0;
   119770       } else {
   119771          return 0;
   119772       }
   119773    default:
   119774       unreachable("Invalid hardware generation");
   119775    }
   119776 }
   119777 
   119778 
   119779 
   119780 /* DEPTH_STENCIL_STATE::Depth Buffer Write Enable */
   119781 
   119782 
   119783 #define GEN75_DEPTH_STENCIL_STATE_DepthBufferWriteEnable_bits  1
   119784 #define GEN7_DEPTH_STENCIL_STATE_DepthBufferWriteEnable_bits  1
   119785 #define GEN6_DEPTH_STENCIL_STATE_DepthBufferWriteEnable_bits  1
   119786 
   119787 static inline uint32_t ATTRIBUTE_PURE
   119788 DEPTH_STENCIL_STATE_DepthBufferWriteEnable_bits(const struct gen_device_info *devinfo)
   119789 {
   119790    switch (devinfo->gen) {
   119791    case 10: return 0;
   119792    case 9: return 0;
   119793    case 8: return 0;
   119794    case 7:
   119795       if (devinfo->is_haswell) {
   119796          return 1;
   119797       } else {
   119798          return 1;
   119799       }
   119800    case 6: return 1;
   119801    case 5: return 0;
   119802    case 4:
   119803       if (devinfo->is_g4x) {
   119804          return 0;
   119805       } else {
   119806          return 0;
   119807       }
   119808    default:
   119809       unreachable("Invalid hardware generation");
   119810    }
   119811 }
   119812 
   119813 
   119814 
   119815 #define GEN75_DEPTH_STENCIL_STATE_DepthBufferWriteEnable_start  90
   119816 #define GEN7_DEPTH_STENCIL_STATE_DepthBufferWriteEnable_start  90
   119817 #define GEN6_DEPTH_STENCIL_STATE_DepthBufferWriteEnable_start  90
   119818 
   119819 static inline uint32_t ATTRIBUTE_PURE
   119820 DEPTH_STENCIL_STATE_DepthBufferWriteEnable_start(const struct gen_device_info *devinfo)
   119821 {
   119822    switch (devinfo->gen) {
   119823    case 10: return 0;
   119824    case 9: return 0;
   119825    case 8: return 0;
   119826    case 7:
   119827       if (devinfo->is_haswell) {
   119828          return 90;
   119829       } else {
   119830          return 90;
   119831       }
   119832    case 6: return 90;
   119833    case 5: return 0;
   119834    case 4:
   119835       if (devinfo->is_g4x) {
   119836          return 0;
   119837       } else {
   119838          return 0;
   119839       }
   119840    default:
   119841       unreachable("Invalid hardware generation");
   119842    }
   119843 }
   119844 
   119845 
   119846 
   119847 /* DEPTH_STENCIL_STATE::Depth Test Enable */
   119848 
   119849 
   119850 #define GEN75_DEPTH_STENCIL_STATE_DepthTestEnable_bits  1
   119851 #define GEN7_DEPTH_STENCIL_STATE_DepthTestEnable_bits  1
   119852 #define GEN6_DEPTH_STENCIL_STATE_DepthTestEnable_bits  1
   119853 
   119854 static inline uint32_t ATTRIBUTE_PURE
   119855 DEPTH_STENCIL_STATE_DepthTestEnable_bits(const struct gen_device_info *devinfo)
   119856 {
   119857    switch (devinfo->gen) {
   119858    case 10: return 0;
   119859    case 9: return 0;
   119860    case 8: return 0;
   119861    case 7:
   119862       if (devinfo->is_haswell) {
   119863          return 1;
   119864       } else {
   119865          return 1;
   119866       }
   119867    case 6: return 1;
   119868    case 5: return 0;
   119869    case 4:
   119870       if (devinfo->is_g4x) {
   119871          return 0;
   119872       } else {
   119873          return 0;
   119874       }
   119875    default:
   119876       unreachable("Invalid hardware generation");
   119877    }
   119878 }
   119879 
   119880 
   119881 
   119882 #define GEN75_DEPTH_STENCIL_STATE_DepthTestEnable_start  95
   119883 #define GEN7_DEPTH_STENCIL_STATE_DepthTestEnable_start  95
   119884 #define GEN6_DEPTH_STENCIL_STATE_DepthTestEnable_start  95
   119885 
   119886 static inline uint32_t ATTRIBUTE_PURE
   119887 DEPTH_STENCIL_STATE_DepthTestEnable_start(const struct gen_device_info *devinfo)
   119888 {
   119889    switch (devinfo->gen) {
   119890    case 10: return 0;
   119891    case 9: return 0;
   119892    case 8: return 0;
   119893    case 7:
   119894       if (devinfo->is_haswell) {
   119895          return 95;
   119896       } else {
   119897          return 95;
   119898       }
   119899    case 6: return 95;
   119900    case 5: return 0;
   119901    case 4:
   119902       if (devinfo->is_g4x) {
   119903          return 0;
   119904       } else {
   119905          return 0;
   119906       }
   119907    default:
   119908       unreachable("Invalid hardware generation");
   119909    }
   119910 }
   119911 
   119912 
   119913 
   119914 /* DEPTH_STENCIL_STATE::Depth Test Function */
   119915 
   119916 
   119917 #define GEN75_DEPTH_STENCIL_STATE_DepthTestFunction_bits  3
   119918 #define GEN7_DEPTH_STENCIL_STATE_DepthTestFunction_bits  3
   119919 #define GEN6_DEPTH_STENCIL_STATE_DepthTestFunction_bits  3
   119920 
   119921 static inline uint32_t ATTRIBUTE_PURE
   119922 DEPTH_STENCIL_STATE_DepthTestFunction_bits(const struct gen_device_info *devinfo)
   119923 {
   119924    switch (devinfo->gen) {
   119925    case 10: return 0;
   119926    case 9: return 0;
   119927    case 8: return 0;
   119928    case 7:
   119929       if (devinfo->is_haswell) {
   119930          return 3;
   119931       } else {
   119932          return 3;
   119933       }
   119934    case 6: return 3;
   119935    case 5: return 0;
   119936    case 4:
   119937       if (devinfo->is_g4x) {
   119938          return 0;
   119939       } else {
   119940          return 0;
   119941       }
   119942    default:
   119943       unreachable("Invalid hardware generation");
   119944    }
   119945 }
   119946 
   119947 
   119948 
   119949 #define GEN75_DEPTH_STENCIL_STATE_DepthTestFunction_start  91
   119950 #define GEN7_DEPTH_STENCIL_STATE_DepthTestFunction_start  91
   119951 #define GEN6_DEPTH_STENCIL_STATE_DepthTestFunction_start  91
   119952 
   119953 static inline uint32_t ATTRIBUTE_PURE
   119954 DEPTH_STENCIL_STATE_DepthTestFunction_start(const struct gen_device_info *devinfo)
   119955 {
   119956    switch (devinfo->gen) {
   119957    case 10: return 0;
   119958    case 9: return 0;
   119959    case 8: return 0;
   119960    case 7:
   119961       if (devinfo->is_haswell) {
   119962          return 91;
   119963       } else {
   119964          return 91;
   119965       }
   119966    case 6: return 91;
   119967    case 5: return 0;
   119968    case 4:
   119969       if (devinfo->is_g4x) {
   119970          return 0;
   119971       } else {
   119972          return 0;
   119973       }
   119974    default:
   119975       unreachable("Invalid hardware generation");
   119976    }
   119977 }
   119978 
   119979 
   119980 
   119981 /* DEPTH_STENCIL_STATE::Double Sided Stencil Enable */
   119982 
   119983 
   119984 #define GEN75_DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_bits  1
   119985 #define GEN7_DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_bits  1
   119986 #define GEN6_DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_bits  1
   119987 
   119988 static inline uint32_t ATTRIBUTE_PURE
   119989 DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_bits(const struct gen_device_info *devinfo)
   119990 {
   119991    switch (devinfo->gen) {
   119992    case 10: return 0;
   119993    case 9: return 0;
   119994    case 8: return 0;
   119995    case 7:
   119996       if (devinfo->is_haswell) {
   119997          return 1;
   119998       } else {
   119999          return 1;
   120000       }
   120001    case 6: return 1;
   120002    case 5: return 0;
   120003    case 4:
   120004       if (devinfo->is_g4x) {
   120005          return 0;
   120006       } else {
   120007          return 0;
   120008       }
   120009    default:
   120010       unreachable("Invalid hardware generation");
   120011    }
   120012 }
   120013 
   120014 
   120015 
   120016 #define GEN75_DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_start  15
   120017 #define GEN7_DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_start  15
   120018 #define GEN6_DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_start  15
   120019 
   120020 static inline uint32_t ATTRIBUTE_PURE
   120021 DEPTH_STENCIL_STATE_DoubleSidedStencilEnable_start(const struct gen_device_info *devinfo)
   120022 {
   120023    switch (devinfo->gen) {
   120024    case 10: return 0;
   120025    case 9: return 0;
   120026    case 8: return 0;
   120027    case 7:
   120028       if (devinfo->is_haswell) {
   120029          return 15;
   120030       } else {
   120031          return 15;
   120032       }
   120033    case 6: return 15;
   120034    case 5: return 0;
   120035    case 4:
   120036       if (devinfo->is_g4x) {
   120037          return 0;
   120038       } else {
   120039          return 0;
   120040       }
   120041    default:
   120042       unreachable("Invalid hardware generation");
   120043    }
   120044 }
   120045 
   120046 
   120047 
   120048 /* DEPTH_STENCIL_STATE::Stencil Buffer Write Enable */
   120049 
   120050 
   120051 #define GEN75_DEPTH_STENCIL_STATE_StencilBufferWriteEnable_bits  1
   120052 #define GEN7_DEPTH_STENCIL_STATE_StencilBufferWriteEnable_bits  1
   120053 #define GEN6_DEPTH_STENCIL_STATE_StencilBufferWriteEnable_bits  1
   120054 
   120055 static inline uint32_t ATTRIBUTE_PURE
   120056 DEPTH_STENCIL_STATE_StencilBufferWriteEnable_bits(const struct gen_device_info *devinfo)
   120057 {
   120058    switch (devinfo->gen) {
   120059    case 10: return 0;
   120060    case 9: return 0;
   120061    case 8: return 0;
   120062    case 7:
   120063       if (devinfo->is_haswell) {
   120064          return 1;
   120065       } else {
   120066          return 1;
   120067       }
   120068    case 6: return 1;
   120069    case 5: return 0;
   120070    case 4:
   120071       if (devinfo->is_g4x) {
   120072          return 0;
   120073       } else {
   120074          return 0;
   120075       }
   120076    default:
   120077       unreachable("Invalid hardware generation");
   120078    }
   120079 }
   120080 
   120081 
   120082 
   120083 #define GEN75_DEPTH_STENCIL_STATE_StencilBufferWriteEnable_start  18
   120084 #define GEN7_DEPTH_STENCIL_STATE_StencilBufferWriteEnable_start  18
   120085 #define GEN6_DEPTH_STENCIL_STATE_StencilBufferWriteEnable_start  18
   120086 
   120087 static inline uint32_t ATTRIBUTE_PURE
   120088 DEPTH_STENCIL_STATE_StencilBufferWriteEnable_start(const struct gen_device_info *devinfo)
   120089 {
   120090    switch (devinfo->gen) {
   120091    case 10: return 0;
   120092    case 9: return 0;
   120093    case 8: return 0;
   120094    case 7:
   120095       if (devinfo->is_haswell) {
   120096          return 18;
   120097       } else {
   120098          return 18;
   120099       }
   120100    case 6: return 18;
   120101    case 5: return 0;
   120102    case 4:
   120103       if (devinfo->is_g4x) {
   120104          return 0;
   120105       } else {
   120106          return 0;
   120107       }
   120108    default:
   120109       unreachable("Invalid hardware generation");
   120110    }
   120111 }
   120112 
   120113 
   120114 
   120115 /* DEPTH_STENCIL_STATE::Stencil Fail Op */
   120116 
   120117 
   120118 #define GEN75_DEPTH_STENCIL_STATE_StencilFailOp_bits  3
   120119 #define GEN7_DEPTH_STENCIL_STATE_StencilFailOp_bits  3
   120120 #define GEN6_DEPTH_STENCIL_STATE_StencilFailOp_bits  3
   120121 
   120122 static inline uint32_t ATTRIBUTE_PURE
   120123 DEPTH_STENCIL_STATE_StencilFailOp_bits(const struct gen_device_info *devinfo)
   120124 {
   120125    switch (devinfo->gen) {
   120126    case 10: return 0;
   120127    case 9: return 0;
   120128    case 8: return 0;
   120129    case 7:
   120130       if (devinfo->is_haswell) {
   120131          return 3;
   120132       } else {
   120133          return 3;
   120134       }
   120135    case 6: return 3;
   120136    case 5: return 0;
   120137    case 4:
   120138       if (devinfo->is_g4x) {
   120139          return 0;
   120140       } else {
   120141          return 0;
   120142       }
   120143    default:
   120144       unreachable("Invalid hardware generation");
   120145    }
   120146 }
   120147 
   120148 
   120149 
   120150 #define GEN75_DEPTH_STENCIL_STATE_StencilFailOp_start  25
   120151 #define GEN7_DEPTH_STENCIL_STATE_StencilFailOp_start  25
   120152 #define GEN6_DEPTH_STENCIL_STATE_StencilFailOp_start  25
   120153 
   120154 static inline uint32_t ATTRIBUTE_PURE
   120155 DEPTH_STENCIL_STATE_StencilFailOp_start(const struct gen_device_info *devinfo)
   120156 {
   120157    switch (devinfo->gen) {
   120158    case 10: return 0;
   120159    case 9: return 0;
   120160    case 8: return 0;
   120161    case 7:
   120162       if (devinfo->is_haswell) {
   120163          return 25;
   120164       } else {
   120165          return 25;
   120166       }
   120167    case 6: return 25;
   120168    case 5: return 0;
   120169    case 4:
   120170       if (devinfo->is_g4x) {
   120171          return 0;
   120172       } else {
   120173          return 0;
   120174       }
   120175    default:
   120176       unreachable("Invalid hardware generation");
   120177    }
   120178 }
   120179 
   120180 
   120181 
   120182 /* DEPTH_STENCIL_STATE::Stencil Pass Depth Fail Op */
   120183 
   120184 
   120185 #define GEN75_DEPTH_STENCIL_STATE_StencilPassDepthFailOp_bits  3
   120186 #define GEN7_DEPTH_STENCIL_STATE_StencilPassDepthFailOp_bits  3
   120187 #define GEN6_DEPTH_STENCIL_STATE_StencilPassDepthFailOp_bits  3
   120188 
   120189 static inline uint32_t ATTRIBUTE_PURE
   120190 DEPTH_STENCIL_STATE_StencilPassDepthFailOp_bits(const struct gen_device_info *devinfo)
   120191 {
   120192    switch (devinfo->gen) {
   120193    case 10: return 0;
   120194    case 9: return 0;
   120195    case 8: return 0;
   120196    case 7:
   120197       if (devinfo->is_haswell) {
   120198          return 3;
   120199       } else {
   120200          return 3;
   120201       }
   120202    case 6: return 3;
   120203    case 5: return 0;
   120204    case 4:
   120205       if (devinfo->is_g4x) {
   120206          return 0;
   120207       } else {
   120208          return 0;
   120209       }
   120210    default:
   120211       unreachable("Invalid hardware generation");
   120212    }
   120213 }
   120214 
   120215 
   120216 
   120217 #define GEN75_DEPTH_STENCIL_STATE_StencilPassDepthFailOp_start  22
   120218 #define GEN7_DEPTH_STENCIL_STATE_StencilPassDepthFailOp_start  22
   120219 #define GEN6_DEPTH_STENCIL_STATE_StencilPassDepthFailOp_start  22
   120220 
   120221 static inline uint32_t ATTRIBUTE_PURE
   120222 DEPTH_STENCIL_STATE_StencilPassDepthFailOp_start(const struct gen_device_info *devinfo)
   120223 {
   120224    switch (devinfo->gen) {
   120225    case 10: return 0;
   120226    case 9: return 0;
   120227    case 8: return 0;
   120228    case 7:
   120229       if (devinfo->is_haswell) {
   120230          return 22;
   120231       } else {
   120232          return 22;
   120233       }
   120234    case 6: return 22;
   120235    case 5: return 0;
   120236    case 4:
   120237       if (devinfo->is_g4x) {
   120238          return 0;
   120239       } else {
   120240          return 0;
   120241       }
   120242    default:
   120243       unreachable("Invalid hardware generation");
   120244    }
   120245 }
   120246 
   120247 
   120248 
   120249 /* DEPTH_STENCIL_STATE::Stencil Pass Depth Pass Op */
   120250 
   120251 
   120252 #define GEN75_DEPTH_STENCIL_STATE_StencilPassDepthPassOp_bits  3
   120253 #define GEN7_DEPTH_STENCIL_STATE_StencilPassDepthPassOp_bits  3
   120254 #define GEN6_DEPTH_STENCIL_STATE_StencilPassDepthPassOp_bits  3
   120255 
   120256 static inline uint32_t ATTRIBUTE_PURE
   120257 DEPTH_STENCIL_STATE_StencilPassDepthPassOp_bits(const struct gen_device_info *devinfo)
   120258 {
   120259    switch (devinfo->gen) {
   120260    case 10: return 0;
   120261    case 9: return 0;
   120262    case 8: return 0;
   120263    case 7:
   120264       if (devinfo->is_haswell) {
   120265          return 3;
   120266       } else {
   120267          return 3;
   120268       }
   120269    case 6: return 3;
   120270    case 5: return 0;
   120271    case 4:
   120272       if (devinfo->is_g4x) {
   120273          return 0;
   120274       } else {
   120275          return 0;
   120276       }
   120277    default:
   120278       unreachable("Invalid hardware generation");
   120279    }
   120280 }
   120281 
   120282 
   120283 
   120284 #define GEN75_DEPTH_STENCIL_STATE_StencilPassDepthPassOp_start  19
   120285 #define GEN7_DEPTH_STENCIL_STATE_StencilPassDepthPassOp_start  19
   120286 #define GEN6_DEPTH_STENCIL_STATE_StencilPassDepthPassOp_start  19
   120287 
   120288 static inline uint32_t ATTRIBUTE_PURE
   120289 DEPTH_STENCIL_STATE_StencilPassDepthPassOp_start(const struct gen_device_info *devinfo)
   120290 {
   120291    switch (devinfo->gen) {
   120292    case 10: return 0;
   120293    case 9: return 0;
   120294    case 8: return 0;
   120295    case 7:
   120296       if (devinfo->is_haswell) {
   120297          return 19;
   120298       } else {
   120299          return 19;
   120300       }
   120301    case 6: return 19;
   120302    case 5: return 0;
   120303    case 4:
   120304       if (devinfo->is_g4x) {
   120305          return 0;
   120306       } else {
   120307          return 0;
   120308       }
   120309    default:
   120310       unreachable("Invalid hardware generation");
   120311    }
   120312 }
   120313 
   120314 
   120315 
   120316 /* DEPTH_STENCIL_STATE::Stencil Test Enable */
   120317 
   120318 
   120319 #define GEN75_DEPTH_STENCIL_STATE_StencilTestEnable_bits  1
   120320 #define GEN7_DEPTH_STENCIL_STATE_StencilTestEnable_bits  1
   120321 #define GEN6_DEPTH_STENCIL_STATE_StencilTestEnable_bits  1
   120322 
   120323 static inline uint32_t ATTRIBUTE_PURE
   120324 DEPTH_STENCIL_STATE_StencilTestEnable_bits(const struct gen_device_info *devinfo)
   120325 {
   120326    switch (devinfo->gen) {
   120327    case 10: return 0;
   120328    case 9: return 0;
   120329    case 8: return 0;
   120330    case 7:
   120331       if (devinfo->is_haswell) {
   120332          return 1;
   120333       } else {
   120334          return 1;
   120335       }
   120336    case 6: return 1;
   120337    case 5: return 0;
   120338    case 4:
   120339       if (devinfo->is_g4x) {
   120340          return 0;
   120341       } else {
   120342          return 0;
   120343       }
   120344    default:
   120345       unreachable("Invalid hardware generation");
   120346    }
   120347 }
   120348 
   120349 
   120350 
   120351 #define GEN75_DEPTH_STENCIL_STATE_StencilTestEnable_start  31
   120352 #define GEN7_DEPTH_STENCIL_STATE_StencilTestEnable_start  31
   120353 #define GEN6_DEPTH_STENCIL_STATE_StencilTestEnable_start  31
   120354 
   120355 static inline uint32_t ATTRIBUTE_PURE
   120356 DEPTH_STENCIL_STATE_StencilTestEnable_start(const struct gen_device_info *devinfo)
   120357 {
   120358    switch (devinfo->gen) {
   120359    case 10: return 0;
   120360    case 9: return 0;
   120361    case 8: return 0;
   120362    case 7:
   120363       if (devinfo->is_haswell) {
   120364          return 31;
   120365       } else {
   120366          return 31;
   120367       }
   120368    case 6: return 31;
   120369    case 5: return 0;
   120370    case 4:
   120371       if (devinfo->is_g4x) {
   120372          return 0;
   120373       } else {
   120374          return 0;
   120375       }
   120376    default:
   120377       unreachable("Invalid hardware generation");
   120378    }
   120379 }
   120380 
   120381 
   120382 
   120383 /* DEPTH_STENCIL_STATE::Stencil Test Function */
   120384 
   120385 
   120386 #define GEN75_DEPTH_STENCIL_STATE_StencilTestFunction_bits  3
   120387 #define GEN7_DEPTH_STENCIL_STATE_StencilTestFunction_bits  3
   120388 #define GEN6_DEPTH_STENCIL_STATE_StencilTestFunction_bits  3
   120389 
   120390 static inline uint32_t ATTRIBUTE_PURE
   120391 DEPTH_STENCIL_STATE_StencilTestFunction_bits(const struct gen_device_info *devinfo)
   120392 {
   120393    switch (devinfo->gen) {
   120394    case 10: return 0;
   120395    case 9: return 0;
   120396    case 8: return 0;
   120397    case 7:
   120398       if (devinfo->is_haswell) {
   120399          return 3;
   120400       } else {
   120401          return 3;
   120402       }
   120403    case 6: return 3;
   120404    case 5: return 0;
   120405    case 4:
   120406       if (devinfo->is_g4x) {
   120407          return 0;
   120408       } else {
   120409          return 0;
   120410       }
   120411    default:
   120412       unreachable("Invalid hardware generation");
   120413    }
   120414 }
   120415 
   120416 
   120417 
   120418 #define GEN75_DEPTH_STENCIL_STATE_StencilTestFunction_start  28
   120419 #define GEN7_DEPTH_STENCIL_STATE_StencilTestFunction_start  28
   120420 #define GEN6_DEPTH_STENCIL_STATE_StencilTestFunction_start  28
   120421 
   120422 static inline uint32_t ATTRIBUTE_PURE
   120423 DEPTH_STENCIL_STATE_StencilTestFunction_start(const struct gen_device_info *devinfo)
   120424 {
   120425    switch (devinfo->gen) {
   120426    case 10: return 0;
   120427    case 9: return 0;
   120428    case 8: return 0;
   120429    case 7:
   120430       if (devinfo->is_haswell) {
   120431          return 28;
   120432       } else {
   120433          return 28;
   120434       }
   120435    case 6: return 28;
   120436    case 5: return 0;
   120437    case 4:
   120438       if (devinfo->is_g4x) {
   120439          return 0;
   120440       } else {
   120441          return 0;
   120442       }
   120443    default:
   120444       unreachable("Invalid hardware generation");
   120445    }
   120446 }
   120447 
   120448 
   120449 
   120450 /* DEPTH_STENCIL_STATE::Stencil Test Mask */
   120451 
   120452 
   120453 #define GEN75_DEPTH_STENCIL_STATE_StencilTestMask_bits  8
   120454 #define GEN7_DEPTH_STENCIL_STATE_StencilTestMask_bits  8
   120455 #define GEN6_DEPTH_STENCIL_STATE_StencilTestMask_bits  8
   120456 
   120457 static inline uint32_t ATTRIBUTE_PURE
   120458 DEPTH_STENCIL_STATE_StencilTestMask_bits(const struct gen_device_info *devinfo)
   120459 {
   120460    switch (devinfo->gen) {
   120461    case 10: return 0;
   120462    case 9: return 0;
   120463    case 8: return 0;
   120464    case 7:
   120465       if (devinfo->is_haswell) {
   120466          return 8;
   120467       } else {
   120468          return 8;
   120469       }
   120470    case 6: return 8;
   120471    case 5: return 0;
   120472    case 4:
   120473       if (devinfo->is_g4x) {
   120474          return 0;
   120475       } else {
   120476          return 0;
   120477       }
   120478    default:
   120479       unreachable("Invalid hardware generation");
   120480    }
   120481 }
   120482 
   120483 
   120484 
   120485 #define GEN75_DEPTH_STENCIL_STATE_StencilTestMask_start  56
   120486 #define GEN7_DEPTH_STENCIL_STATE_StencilTestMask_start  56
   120487 #define GEN6_DEPTH_STENCIL_STATE_StencilTestMask_start  56
   120488 
   120489 static inline uint32_t ATTRIBUTE_PURE
   120490 DEPTH_STENCIL_STATE_StencilTestMask_start(const struct gen_device_info *devinfo)
   120491 {
   120492    switch (devinfo->gen) {
   120493    case 10: return 0;
   120494    case 9: return 0;
   120495    case 8: return 0;
   120496    case 7:
   120497       if (devinfo->is_haswell) {
   120498          return 56;
   120499       } else {
   120500          return 56;
   120501       }
   120502    case 6: return 56;
   120503    case 5: return 0;
   120504    case 4:
   120505       if (devinfo->is_g4x) {
   120506          return 0;
   120507       } else {
   120508          return 0;
   120509       }
   120510    default:
   120511       unreachable("Invalid hardware generation");
   120512    }
   120513 }
   120514 
   120515 
   120516 
   120517 /* DEPTH_STENCIL_STATE::Stencil Write Mask */
   120518 
   120519 
   120520 #define GEN75_DEPTH_STENCIL_STATE_StencilWriteMask_bits  8
   120521 #define GEN7_DEPTH_STENCIL_STATE_StencilWriteMask_bits  8
   120522 #define GEN6_DEPTH_STENCIL_STATE_StencilWriteMask_bits  8
   120523 
   120524 static inline uint32_t ATTRIBUTE_PURE
   120525 DEPTH_STENCIL_STATE_StencilWriteMask_bits(const struct gen_device_info *devinfo)
   120526 {
   120527    switch (devinfo->gen) {
   120528    case 10: return 0;
   120529    case 9: return 0;
   120530    case 8: return 0;
   120531    case 7:
   120532       if (devinfo->is_haswell) {
   120533          return 8;
   120534       } else {
   120535          return 8;
   120536       }
   120537    case 6: return 8;
   120538    case 5: return 0;
   120539    case 4:
   120540       if (devinfo->is_g4x) {
   120541          return 0;
   120542       } else {
   120543          return 0;
   120544       }
   120545    default:
   120546       unreachable("Invalid hardware generation");
   120547    }
   120548 }
   120549 
   120550 
   120551 
   120552 #define GEN75_DEPTH_STENCIL_STATE_StencilWriteMask_start  48
   120553 #define GEN7_DEPTH_STENCIL_STATE_StencilWriteMask_start  48
   120554 #define GEN6_DEPTH_STENCIL_STATE_StencilWriteMask_start  48
   120555 
   120556 static inline uint32_t ATTRIBUTE_PURE
   120557 DEPTH_STENCIL_STATE_StencilWriteMask_start(const struct gen_device_info *devinfo)
   120558 {
   120559    switch (devinfo->gen) {
   120560    case 10: return 0;
   120561    case 9: return 0;
   120562    case 8: return 0;
   120563    case 7:
   120564       if (devinfo->is_haswell) {
   120565          return 48;
   120566       } else {
   120567          return 48;
   120568       }
   120569    case 6: return 48;
   120570    case 5: return 0;
   120571    case 4:
   120572       if (devinfo->is_g4x) {
   120573          return 0;
   120574       } else {
   120575          return 0;
   120576       }
   120577    default:
   120578       unreachable("Invalid hardware generation");
   120579    }
   120580 }
   120581 
   120582 
   120583 
   120584 /* DS_INVOCATION_COUNT */
   120585 
   120586 
   120587 #define GEN10_DS_INVOCATION_COUNT_length  2
   120588 #define GEN9_DS_INVOCATION_COUNT_length  2
   120589 #define GEN8_DS_INVOCATION_COUNT_length  2
   120590 #define GEN75_DS_INVOCATION_COUNT_length  2
   120591 #define GEN7_DS_INVOCATION_COUNT_length  2
   120592 
   120593 static inline uint32_t ATTRIBUTE_PURE
   120594 DS_INVOCATION_COUNT_length(const struct gen_device_info *devinfo)
   120595 {
   120596    switch (devinfo->gen) {
   120597    case 10: return 2;
   120598    case 9: return 2;
   120599    case 8: return 2;
   120600    case 7:
   120601       if (devinfo->is_haswell) {
   120602          return 2;
   120603       } else {
   120604          return 2;
   120605       }
   120606    case 6: return 0;
   120607    case 5: return 0;
   120608    case 4:
   120609       if (devinfo->is_g4x) {
   120610          return 0;
   120611       } else {
   120612          return 0;
   120613       }
   120614    default:
   120615       unreachable("Invalid hardware generation");
   120616    }
   120617 }
   120618 
   120619 
   120620 
   120621 /* DS_INVOCATION_COUNT::DS Invocation Count Report */
   120622 
   120623 
   120624 #define GEN10_DS_INVOCATION_COUNT_DSInvocationCountReport_bits  64
   120625 #define GEN9_DS_INVOCATION_COUNT_DSInvocationCountReport_bits  64
   120626 #define GEN8_DS_INVOCATION_COUNT_DSInvocationCountReport_bits  64
   120627 #define GEN75_DS_INVOCATION_COUNT_DSInvocationCountReport_bits  64
   120628 #define GEN7_DS_INVOCATION_COUNT_DSInvocationCountReport_bits  64
   120629 
   120630 static inline uint32_t ATTRIBUTE_PURE
   120631 DS_INVOCATION_COUNT_DSInvocationCountReport_bits(const struct gen_device_info *devinfo)
   120632 {
   120633    switch (devinfo->gen) {
   120634    case 10: return 64;
   120635    case 9: return 64;
   120636    case 8: return 64;
   120637    case 7:
   120638       if (devinfo->is_haswell) {
   120639          return 64;
   120640       } else {
   120641          return 64;
   120642       }
   120643    case 6: return 0;
   120644    case 5: return 0;
   120645    case 4:
   120646       if (devinfo->is_g4x) {
   120647          return 0;
   120648       } else {
   120649          return 0;
   120650       }
   120651    default:
   120652       unreachable("Invalid hardware generation");
   120653    }
   120654 }
   120655 
   120656 
   120657 
   120658 #define GEN10_DS_INVOCATION_COUNT_DSInvocationCountReport_start  0
   120659 #define GEN9_DS_INVOCATION_COUNT_DSInvocationCountReport_start  0
   120660 #define GEN8_DS_INVOCATION_COUNT_DSInvocationCountReport_start  0
   120661 #define GEN75_DS_INVOCATION_COUNT_DSInvocationCountReport_start  0
   120662 #define GEN7_DS_INVOCATION_COUNT_DSInvocationCountReport_start  0
   120663 
   120664 static inline uint32_t ATTRIBUTE_PURE
   120665 DS_INVOCATION_COUNT_DSInvocationCountReport_start(const struct gen_device_info *devinfo)
   120666 {
   120667    switch (devinfo->gen) {
   120668    case 10: return 0;
   120669    case 9: return 0;
   120670    case 8: return 0;
   120671    case 7:
   120672       if (devinfo->is_haswell) {
   120673          return 0;
   120674       } else {
   120675          return 0;
   120676       }
   120677    case 6: return 0;
   120678    case 5: return 0;
   120679    case 4:
   120680       if (devinfo->is_g4x) {
   120681          return 0;
   120682       } else {
   120683          return 0;
   120684       }
   120685    default:
   120686       unreachable("Invalid hardware generation");
   120687    }
   120688 }
   120689 
   120690 
   120691 
   120692 /* ERR_INT */
   120693 
   120694 
   120695 #define GEN75_ERR_INT_length  1
   120696 #define GEN7_ERR_INT_length  1
   120697 
   120698 static inline uint32_t ATTRIBUTE_PURE
   120699 ERR_INT_length(const struct gen_device_info *devinfo)
   120700 {
   120701    switch (devinfo->gen) {
   120702    case 10: return 0;
   120703    case 9: return 0;
   120704    case 8: return 0;
   120705    case 7:
   120706       if (devinfo->is_haswell) {
   120707          return 1;
   120708       } else {
   120709          return 1;
   120710       }
   120711    case 6: return 0;
   120712    case 5: return 0;
   120713    case 4:
   120714       if (devinfo->is_g4x) {
   120715          return 0;
   120716       } else {
   120717          return 0;
   120718       }
   120719    default:
   120720       unreachable("Invalid hardware generation");
   120721    }
   120722 }
   120723 
   120724 
   120725 
   120726 /* ERR_INT::Cursor A GTT Fault Status */
   120727 
   120728 
   120729 #define GEN75_ERR_INT_CursorAGTTFaultStatus_bits  1
   120730 #define GEN7_ERR_INT_CursorAGTTFaultStatus_bits  1
   120731 
   120732 static inline uint32_t ATTRIBUTE_PURE
   120733 ERR_INT_CursorAGTTFaultStatus_bits(const struct gen_device_info *devinfo)
   120734 {
   120735    switch (devinfo->gen) {
   120736    case 10: return 0;
   120737    case 9: return 0;
   120738    case 8: return 0;
   120739    case 7:
   120740       if (devinfo->is_haswell) {
   120741          return 1;
   120742       } else {
   120743          return 1;
   120744       }
   120745    case 6: return 0;
   120746    case 5: return 0;
   120747    case 4:
   120748       if (devinfo->is_g4x) {
   120749          return 0;
   120750       } else {
   120751          return 0;
   120752       }
   120753    default:
   120754       unreachable("Invalid hardware generation");
   120755    }
   120756 }
   120757 
   120758 
   120759 
   120760 #define GEN75_ERR_INT_CursorAGTTFaultStatus_start  4
   120761 #define GEN7_ERR_INT_CursorAGTTFaultStatus_start  4
   120762 
   120763 static inline uint32_t ATTRIBUTE_PURE
   120764 ERR_INT_CursorAGTTFaultStatus_start(const struct gen_device_info *devinfo)
   120765 {
   120766    switch (devinfo->gen) {
   120767    case 10: return 0;
   120768    case 9: return 0;
   120769    case 8: return 0;
   120770    case 7:
   120771       if (devinfo->is_haswell) {
   120772          return 4;
   120773       } else {
   120774          return 4;
   120775       }
   120776    case 6: return 0;
   120777    case 5: return 0;
   120778    case 4:
   120779       if (devinfo->is_g4x) {
   120780          return 0;
   120781       } else {
   120782          return 0;
   120783       }
   120784    default:
   120785       unreachable("Invalid hardware generation");
   120786    }
   120787 }
   120788 
   120789 
   120790 
   120791 /* ERR_INT::Cursor B GTT Fault Status */
   120792 
   120793 
   120794 #define GEN75_ERR_INT_CursorBGTTFaultStatus_bits  1
   120795 #define GEN7_ERR_INT_CursorBGTTFaultStatus_bits  1
   120796 
   120797 static inline uint32_t ATTRIBUTE_PURE
   120798 ERR_INT_CursorBGTTFaultStatus_bits(const struct gen_device_info *devinfo)
   120799 {
   120800    switch (devinfo->gen) {
   120801    case 10: return 0;
   120802    case 9: return 0;
   120803    case 8: return 0;
   120804    case 7:
   120805       if (devinfo->is_haswell) {
   120806          return 1;
   120807       } else {
   120808          return 1;
   120809       }
   120810    case 6: return 0;
   120811    case 5: return 0;
   120812    case 4:
   120813       if (devinfo->is_g4x) {
   120814          return 0;
   120815       } else {
   120816          return 0;
   120817       }
   120818    default:
   120819       unreachable("Invalid hardware generation");
   120820    }
   120821 }
   120822 
   120823 
   120824 
   120825 #define GEN75_ERR_INT_CursorBGTTFaultStatus_start  5
   120826 #define GEN7_ERR_INT_CursorBGTTFaultStatus_start  5
   120827 
   120828 static inline uint32_t ATTRIBUTE_PURE
   120829 ERR_INT_CursorBGTTFaultStatus_start(const struct gen_device_info *devinfo)
   120830 {
   120831    switch (devinfo->gen) {
   120832    case 10: return 0;
   120833    case 9: return 0;
   120834    case 8: return 0;
   120835    case 7:
   120836       if (devinfo->is_haswell) {
   120837          return 5;
   120838       } else {
   120839          return 5;
   120840       }
   120841    case 6: return 0;
   120842    case 5: return 0;
   120843    case 4:
   120844       if (devinfo->is_g4x) {
   120845          return 0;
   120846       } else {
   120847          return 0;
   120848       }
   120849    default:
   120850       unreachable("Invalid hardware generation");
   120851    }
   120852 }
   120853 
   120854 
   120855 
   120856 /* ERR_INT::Invalid GTT page table entry */
   120857 
   120858 
   120859 #define GEN75_ERR_INT_InvalidGTTpagetableentry_bits  1
   120860 #define GEN7_ERR_INT_InvalidGTTpagetableentry_bits  1
   120861 
   120862 static inline uint32_t ATTRIBUTE_PURE
   120863 ERR_INT_InvalidGTTpagetableentry_bits(const struct gen_device_info *devinfo)
   120864 {
   120865    switch (devinfo->gen) {
   120866    case 10: return 0;
   120867    case 9: return 0;
   120868    case 8: return 0;
   120869    case 7:
   120870       if (devinfo->is_haswell) {
   120871          return 1;
   120872       } else {
   120873          return 1;
   120874       }
   120875    case 6: return 0;
   120876    case 5: return 0;
   120877    case 4:
   120878       if (devinfo->is_g4x) {
   120879          return 0;
   120880       } else {
   120881          return 0;
   120882       }
   120883    default:
   120884       unreachable("Invalid hardware generation");
   120885    }
   120886 }
   120887 
   120888 
   120889 
   120890 #define GEN75_ERR_INT_InvalidGTTpagetableentry_start  7
   120891 #define GEN7_ERR_INT_InvalidGTTpagetableentry_start  7
   120892 
   120893 static inline uint32_t ATTRIBUTE_PURE
   120894 ERR_INT_InvalidGTTpagetableentry_start(const struct gen_device_info *devinfo)
   120895 {
   120896    switch (devinfo->gen) {
   120897    case 10: return 0;
   120898    case 9: return 0;
   120899    case 8: return 0;
   120900    case 7:
   120901       if (devinfo->is_haswell) {
   120902          return 7;
   120903       } else {
   120904          return 7;
   120905       }
   120906    case 6: return 0;
   120907    case 5: return 0;
   120908    case 4:
   120909       if (devinfo->is_g4x) {
   120910          return 0;
   120911       } else {
   120912          return 0;
   120913       }
   120914    default:
   120915       unreachable("Invalid hardware generation");
   120916    }
   120917 }
   120918 
   120919 
   120920 
   120921 /* ERR_INT::Invalid page table entry data */
   120922 
   120923 
   120924 #define GEN75_ERR_INT_Invalidpagetableentrydata_bits  1
   120925 #define GEN7_ERR_INT_Invalidpagetableentrydata_bits  1
   120926 
   120927 static inline uint32_t ATTRIBUTE_PURE
   120928 ERR_INT_Invalidpagetableentrydata_bits(const struct gen_device_info *devinfo)
   120929 {
   120930    switch (devinfo->gen) {
   120931    case 10: return 0;
   120932    case 9: return 0;
   120933    case 8: return 0;
   120934    case 7:
   120935       if (devinfo->is_haswell) {
   120936          return 1;
   120937       } else {
   120938          return 1;
   120939       }
   120940    case 6: return 0;
   120941    case 5: return 0;
   120942    case 4:
   120943       if (devinfo->is_g4x) {
   120944          return 0;
   120945       } else {
   120946          return 0;
   120947       }
   120948    default:
   120949       unreachable("Invalid hardware generation");
   120950    }
   120951 }
   120952 
   120953 
   120954 
   120955 #define GEN75_ERR_INT_Invalidpagetableentrydata_start  6
   120956 #define GEN7_ERR_INT_Invalidpagetableentrydata_start  6
   120957 
   120958 static inline uint32_t ATTRIBUTE_PURE
   120959 ERR_INT_Invalidpagetableentrydata_start(const struct gen_device_info *devinfo)
   120960 {
   120961    switch (devinfo->gen) {
   120962    case 10: return 0;
   120963    case 9: return 0;
   120964    case 8: return 0;
   120965    case 7:
   120966       if (devinfo->is_haswell) {
   120967          return 6;
   120968       } else {
   120969          return 6;
   120970       }
   120971    case 6: return 0;
   120972    case 5: return 0;
   120973    case 4:
   120974       if (devinfo->is_g4x) {
   120975          return 0;
   120976       } else {
   120977          return 0;
   120978       }
   120979    default:
   120980       unreachable("Invalid hardware generation");
   120981    }
   120982 }
   120983 
   120984 
   120985 
   120986 /* ERR_INT::Primary A GTT Fault Status */
   120987 
   120988 
   120989 #define GEN75_ERR_INT_PrimaryAGTTFaultStatus_bits  1
   120990 #define GEN7_ERR_INT_PrimaryAGTTFaultStatus_bits  1
   120991 
   120992 static inline uint32_t ATTRIBUTE_PURE
   120993 ERR_INT_PrimaryAGTTFaultStatus_bits(const struct gen_device_info *devinfo)
   120994 {
   120995    switch (devinfo->gen) {
   120996    case 10: return 0;
   120997    case 9: return 0;
   120998    case 8: return 0;
   120999    case 7:
   121000       if (devinfo->is_haswell) {
   121001          return 1;
   121002       } else {
   121003          return 1;
   121004       }
   121005    case 6: return 0;
   121006    case 5: return 0;
   121007    case 4:
   121008       if (devinfo->is_g4x) {
   121009          return 0;
   121010       } else {
   121011          return 0;
   121012       }
   121013    default:
   121014       unreachable("Invalid hardware generation");
   121015    }
   121016 }
   121017 
   121018 
   121019 
   121020 #define GEN75_ERR_INT_PrimaryAGTTFaultStatus_start  0
   121021 #define GEN7_ERR_INT_PrimaryAGTTFaultStatus_start  0
   121022 
   121023 static inline uint32_t ATTRIBUTE_PURE
   121024 ERR_INT_PrimaryAGTTFaultStatus_start(const struct gen_device_info *devinfo)
   121025 {
   121026    switch (devinfo->gen) {
   121027    case 10: return 0;
   121028    case 9: return 0;
   121029    case 8: return 0;
   121030    case 7:
   121031       if (devinfo->is_haswell) {
   121032          return 0;
   121033       } else {
   121034          return 0;
   121035       }
   121036    case 6: return 0;
   121037    case 5: return 0;
   121038    case 4:
   121039       if (devinfo->is_g4x) {
   121040          return 0;
   121041       } else {
   121042          return 0;
   121043       }
   121044    default:
   121045       unreachable("Invalid hardware generation");
   121046    }
   121047 }
   121048 
   121049 
   121050 
   121051 /* ERR_INT::Primary B GTT Fault Status */
   121052 
   121053 
   121054 #define GEN75_ERR_INT_PrimaryBGTTFaultStatus_bits  1
   121055 #define GEN7_ERR_INT_PrimaryBGTTFaultStatus_bits  1
   121056 
   121057 static inline uint32_t ATTRIBUTE_PURE
   121058 ERR_INT_PrimaryBGTTFaultStatus_bits(const struct gen_device_info *devinfo)
   121059 {
   121060    switch (devinfo->gen) {
   121061    case 10: return 0;
   121062    case 9: return 0;
   121063    case 8: return 0;
   121064    case 7:
   121065       if (devinfo->is_haswell) {
   121066          return 1;
   121067       } else {
   121068          return 1;
   121069       }
   121070    case 6: return 0;
   121071    case 5: return 0;
   121072    case 4:
   121073       if (devinfo->is_g4x) {
   121074          return 0;
   121075       } else {
   121076          return 0;
   121077       }
   121078    default:
   121079       unreachable("Invalid hardware generation");
   121080    }
   121081 }
   121082 
   121083 
   121084 
   121085 #define GEN75_ERR_INT_PrimaryBGTTFaultStatus_start  1
   121086 #define GEN7_ERR_INT_PrimaryBGTTFaultStatus_start  1
   121087 
   121088 static inline uint32_t ATTRIBUTE_PURE
   121089 ERR_INT_PrimaryBGTTFaultStatus_start(const struct gen_device_info *devinfo)
   121090 {
   121091    switch (devinfo->gen) {
   121092    case 10: return 0;
   121093    case 9: return 0;
   121094    case 8: return 0;
   121095    case 7:
   121096       if (devinfo->is_haswell) {
   121097          return 1;
   121098       } else {
   121099          return 1;
   121100       }
   121101    case 6: return 0;
   121102    case 5: return 0;
   121103    case 4:
   121104       if (devinfo->is_g4x) {
   121105          return 0;
   121106       } else {
   121107          return 0;
   121108       }
   121109    default:
   121110       unreachable("Invalid hardware generation");
   121111    }
   121112 }
   121113 
   121114 
   121115 
   121116 /* ERR_INT::Sprite A GTT Fault Status */
   121117 
   121118 
   121119 #define GEN75_ERR_INT_SpriteAGTTFaultStatus_bits  1
   121120 #define GEN7_ERR_INT_SpriteAGTTFaultStatus_bits  1
   121121 
   121122 static inline uint32_t ATTRIBUTE_PURE
   121123 ERR_INT_SpriteAGTTFaultStatus_bits(const struct gen_device_info *devinfo)
   121124 {
   121125    switch (devinfo->gen) {
   121126    case 10: return 0;
   121127    case 9: return 0;
   121128    case 8: return 0;
   121129    case 7:
   121130       if (devinfo->is_haswell) {
   121131          return 1;
   121132       } else {
   121133          return 1;
   121134       }
   121135    case 6: return 0;
   121136    case 5: return 0;
   121137    case 4:
   121138       if (devinfo->is_g4x) {
   121139          return 0;
   121140       } else {
   121141          return 0;
   121142       }
   121143    default:
   121144       unreachable("Invalid hardware generation");
   121145    }
   121146 }
   121147 
   121148 
   121149 
   121150 #define GEN75_ERR_INT_SpriteAGTTFaultStatus_start  2
   121151 #define GEN7_ERR_INT_SpriteAGTTFaultStatus_start  2
   121152 
   121153 static inline uint32_t ATTRIBUTE_PURE
   121154 ERR_INT_SpriteAGTTFaultStatus_start(const struct gen_device_info *devinfo)
   121155 {
   121156    switch (devinfo->gen) {
   121157    case 10: return 0;
   121158    case 9: return 0;
   121159    case 8: return 0;
   121160    case 7:
   121161       if (devinfo->is_haswell) {
   121162          return 2;
   121163       } else {
   121164          return 2;
   121165       }
   121166    case 6: return 0;
   121167    case 5: return 0;
   121168    case 4:
   121169       if (devinfo->is_g4x) {
   121170          return 0;
   121171       } else {
   121172          return 0;
   121173       }
   121174    default:
   121175       unreachable("Invalid hardware generation");
   121176    }
   121177 }
   121178 
   121179 
   121180 
   121181 /* ERR_INT::Sprite B GTT Fault Status */
   121182 
   121183 
   121184 #define GEN75_ERR_INT_SpriteBGTTFaultStatus_bits  1
   121185 #define GEN7_ERR_INT_SpriteBGTTFaultStatus_bits  1
   121186 
   121187 static inline uint32_t ATTRIBUTE_PURE
   121188 ERR_INT_SpriteBGTTFaultStatus_bits(const struct gen_device_info *devinfo)
   121189 {
   121190    switch (devinfo->gen) {
   121191    case 10: return 0;
   121192    case 9: return 0;
   121193    case 8: return 0;
   121194    case 7:
   121195       if (devinfo->is_haswell) {
   121196          return 1;
   121197       } else {
   121198          return 1;
   121199       }
   121200    case 6: return 0;
   121201    case 5: return 0;
   121202    case 4:
   121203       if (devinfo->is_g4x) {
   121204          return 0;
   121205       } else {
   121206          return 0;
   121207       }
   121208    default:
   121209       unreachable("Invalid hardware generation");
   121210    }
   121211 }
   121212 
   121213 
   121214 
   121215 #define GEN75_ERR_INT_SpriteBGTTFaultStatus_start  3
   121216 #define GEN7_ERR_INT_SpriteBGTTFaultStatus_start  3
   121217 
   121218 static inline uint32_t ATTRIBUTE_PURE
   121219 ERR_INT_SpriteBGTTFaultStatus_start(const struct gen_device_info *devinfo)
   121220 {
   121221    switch (devinfo->gen) {
   121222    case 10: return 0;
   121223    case 9: return 0;
   121224    case 8: return 0;
   121225    case 7:
   121226       if (devinfo->is_haswell) {
   121227          return 3;
   121228       } else {
   121229          return 3;
   121230       }
   121231    case 6: return 0;
   121232    case 5: return 0;
   121233    case 4:
   121234       if (devinfo->is_g4x) {
   121235          return 0;
   121236       } else {
   121237          return 0;
   121238       }
   121239    default:
   121240       unreachable("Invalid hardware generation");
   121241    }
   121242 }
   121243 
   121244 
   121245 
   121246 /* EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR */
   121247 
   121248 
   121249 #define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_length  1
   121250 #define GEN9_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_length  1
   121251 
   121252 static inline uint32_t ATTRIBUTE_PURE
   121253 EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_length(const struct gen_device_info *devinfo)
   121254 {
   121255    switch (devinfo->gen) {
   121256    case 10: return 1;
   121257    case 9: return 1;
   121258    case 8: return 0;
   121259    case 7:
   121260       if (devinfo->is_haswell) {
   121261          return 0;
   121262       } else {
   121263          return 0;
   121264       }
   121265    case 6: return 0;
   121266    case 5: return 0;
   121267    case 4:
   121268       if (devinfo->is_g4x) {
   121269          return 0;
   121270       } else {
   121271          return 0;
   121272       }
   121273    default:
   121274       unreachable("Invalid hardware generation");
   121275    }
   121276 }
   121277 
   121278 
   121279 
   121280 /* EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR::End Of Thread */
   121281 
   121282 
   121283 #define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_EndOfThread_bits  1
   121284 #define GEN9_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_EndOfThread_bits  1
   121285 
   121286 static inline uint32_t ATTRIBUTE_PURE
   121287 EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_EndOfThread_bits(const struct gen_device_info *devinfo)
   121288 {
   121289    switch (devinfo->gen) {
   121290    case 10: return 1;
   121291    case 9: return 1;
   121292    case 8: return 0;
   121293    case 7:
   121294       if (devinfo->is_haswell) {
   121295          return 0;
   121296       } else {
   121297          return 0;
   121298       }
   121299    case 6: return 0;
   121300    case 5: return 0;
   121301    case 4:
   121302       if (devinfo->is_g4x) {
   121303          return 0;
   121304       } else {
   121305          return 0;
   121306       }
   121307    default:
   121308       unreachable("Invalid hardware generation");
   121309    }
   121310 }
   121311 
   121312 
   121313 
   121314 #define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_EndOfThread_start  5
   121315 #define GEN9_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_EndOfThread_start  5
   121316 
   121317 static inline uint32_t ATTRIBUTE_PURE
   121318 EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_EndOfThread_start(const struct gen_device_info *devinfo)
   121319 {
   121320    switch (devinfo->gen) {
   121321    case 10: return 5;
   121322    case 9: return 5;
   121323    case 8: return 0;
   121324    case 7:
   121325       if (devinfo->is_haswell) {
   121326          return 0;
   121327       } else {
   121328          return 0;
   121329       }
   121330    case 6: return 0;
   121331    case 5: return 0;
   121332    case 4:
   121333       if (devinfo->is_g4x) {
   121334          return 0;
   121335       } else {
   121336          return 0;
   121337       }
   121338    default:
   121339       unreachable("Invalid hardware generation");
   121340    }
   121341 }
   121342 
   121343 
   121344 
   121345 /* EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR::Extended Message Length */
   121346 
   121347 
   121348 #define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_ExtendedMessageLength_bits  4
   121349 #define GEN9_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_ExtendedMessageLength_bits  4
   121350 
   121351 static inline uint32_t ATTRIBUTE_PURE
   121352 EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_ExtendedMessageLength_bits(const struct gen_device_info *devinfo)
   121353 {
   121354    switch (devinfo->gen) {
   121355    case 10: return 4;
   121356    case 9: return 4;
   121357    case 8: return 0;
   121358    case 7:
   121359       if (devinfo->is_haswell) {
   121360          return 0;
   121361       } else {
   121362          return 0;
   121363       }
   121364    case 6: return 0;
   121365    case 5: return 0;
   121366    case 4:
   121367       if (devinfo->is_g4x) {
   121368          return 0;
   121369       } else {
   121370          return 0;
   121371       }
   121372    default:
   121373       unreachable("Invalid hardware generation");
   121374    }
   121375 }
   121376 
   121377 
   121378 
   121379 #define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_ExtendedMessageLength_start  6
   121380 #define GEN9_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_ExtendedMessageLength_start  6
   121381 
   121382 static inline uint32_t ATTRIBUTE_PURE
   121383 EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_ExtendedMessageLength_start(const struct gen_device_info *devinfo)
   121384 {
   121385    switch (devinfo->gen) {
   121386    case 10: return 6;
   121387    case 9: return 6;
   121388    case 8: return 0;
   121389    case 7:
   121390       if (devinfo->is_haswell) {
   121391          return 0;
   121392       } else {
   121393          return 0;
   121394       }
   121395    case 6: return 0;
   121396    case 5: return 0;
   121397    case 4:
   121398       if (devinfo->is_g4x) {
   121399          return 0;
   121400       } else {
   121401          return 0;
   121402       }
   121403    default:
   121404       unreachable("Invalid hardware generation");
   121405    }
   121406 }
   121407 
   121408 
   121409 
   121410 /* EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR::Target Function ID */
   121411 
   121412 
   121413 #define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_TargetFunctionID_bits  4
   121414 #define GEN9_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_TargetFunctionID_bits  4
   121415 
   121416 static inline uint32_t ATTRIBUTE_PURE
   121417 EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_TargetFunctionID_bits(const struct gen_device_info *devinfo)
   121418 {
   121419    switch (devinfo->gen) {
   121420    case 10: return 4;
   121421    case 9: return 4;
   121422    case 8: return 0;
   121423    case 7:
   121424       if (devinfo->is_haswell) {
   121425          return 0;
   121426       } else {
   121427          return 0;
   121428       }
   121429    case 6: return 0;
   121430    case 5: return 0;
   121431    case 4:
   121432       if (devinfo->is_g4x) {
   121433          return 0;
   121434       } else {
   121435          return 0;
   121436       }
   121437    default:
   121438       unreachable("Invalid hardware generation");
   121439    }
   121440 }
   121441 
   121442 
   121443 
   121444 #define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_TargetFunctionID_start  0
   121445 #define GEN9_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_TargetFunctionID_start  0
   121446 
   121447 static inline uint32_t ATTRIBUTE_PURE
   121448 EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_TargetFunctionID_start(const struct gen_device_info *devinfo)
   121449 {
   121450    switch (devinfo->gen) {
   121451    case 10: return 0;
   121452    case 9: return 0;
   121453    case 8: return 0;
   121454    case 7:
   121455       if (devinfo->is_haswell) {
   121456          return 0;
   121457       } else {
   121458          return 0;
   121459       }
   121460    case 6: return 0;
   121461    case 5: return 0;
   121462    case 4:
   121463       if (devinfo->is_g4x) {
   121464          return 0;
   121465       } else {
   121466          return 0;
   121467       }
   121468    default:
   121469       unreachable("Invalid hardware generation");
   121470    }
   121471 }
   121472 
   121473 
   121474 
   121475 /* FAULT_REG */
   121476 
   121477 
   121478 #define GEN9_FAULT_REG_length  1
   121479 #define GEN8_FAULT_REG_length  1
   121480 
   121481 static inline uint32_t ATTRIBUTE_PURE
   121482 FAULT_REG_length(const struct gen_device_info *devinfo)
   121483 {
   121484    switch (devinfo->gen) {
   121485    case 10: return 0;
   121486    case 9: return 1;
   121487    case 8: return 1;
   121488    case 7:
   121489       if (devinfo->is_haswell) {
   121490          return 0;
   121491       } else {
   121492          return 0;
   121493       }
   121494    case 6: return 0;
   121495    case 5: return 0;
   121496    case 4:
   121497       if (devinfo->is_g4x) {
   121498          return 0;
   121499       } else {
   121500          return 0;
   121501       }
   121502    default:
   121503       unreachable("Invalid hardware generation");
   121504    }
   121505 }
   121506 
   121507 
   121508 
   121509 /* FAULT_REG::Engine ID */
   121510 
   121511 
   121512 #define GEN9_FAULT_REG_EngineID_bits  3
   121513 #define GEN8_FAULT_REG_EngineID_bits  3
   121514 
   121515 static inline uint32_t ATTRIBUTE_PURE
   121516 FAULT_REG_EngineID_bits(const struct gen_device_info *devinfo)
   121517 {
   121518    switch (devinfo->gen) {
   121519    case 10: return 0;
   121520    case 9: return 3;
   121521    case 8: return 3;
   121522    case 7:
   121523       if (devinfo->is_haswell) {
   121524          return 0;
   121525       } else {
   121526          return 0;
   121527       }
   121528    case 6: return 0;
   121529    case 5: return 0;
   121530    case 4:
   121531       if (devinfo->is_g4x) {
   121532          return 0;
   121533       } else {
   121534          return 0;
   121535       }
   121536    default:
   121537       unreachable("Invalid hardware generation");
   121538    }
   121539 }
   121540 
   121541 
   121542 
   121543 #define GEN9_FAULT_REG_EngineID_start  12
   121544 #define GEN8_FAULT_REG_EngineID_start  12
   121545 
   121546 static inline uint32_t ATTRIBUTE_PURE
   121547 FAULT_REG_EngineID_start(const struct gen_device_info *devinfo)
   121548 {
   121549    switch (devinfo->gen) {
   121550    case 10: return 0;
   121551    case 9: return 12;
   121552    case 8: return 12;
   121553    case 7:
   121554       if (devinfo->is_haswell) {
   121555          return 0;
   121556       } else {
   121557          return 0;
   121558       }
   121559    case 6: return 0;
   121560    case 5: return 0;
   121561    case 4:
   121562       if (devinfo->is_g4x) {
   121563          return 0;
   121564       } else {
   121565          return 0;
   121566       }
   121567    default:
   121568       unreachable("Invalid hardware generation");
   121569    }
   121570 }
   121571 
   121572 
   121573 
   121574 /* FAULT_REG::Fault Type */
   121575 
   121576 
   121577 #define GEN9_FAULT_REG_FaultType_bits  2
   121578 #define GEN8_FAULT_REG_FaultType_bits  2
   121579 
   121580 static inline uint32_t ATTRIBUTE_PURE
   121581 FAULT_REG_FaultType_bits(const struct gen_device_info *devinfo)
   121582 {
   121583    switch (devinfo->gen) {
   121584    case 10: return 0;
   121585    case 9: return 2;
   121586    case 8: return 2;
   121587    case 7:
   121588       if (devinfo->is_haswell) {
   121589          return 0;
   121590       } else {
   121591          return 0;
   121592       }
   121593    case 6: return 0;
   121594    case 5: return 0;
   121595    case 4:
   121596       if (devinfo->is_g4x) {
   121597          return 0;
   121598       } else {
   121599          return 0;
   121600       }
   121601    default:
   121602       unreachable("Invalid hardware generation");
   121603    }
   121604 }
   121605 
   121606 
   121607 
   121608 #define GEN9_FAULT_REG_FaultType_start  1
   121609 #define GEN8_FAULT_REG_FaultType_start  1
   121610 
   121611 static inline uint32_t ATTRIBUTE_PURE
   121612 FAULT_REG_FaultType_start(const struct gen_device_info *devinfo)
   121613 {
   121614    switch (devinfo->gen) {
   121615    case 10: return 0;
   121616    case 9: return 1;
   121617    case 8: return 1;
   121618    case 7:
   121619       if (devinfo->is_haswell) {
   121620          return 0;
   121621       } else {
   121622          return 0;
   121623       }
   121624    case 6: return 0;
   121625    case 5: return 0;
   121626    case 4:
   121627       if (devinfo->is_g4x) {
   121628          return 0;
   121629       } else {
   121630          return 0;
   121631       }
   121632    default:
   121633       unreachable("Invalid hardware generation");
   121634    }
   121635 }
   121636 
   121637 
   121638 
   121639 /* FAULT_REG::GTTSEL */
   121640 
   121641 
   121642 #define GEN9_FAULT_REG_GTTSEL_bits  1
   121643 #define GEN8_FAULT_REG_GTTSEL_bits  1
   121644 
   121645 static inline uint32_t ATTRIBUTE_PURE
   121646 FAULT_REG_GTTSEL_bits(const struct gen_device_info *devinfo)
   121647 {
   121648    switch (devinfo->gen) {
   121649    case 10: return 0;
   121650    case 9: return 1;
   121651    case 8: return 1;
   121652    case 7:
   121653       if (devinfo->is_haswell) {
   121654          return 0;
   121655       } else {
   121656          return 0;
   121657       }
   121658    case 6: return 0;
   121659    case 5: return 0;
   121660    case 4:
   121661       if (devinfo->is_g4x) {
   121662          return 0;
   121663       } else {
   121664          return 0;
   121665       }
   121666    default:
   121667       unreachable("Invalid hardware generation");
   121668    }
   121669 }
   121670 
   121671 
   121672 
   121673 #define GEN9_FAULT_REG_GTTSEL_start  11
   121674 #define GEN8_FAULT_REG_GTTSEL_start  11
   121675 
   121676 static inline uint32_t ATTRIBUTE_PURE
   121677 FAULT_REG_GTTSEL_start(const struct gen_device_info *devinfo)
   121678 {
   121679    switch (devinfo->gen) {
   121680    case 10: return 0;
   121681    case 9: return 11;
   121682    case 8: return 11;
   121683    case 7:
   121684       if (devinfo->is_haswell) {
   121685          return 0;
   121686       } else {
   121687          return 0;
   121688       }
   121689    case 6: return 0;
   121690    case 5: return 0;
   121691    case 4:
   121692       if (devinfo->is_g4x) {
   121693          return 0;
   121694       } else {
   121695          return 0;
   121696       }
   121697    default:
   121698       unreachable("Invalid hardware generation");
   121699    }
   121700 }
   121701 
   121702 
   121703 
   121704 /* FAULT_REG::SRCID of Fault */
   121705 
   121706 
   121707 #define GEN9_FAULT_REG_SRCIDofFault_bits  8
   121708 #define GEN8_FAULT_REG_SRCIDofFault_bits  8
   121709 
   121710 static inline uint32_t ATTRIBUTE_PURE
   121711 FAULT_REG_SRCIDofFault_bits(const struct gen_device_info *devinfo)
   121712 {
   121713    switch (devinfo->gen) {
   121714    case 10: return 0;
   121715    case 9: return 8;
   121716    case 8: return 8;
   121717    case 7:
   121718       if (devinfo->is_haswell) {
   121719          return 0;
   121720       } else {
   121721          return 0;
   121722       }
   121723    case 6: return 0;
   121724    case 5: return 0;
   121725    case 4:
   121726       if (devinfo->is_g4x) {
   121727          return 0;
   121728       } else {
   121729          return 0;
   121730       }
   121731    default:
   121732       unreachable("Invalid hardware generation");
   121733    }
   121734 }
   121735 
   121736 
   121737 
   121738 #define GEN9_FAULT_REG_SRCIDofFault_start  3
   121739 #define GEN8_FAULT_REG_SRCIDofFault_start  3
   121740 
   121741 static inline uint32_t ATTRIBUTE_PURE
   121742 FAULT_REG_SRCIDofFault_start(const struct gen_device_info *devinfo)
   121743 {
   121744    switch (devinfo->gen) {
   121745    case 10: return 0;
   121746    case 9: return 3;
   121747    case 8: return 3;
   121748    case 7:
   121749       if (devinfo->is_haswell) {
   121750          return 0;
   121751       } else {
   121752          return 0;
   121753       }
   121754    case 6: return 0;
   121755    case 5: return 0;
   121756    case 4:
   121757       if (devinfo->is_g4x) {
   121758          return 0;
   121759       } else {
   121760          return 0;
   121761       }
   121762    default:
   121763       unreachable("Invalid hardware generation");
   121764    }
   121765 }
   121766 
   121767 
   121768 
   121769 /* FAULT_REG::Valid Bit */
   121770 
   121771 
   121772 #define GEN9_FAULT_REG_ValidBit_bits  1
   121773 #define GEN8_FAULT_REG_ValidBit_bits  1
   121774 
   121775 static inline uint32_t ATTRIBUTE_PURE
   121776 FAULT_REG_ValidBit_bits(const struct gen_device_info *devinfo)
   121777 {
   121778    switch (devinfo->gen) {
   121779    case 10: return 0;
   121780    case 9: return 1;
   121781    case 8: return 1;
   121782    case 7:
   121783       if (devinfo->is_haswell) {
   121784          return 0;
   121785       } else {
   121786          return 0;
   121787       }
   121788    case 6: return 0;
   121789    case 5: return 0;
   121790    case 4:
   121791       if (devinfo->is_g4x) {
   121792          return 0;
   121793       } else {
   121794          return 0;
   121795       }
   121796    default:
   121797       unreachable("Invalid hardware generation");
   121798    }
   121799 }
   121800 
   121801 
   121802 
   121803 #define GEN9_FAULT_REG_ValidBit_start  0
   121804 #define GEN8_FAULT_REG_ValidBit_start  0
   121805 
   121806 static inline uint32_t ATTRIBUTE_PURE
   121807 FAULT_REG_ValidBit_start(const struct gen_device_info *devinfo)
   121808 {
   121809    switch (devinfo->gen) {
   121810    case 10: return 0;
   121811    case 9: return 0;
   121812    case 8: return 0;
   121813    case 7:
   121814       if (devinfo->is_haswell) {
   121815          return 0;
   121816       } else {
   121817          return 0;
   121818       }
   121819    case 6: return 0;
   121820    case 5: return 0;
   121821    case 4:
   121822       if (devinfo->is_g4x) {
   121823          return 0;
   121824       } else {
   121825          return 0;
   121826       }
   121827    default:
   121828       unreachable("Invalid hardware generation");
   121829    }
   121830 }
   121831 
   121832 
   121833 
   121834 /* FILTER_COEFFICIENT */
   121835 
   121836 
   121837 #define GEN10_FILTER_COEFFICIENT_length  1
   121838 #define GEN9_FILTER_COEFFICIENT_length  1
   121839 #define GEN8_FILTER_COEFFICIENT_length  1
   121840 
   121841 static inline uint32_t ATTRIBUTE_PURE
   121842 FILTER_COEFFICIENT_length(const struct gen_device_info *devinfo)
   121843 {
   121844    switch (devinfo->gen) {
   121845    case 10: return 1;
   121846    case 9: return 1;
   121847    case 8: return 1;
   121848    case 7:
   121849       if (devinfo->is_haswell) {
   121850          return 0;
   121851       } else {
   121852          return 0;
   121853       }
   121854    case 6: return 0;
   121855    case 5: return 0;
   121856    case 4:
   121857       if (devinfo->is_g4x) {
   121858          return 0;
   121859       } else {
   121860          return 0;
   121861       }
   121862    default:
   121863       unreachable("Invalid hardware generation");
   121864    }
   121865 }
   121866 
   121867 
   121868 
   121869 /* FILTER_COEFFICIENT::Filter Coefficient */
   121870 
   121871 
   121872 #define GEN10_FILTER_COEFFICIENT_FilterCoefficient_bits  8
   121873 #define GEN9_FILTER_COEFFICIENT_FilterCoefficient_bits  8
   121874 #define GEN8_FILTER_COEFFICIENT_FilterCoefficient_bits  8
   121875 
   121876 static inline uint32_t ATTRIBUTE_PURE
   121877 FILTER_COEFFICIENT_FilterCoefficient_bits(const struct gen_device_info *devinfo)
   121878 {
   121879    switch (devinfo->gen) {
   121880    case 10: return 8;
   121881    case 9: return 8;
   121882    case 8: return 8;
   121883    case 7:
   121884       if (devinfo->is_haswell) {
   121885          return 0;
   121886       } else {
   121887          return 0;
   121888       }
   121889    case 6: return 0;
   121890    case 5: return 0;
   121891    case 4:
   121892       if (devinfo->is_g4x) {
   121893          return 0;
   121894       } else {
   121895          return 0;
   121896       }
   121897    default:
   121898       unreachable("Invalid hardware generation");
   121899    }
   121900 }
   121901 
   121902 
   121903 
   121904 #define GEN10_FILTER_COEFFICIENT_FilterCoefficient_start  0
   121905 #define GEN9_FILTER_COEFFICIENT_FilterCoefficient_start  0
   121906 #define GEN8_FILTER_COEFFICIENT_FilterCoefficient_start  0
   121907 
   121908 static inline uint32_t ATTRIBUTE_PURE
   121909 FILTER_COEFFICIENT_FilterCoefficient_start(const struct gen_device_info *devinfo)
   121910 {
   121911    switch (devinfo->gen) {
   121912    case 10: return 0;
   121913    case 9: return 0;
   121914    case 8: return 0;
   121915    case 7:
   121916       if (devinfo->is_haswell) {
   121917          return 0;
   121918       } else {
   121919          return 0;
   121920       }
   121921    case 6: return 0;
   121922    case 5: return 0;
   121923    case 4:
   121924       if (devinfo->is_g4x) {
   121925          return 0;
   121926       } else {
   121927          return 0;
   121928       }
   121929    default:
   121930       unreachable("Invalid hardware generation");
   121931    }
   121932 }
   121933 
   121934 
   121935 
   121936 /* GATHER_CONSTANT_ENTRY */
   121937 
   121938 
   121939 #define GEN10_GATHER_CONSTANT_ENTRY_length  1
   121940 #define GEN9_GATHER_CONSTANT_ENTRY_length  1
   121941 #define GEN8_GATHER_CONSTANT_ENTRY_length  1
   121942 #define GEN75_GATHER_CONSTANT_ENTRY_length  1
   121943 
   121944 static inline uint32_t ATTRIBUTE_PURE
   121945 GATHER_CONSTANT_ENTRY_length(const struct gen_device_info *devinfo)
   121946 {
   121947    switch (devinfo->gen) {
   121948    case 10: return 1;
   121949    case 9: return 1;
   121950    case 8: return 1;
   121951    case 7:
   121952       if (devinfo->is_haswell) {
   121953          return 1;
   121954       } else {
   121955          return 0;
   121956       }
   121957    case 6: return 0;
   121958    case 5: return 0;
   121959    case 4:
   121960       if (devinfo->is_g4x) {
   121961          return 0;
   121962       } else {
   121963          return 0;
   121964       }
   121965    default:
   121966       unreachable("Invalid hardware generation");
   121967    }
   121968 }
   121969 
   121970 
   121971 
   121972 /* GATHER_CONSTANT_ENTRY::Binding Table Index Offset */
   121973 
   121974 
   121975 #define GEN10_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_bits  4
   121976 #define GEN9_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_bits  4
   121977 #define GEN8_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_bits  4
   121978 #define GEN75_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_bits  4
   121979 
   121980 static inline uint32_t ATTRIBUTE_PURE
   121981 GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_bits(const struct gen_device_info *devinfo)
   121982 {
   121983    switch (devinfo->gen) {
   121984    case 10: return 4;
   121985    case 9: return 4;
   121986    case 8: return 4;
   121987    case 7:
   121988       if (devinfo->is_haswell) {
   121989          return 4;
   121990       } else {
   121991          return 0;
   121992       }
   121993    case 6: return 0;
   121994    case 5: return 0;
   121995    case 4:
   121996       if (devinfo->is_g4x) {
   121997          return 0;
   121998       } else {
   121999          return 0;
   122000       }
   122001    default:
   122002       unreachable("Invalid hardware generation");
   122003    }
   122004 }
   122005 
   122006 
   122007 
   122008 #define GEN10_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_start  0
   122009 #define GEN9_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_start  0
   122010 #define GEN8_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_start  0
   122011 #define GEN75_GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_start  0
   122012 
   122013 static inline uint32_t ATTRIBUTE_PURE
   122014 GATHER_CONSTANT_ENTRY_BindingTableIndexOffset_start(const struct gen_device_info *devinfo)
   122015 {
   122016    switch (devinfo->gen) {
   122017    case 10: return 0;
   122018    case 9: return 0;
   122019    case 8: return 0;
   122020    case 7:
   122021       if (devinfo->is_haswell) {
   122022          return 0;
   122023       } else {
   122024          return 0;
   122025       }
   122026    case 6: return 0;
   122027    case 5: return 0;
   122028    case 4:
   122029       if (devinfo->is_g4x) {
   122030          return 0;
   122031       } else {
   122032          return 0;
   122033       }
   122034    default:
   122035       unreachable("Invalid hardware generation");
   122036    }
   122037 }
   122038 
   122039 
   122040 
   122041 /* GATHER_CONSTANT_ENTRY::Channel Mask */
   122042 
   122043 
   122044 #define GEN10_GATHER_CONSTANT_ENTRY_ChannelMask_bits  4
   122045 #define GEN9_GATHER_CONSTANT_ENTRY_ChannelMask_bits  4
   122046 #define GEN8_GATHER_CONSTANT_ENTRY_ChannelMask_bits  4
   122047 #define GEN75_GATHER_CONSTANT_ENTRY_ChannelMask_bits  4
   122048 
   122049 static inline uint32_t ATTRIBUTE_PURE
   122050 GATHER_CONSTANT_ENTRY_ChannelMask_bits(const struct gen_device_info *devinfo)
   122051 {
   122052    switch (devinfo->gen) {
   122053    case 10: return 4;
   122054    case 9: return 4;
   122055    case 8: return 4;
   122056    case 7:
   122057       if (devinfo->is_haswell) {
   122058          return 4;
   122059       } else {
   122060          return 0;
   122061       }
   122062    case 6: return 0;
   122063    case 5: return 0;
   122064    case 4:
   122065       if (devinfo->is_g4x) {
   122066          return 0;
   122067       } else {
   122068          return 0;
   122069       }
   122070    default:
   122071       unreachable("Invalid hardware generation");
   122072    }
   122073 }
   122074 
   122075 
   122076 
   122077 #define GEN10_GATHER_CONSTANT_ENTRY_ChannelMask_start  4
   122078 #define GEN9_GATHER_CONSTANT_ENTRY_ChannelMask_start  4
   122079 #define GEN8_GATHER_CONSTANT_ENTRY_ChannelMask_start  4
   122080 #define GEN75_GATHER_CONSTANT_ENTRY_ChannelMask_start  4
   122081 
   122082 static inline uint32_t ATTRIBUTE_PURE
   122083 GATHER_CONSTANT_ENTRY_ChannelMask_start(const struct gen_device_info *devinfo)
   122084 {
   122085    switch (devinfo->gen) {
   122086    case 10: return 4;
   122087    case 9: return 4;
   122088    case 8: return 4;
   122089    case 7:
   122090       if (devinfo->is_haswell) {
   122091          return 4;
   122092       } else {
   122093          return 0;
   122094       }
   122095    case 6: return 0;
   122096    case 5: return 0;
   122097    case 4:
   122098       if (devinfo->is_g4x) {
   122099          return 0;
   122100       } else {
   122101          return 0;
   122102       }
   122103    default:
   122104       unreachable("Invalid hardware generation");
   122105    }
   122106 }
   122107 
   122108 
   122109 
   122110 /* GATHER_CONSTANT_ENTRY::Constant Buffer Offset */
   122111 
   122112 
   122113 #define GEN10_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_bits  8
   122114 #define GEN9_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_bits  8
   122115 #define GEN8_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_bits  8
   122116 #define GEN75_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_bits  8
   122117 
   122118 static inline uint32_t ATTRIBUTE_PURE
   122119 GATHER_CONSTANT_ENTRY_ConstantBufferOffset_bits(const struct gen_device_info *devinfo)
   122120 {
   122121    switch (devinfo->gen) {
   122122    case 10: return 8;
   122123    case 9: return 8;
   122124    case 8: return 8;
   122125    case 7:
   122126       if (devinfo->is_haswell) {
   122127          return 8;
   122128       } else {
   122129          return 0;
   122130       }
   122131    case 6: return 0;
   122132    case 5: return 0;
   122133    case 4:
   122134       if (devinfo->is_g4x) {
   122135          return 0;
   122136       } else {
   122137          return 0;
   122138       }
   122139    default:
   122140       unreachable("Invalid hardware generation");
   122141    }
   122142 }
   122143 
   122144 
   122145 
   122146 #define GEN10_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_start  8
   122147 #define GEN9_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_start  8
   122148 #define GEN8_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_start  8
   122149 #define GEN75_GATHER_CONSTANT_ENTRY_ConstantBufferOffset_start  8
   122150 
   122151 static inline uint32_t ATTRIBUTE_PURE
   122152 GATHER_CONSTANT_ENTRY_ConstantBufferOffset_start(const struct gen_device_info *devinfo)
   122153 {
   122154    switch (devinfo->gen) {
   122155    case 10: return 8;
   122156    case 9: return 8;
   122157    case 8: return 8;
   122158    case 7:
   122159       if (devinfo->is_haswell) {
   122160          return 8;
   122161       } else {
   122162          return 0;
   122163       }
   122164    case 6: return 0;
   122165    case 5: return 0;
   122166    case 4:
   122167       if (devinfo->is_g4x) {
   122168          return 0;
   122169       } else {
   122170          return 0;
   122171       }
   122172    default:
   122173       unreachable("Invalid hardware generation");
   122174    }
   122175 }
   122176 
   122177 
   122178 
   122179 /* GFX_ARB_ERROR_RPT */
   122180 
   122181 
   122182 #define GEN9_GFX_ARB_ERROR_RPT_length  1
   122183 #define GEN8_GFX_ARB_ERROR_RPT_length  1
   122184 #define GEN75_GFX_ARB_ERROR_RPT_length  1
   122185 #define GEN7_GFX_ARB_ERROR_RPT_length  1
   122186 #define GEN6_GFX_ARB_ERROR_RPT_length  1
   122187 
   122188 static inline uint32_t ATTRIBUTE_PURE
   122189 GFX_ARB_ERROR_RPT_length(const struct gen_device_info *devinfo)
   122190 {
   122191    switch (devinfo->gen) {
   122192    case 10: return 0;
   122193    case 9: return 1;
   122194    case 8: return 1;
   122195    case 7:
   122196       if (devinfo->is_haswell) {
   122197          return 1;
   122198       } else {
   122199          return 1;
   122200       }
   122201    case 6: return 1;
   122202    case 5: return 0;
   122203    case 4:
   122204       if (devinfo->is_g4x) {
   122205          return 0;
   122206       } else {
   122207          return 0;
   122208       }
   122209    default:
   122210       unreachable("Invalid hardware generation");
   122211    }
   122212 }
   122213 
   122214 
   122215 
   122216 /* GFX_ARB_ERROR_RPT::Context Page Fault Error */
   122217 
   122218 
   122219 #define GEN75_GFX_ARB_ERROR_RPT_ContextPageFaultError_bits  1
   122220 #define GEN7_GFX_ARB_ERROR_RPT_ContextPageFaultError_bits  1
   122221 #define GEN6_GFX_ARB_ERROR_RPT_ContextPageFaultError_bits  1
   122222 
   122223 static inline uint32_t ATTRIBUTE_PURE
   122224 GFX_ARB_ERROR_RPT_ContextPageFaultError_bits(const struct gen_device_info *devinfo)
   122225 {
   122226    switch (devinfo->gen) {
   122227    case 10: return 0;
   122228    case 9: return 0;
   122229    case 8: return 0;
   122230    case 7:
   122231       if (devinfo->is_haswell) {
   122232          return 1;
   122233       } else {
   122234          return 1;
   122235       }
   122236    case 6: return 1;
   122237    case 5: return 0;
   122238    case 4:
   122239       if (devinfo->is_g4x) {
   122240          return 0;
   122241       } else {
   122242          return 0;
   122243       }
   122244    default:
   122245       unreachable("Invalid hardware generation");
   122246    }
   122247 }
   122248 
   122249 
   122250 
   122251 #define GEN75_GFX_ARB_ERROR_RPT_ContextPageFaultError_start  1
   122252 #define GEN7_GFX_ARB_ERROR_RPT_ContextPageFaultError_start  1
   122253 #define GEN6_GFX_ARB_ERROR_RPT_ContextPageFaultError_start  1
   122254 
   122255 static inline uint32_t ATTRIBUTE_PURE
   122256 GFX_ARB_ERROR_RPT_ContextPageFaultError_start(const struct gen_device_info *devinfo)
   122257 {
   122258    switch (devinfo->gen) {
   122259    case 10: return 0;
   122260    case 9: return 0;
   122261    case 8: return 0;
   122262    case 7:
   122263       if (devinfo->is_haswell) {
   122264          return 1;
   122265       } else {
   122266          return 1;
   122267       }
   122268    case 6: return 1;
   122269    case 5: return 0;
   122270    case 4:
   122271       if (devinfo->is_g4x) {
   122272          return 0;
   122273       } else {
   122274          return 0;
   122275       }
   122276    default:
   122277       unreachable("Invalid hardware generation");
   122278    }
   122279 }
   122280 
   122281 
   122282 
   122283 /* GFX_ARB_ERROR_RPT::Context Page VTD Translation Error */
   122284 
   122285 
   122286 #define GEN75_GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_bits  1
   122287 #define GEN7_GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_bits  1
   122288 #define GEN6_GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_bits  1
   122289 
   122290 static inline uint32_t ATTRIBUTE_PURE
   122291 GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_bits(const struct gen_device_info *devinfo)
   122292 {
   122293    switch (devinfo->gen) {
   122294    case 10: return 0;
   122295    case 9: return 0;
   122296    case 8: return 0;
   122297    case 7:
   122298       if (devinfo->is_haswell) {
   122299          return 1;
   122300       } else {
   122301          return 1;
   122302       }
   122303    case 6: return 1;
   122304    case 5: return 0;
   122305    case 4:
   122306       if (devinfo->is_g4x) {
   122307          return 0;
   122308       } else {
   122309          return 0;
   122310       }
   122311    default:
   122312       unreachable("Invalid hardware generation");
   122313    }
   122314 }
   122315 
   122316 
   122317 
   122318 #define GEN75_GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_start  5
   122319 #define GEN7_GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_start  5
   122320 #define GEN6_GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_start  5
   122321 
   122322 static inline uint32_t ATTRIBUTE_PURE
   122323 GFX_ARB_ERROR_RPT_ContextPageVTDTranslationError_start(const struct gen_device_info *devinfo)
   122324 {
   122325    switch (devinfo->gen) {
   122326    case 10: return 0;
   122327    case 9: return 0;
   122328    case 8: return 0;
   122329    case 7:
   122330       if (devinfo->is_haswell) {
   122331          return 5;
   122332       } else {
   122333          return 5;
   122334       }
   122335    case 6: return 5;
   122336    case 5: return 0;
   122337    case 4:
   122338       if (devinfo->is_g4x) {
   122339          return 0;
   122340       } else {
   122341          return 0;
   122342       }
   122343    default:
   122344       unreachable("Invalid hardware generation");
   122345    }
   122346 }
   122347 
   122348 
   122349 
   122350 /* GFX_ARB_ERROR_RPT::Context Was Not Marked As Present When Doing DMA */
   122351 
   122352 
   122353 #define GEN9_GFX_ARB_ERROR_RPT_ContextWasNotMarkedAsPresentWhenDoingDMA_bits  1
   122354 #define GEN8_GFX_ARB_ERROR_RPT_ContextWasNotMarkedAsPresentWhenDoingDMA_bits  1
   122355 
   122356 static inline uint32_t ATTRIBUTE_PURE
   122357 GFX_ARB_ERROR_RPT_ContextWasNotMarkedAsPresentWhenDoingDMA_bits(const struct gen_device_info *devinfo)
   122358 {
   122359    switch (devinfo->gen) {
   122360    case 10: return 0;
   122361    case 9: return 1;
   122362    case 8: return 1;
   122363    case 7:
   122364       if (devinfo->is_haswell) {
   122365          return 0;
   122366       } else {
   122367          return 0;
   122368       }
   122369    case 6: return 0;
   122370    case 5: return 0;
   122371    case 4:
   122372       if (devinfo->is_g4x) {
   122373          return 0;
   122374       } else {
   122375          return 0;
   122376       }
   122377    default:
   122378       unreachable("Invalid hardware generation");
   122379    }
   122380 }
   122381 
   122382 
   122383 
   122384 #define GEN9_GFX_ARB_ERROR_RPT_ContextWasNotMarkedAsPresentWhenDoingDMA_start  15
   122385 #define GEN8_GFX_ARB_ERROR_RPT_ContextWasNotMarkedAsPresentWhenDoingDMA_start  15
   122386 
   122387 static inline uint32_t ATTRIBUTE_PURE
   122388 GFX_ARB_ERROR_RPT_ContextWasNotMarkedAsPresentWhenDoingDMA_start(const struct gen_device_info *devinfo)
   122389 {
   122390    switch (devinfo->gen) {
   122391    case 10: return 0;
   122392    case 9: return 15;
   122393    case 8: return 15;
   122394    case 7:
   122395       if (devinfo->is_haswell) {
   122396          return 0;
   122397       } else {
   122398          return 0;
   122399       }
   122400    case 6: return 0;
   122401    case 5: return 0;
   122402    case 4:
   122403       if (devinfo->is_g4x) {
   122404          return 0;
   122405       } else {
   122406          return 0;
   122407       }
   122408    default:
   122409       unreachable("Invalid hardware generation");
   122410    }
   122411 }
   122412 
   122413 
   122414 
   122415 /* GFX_ARB_ERROR_RPT::GuC VTd translation Page Fault 2nd level (Undefined doorbell) */
   122416 
   122417 
   122418 #define GEN9_GFX_ARB_ERROR_RPT_GuCVTdtranslationPageFault2ndlevelUndefineddoorbell_bits  1
   122419 #define GEN8_GFX_ARB_ERROR_RPT_GuCVTdtranslationPageFault2ndlevelUndefineddoorbell_bits  1
   122420 
   122421 static inline uint32_t ATTRIBUTE_PURE
   122422 GFX_ARB_ERROR_RPT_GuCVTdtranslationPageFault2ndlevelUndefineddoorbell_bits(const struct gen_device_info *devinfo)
   122423 {
   122424    switch (devinfo->gen) {
   122425    case 10: return 0;
   122426    case 9: return 1;
   122427    case 8: return 1;
   122428    case 7:
   122429       if (devinfo->is_haswell) {
   122430          return 0;
   122431       } else {
   122432          return 0;
   122433       }
   122434    case 6: return 0;
   122435    case 5: return 0;
   122436    case 4:
   122437       if (devinfo->is_g4x) {
   122438          return 0;
   122439       } else {
   122440          return 0;
   122441       }
   122442    default:
   122443       unreachable("Invalid hardware generation");
   122444    }
   122445 }
   122446 
   122447 
   122448 
   122449 #define GEN9_GFX_ARB_ERROR_RPT_GuCVTdtranslationPageFault2ndlevelUndefineddoorbell_start  9
   122450 #define GEN8_GFX_ARB_ERROR_RPT_GuCVTdtranslationPageFault2ndlevelUndefineddoorbell_start  9
   122451 
   122452 static inline uint32_t ATTRIBUTE_PURE
   122453 GFX_ARB_ERROR_RPT_GuCVTdtranslationPageFault2ndlevelUndefineddoorbell_start(const struct gen_device_info *devinfo)
   122454 {
   122455    switch (devinfo->gen) {
   122456    case 10: return 0;
   122457    case 9: return 9;
   122458    case 8: return 9;
   122459    case 7:
   122460       if (devinfo->is_haswell) {
   122461          return 0;
   122462       } else {
   122463          return 0;
   122464       }
   122465    case 6: return 0;
   122466    case 5: return 0;
   122467    case 4:
   122468       if (devinfo->is_g4x) {
   122469          return 0;
   122470       } else {
   122471          return 0;
   122472       }
   122473    default:
   122474       unreachable("Invalid hardware generation");
   122475    }
   122476 }
   122477 
   122478 
   122479 
   122480 /* GFX_ARB_ERROR_RPT::Hardware Status Page Fault Error */
   122481 
   122482 
   122483 #define GEN75_GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_bits  1
   122484 #define GEN7_GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_bits  1
   122485 #define GEN6_GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_bits  1
   122486 
   122487 static inline uint32_t ATTRIBUTE_PURE
   122488 GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_bits(const struct gen_device_info *devinfo)
   122489 {
   122490    switch (devinfo->gen) {
   122491    case 10: return 0;
   122492    case 9: return 0;
   122493    case 8: return 0;
   122494    case 7:
   122495       if (devinfo->is_haswell) {
   122496          return 1;
   122497       } else {
   122498          return 1;
   122499       }
   122500    case 6: return 1;
   122501    case 5: return 0;
   122502    case 4:
   122503       if (devinfo->is_g4x) {
   122504          return 0;
   122505       } else {
   122506          return 0;
   122507       }
   122508    default:
   122509       unreachable("Invalid hardware generation");
   122510    }
   122511 }
   122512 
   122513 
   122514 
   122515 #define GEN75_GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_start  3
   122516 #define GEN7_GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_start  3
   122517 #define GEN6_GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_start  3
   122518 
   122519 static inline uint32_t ATTRIBUTE_PURE
   122520 GFX_ARB_ERROR_RPT_HardwareStatusPageFaultError_start(const struct gen_device_info *devinfo)
   122521 {
   122522    switch (devinfo->gen) {
   122523    case 10: return 0;
   122524    case 9: return 0;
   122525    case 8: return 0;
   122526    case 7:
   122527       if (devinfo->is_haswell) {
   122528          return 3;
   122529       } else {
   122530          return 3;
   122531       }
   122532    case 6: return 3;
   122533    case 5: return 0;
   122534    case 4:
   122535       if (devinfo->is_g4x) {
   122536          return 0;
   122537       } else {
   122538          return 0;
   122539       }
   122540    default:
   122541       unreachable("Invalid hardware generation");
   122542    }
   122543 }
   122544 
   122545 
   122546 
   122547 /* GFX_ARB_ERROR_RPT::Hardware Status Page VTD Translation Error */
   122548 
   122549 
   122550 #define GEN75_GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_bits  1
   122551 #define GEN7_GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_bits  1
   122552 #define GEN6_GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_bits  1
   122553 
   122554 static inline uint32_t ATTRIBUTE_PURE
   122555 GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_bits(const struct gen_device_info *devinfo)
   122556 {
   122557    switch (devinfo->gen) {
   122558    case 10: return 0;
   122559    case 9: return 0;
   122560    case 8: return 0;
   122561    case 7:
   122562       if (devinfo->is_haswell) {
   122563          return 1;
   122564       } else {
   122565          return 1;
   122566       }
   122567    case 6: return 1;
   122568    case 5: return 0;
   122569    case 4:
   122570       if (devinfo->is_g4x) {
   122571          return 0;
   122572       } else {
   122573          return 0;
   122574       }
   122575    default:
   122576       unreachable("Invalid hardware generation");
   122577    }
   122578 }
   122579 
   122580 
   122581 
   122582 #define GEN75_GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_start  7
   122583 #define GEN7_GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_start  7
   122584 #define GEN6_GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_start  7
   122585 
   122586 static inline uint32_t ATTRIBUTE_PURE
   122587 GFX_ARB_ERROR_RPT_HardwareStatusPageVTDTranslationError_start(const struct gen_device_info *devinfo)
   122588 {
   122589    switch (devinfo->gen) {
   122590    case 10: return 0;
   122591    case 9: return 0;
   122592    case 8: return 0;
   122593    case 7:
   122594       if (devinfo->is_haswell) {
   122595          return 7;
   122596       } else {
   122597          return 7;
   122598       }
   122599    case 6: return 7;
   122600    case 5: return 0;
   122601    case 4:
   122602       if (devinfo->is_g4x) {
   122603          return 0;
   122604       } else {
   122605          return 0;
   122606       }
   122607    default:
   122608       unreachable("Invalid hardware generation");
   122609    }
   122610 }
   122611 
   122612 
   122613 
   122614 /* GFX_ARB_ERROR_RPT::Invalid Page Directory Entry Error */
   122615 
   122616 
   122617 #define GEN9_GFX_ARB_ERROR_RPT_InvalidPageDirectoryEntryError_bits  1
   122618 #define GEN8_GFX_ARB_ERROR_RPT_InvalidPageDirectoryEntryError_bits  1
   122619 
   122620 static inline uint32_t ATTRIBUTE_PURE
   122621 GFX_ARB_ERROR_RPT_InvalidPageDirectoryEntryError_bits(const struct gen_device_info *devinfo)
   122622 {
   122623    switch (devinfo->gen) {
   122624    case 10: return 0;
   122625    case 9: return 1;
   122626    case 8: return 1;
   122627    case 7:
   122628       if (devinfo->is_haswell) {
   122629          return 0;
   122630       } else {
   122631          return 0;
   122632       }
   122633    case 6: return 0;
   122634    case 5: return 0;
   122635    case 4:
   122636       if (devinfo->is_g4x) {
   122637          return 0;
   122638       } else {
   122639          return 0;
   122640       }
   122641    default:
   122642       unreachable("Invalid hardware generation");
   122643    }
   122644 }
   122645 
   122646 
   122647 
   122648 #define GEN9_GFX_ARB_ERROR_RPT_InvalidPageDirectoryEntryError_start  2
   122649 #define GEN8_GFX_ARB_ERROR_RPT_InvalidPageDirectoryEntryError_start  2
   122650 
   122651 static inline uint32_t ATTRIBUTE_PURE
   122652 GFX_ARB_ERROR_RPT_InvalidPageDirectoryEntryError_start(const struct gen_device_info *devinfo)
   122653 {
   122654    switch (devinfo->gen) {
   122655    case 10: return 0;
   122656    case 9: return 2;
   122657    case 8: return 2;
   122658    case 7:
   122659       if (devinfo->is_haswell) {
   122660          return 0;
   122661       } else {
   122662          return 0;
   122663       }
   122664    case 6: return 0;
   122665    case 5: return 0;
   122666    case 4:
   122667       if (devinfo->is_g4x) {
   122668          return 0;
   122669       } else {
   122670          return 0;
   122671       }
   122672    default:
   122673       unreachable("Invalid hardware generation");
   122674    }
   122675 }
   122676 
   122677 
   122678 
   122679 /* GFX_ARB_ERROR_RPT::Invalid Page Directory entry error */
   122680 
   122681 
   122682 #define GEN75_GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_bits  1
   122683 #define GEN7_GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_bits  1
   122684 #define GEN6_GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_bits  1
   122685 
   122686 static inline uint32_t ATTRIBUTE_PURE
   122687 GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_bits(const struct gen_device_info *devinfo)
   122688 {
   122689    switch (devinfo->gen) {
   122690    case 10: return 0;
   122691    case 9: return 0;
   122692    case 8: return 0;
   122693    case 7:
   122694       if (devinfo->is_haswell) {
   122695          return 1;
   122696       } else {
   122697          return 1;
   122698       }
   122699    case 6: return 1;
   122700    case 5: return 0;
   122701    case 4:
   122702       if (devinfo->is_g4x) {
   122703          return 0;
   122704       } else {
   122705          return 0;
   122706       }
   122707    default:
   122708       unreachable("Invalid hardware generation");
   122709    }
   122710 }
   122711 
   122712 
   122713 
   122714 #define GEN75_GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_start  2
   122715 #define GEN7_GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_start  2
   122716 #define GEN6_GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_start  2
   122717 
   122718 static inline uint32_t ATTRIBUTE_PURE
   122719 GFX_ARB_ERROR_RPT_InvalidPageDirectoryentryerror_start(const struct gen_device_info *devinfo)
   122720 {
   122721    switch (devinfo->gen) {
   122722    case 10: return 0;
   122723    case 9: return 0;
   122724    case 8: return 0;
   122725    case 7:
   122726       if (devinfo->is_haswell) {
   122727          return 2;
   122728       } else {
   122729          return 2;
   122730       }
   122731    case 6: return 2;
   122732    case 5: return 0;
   122733    case 4:
   122734       if (devinfo->is_g4x) {
   122735          return 0;
   122736       } else {
   122737          return 0;
   122738       }
   122739    default:
   122740       unreachable("Invalid hardware generation");
   122741    }
   122742 }
   122743 
   122744 
   122745 
   122746 /* GFX_ARB_ERROR_RPT::Non WB memory type for Advanced Context */
   122747 
   122748 
   122749 #define GEN9_GFX_ARB_ERROR_RPT_NonWBmemorytypeforAdvancedContext_bits  1
   122750 #define GEN8_GFX_ARB_ERROR_RPT_NonWBmemorytypeforAdvancedContext_bits  1
   122751 
   122752 static inline uint32_t ATTRIBUTE_PURE
   122753 GFX_ARB_ERROR_RPT_NonWBmemorytypeforAdvancedContext_bits(const struct gen_device_info *devinfo)
   122754 {
   122755    switch (devinfo->gen) {
   122756    case 10: return 0;
   122757    case 9: return 1;
   122758    case 8: return 1;
   122759    case 7:
   122760       if (devinfo->is_haswell) {
   122761          return 0;
   122762       } else {
   122763          return 0;
   122764       }
   122765    case 6: return 0;
   122766    case 5: return 0;
   122767    case 4:
   122768       if (devinfo->is_g4x) {
   122769          return 0;
   122770       } else {
   122771          return 0;
   122772       }
   122773    default:
   122774       unreachable("Invalid hardware generation");
   122775    }
   122776 }
   122777 
   122778 
   122779 
   122780 #define GEN9_GFX_ARB_ERROR_RPT_NonWBmemorytypeforAdvancedContext_start  10
   122781 #define GEN8_GFX_ARB_ERROR_RPT_NonWBmemorytypeforAdvancedContext_start  10
   122782 
   122783 static inline uint32_t ATTRIBUTE_PURE
   122784 GFX_ARB_ERROR_RPT_NonWBmemorytypeforAdvancedContext_start(const struct gen_device_info *devinfo)
   122785 {
   122786    switch (devinfo->gen) {
   122787    case 10: return 0;
   122788    case 9: return 10;
   122789    case 8: return 10;
   122790    case 7:
   122791       if (devinfo->is_haswell) {
   122792          return 0;
   122793       } else {
   122794          return 0;
   122795       }
   122796    case 6: return 0;
   122797    case 5: return 0;
   122798    case 4:
   122799       if (devinfo->is_g4x) {
   122800          return 0;
   122801       } else {
   122802          return 0;
   122803       }
   122804    default:
   122805       unreachable("Invalid hardware generation");
   122806    }
   122807 }
   122808 
   122809 
   122810 
   122811 /* GFX_ARB_ERROR_RPT::PASID Boundary Violation */
   122812 
   122813 
   122814 #define GEN9_GFX_ARB_ERROR_RPT_PASIDBoundaryViolation_bits  1
   122815 #define GEN8_GFX_ARB_ERROR_RPT_PASIDBoundaryViolation_bits  1
   122816 
   122817 static inline uint32_t ATTRIBUTE_PURE
   122818 GFX_ARB_ERROR_RPT_PASIDBoundaryViolation_bits(const struct gen_device_info *devinfo)
   122819 {
   122820    switch (devinfo->gen) {
   122821    case 10: return 0;
   122822    case 9: return 1;
   122823    case 8: return 1;
   122824    case 7:
   122825       if (devinfo->is_haswell) {
   122826          return 0;
   122827       } else {
   122828          return 0;
   122829       }
   122830    case 6: return 0;
   122831    case 5: return 0;
   122832    case 4:
   122833       if (devinfo->is_g4x) {
   122834          return 0;
   122835       } else {
   122836          return 0;
   122837       }
   122838    default:
   122839       unreachable("Invalid hardware generation");
   122840    }
   122841 }
   122842 
   122843 
   122844 
   122845 #define GEN9_GFX_ARB_ERROR_RPT_PASIDBoundaryViolation_start  12
   122846 #define GEN8_GFX_ARB_ERROR_RPT_PASIDBoundaryViolation_start  12
   122847 
   122848 static inline uint32_t ATTRIBUTE_PURE
   122849 GFX_ARB_ERROR_RPT_PASIDBoundaryViolation_start(const struct gen_device_info *devinfo)
   122850 {
   122851    switch (devinfo->gen) {
   122852    case 10: return 0;
   122853    case 9: return 12;
   122854    case 8: return 12;
   122855    case 7:
   122856       if (devinfo->is_haswell) {
   122857          return 0;
   122858       } else {
   122859          return 0;
   122860       }
   122861    case 6: return 0;
   122862    case 5: return 0;
   122863    case 4:
   122864       if (devinfo->is_g4x) {
   122865          return 0;
   122866       } else {
   122867          return 0;
   122868       }
   122869    default:
   122870       unreachable("Invalid hardware generation");
   122871    }
   122872 }
   122873 
   122874 
   122875 
   122876 /* GFX_ARB_ERROR_RPT::PASID Not Enabled */
   122877 
   122878 
   122879 #define GEN9_GFX_ARB_ERROR_RPT_PASIDNotEnabled_bits  1
   122880 #define GEN8_GFX_ARB_ERROR_RPT_PASIDNotEnabled_bits  1
   122881 
   122882 static inline uint32_t ATTRIBUTE_PURE
   122883 GFX_ARB_ERROR_RPT_PASIDNotEnabled_bits(const struct gen_device_info *devinfo)
   122884 {
   122885    switch (devinfo->gen) {
   122886    case 10: return 0;
   122887    case 9: return 1;
   122888    case 8: return 1;
   122889    case 7:
   122890       if (devinfo->is_haswell) {
   122891          return 0;
   122892       } else {
   122893          return 0;
   122894       }
   122895    case 6: return 0;
   122896    case 5: return 0;
   122897    case 4:
   122898       if (devinfo->is_g4x) {
   122899          return 0;
   122900       } else {
   122901          return 0;
   122902       }
   122903    default:
   122904       unreachable("Invalid hardware generation");
   122905    }
   122906 }
   122907 
   122908 
   122909 
   122910 #define GEN9_GFX_ARB_ERROR_RPT_PASIDNotEnabled_start  11
   122911 #define GEN8_GFX_ARB_ERROR_RPT_PASIDNotEnabled_start  11
   122912 
   122913 static inline uint32_t ATTRIBUTE_PURE
   122914 GFX_ARB_ERROR_RPT_PASIDNotEnabled_start(const struct gen_device_info *devinfo)
   122915 {
   122916    switch (devinfo->gen) {
   122917    case 10: return 0;
   122918    case 9: return 11;
   122919    case 8: return 11;
   122920    case 7:
   122921       if (devinfo->is_haswell) {
   122922          return 0;
   122923       } else {
   122924          return 0;
   122925       }
   122926    case 6: return 0;
   122927    case 5: return 0;
   122928    case 4:
   122929       if (devinfo->is_g4x) {
   122930          return 0;
   122931       } else {
   122932          return 0;
   122933       }
   122934    default:
   122935       unreachable("Invalid hardware generation");
   122936    }
   122937 }
   122938 
   122939 
   122940 
   122941 /* GFX_ARB_ERROR_RPT::PASID Not Valid */
   122942 
   122943 
   122944 #define GEN9_GFX_ARB_ERROR_RPT_PASIDNotValid_bits  1
   122945 #define GEN8_GFX_ARB_ERROR_RPT_PASIDNotValid_bits  1
   122946 
   122947 static inline uint32_t ATTRIBUTE_PURE
   122948 GFX_ARB_ERROR_RPT_PASIDNotValid_bits(const struct gen_device_info *devinfo)
   122949 {
   122950    switch (devinfo->gen) {
   122951    case 10: return 0;
   122952    case 9: return 1;
   122953    case 8: return 1;
   122954    case 7:
   122955       if (devinfo->is_haswell) {
   122956          return 0;
   122957       } else {
   122958          return 0;
   122959       }
   122960    case 6: return 0;
   122961    case 5: return 0;
   122962    case 4:
   122963       if (devinfo->is_g4x) {
   122964          return 0;
   122965       } else {
   122966          return 0;
   122967       }
   122968    default:
   122969       unreachable("Invalid hardware generation");
   122970    }
   122971 }
   122972 
   122973 
   122974 
   122975 #define GEN9_GFX_ARB_ERROR_RPT_PASIDNotValid_start  13
   122976 #define GEN8_GFX_ARB_ERROR_RPT_PASIDNotValid_start  13
   122977 
   122978 static inline uint32_t ATTRIBUTE_PURE
   122979 GFX_ARB_ERROR_RPT_PASIDNotValid_start(const struct gen_device_info *devinfo)
   122980 {
   122981    switch (devinfo->gen) {
   122982    case 10: return 0;
   122983    case 9: return 13;
   122984    case 8: return 13;
   122985    case 7:
   122986       if (devinfo->is_haswell) {
   122987          return 0;
   122988       } else {
   122989          return 0;
   122990       }
   122991    case 6: return 0;
   122992    case 5: return 0;
   122993    case 4:
   122994       if (devinfo->is_g4x) {
   122995          return 0;
   122996       } else {
   122997          return 0;
   122998       }
   122999    default:
   123000       unreachable("Invalid hardware generation");
   123001    }
   123002 }
   123003 
   123004 
   123005 
   123006 /* GFX_ARB_ERROR_RPT::PASID Was Zero For Untranslated Request */
   123007 
   123008 
   123009 #define GEN9_GFX_ARB_ERROR_RPT_PASIDWasZeroForUntranslatedRequest_bits  1
   123010 #define GEN8_GFX_ARB_ERROR_RPT_PASIDWasZeroForUntranslatedRequest_bits  1
   123011 
   123012 static inline uint32_t ATTRIBUTE_PURE
   123013 GFX_ARB_ERROR_RPT_PASIDWasZeroForUntranslatedRequest_bits(const struct gen_device_info *devinfo)
   123014 {
   123015    switch (devinfo->gen) {
   123016    case 10: return 0;
   123017    case 9: return 1;
   123018    case 8: return 1;
   123019    case 7:
   123020       if (devinfo->is_haswell) {
   123021          return 0;
   123022       } else {
   123023          return 0;
   123024       }
   123025    case 6: return 0;
   123026    case 5: return 0;
   123027    case 4:
   123028       if (devinfo->is_g4x) {
   123029          return 0;
   123030       } else {
   123031          return 0;
   123032       }
   123033    default:
   123034       unreachable("Invalid hardware generation");
   123035    }
   123036 }
   123037 
   123038 
   123039 
   123040 #define GEN9_GFX_ARB_ERROR_RPT_PASIDWasZeroForUntranslatedRequest_start  14
   123041 #define GEN8_GFX_ARB_ERROR_RPT_PASIDWasZeroForUntranslatedRequest_start  14
   123042 
   123043 static inline uint32_t ATTRIBUTE_PURE
   123044 GFX_ARB_ERROR_RPT_PASIDWasZeroForUntranslatedRequest_start(const struct gen_device_info *devinfo)
   123045 {
   123046    switch (devinfo->gen) {
   123047    case 10: return 0;
   123048    case 9: return 14;
   123049    case 8: return 14;
   123050    case 7:
   123051       if (devinfo->is_haswell) {
   123052          return 0;
   123053       } else {
   123054          return 0;
   123055       }
   123056    case 6: return 0;
   123057    case 5: return 0;
   123058    case 4:
   123059       if (devinfo->is_g4x) {
   123060          return 0;
   123061       } else {
   123062          return 0;
   123063       }
   123064    default:
   123065       unreachable("Invalid hardware generation");
   123066    }
   123067 }
   123068 
   123069 
   123070 
   123071 /* GFX_ARB_ERROR_RPT::Page Directory Entry VTD Translation Error */
   123072 
   123073 
   123074 #define GEN9_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_bits  1
   123075 #define GEN8_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_bits  1
   123076 #define GEN75_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_bits  1
   123077 #define GEN7_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_bits  1
   123078 #define GEN6_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_bits  1
   123079 
   123080 static inline uint32_t ATTRIBUTE_PURE
   123081 GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_bits(const struct gen_device_info *devinfo)
   123082 {
   123083    switch (devinfo->gen) {
   123084    case 10: return 0;
   123085    case 9: return 1;
   123086    case 8: return 1;
   123087    case 7:
   123088       if (devinfo->is_haswell) {
   123089          return 1;
   123090       } else {
   123091          return 1;
   123092       }
   123093    case 6: return 1;
   123094    case 5: return 0;
   123095    case 4:
   123096       if (devinfo->is_g4x) {
   123097          return 0;
   123098       } else {
   123099          return 0;
   123100       }
   123101    default:
   123102       unreachable("Invalid hardware generation");
   123103    }
   123104 }
   123105 
   123106 
   123107 
   123108 #define GEN9_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_start  6
   123109 #define GEN8_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_start  6
   123110 #define GEN75_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_start  6
   123111 #define GEN7_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_start  6
   123112 #define GEN6_GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_start  6
   123113 
   123114 static inline uint32_t ATTRIBUTE_PURE
   123115 GFX_ARB_ERROR_RPT_PageDirectoryEntryVTDTranslationError_start(const struct gen_device_info *devinfo)
   123116 {
   123117    switch (devinfo->gen) {
   123118    case 10: return 0;
   123119    case 9: return 6;
   123120    case 8: return 6;
   123121    case 7:
   123122       if (devinfo->is_haswell) {
   123123          return 6;
   123124       } else {
   123125          return 6;
   123126       }
   123127    case 6: return 6;
   123128    case 5: return 0;
   123129    case 4:
   123130       if (devinfo->is_g4x) {
   123131          return 0;
   123132       } else {
   123133          return 0;
   123134       }
   123135    default:
   123136       unreachable("Invalid hardware generation");
   123137    }
   123138 }
   123139 
   123140 
   123141 
   123142 /* GFX_ARB_ERROR_RPT::Pending Page Faults */
   123143 
   123144 
   123145 #define GEN75_GFX_ARB_ERROR_RPT_PendingPageFaults_bits  7
   123146 
   123147 static inline uint32_t ATTRIBUTE_PURE
   123148 GFX_ARB_ERROR_RPT_PendingPageFaults_bits(const struct gen_device_info *devinfo)
   123149 {
   123150    switch (devinfo->gen) {
   123151    case 10: return 0;
   123152    case 9: return 0;
   123153    case 8: return 0;
   123154    case 7:
   123155       if (devinfo->is_haswell) {
   123156          return 7;
   123157       } else {
   123158          return 0;
   123159       }
   123160    case 6: return 0;
   123161    case 5: return 0;
   123162    case 4:
   123163       if (devinfo->is_g4x) {
   123164          return 0;
   123165       } else {
   123166          return 0;
   123167       }
   123168    default:
   123169       unreachable("Invalid hardware generation");
   123170    }
   123171 }
   123172 
   123173 
   123174 
   123175 #define GEN75_GFX_ARB_ERROR_RPT_PendingPageFaults_start  9
   123176 
   123177 static inline uint32_t ATTRIBUTE_PURE
   123178 GFX_ARB_ERROR_RPT_PendingPageFaults_start(const struct gen_device_info *devinfo)
   123179 {
   123180    switch (devinfo->gen) {
   123181    case 10: return 0;
   123182    case 9: return 0;
   123183    case 8: return 0;
   123184    case 7:
   123185       if (devinfo->is_haswell) {
   123186          return 9;
   123187       } else {
   123188          return 0;
   123189       }
   123190    case 6: return 0;
   123191    case 5: return 0;
   123192    case 4:
   123193       if (devinfo->is_g4x) {
   123194          return 0;
   123195       } else {
   123196          return 0;
   123197       }
   123198    default:
   123199       unreachable("Invalid hardware generation");
   123200    }
   123201 }
   123202 
   123203 
   123204 
   123205 /* GFX_ARB_ERROR_RPT::ROSTRM PAVP Invalid Physical Address */
   123206 
   123207 
   123208 #define GEN9_GFX_ARB_ERROR_RPT_ROSTRMPAVPInvalidPhysicalAddress_bits  1
   123209 #define GEN8_GFX_ARB_ERROR_RPT_ROSTRMPAVPInvalidPhysicalAddress_bits  1
   123210 
   123211 static inline uint32_t ATTRIBUTE_PURE
   123212 GFX_ARB_ERROR_RPT_ROSTRMPAVPInvalidPhysicalAddress_bits(const struct gen_device_info *devinfo)
   123213 {
   123214    switch (devinfo->gen) {
   123215    case 10: return 0;
   123216    case 9: return 1;
   123217    case 8: return 1;
   123218    case 7:
   123219       if (devinfo->is_haswell) {
   123220          return 0;
   123221       } else {
   123222          return 0;
   123223       }
   123224    case 6: return 0;
   123225    case 5: return 0;
   123226    case 4:
   123227       if (devinfo->is_g4x) {
   123228          return 0;
   123229       } else {
   123230          return 0;
   123231       }
   123232    default:
   123233       unreachable("Invalid hardware generation");
   123234    }
   123235 }
   123236 
   123237 
   123238 
   123239 #define GEN9_GFX_ARB_ERROR_RPT_ROSTRMPAVPInvalidPhysicalAddress_start  3
   123240 #define GEN8_GFX_ARB_ERROR_RPT_ROSTRMPAVPInvalidPhysicalAddress_start  3
   123241 
   123242 static inline uint32_t ATTRIBUTE_PURE
   123243 GFX_ARB_ERROR_RPT_ROSTRMPAVPInvalidPhysicalAddress_start(const struct gen_device_info *devinfo)
   123244 {
   123245    switch (devinfo->gen) {
   123246    case 10: return 0;
   123247    case 9: return 3;
   123248    case 8: return 3;
   123249    case 7:
   123250       if (devinfo->is_haswell) {
   123251          return 0;
   123252       } else {
   123253          return 0;
   123254       }
   123255    case 6: return 0;
   123256    case 5: return 0;
   123257    case 4:
   123258       if (devinfo->is_g4x) {
   123259          return 0;
   123260       } else {
   123261          return 0;
   123262       }
   123263    default:
   123264       unreachable("Invalid hardware generation");
   123265    }
   123266 }
   123267 
   123268 
   123269 
   123270 /* GFX_ARB_ERROR_RPT::RSTRM PAVP Read Invalid */
   123271 
   123272 
   123273 #define GEN9_GFX_ARB_ERROR_RPT_RSTRMPAVPReadInvalid_bits  1
   123274 #define GEN8_GFX_ARB_ERROR_RPT_RSTRMPAVPReadInvalid_bits  1
   123275 
   123276 static inline uint32_t ATTRIBUTE_PURE
   123277 GFX_ARB_ERROR_RPT_RSTRMPAVPReadInvalid_bits(const struct gen_device_info *devinfo)
   123278 {
   123279    switch (devinfo->gen) {
   123280    case 10: return 0;
   123281    case 9: return 1;
   123282    case 8: return 1;
   123283    case 7:
   123284       if (devinfo->is_haswell) {
   123285          return 0;
   123286       } else {
   123287          return 0;
   123288       }
   123289    case 6: return 0;
   123290    case 5: return 0;
   123291    case 4:
   123292       if (devinfo->is_g4x) {
   123293          return 0;
   123294       } else {
   123295          return 0;
   123296       }
   123297    default:
   123298       unreachable("Invalid hardware generation");
   123299    }
   123300 }
   123301 
   123302 
   123303 
   123304 #define GEN9_GFX_ARB_ERROR_RPT_RSTRMPAVPReadInvalid_start  1
   123305 #define GEN8_GFX_ARB_ERROR_RPT_RSTRMPAVPReadInvalid_start  1
   123306 
   123307 static inline uint32_t ATTRIBUTE_PURE
   123308 GFX_ARB_ERROR_RPT_RSTRMPAVPReadInvalid_start(const struct gen_device_info *devinfo)
   123309 {
   123310    switch (devinfo->gen) {
   123311    case 10: return 0;
   123312    case 9: return 1;
   123313    case 8: return 1;
   123314    case 7:
   123315       if (devinfo->is_haswell) {
   123316          return 0;
   123317       } else {
   123318          return 0;
   123319       }
   123320    case 6: return 0;
   123321    case 5: return 0;
   123322    case 4:
   123323       if (devinfo->is_g4x) {
   123324          return 0;
   123325       } else {
   123326          return 0;
   123327       }
   123328    default:
   123329       unreachable("Invalid hardware generation");
   123330    }
   123331 }
   123332 
   123333 
   123334 
   123335 /* GFX_ARB_ERROR_RPT::TLB Page Fault Error */
   123336 
   123337 
   123338 #define GEN9_GFX_ARB_ERROR_RPT_TLBPageFaultError_bits  1
   123339 #define GEN8_GFX_ARB_ERROR_RPT_TLBPageFaultError_bits  1
   123340 #define GEN75_GFX_ARB_ERROR_RPT_TLBPageFaultError_bits  1
   123341 #define GEN7_GFX_ARB_ERROR_RPT_TLBPageFaultError_bits  1
   123342 #define GEN6_GFX_ARB_ERROR_RPT_TLBPageFaultError_bits  1
   123343 
   123344 static inline uint32_t ATTRIBUTE_PURE
   123345 GFX_ARB_ERROR_RPT_TLBPageFaultError_bits(const struct gen_device_info *devinfo)
   123346 {
   123347    switch (devinfo->gen) {
   123348    case 10: return 0;
   123349    case 9: return 1;
   123350    case 8: return 1;
   123351    case 7:
   123352       if (devinfo->is_haswell) {
   123353          return 1;
   123354       } else {
   123355          return 1;
   123356       }
   123357    case 6: return 1;
   123358    case 5: return 0;
   123359    case 4:
   123360       if (devinfo->is_g4x) {
   123361          return 0;
   123362       } else {
   123363          return 0;
   123364       }
   123365    default:
   123366       unreachable("Invalid hardware generation");
   123367    }
   123368 }
   123369 
   123370 
   123371 
   123372 #define GEN9_GFX_ARB_ERROR_RPT_TLBPageFaultError_start  0
   123373 #define GEN8_GFX_ARB_ERROR_RPT_TLBPageFaultError_start  0
   123374 #define GEN75_GFX_ARB_ERROR_RPT_TLBPageFaultError_start  0
   123375 #define GEN7_GFX_ARB_ERROR_RPT_TLBPageFaultError_start  0
   123376 #define GEN6_GFX_ARB_ERROR_RPT_TLBPageFaultError_start  0
   123377 
   123378 static inline uint32_t ATTRIBUTE_PURE
   123379 GFX_ARB_ERROR_RPT_TLBPageFaultError_start(const struct gen_device_info *devinfo)
   123380 {
   123381    switch (devinfo->gen) {
   123382    case 10: return 0;
   123383    case 9: return 0;
   123384    case 8: return 0;
   123385    case 7:
   123386       if (devinfo->is_haswell) {
   123387          return 0;
   123388       } else {
   123389          return 0;
   123390       }
   123391    case 6: return 0;
   123392    case 5: return 0;
   123393    case 4:
   123394       if (devinfo->is_g4x) {
   123395          return 0;
   123396       } else {
   123397          return 0;
   123398       }
   123399    default:
   123400       unreachable("Invalid hardware generation");
   123401    }
   123402 }
   123403 
   123404 
   123405 
   123406 /* GFX_ARB_ERROR_RPT::TLB Page VTD Translation Error */
   123407 
   123408 
   123409 #define GEN9_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_bits  1
   123410 #define GEN8_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_bits  1
   123411 #define GEN75_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_bits  1
   123412 #define GEN7_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_bits  1
   123413 #define GEN6_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_bits  1
   123414 
   123415 static inline uint32_t ATTRIBUTE_PURE
   123416 GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_bits(const struct gen_device_info *devinfo)
   123417 {
   123418    switch (devinfo->gen) {
   123419    case 10: return 0;
   123420    case 9: return 1;
   123421    case 8: return 1;
   123422    case 7:
   123423       if (devinfo->is_haswell) {
   123424          return 1;
   123425       } else {
   123426          return 1;
   123427       }
   123428    case 6: return 1;
   123429    case 5: return 0;
   123430    case 4:
   123431       if (devinfo->is_g4x) {
   123432          return 0;
   123433       } else {
   123434          return 0;
   123435       }
   123436    default:
   123437       unreachable("Invalid hardware generation");
   123438    }
   123439 }
   123440 
   123441 
   123442 
   123443 #define GEN9_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_start  4
   123444 #define GEN8_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_start  4
   123445 #define GEN75_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_start  4
   123446 #define GEN7_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_start  4
   123447 #define GEN6_GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_start  4
   123448 
   123449 static inline uint32_t ATTRIBUTE_PURE
   123450 GFX_ARB_ERROR_RPT_TLBPageVTDTranslationError_start(const struct gen_device_info *devinfo)
   123451 {
   123452    switch (devinfo->gen) {
   123453    case 10: return 0;
   123454    case 9: return 4;
   123455    case 8: return 4;
   123456    case 7:
   123457       if (devinfo->is_haswell) {
   123458          return 4;
   123459       } else {
   123460          return 4;
   123461       }
   123462    case 6: return 4;
   123463    case 5: return 0;
   123464    case 4:
   123465       if (devinfo->is_g4x) {
   123466          return 0;
   123467       } else {
   123468          return 0;
   123469       }
   123470    default:
   123471       unreachable("Invalid hardware generation");
   123472    }
   123473 }
   123474 
   123475 
   123476 
   123477 /* GFX_ARB_ERROR_RPT::Unloaded PD Error */
   123478 
   123479 
   123480 #define GEN9_GFX_ARB_ERROR_RPT_UnloadedPDError_bits  1
   123481 #define GEN8_GFX_ARB_ERROR_RPT_UnloadedPDError_bits  1
   123482 #define GEN75_GFX_ARB_ERROR_RPT_UnloadedPDError_bits  1
   123483 #define GEN7_GFX_ARB_ERROR_RPT_UnloadedPDError_bits  1
   123484 #define GEN6_GFX_ARB_ERROR_RPT_UnloadedPDError_bits  1
   123485 
   123486 static inline uint32_t ATTRIBUTE_PURE
   123487 GFX_ARB_ERROR_RPT_UnloadedPDError_bits(const struct gen_device_info *devinfo)
   123488 {
   123489    switch (devinfo->gen) {
   123490    case 10: return 0;
   123491    case 9: return 1;
   123492    case 8: return 1;
   123493    case 7:
   123494       if (devinfo->is_haswell) {
   123495          return 1;
   123496       } else {
   123497          return 1;
   123498       }
   123499    case 6: return 1;
   123500    case 5: return 0;
   123501    case 4:
   123502       if (devinfo->is_g4x) {
   123503          return 0;
   123504       } else {
   123505          return 0;
   123506       }
   123507    default:
   123508       unreachable("Invalid hardware generation");
   123509    }
   123510 }
   123511 
   123512 
   123513 
   123514 #define GEN9_GFX_ARB_ERROR_RPT_UnloadedPDError_start  8
   123515 #define GEN8_GFX_ARB_ERROR_RPT_UnloadedPDError_start  8
   123516 #define GEN75_GFX_ARB_ERROR_RPT_UnloadedPDError_start  8
   123517 #define GEN7_GFX_ARB_ERROR_RPT_UnloadedPDError_start  8
   123518 #define GEN6_GFX_ARB_ERROR_RPT_UnloadedPDError_start  8
   123519 
   123520 static inline uint32_t ATTRIBUTE_PURE
   123521 GFX_ARB_ERROR_RPT_UnloadedPDError_start(const struct gen_device_info *devinfo)
   123522 {
   123523    switch (devinfo->gen) {
   123524    case 10: return 0;
   123525    case 9: return 8;
   123526    case 8: return 8;
   123527    case 7:
   123528       if (devinfo->is_haswell) {
   123529          return 8;
   123530       } else {
   123531          return 8;
   123532       }
   123533    case 6: return 8;
   123534    case 5: return 0;
   123535    case 4:
   123536       if (devinfo->is_g4x) {
   123537          return 0;
   123538       } else {
   123539          return 0;
   123540       }
   123541    default:
   123542       unreachable("Invalid hardware generation");
   123543    }
   123544 }
   123545 
   123546 
   123547 
   123548 /* GFX_ARB_ERROR_RPT::WRDP PAVP Invalid */
   123549 
   123550 
   123551 #define GEN9_GFX_ARB_ERROR_RPT_WRDPPAVPInvalid_bits  1
   123552 #define GEN8_GFX_ARB_ERROR_RPT_WRDPPAVPInvalid_bits  1
   123553 
   123554 static inline uint32_t ATTRIBUTE_PURE
   123555 GFX_ARB_ERROR_RPT_WRDPPAVPInvalid_bits(const struct gen_device_info *devinfo)
   123556 {
   123557    switch (devinfo->gen) {
   123558    case 10: return 0;
   123559    case 9: return 1;
   123560    case 8: return 1;
   123561    case 7:
   123562       if (devinfo->is_haswell) {
   123563          return 0;
   123564       } else {
   123565          return 0;
   123566       }
   123567    case 6: return 0;
   123568    case 5: return 0;
   123569    case 4:
   123570       if (devinfo->is_g4x) {
   123571          return 0;
   123572       } else {
   123573          return 0;
   123574       }
   123575    default:
   123576       unreachable("Invalid hardware generation");
   123577    }
   123578 }
   123579 
   123580 
   123581 
   123582 #define GEN9_GFX_ARB_ERROR_RPT_WRDPPAVPInvalid_start  5
   123583 #define GEN8_GFX_ARB_ERROR_RPT_WRDPPAVPInvalid_start  5
   123584 
   123585 static inline uint32_t ATTRIBUTE_PURE
   123586 GFX_ARB_ERROR_RPT_WRDPPAVPInvalid_start(const struct gen_device_info *devinfo)
   123587 {
   123588    switch (devinfo->gen) {
   123589    case 10: return 0;
   123590    case 9: return 5;
   123591    case 8: return 5;
   123592    case 7:
   123593       if (devinfo->is_haswell) {
   123594          return 0;
   123595       } else {
   123596          return 0;
   123597       }
   123598    case 6: return 0;
   123599    case 5: return 0;
   123600    case 4:
   123601       if (devinfo->is_g4x) {
   123602          return 0;
   123603       } else {
   123604          return 0;
   123605       }
   123606    default:
   123607       unreachable("Invalid hardware generation");
   123608    }
   123609 }
   123610 
   123611 
   123612 
   123613 /* GPGPU_CSR_BASE_ADDRESS */
   123614 
   123615 
   123616 #define GEN9_GPGPU_CSR_BASE_ADDRESS_length  3
   123617 #define GEN8_GPGPU_CSR_BASE_ADDRESS_length  3
   123618 #define GEN75_GPGPU_CSR_BASE_ADDRESS_length  2
   123619 
   123620 static inline uint32_t ATTRIBUTE_PURE
   123621 GPGPU_CSR_BASE_ADDRESS_length(const struct gen_device_info *devinfo)
   123622 {
   123623    switch (devinfo->gen) {
   123624    case 10: return 0;
   123625    case 9: return 3;
   123626    case 8: return 3;
   123627    case 7:
   123628       if (devinfo->is_haswell) {
   123629          return 2;
   123630       } else {
   123631          return 0;
   123632       }
   123633    case 6: return 0;
   123634    case 5: return 0;
   123635    case 4:
   123636       if (devinfo->is_g4x) {
   123637          return 0;
   123638       } else {
   123639          return 0;
   123640       }
   123641    default:
   123642       unreachable("Invalid hardware generation");
   123643    }
   123644 }
   123645 
   123646 
   123647 
   123648 /* GPGPU_CSR_BASE_ADDRESS::3D Command Opcode */
   123649 
   123650 
   123651 #define GEN9_GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_bits  3
   123652 #define GEN8_GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_bits  3
   123653 #define GEN75_GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_bits  3
   123654 
   123655 static inline uint32_t ATTRIBUTE_PURE
   123656 GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   123657 {
   123658    switch (devinfo->gen) {
   123659    case 10: return 0;
   123660    case 9: return 3;
   123661    case 8: return 3;
   123662    case 7:
   123663       if (devinfo->is_haswell) {
   123664          return 3;
   123665       } else {
   123666          return 0;
   123667       }
   123668    case 6: return 0;
   123669    case 5: return 0;
   123670    case 4:
   123671       if (devinfo->is_g4x) {
   123672          return 0;
   123673       } else {
   123674          return 0;
   123675       }
   123676    default:
   123677       unreachable("Invalid hardware generation");
   123678    }
   123679 }
   123680 
   123681 
   123682 
   123683 #define GEN9_GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_start  24
   123684 #define GEN8_GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_start  24
   123685 #define GEN75_GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_start  24
   123686 
   123687 static inline uint32_t ATTRIBUTE_PURE
   123688 GPGPU_CSR_BASE_ADDRESS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   123689 {
   123690    switch (devinfo->gen) {
   123691    case 10: return 0;
   123692    case 9: return 24;
   123693    case 8: return 24;
   123694    case 7:
   123695       if (devinfo->is_haswell) {
   123696          return 24;
   123697       } else {
   123698          return 0;
   123699       }
   123700    case 6: return 0;
   123701    case 5: return 0;
   123702    case 4:
   123703       if (devinfo->is_g4x) {
   123704          return 0;
   123705       } else {
   123706          return 0;
   123707       }
   123708    default:
   123709       unreachable("Invalid hardware generation");
   123710    }
   123711 }
   123712 
   123713 
   123714 
   123715 /* GPGPU_CSR_BASE_ADDRESS::3D Command Sub Opcode */
   123716 
   123717 
   123718 #define GEN9_GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   123719 #define GEN8_GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   123720 #define GEN75_GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   123721 
   123722 static inline uint32_t ATTRIBUTE_PURE
   123723 GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   123724 {
   123725    switch (devinfo->gen) {
   123726    case 10: return 0;
   123727    case 9: return 8;
   123728    case 8: return 8;
   123729    case 7:
   123730       if (devinfo->is_haswell) {
   123731          return 8;
   123732       } else {
   123733          return 0;
   123734       }
   123735    case 6: return 0;
   123736    case 5: return 0;
   123737    case 4:
   123738       if (devinfo->is_g4x) {
   123739          return 0;
   123740       } else {
   123741          return 0;
   123742       }
   123743    default:
   123744       unreachable("Invalid hardware generation");
   123745    }
   123746 }
   123747 
   123748 
   123749 
   123750 #define GEN9_GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_start  16
   123751 #define GEN8_GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_start  16
   123752 #define GEN75_GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_start  16
   123753 
   123754 static inline uint32_t ATTRIBUTE_PURE
   123755 GPGPU_CSR_BASE_ADDRESS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   123756 {
   123757    switch (devinfo->gen) {
   123758    case 10: return 0;
   123759    case 9: return 16;
   123760    case 8: return 16;
   123761    case 7:
   123762       if (devinfo->is_haswell) {
   123763          return 16;
   123764       } else {
   123765          return 0;
   123766       }
   123767    case 6: return 0;
   123768    case 5: return 0;
   123769    case 4:
   123770       if (devinfo->is_g4x) {
   123771          return 0;
   123772       } else {
   123773          return 0;
   123774       }
   123775    default:
   123776       unreachable("Invalid hardware generation");
   123777    }
   123778 }
   123779 
   123780 
   123781 
   123782 /* GPGPU_CSR_BASE_ADDRESS::Command SubType */
   123783 
   123784 
   123785 #define GEN9_GPGPU_CSR_BASE_ADDRESS_CommandSubType_bits  2
   123786 #define GEN8_GPGPU_CSR_BASE_ADDRESS_CommandSubType_bits  2
   123787 #define GEN75_GPGPU_CSR_BASE_ADDRESS_CommandSubType_bits  2
   123788 
   123789 static inline uint32_t ATTRIBUTE_PURE
   123790 GPGPU_CSR_BASE_ADDRESS_CommandSubType_bits(const struct gen_device_info *devinfo)
   123791 {
   123792    switch (devinfo->gen) {
   123793    case 10: return 0;
   123794    case 9: return 2;
   123795    case 8: return 2;
   123796    case 7:
   123797       if (devinfo->is_haswell) {
   123798          return 2;
   123799       } else {
   123800          return 0;
   123801       }
   123802    case 6: return 0;
   123803    case 5: return 0;
   123804    case 4:
   123805       if (devinfo->is_g4x) {
   123806          return 0;
   123807       } else {
   123808          return 0;
   123809       }
   123810    default:
   123811       unreachable("Invalid hardware generation");
   123812    }
   123813 }
   123814 
   123815 
   123816 
   123817 #define GEN9_GPGPU_CSR_BASE_ADDRESS_CommandSubType_start  27
   123818 #define GEN8_GPGPU_CSR_BASE_ADDRESS_CommandSubType_start  27
   123819 #define GEN75_GPGPU_CSR_BASE_ADDRESS_CommandSubType_start  27
   123820 
   123821 static inline uint32_t ATTRIBUTE_PURE
   123822 GPGPU_CSR_BASE_ADDRESS_CommandSubType_start(const struct gen_device_info *devinfo)
   123823 {
   123824    switch (devinfo->gen) {
   123825    case 10: return 0;
   123826    case 9: return 27;
   123827    case 8: return 27;
   123828    case 7:
   123829       if (devinfo->is_haswell) {
   123830          return 27;
   123831       } else {
   123832          return 0;
   123833       }
   123834    case 6: return 0;
   123835    case 5: return 0;
   123836    case 4:
   123837       if (devinfo->is_g4x) {
   123838          return 0;
   123839       } else {
   123840          return 0;
   123841       }
   123842    default:
   123843       unreachable("Invalid hardware generation");
   123844    }
   123845 }
   123846 
   123847 
   123848 
   123849 /* GPGPU_CSR_BASE_ADDRESS::Command Type */
   123850 
   123851 
   123852 #define GEN9_GPGPU_CSR_BASE_ADDRESS_CommandType_bits  3
   123853 #define GEN8_GPGPU_CSR_BASE_ADDRESS_CommandType_bits  3
   123854 #define GEN75_GPGPU_CSR_BASE_ADDRESS_CommandType_bits  3
   123855 
   123856 static inline uint32_t ATTRIBUTE_PURE
   123857 GPGPU_CSR_BASE_ADDRESS_CommandType_bits(const struct gen_device_info *devinfo)
   123858 {
   123859    switch (devinfo->gen) {
   123860    case 10: return 0;
   123861    case 9: return 3;
   123862    case 8: return 3;
   123863    case 7:
   123864       if (devinfo->is_haswell) {
   123865          return 3;
   123866       } else {
   123867          return 0;
   123868       }
   123869    case 6: return 0;
   123870    case 5: return 0;
   123871    case 4:
   123872       if (devinfo->is_g4x) {
   123873          return 0;
   123874       } else {
   123875          return 0;
   123876       }
   123877    default:
   123878       unreachable("Invalid hardware generation");
   123879    }
   123880 }
   123881 
   123882 
   123883 
   123884 #define GEN9_GPGPU_CSR_BASE_ADDRESS_CommandType_start  29
   123885 #define GEN8_GPGPU_CSR_BASE_ADDRESS_CommandType_start  29
   123886 #define GEN75_GPGPU_CSR_BASE_ADDRESS_CommandType_start  29
   123887 
   123888 static inline uint32_t ATTRIBUTE_PURE
   123889 GPGPU_CSR_BASE_ADDRESS_CommandType_start(const struct gen_device_info *devinfo)
   123890 {
   123891    switch (devinfo->gen) {
   123892    case 10: return 0;
   123893    case 9: return 29;
   123894    case 8: return 29;
   123895    case 7:
   123896       if (devinfo->is_haswell) {
   123897          return 29;
   123898       } else {
   123899          return 0;
   123900       }
   123901    case 6: return 0;
   123902    case 5: return 0;
   123903    case 4:
   123904       if (devinfo->is_g4x) {
   123905          return 0;
   123906       } else {
   123907          return 0;
   123908       }
   123909    default:
   123910       unreachable("Invalid hardware generation");
   123911    }
   123912 }
   123913 
   123914 
   123915 
   123916 /* GPGPU_CSR_BASE_ADDRESS::DWord Length */
   123917 
   123918 
   123919 #define GEN9_GPGPU_CSR_BASE_ADDRESS_DWordLength_bits  8
   123920 #define GEN8_GPGPU_CSR_BASE_ADDRESS_DWordLength_bits  8
   123921 #define GEN75_GPGPU_CSR_BASE_ADDRESS_DWordLength_bits  8
   123922 
   123923 static inline uint32_t ATTRIBUTE_PURE
   123924 GPGPU_CSR_BASE_ADDRESS_DWordLength_bits(const struct gen_device_info *devinfo)
   123925 {
   123926    switch (devinfo->gen) {
   123927    case 10: return 0;
   123928    case 9: return 8;
   123929    case 8: return 8;
   123930    case 7:
   123931       if (devinfo->is_haswell) {
   123932          return 8;
   123933       } else {
   123934          return 0;
   123935       }
   123936    case 6: return 0;
   123937    case 5: return 0;
   123938    case 4:
   123939       if (devinfo->is_g4x) {
   123940          return 0;
   123941       } else {
   123942          return 0;
   123943       }
   123944    default:
   123945       unreachable("Invalid hardware generation");
   123946    }
   123947 }
   123948 
   123949 
   123950 
   123951 #define GEN9_GPGPU_CSR_BASE_ADDRESS_DWordLength_start  0
   123952 #define GEN8_GPGPU_CSR_BASE_ADDRESS_DWordLength_start  0
   123953 #define GEN75_GPGPU_CSR_BASE_ADDRESS_DWordLength_start  0
   123954 
   123955 static inline uint32_t ATTRIBUTE_PURE
   123956 GPGPU_CSR_BASE_ADDRESS_DWordLength_start(const struct gen_device_info *devinfo)
   123957 {
   123958    switch (devinfo->gen) {
   123959    case 10: return 0;
   123960    case 9: return 0;
   123961    case 8: return 0;
   123962    case 7:
   123963       if (devinfo->is_haswell) {
   123964          return 0;
   123965       } else {
   123966          return 0;
   123967       }
   123968    case 6: return 0;
   123969    case 5: return 0;
   123970    case 4:
   123971       if (devinfo->is_g4x) {
   123972          return 0;
   123973       } else {
   123974          return 0;
   123975       }
   123976    default:
   123977       unreachable("Invalid hardware generation");
   123978    }
   123979 }
   123980 
   123981 
   123982 
   123983 /* GPGPU_CSR_BASE_ADDRESS::GPGPU CSR Base Address */
   123984 
   123985 
   123986 #define GEN9_GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_bits  52
   123987 #define GEN8_GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_bits  52
   123988 #define GEN75_GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_bits  20
   123989 
   123990 static inline uint32_t ATTRIBUTE_PURE
   123991 GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_bits(const struct gen_device_info *devinfo)
   123992 {
   123993    switch (devinfo->gen) {
   123994    case 10: return 0;
   123995    case 9: return 52;
   123996    case 8: return 52;
   123997    case 7:
   123998       if (devinfo->is_haswell) {
   123999          return 20;
   124000       } else {
   124001          return 0;
   124002       }
   124003    case 6: return 0;
   124004    case 5: return 0;
   124005    case 4:
   124006       if (devinfo->is_g4x) {
   124007          return 0;
   124008       } else {
   124009          return 0;
   124010       }
   124011    default:
   124012       unreachable("Invalid hardware generation");
   124013    }
   124014 }
   124015 
   124016 
   124017 
   124018 #define GEN9_GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_start  44
   124019 #define GEN8_GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_start  44
   124020 #define GEN75_GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_start  44
   124021 
   124022 static inline uint32_t ATTRIBUTE_PURE
   124023 GPGPU_CSR_BASE_ADDRESS_GPGPUCSRBaseAddress_start(const struct gen_device_info *devinfo)
   124024 {
   124025    switch (devinfo->gen) {
   124026    case 10: return 0;
   124027    case 9: return 44;
   124028    case 8: return 44;
   124029    case 7:
   124030       if (devinfo->is_haswell) {
   124031          return 44;
   124032       } else {
   124033          return 0;
   124034       }
   124035    case 6: return 0;
   124036    case 5: return 0;
   124037    case 4:
   124038       if (devinfo->is_g4x) {
   124039          return 0;
   124040       } else {
   124041          return 0;
   124042       }
   124043    default:
   124044       unreachable("Invalid hardware generation");
   124045    }
   124046 }
   124047 
   124048 
   124049 
   124050 /* GPGPU_OBJECT */
   124051 
   124052 
   124053 #define GEN75_GPGPU_OBJECT_length  8
   124054 #define GEN7_GPGPU_OBJECT_length  8
   124055 
   124056 static inline uint32_t ATTRIBUTE_PURE
   124057 GPGPU_OBJECT_length(const struct gen_device_info *devinfo)
   124058 {
   124059    switch (devinfo->gen) {
   124060    case 10: return 0;
   124061    case 9: return 0;
   124062    case 8: return 0;
   124063    case 7:
   124064       if (devinfo->is_haswell) {
   124065          return 8;
   124066       } else {
   124067          return 8;
   124068       }
   124069    case 6: return 0;
   124070    case 5: return 0;
   124071    case 4:
   124072       if (devinfo->is_g4x) {
   124073          return 0;
   124074       } else {
   124075          return 0;
   124076       }
   124077    default:
   124078       unreachable("Invalid hardware generation");
   124079    }
   124080 }
   124081 
   124082 
   124083 
   124084 /* GPGPU_OBJECT::Command Type */
   124085 
   124086 
   124087 #define GEN75_GPGPU_OBJECT_CommandType_bits  3
   124088 #define GEN7_GPGPU_OBJECT_CommandType_bits  3
   124089 
   124090 static inline uint32_t ATTRIBUTE_PURE
   124091 GPGPU_OBJECT_CommandType_bits(const struct gen_device_info *devinfo)
   124092 {
   124093    switch (devinfo->gen) {
   124094    case 10: return 0;
   124095    case 9: return 0;
   124096    case 8: return 0;
   124097    case 7:
   124098       if (devinfo->is_haswell) {
   124099          return 3;
   124100       } else {
   124101          return 3;
   124102       }
   124103    case 6: return 0;
   124104    case 5: return 0;
   124105    case 4:
   124106       if (devinfo->is_g4x) {
   124107          return 0;
   124108       } else {
   124109          return 0;
   124110       }
   124111    default:
   124112       unreachable("Invalid hardware generation");
   124113    }
   124114 }
   124115 
   124116 
   124117 
   124118 #define GEN75_GPGPU_OBJECT_CommandType_start  29
   124119 #define GEN7_GPGPU_OBJECT_CommandType_start  29
   124120 
   124121 static inline uint32_t ATTRIBUTE_PURE
   124122 GPGPU_OBJECT_CommandType_start(const struct gen_device_info *devinfo)
   124123 {
   124124    switch (devinfo->gen) {
   124125    case 10: return 0;
   124126    case 9: return 0;
   124127    case 8: return 0;
   124128    case 7:
   124129       if (devinfo->is_haswell) {
   124130          return 29;
   124131       } else {
   124132          return 29;
   124133       }
   124134    case 6: return 0;
   124135    case 5: return 0;
   124136    case 4:
   124137       if (devinfo->is_g4x) {
   124138          return 0;
   124139       } else {
   124140          return 0;
   124141       }
   124142    default:
   124143       unreachable("Invalid hardware generation");
   124144    }
   124145 }
   124146 
   124147 
   124148 
   124149 /* GPGPU_OBJECT::DWord Length */
   124150 
   124151 
   124152 #define GEN75_GPGPU_OBJECT_DWordLength_bits  8
   124153 #define GEN7_GPGPU_OBJECT_DWordLength_bits  8
   124154 
   124155 static inline uint32_t ATTRIBUTE_PURE
   124156 GPGPU_OBJECT_DWordLength_bits(const struct gen_device_info *devinfo)
   124157 {
   124158    switch (devinfo->gen) {
   124159    case 10: return 0;
   124160    case 9: return 0;
   124161    case 8: return 0;
   124162    case 7:
   124163       if (devinfo->is_haswell) {
   124164          return 8;
   124165       } else {
   124166          return 8;
   124167       }
   124168    case 6: return 0;
   124169    case 5: return 0;
   124170    case 4:
   124171       if (devinfo->is_g4x) {
   124172          return 0;
   124173       } else {
   124174          return 0;
   124175       }
   124176    default:
   124177       unreachable("Invalid hardware generation");
   124178    }
   124179 }
   124180 
   124181 
   124182 
   124183 #define GEN75_GPGPU_OBJECT_DWordLength_start  0
   124184 #define GEN7_GPGPU_OBJECT_DWordLength_start  0
   124185 
   124186 static inline uint32_t ATTRIBUTE_PURE
   124187 GPGPU_OBJECT_DWordLength_start(const struct gen_device_info *devinfo)
   124188 {
   124189    switch (devinfo->gen) {
   124190    case 10: return 0;
   124191    case 9: return 0;
   124192    case 8: return 0;
   124193    case 7:
   124194       if (devinfo->is_haswell) {
   124195          return 0;
   124196       } else {
   124197          return 0;
   124198       }
   124199    case 6: return 0;
   124200    case 5: return 0;
   124201    case 4:
   124202       if (devinfo->is_g4x) {
   124203          return 0;
   124204       } else {
   124205          return 0;
   124206       }
   124207    default:
   124208       unreachable("Invalid hardware generation");
   124209    }
   124210 }
   124211 
   124212 
   124213 
   124214 /* GPGPU_OBJECT::End of Thread Group */
   124215 
   124216 
   124217 #define GEN75_GPGPU_OBJECT_EndofThreadGroup_bits  1
   124218 #define GEN7_GPGPU_OBJECT_EndofThreadGroup_bits  1
   124219 
   124220 static inline uint32_t ATTRIBUTE_PURE
   124221 GPGPU_OBJECT_EndofThreadGroup_bits(const struct gen_device_info *devinfo)
   124222 {
   124223    switch (devinfo->gen) {
   124224    case 10: return 0;
   124225    case 9: return 0;
   124226    case 8: return 0;
   124227    case 7:
   124228       if (devinfo->is_haswell) {
   124229          return 1;
   124230       } else {
   124231          return 1;
   124232       }
   124233    case 6: return 0;
   124234    case 5: return 0;
   124235    case 4:
   124236       if (devinfo->is_g4x) {
   124237          return 0;
   124238       } else {
   124239          return 0;
   124240       }
   124241    default:
   124242       unreachable("Invalid hardware generation");
   124243    }
   124244 }
   124245 
   124246 
   124247 
   124248 #define GEN75_GPGPU_OBJECT_EndofThreadGroup_start  88
   124249 #define GEN7_GPGPU_OBJECT_EndofThreadGroup_start  88
   124250 
   124251 static inline uint32_t ATTRIBUTE_PURE
   124252 GPGPU_OBJECT_EndofThreadGroup_start(const struct gen_device_info *devinfo)
   124253 {
   124254    switch (devinfo->gen) {
   124255    case 10: return 0;
   124256    case 9: return 0;
   124257    case 8: return 0;
   124258    case 7:
   124259       if (devinfo->is_haswell) {
   124260          return 88;
   124261       } else {
   124262          return 88;
   124263       }
   124264    case 6: return 0;
   124265    case 5: return 0;
   124266    case 4:
   124267       if (devinfo->is_g4x) {
   124268          return 0;
   124269       } else {
   124270          return 0;
   124271       }
   124272    default:
   124273       unreachable("Invalid hardware generation");
   124274    }
   124275 }
   124276 
   124277 
   124278 
   124279 /* GPGPU_OBJECT::Execution Mask */
   124280 
   124281 
   124282 #define GEN75_GPGPU_OBJECT_ExecutionMask_bits  32
   124283 #define GEN7_GPGPU_OBJECT_ExecutionMask_bits  32
   124284 
   124285 static inline uint32_t ATTRIBUTE_PURE
   124286 GPGPU_OBJECT_ExecutionMask_bits(const struct gen_device_info *devinfo)
   124287 {
   124288    switch (devinfo->gen) {
   124289    case 10: return 0;
   124290    case 9: return 0;
   124291    case 8: return 0;
   124292    case 7:
   124293       if (devinfo->is_haswell) {
   124294          return 32;
   124295       } else {
   124296          return 32;
   124297       }
   124298    case 6: return 0;
   124299    case 5: return 0;
   124300    case 4:
   124301       if (devinfo->is_g4x) {
   124302          return 0;
   124303       } else {
   124304          return 0;
   124305       }
   124306    default:
   124307       unreachable("Invalid hardware generation");
   124308    }
   124309 }
   124310 
   124311 
   124312 
   124313 #define GEN75_GPGPU_OBJECT_ExecutionMask_start  224
   124314 #define GEN7_GPGPU_OBJECT_ExecutionMask_start  224
   124315 
   124316 static inline uint32_t ATTRIBUTE_PURE
   124317 GPGPU_OBJECT_ExecutionMask_start(const struct gen_device_info *devinfo)
   124318 {
   124319    switch (devinfo->gen) {
   124320    case 10: return 0;
   124321    case 9: return 0;
   124322    case 8: return 0;
   124323    case 7:
   124324       if (devinfo->is_haswell) {
   124325          return 224;
   124326       } else {
   124327          return 224;
   124328       }
   124329    case 6: return 0;
   124330    case 5: return 0;
   124331    case 4:
   124332       if (devinfo->is_g4x) {
   124333          return 0;
   124334       } else {
   124335          return 0;
   124336       }
   124337    default:
   124338       unreachable("Invalid hardware generation");
   124339    }
   124340 }
   124341 
   124342 
   124343 
   124344 /* GPGPU_OBJECT::Half-Slice Destination Select */
   124345 
   124346 
   124347 #define GEN75_GPGPU_OBJECT_HalfSliceDestinationSelect_bits  2
   124348 #define GEN7_GPGPU_OBJECT_HalfSliceDestinationSelect_bits  2
   124349 
   124350 static inline uint32_t ATTRIBUTE_PURE
   124351 GPGPU_OBJECT_HalfSliceDestinationSelect_bits(const struct gen_device_info *devinfo)
   124352 {
   124353    switch (devinfo->gen) {
   124354    case 10: return 0;
   124355    case 9: return 0;
   124356    case 8: return 0;
   124357    case 7:
   124358       if (devinfo->is_haswell) {
   124359          return 2;
   124360       } else {
   124361          return 2;
   124362       }
   124363    case 6: return 0;
   124364    case 5: return 0;
   124365    case 4:
   124366       if (devinfo->is_g4x) {
   124367          return 0;
   124368       } else {
   124369          return 0;
   124370       }
   124371    default:
   124372       unreachable("Invalid hardware generation");
   124373    }
   124374 }
   124375 
   124376 
   124377 
   124378 #define GEN75_GPGPU_OBJECT_HalfSliceDestinationSelect_start  81
   124379 #define GEN7_GPGPU_OBJECT_HalfSliceDestinationSelect_start  81
   124380 
   124381 static inline uint32_t ATTRIBUTE_PURE
   124382 GPGPU_OBJECT_HalfSliceDestinationSelect_start(const struct gen_device_info *devinfo)
   124383 {
   124384    switch (devinfo->gen) {
   124385    case 10: return 0;
   124386    case 9: return 0;
   124387    case 8: return 0;
   124388    case 7:
   124389       if (devinfo->is_haswell) {
   124390          return 81;
   124391       } else {
   124392          return 81;
   124393       }
   124394    case 6: return 0;
   124395    case 5: return 0;
   124396    case 4:
   124397       if (devinfo->is_g4x) {
   124398          return 0;
   124399       } else {
   124400          return 0;
   124401       }
   124402    default:
   124403       unreachable("Invalid hardware generation");
   124404    }
   124405 }
   124406 
   124407 
   124408 
   124409 /* GPGPU_OBJECT::Indirect Data Length */
   124410 
   124411 
   124412 #define GEN75_GPGPU_OBJECT_IndirectDataLength_bits  17
   124413 #define GEN7_GPGPU_OBJECT_IndirectDataLength_bits  17
   124414 
   124415 static inline uint32_t ATTRIBUTE_PURE
   124416 GPGPU_OBJECT_IndirectDataLength_bits(const struct gen_device_info *devinfo)
   124417 {
   124418    switch (devinfo->gen) {
   124419    case 10: return 0;
   124420    case 9: return 0;
   124421    case 8: return 0;
   124422    case 7:
   124423       if (devinfo->is_haswell) {
   124424          return 17;
   124425       } else {
   124426          return 17;
   124427       }
   124428    case 6: return 0;
   124429    case 5: return 0;
   124430    case 4:
   124431       if (devinfo->is_g4x) {
   124432          return 0;
   124433       } else {
   124434          return 0;
   124435       }
   124436    default:
   124437       unreachable("Invalid hardware generation");
   124438    }
   124439 }
   124440 
   124441 
   124442 
   124443 #define GEN75_GPGPU_OBJECT_IndirectDataLength_start  64
   124444 #define GEN7_GPGPU_OBJECT_IndirectDataLength_start  64
   124445 
   124446 static inline uint32_t ATTRIBUTE_PURE
   124447 GPGPU_OBJECT_IndirectDataLength_start(const struct gen_device_info *devinfo)
   124448 {
   124449    switch (devinfo->gen) {
   124450    case 10: return 0;
   124451    case 9: return 0;
   124452    case 8: return 0;
   124453    case 7:
   124454       if (devinfo->is_haswell) {
   124455          return 64;
   124456       } else {
   124457          return 64;
   124458       }
   124459    case 6: return 0;
   124460    case 5: return 0;
   124461    case 4:
   124462       if (devinfo->is_g4x) {
   124463          return 0;
   124464       } else {
   124465          return 0;
   124466       }
   124467    default:
   124468       unreachable("Invalid hardware generation");
   124469    }
   124470 }
   124471 
   124472 
   124473 
   124474 /* GPGPU_OBJECT::Indirect Data Start Address */
   124475 
   124476 
   124477 #define GEN75_GPGPU_OBJECT_IndirectDataStartAddress_bits  32
   124478 #define GEN7_GPGPU_OBJECT_IndirectDataStartAddress_bits  32
   124479 
   124480 static inline uint32_t ATTRIBUTE_PURE
   124481 GPGPU_OBJECT_IndirectDataStartAddress_bits(const struct gen_device_info *devinfo)
   124482 {
   124483    switch (devinfo->gen) {
   124484    case 10: return 0;
   124485    case 9: return 0;
   124486    case 8: return 0;
   124487    case 7:
   124488       if (devinfo->is_haswell) {
   124489          return 32;
   124490       } else {
   124491          return 32;
   124492       }
   124493    case 6: return 0;
   124494    case 5: return 0;
   124495    case 4:
   124496       if (devinfo->is_g4x) {
   124497          return 0;
   124498       } else {
   124499          return 0;
   124500       }
   124501    default:
   124502       unreachable("Invalid hardware generation");
   124503    }
   124504 }
   124505 
   124506 
   124507 
   124508 #define GEN75_GPGPU_OBJECT_IndirectDataStartAddress_start  96
   124509 #define GEN7_GPGPU_OBJECT_IndirectDataStartAddress_start  96
   124510 
   124511 static inline uint32_t ATTRIBUTE_PURE
   124512 GPGPU_OBJECT_IndirectDataStartAddress_start(const struct gen_device_info *devinfo)
   124513 {
   124514    switch (devinfo->gen) {
   124515    case 10: return 0;
   124516    case 9: return 0;
   124517    case 8: return 0;
   124518    case 7:
   124519       if (devinfo->is_haswell) {
   124520          return 96;
   124521       } else {
   124522          return 96;
   124523       }
   124524    case 6: return 0;
   124525    case 5: return 0;
   124526    case 4:
   124527       if (devinfo->is_g4x) {
   124528          return 0;
   124529       } else {
   124530          return 0;
   124531       }
   124532    default:
   124533       unreachable("Invalid hardware generation");
   124534    }
   124535 }
   124536 
   124537 
   124538 
   124539 /* GPGPU_OBJECT::Interface Descriptor Offset */
   124540 
   124541 
   124542 #define GEN75_GPGPU_OBJECT_InterfaceDescriptorOffset_bits  6
   124543 #define GEN7_GPGPU_OBJECT_InterfaceDescriptorOffset_bits  5
   124544 
   124545 static inline uint32_t ATTRIBUTE_PURE
   124546 GPGPU_OBJECT_InterfaceDescriptorOffset_bits(const struct gen_device_info *devinfo)
   124547 {
   124548    switch (devinfo->gen) {
   124549    case 10: return 0;
   124550    case 9: return 0;
   124551    case 8: return 0;
   124552    case 7:
   124553       if (devinfo->is_haswell) {
   124554          return 6;
   124555       } else {
   124556          return 5;
   124557       }
   124558    case 6: return 0;
   124559    case 5: return 0;
   124560    case 4:
   124561       if (devinfo->is_g4x) {
   124562          return 0;
   124563       } else {
   124564          return 0;
   124565       }
   124566    default:
   124567       unreachable("Invalid hardware generation");
   124568    }
   124569 }
   124570 
   124571 
   124572 
   124573 #define GEN75_GPGPU_OBJECT_InterfaceDescriptorOffset_start  32
   124574 #define GEN7_GPGPU_OBJECT_InterfaceDescriptorOffset_start  32
   124575 
   124576 static inline uint32_t ATTRIBUTE_PURE
   124577 GPGPU_OBJECT_InterfaceDescriptorOffset_start(const struct gen_device_info *devinfo)
   124578 {
   124579    switch (devinfo->gen) {
   124580    case 10: return 0;
   124581    case 9: return 0;
   124582    case 8: return 0;
   124583    case 7:
   124584       if (devinfo->is_haswell) {
   124585          return 32;
   124586       } else {
   124587          return 32;
   124588       }
   124589    case 6: return 0;
   124590    case 5: return 0;
   124591    case 4:
   124592       if (devinfo->is_g4x) {
   124593          return 0;
   124594       } else {
   124595          return 0;
   124596       }
   124597    default:
   124598       unreachable("Invalid hardware generation");
   124599    }
   124600 }
   124601 
   124602 
   124603 
   124604 /* GPGPU_OBJECT::Media Command Opcode */
   124605 
   124606 
   124607 #define GEN75_GPGPU_OBJECT_MediaCommandOpcode_bits  3
   124608 #define GEN7_GPGPU_OBJECT_MediaCommandOpcode_bits  3
   124609 
   124610 static inline uint32_t ATTRIBUTE_PURE
   124611 GPGPU_OBJECT_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   124612 {
   124613    switch (devinfo->gen) {
   124614    case 10: return 0;
   124615    case 9: return 0;
   124616    case 8: return 0;
   124617    case 7:
   124618       if (devinfo->is_haswell) {
   124619          return 3;
   124620       } else {
   124621          return 3;
   124622       }
   124623    case 6: return 0;
   124624    case 5: return 0;
   124625    case 4:
   124626       if (devinfo->is_g4x) {
   124627          return 0;
   124628       } else {
   124629          return 0;
   124630       }
   124631    default:
   124632       unreachable("Invalid hardware generation");
   124633    }
   124634 }
   124635 
   124636 
   124637 
   124638 #define GEN75_GPGPU_OBJECT_MediaCommandOpcode_start  24
   124639 #define GEN7_GPGPU_OBJECT_MediaCommandOpcode_start  24
   124640 
   124641 static inline uint32_t ATTRIBUTE_PURE
   124642 GPGPU_OBJECT_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   124643 {
   124644    switch (devinfo->gen) {
   124645    case 10: return 0;
   124646    case 9: return 0;
   124647    case 8: return 0;
   124648    case 7:
   124649       if (devinfo->is_haswell) {
   124650          return 24;
   124651       } else {
   124652          return 24;
   124653       }
   124654    case 6: return 0;
   124655    case 5: return 0;
   124656    case 4:
   124657       if (devinfo->is_g4x) {
   124658          return 0;
   124659       } else {
   124660          return 0;
   124661       }
   124662    default:
   124663       unreachable("Invalid hardware generation");
   124664    }
   124665 }
   124666 
   124667 
   124668 
   124669 /* GPGPU_OBJECT::Pipeline */
   124670 
   124671 
   124672 #define GEN75_GPGPU_OBJECT_Pipeline_bits  2
   124673 #define GEN7_GPGPU_OBJECT_Pipeline_bits  2
   124674 
   124675 static inline uint32_t ATTRIBUTE_PURE
   124676 GPGPU_OBJECT_Pipeline_bits(const struct gen_device_info *devinfo)
   124677 {
   124678    switch (devinfo->gen) {
   124679    case 10: return 0;
   124680    case 9: return 0;
   124681    case 8: return 0;
   124682    case 7:
   124683       if (devinfo->is_haswell) {
   124684          return 2;
   124685       } else {
   124686          return 2;
   124687       }
   124688    case 6: return 0;
   124689    case 5: return 0;
   124690    case 4:
   124691       if (devinfo->is_g4x) {
   124692          return 0;
   124693       } else {
   124694          return 0;
   124695       }
   124696    default:
   124697       unreachable("Invalid hardware generation");
   124698    }
   124699 }
   124700 
   124701 
   124702 
   124703 #define GEN75_GPGPU_OBJECT_Pipeline_start  27
   124704 #define GEN7_GPGPU_OBJECT_Pipeline_start  27
   124705 
   124706 static inline uint32_t ATTRIBUTE_PURE
   124707 GPGPU_OBJECT_Pipeline_start(const struct gen_device_info *devinfo)
   124708 {
   124709    switch (devinfo->gen) {
   124710    case 10: return 0;
   124711    case 9: return 0;
   124712    case 8: return 0;
   124713    case 7:
   124714       if (devinfo->is_haswell) {
   124715          return 27;
   124716       } else {
   124717          return 27;
   124718       }
   124719    case 6: return 0;
   124720    case 5: return 0;
   124721    case 4:
   124722       if (devinfo->is_g4x) {
   124723          return 0;
   124724       } else {
   124725          return 0;
   124726       }
   124727    default:
   124728       unreachable("Invalid hardware generation");
   124729    }
   124730 }
   124731 
   124732 
   124733 
   124734 /* GPGPU_OBJECT::Predicate Enable */
   124735 
   124736 
   124737 #define GEN75_GPGPU_OBJECT_PredicateEnable_bits  1
   124738 #define GEN7_GPGPU_OBJECT_PredicateEnable_bits  1
   124739 
   124740 static inline uint32_t ATTRIBUTE_PURE
   124741 GPGPU_OBJECT_PredicateEnable_bits(const struct gen_device_info *devinfo)
   124742 {
   124743    switch (devinfo->gen) {
   124744    case 10: return 0;
   124745    case 9: return 0;
   124746    case 8: return 0;
   124747    case 7:
   124748       if (devinfo->is_haswell) {
   124749          return 1;
   124750       } else {
   124751          return 1;
   124752       }
   124753    case 6: return 0;
   124754    case 5: return 0;
   124755    case 4:
   124756       if (devinfo->is_g4x) {
   124757          return 0;
   124758       } else {
   124759          return 0;
   124760       }
   124761    default:
   124762       unreachable("Invalid hardware generation");
   124763    }
   124764 }
   124765 
   124766 
   124767 
   124768 #define GEN75_GPGPU_OBJECT_PredicateEnable_start  8
   124769 #define GEN7_GPGPU_OBJECT_PredicateEnable_start  8
   124770 
   124771 static inline uint32_t ATTRIBUTE_PURE
   124772 GPGPU_OBJECT_PredicateEnable_start(const struct gen_device_info *devinfo)
   124773 {
   124774    switch (devinfo->gen) {
   124775    case 10: return 0;
   124776    case 9: return 0;
   124777    case 8: return 0;
   124778    case 7:
   124779       if (devinfo->is_haswell) {
   124780          return 8;
   124781       } else {
   124782          return 8;
   124783       }
   124784    case 6: return 0;
   124785    case 5: return 0;
   124786    case 4:
   124787       if (devinfo->is_g4x) {
   124788          return 0;
   124789       } else {
   124790          return 0;
   124791       }
   124792    default:
   124793       unreachable("Invalid hardware generation");
   124794    }
   124795 }
   124796 
   124797 
   124798 
   124799 /* GPGPU_OBJECT::Shared Local Memory Fixed Offset */
   124800 
   124801 
   124802 #define GEN75_GPGPU_OBJECT_SharedLocalMemoryFixedOffset_bits  1
   124803 #define GEN7_GPGPU_OBJECT_SharedLocalMemoryFixedOffset_bits  1
   124804 
   124805 static inline uint32_t ATTRIBUTE_PURE
   124806 GPGPU_OBJECT_SharedLocalMemoryFixedOffset_bits(const struct gen_device_info *devinfo)
   124807 {
   124808    switch (devinfo->gen) {
   124809    case 10: return 0;
   124810    case 9: return 0;
   124811    case 8: return 0;
   124812    case 7:
   124813       if (devinfo->is_haswell) {
   124814          return 1;
   124815       } else {
   124816          return 1;
   124817       }
   124818    case 6: return 0;
   124819    case 5: return 0;
   124820    case 4:
   124821       if (devinfo->is_g4x) {
   124822          return 0;
   124823       } else {
   124824          return 0;
   124825       }
   124826    default:
   124827       unreachable("Invalid hardware generation");
   124828    }
   124829 }
   124830 
   124831 
   124832 
   124833 #define GEN75_GPGPU_OBJECT_SharedLocalMemoryFixedOffset_start  39
   124834 #define GEN7_GPGPU_OBJECT_SharedLocalMemoryFixedOffset_start  39
   124835 
   124836 static inline uint32_t ATTRIBUTE_PURE
   124837 GPGPU_OBJECT_SharedLocalMemoryFixedOffset_start(const struct gen_device_info *devinfo)
   124838 {
   124839    switch (devinfo->gen) {
   124840    case 10: return 0;
   124841    case 9: return 0;
   124842    case 8: return 0;
   124843    case 7:
   124844       if (devinfo->is_haswell) {
   124845          return 39;
   124846       } else {
   124847          return 39;
   124848       }
   124849    case 6: return 0;
   124850    case 5: return 0;
   124851    case 4:
   124852       if (devinfo->is_g4x) {
   124853          return 0;
   124854       } else {
   124855          return 0;
   124856       }
   124857    default:
   124858       unreachable("Invalid hardware generation");
   124859    }
   124860 }
   124861 
   124862 
   124863 
   124864 /* GPGPU_OBJECT::Shared Local Memory Offset */
   124865 
   124866 
   124867 #define GEN75_GPGPU_OBJECT_SharedLocalMemoryOffset_bits  4
   124868 #define GEN7_GPGPU_OBJECT_SharedLocalMemoryOffset_bits  4
   124869 
   124870 static inline uint32_t ATTRIBUTE_PURE
   124871 GPGPU_OBJECT_SharedLocalMemoryOffset_bits(const struct gen_device_info *devinfo)
   124872 {
   124873    switch (devinfo->gen) {
   124874    case 10: return 0;
   124875    case 9: return 0;
   124876    case 8: return 0;
   124877    case 7:
   124878       if (devinfo->is_haswell) {
   124879          return 4;
   124880       } else {
   124881          return 4;
   124882       }
   124883    case 6: return 0;
   124884    case 5: return 0;
   124885    case 4:
   124886       if (devinfo->is_g4x) {
   124887          return 0;
   124888       } else {
   124889          return 0;
   124890       }
   124891    default:
   124892       unreachable("Invalid hardware generation");
   124893    }
   124894 }
   124895 
   124896 
   124897 
   124898 #define GEN75_GPGPU_OBJECT_SharedLocalMemoryOffset_start  92
   124899 #define GEN7_GPGPU_OBJECT_SharedLocalMemoryOffset_start  92
   124900 
   124901 static inline uint32_t ATTRIBUTE_PURE
   124902 GPGPU_OBJECT_SharedLocalMemoryOffset_start(const struct gen_device_info *devinfo)
   124903 {
   124904    switch (devinfo->gen) {
   124905    case 10: return 0;
   124906    case 9: return 0;
   124907    case 8: return 0;
   124908    case 7:
   124909       if (devinfo->is_haswell) {
   124910          return 92;
   124911       } else {
   124912          return 92;
   124913       }
   124914    case 6: return 0;
   124915    case 5: return 0;
   124916    case 4:
   124917       if (devinfo->is_g4x) {
   124918          return 0;
   124919       } else {
   124920          return 0;
   124921       }
   124922    default:
   124923       unreachable("Invalid hardware generation");
   124924    }
   124925 }
   124926 
   124927 
   124928 
   124929 /* GPGPU_OBJECT::Slice Destination Select */
   124930 
   124931 
   124932 #define GEN75_GPGPU_OBJECT_SliceDestinationSelect_bits  1
   124933 
   124934 static inline uint32_t ATTRIBUTE_PURE
   124935 GPGPU_OBJECT_SliceDestinationSelect_bits(const struct gen_device_info *devinfo)
   124936 {
   124937    switch (devinfo->gen) {
   124938    case 10: return 0;
   124939    case 9: return 0;
   124940    case 8: return 0;
   124941    case 7:
   124942       if (devinfo->is_haswell) {
   124943          return 1;
   124944       } else {
   124945          return 0;
   124946       }
   124947    case 6: return 0;
   124948    case 5: return 0;
   124949    case 4:
   124950       if (devinfo->is_g4x) {
   124951          return 0;
   124952       } else {
   124953          return 0;
   124954       }
   124955    default:
   124956       unreachable("Invalid hardware generation");
   124957    }
   124958 }
   124959 
   124960 
   124961 
   124962 #define GEN75_GPGPU_OBJECT_SliceDestinationSelect_start  83
   124963 
   124964 static inline uint32_t ATTRIBUTE_PURE
   124965 GPGPU_OBJECT_SliceDestinationSelect_start(const struct gen_device_info *devinfo)
   124966 {
   124967    switch (devinfo->gen) {
   124968    case 10: return 0;
   124969    case 9: return 0;
   124970    case 8: return 0;
   124971    case 7:
   124972       if (devinfo->is_haswell) {
   124973          return 83;
   124974       } else {
   124975          return 0;
   124976       }
   124977    case 6: return 0;
   124978    case 5: return 0;
   124979    case 4:
   124980       if (devinfo->is_g4x) {
   124981          return 0;
   124982       } else {
   124983          return 0;
   124984       }
   124985    default:
   124986       unreachable("Invalid hardware generation");
   124987    }
   124988 }
   124989 
   124990 
   124991 
   124992 /* GPGPU_OBJECT::SubOpcode */
   124993 
   124994 
   124995 #define GEN75_GPGPU_OBJECT_SubOpcode_bits  8
   124996 #define GEN7_GPGPU_OBJECT_SubOpcode_bits  8
   124997 
   124998 static inline uint32_t ATTRIBUTE_PURE
   124999 GPGPU_OBJECT_SubOpcode_bits(const struct gen_device_info *devinfo)
   125000 {
   125001    switch (devinfo->gen) {
   125002    case 10: return 0;
   125003    case 9: return 0;
   125004    case 8: return 0;
   125005    case 7:
   125006       if (devinfo->is_haswell) {
   125007          return 8;
   125008       } else {
   125009          return 8;
   125010       }
   125011    case 6: return 0;
   125012    case 5: return 0;
   125013    case 4:
   125014       if (devinfo->is_g4x) {
   125015          return 0;
   125016       } else {
   125017          return 0;
   125018       }
   125019    default:
   125020       unreachable("Invalid hardware generation");
   125021    }
   125022 }
   125023 
   125024 
   125025 
   125026 #define GEN75_GPGPU_OBJECT_SubOpcode_start  16
   125027 #define GEN7_GPGPU_OBJECT_SubOpcode_start  16
   125028 
   125029 static inline uint32_t ATTRIBUTE_PURE
   125030 GPGPU_OBJECT_SubOpcode_start(const struct gen_device_info *devinfo)
   125031 {
   125032    switch (devinfo->gen) {
   125033    case 10: return 0;
   125034    case 9: return 0;
   125035    case 8: return 0;
   125036    case 7:
   125037       if (devinfo->is_haswell) {
   125038          return 16;
   125039       } else {
   125040          return 16;
   125041       }
   125042    case 6: return 0;
   125043    case 5: return 0;
   125044    case 4:
   125045       if (devinfo->is_g4x) {
   125046          return 0;
   125047       } else {
   125048          return 0;
   125049       }
   125050    default:
   125051       unreachable("Invalid hardware generation");
   125052    }
   125053 }
   125054 
   125055 
   125056 
   125057 /* GPGPU_OBJECT::Thread Group ID X */
   125058 
   125059 
   125060 #define GEN75_GPGPU_OBJECT_ThreadGroupIDX_bits  32
   125061 #define GEN7_GPGPU_OBJECT_ThreadGroupIDX_bits  32
   125062 
   125063 static inline uint32_t ATTRIBUTE_PURE
   125064 GPGPU_OBJECT_ThreadGroupIDX_bits(const struct gen_device_info *devinfo)
   125065 {
   125066    switch (devinfo->gen) {
   125067    case 10: return 0;
   125068    case 9: return 0;
   125069    case 8: return 0;
   125070    case 7:
   125071       if (devinfo->is_haswell) {
   125072          return 32;
   125073       } else {
   125074          return 32;
   125075       }
   125076    case 6: return 0;
   125077    case 5: return 0;
   125078    case 4:
   125079       if (devinfo->is_g4x) {
   125080          return 0;
   125081       } else {
   125082          return 0;
   125083       }
   125084    default:
   125085       unreachable("Invalid hardware generation");
   125086    }
   125087 }
   125088 
   125089 
   125090 
   125091 #define GEN75_GPGPU_OBJECT_ThreadGroupIDX_start  128
   125092 #define GEN7_GPGPU_OBJECT_ThreadGroupIDX_start  128
   125093 
   125094 static inline uint32_t ATTRIBUTE_PURE
   125095 GPGPU_OBJECT_ThreadGroupIDX_start(const struct gen_device_info *devinfo)
   125096 {
   125097    switch (devinfo->gen) {
   125098    case 10: return 0;
   125099    case 9: return 0;
   125100    case 8: return 0;
   125101    case 7:
   125102       if (devinfo->is_haswell) {
   125103          return 128;
   125104       } else {
   125105          return 128;
   125106       }
   125107    case 6: return 0;
   125108    case 5: return 0;
   125109    case 4:
   125110       if (devinfo->is_g4x) {
   125111          return 0;
   125112       } else {
   125113          return 0;
   125114       }
   125115    default:
   125116       unreachable("Invalid hardware generation");
   125117    }
   125118 }
   125119 
   125120 
   125121 
   125122 /* GPGPU_OBJECT::Thread Group ID Y */
   125123 
   125124 
   125125 #define GEN75_GPGPU_OBJECT_ThreadGroupIDY_bits  32
   125126 #define GEN7_GPGPU_OBJECT_ThreadGroupIDY_bits  32
   125127 
   125128 static inline uint32_t ATTRIBUTE_PURE
   125129 GPGPU_OBJECT_ThreadGroupIDY_bits(const struct gen_device_info *devinfo)
   125130 {
   125131    switch (devinfo->gen) {
   125132    case 10: return 0;
   125133    case 9: return 0;
   125134    case 8: return 0;
   125135    case 7:
   125136       if (devinfo->is_haswell) {
   125137          return 32;
   125138       } else {
   125139          return 32;
   125140       }
   125141    case 6: return 0;
   125142    case 5: return 0;
   125143    case 4:
   125144       if (devinfo->is_g4x) {
   125145          return 0;
   125146       } else {
   125147          return 0;
   125148       }
   125149    default:
   125150       unreachable("Invalid hardware generation");
   125151    }
   125152 }
   125153 
   125154 
   125155 
   125156 #define GEN75_GPGPU_OBJECT_ThreadGroupIDY_start  160
   125157 #define GEN7_GPGPU_OBJECT_ThreadGroupIDY_start  160
   125158 
   125159 static inline uint32_t ATTRIBUTE_PURE
   125160 GPGPU_OBJECT_ThreadGroupIDY_start(const struct gen_device_info *devinfo)
   125161 {
   125162    switch (devinfo->gen) {
   125163    case 10: return 0;
   125164    case 9: return 0;
   125165    case 8: return 0;
   125166    case 7:
   125167       if (devinfo->is_haswell) {
   125168          return 160;
   125169       } else {
   125170          return 160;
   125171       }
   125172    case 6: return 0;
   125173    case 5: return 0;
   125174    case 4:
   125175       if (devinfo->is_g4x) {
   125176          return 0;
   125177       } else {
   125178          return 0;
   125179       }
   125180    default:
   125181       unreachable("Invalid hardware generation");
   125182    }
   125183 }
   125184 
   125185 
   125186 
   125187 /* GPGPU_OBJECT::Thread Group ID Z */
   125188 
   125189 
   125190 #define GEN75_GPGPU_OBJECT_ThreadGroupIDZ_bits  32
   125191 #define GEN7_GPGPU_OBJECT_ThreadGroupIDZ_bits  32
   125192 
   125193 static inline uint32_t ATTRIBUTE_PURE
   125194 GPGPU_OBJECT_ThreadGroupIDZ_bits(const struct gen_device_info *devinfo)
   125195 {
   125196    switch (devinfo->gen) {
   125197    case 10: return 0;
   125198    case 9: return 0;
   125199    case 8: return 0;
   125200    case 7:
   125201       if (devinfo->is_haswell) {
   125202          return 32;
   125203       } else {
   125204          return 32;
   125205       }
   125206    case 6: return 0;
   125207    case 5: return 0;
   125208    case 4:
   125209       if (devinfo->is_g4x) {
   125210          return 0;
   125211       } else {
   125212          return 0;
   125213       }
   125214    default:
   125215       unreachable("Invalid hardware generation");
   125216    }
   125217 }
   125218 
   125219 
   125220 
   125221 #define GEN75_GPGPU_OBJECT_ThreadGroupIDZ_start  192
   125222 #define GEN7_GPGPU_OBJECT_ThreadGroupIDZ_start  192
   125223 
   125224 static inline uint32_t ATTRIBUTE_PURE
   125225 GPGPU_OBJECT_ThreadGroupIDZ_start(const struct gen_device_info *devinfo)
   125226 {
   125227    switch (devinfo->gen) {
   125228    case 10: return 0;
   125229    case 9: return 0;
   125230    case 8: return 0;
   125231    case 7:
   125232       if (devinfo->is_haswell) {
   125233          return 192;
   125234       } else {
   125235          return 192;
   125236       }
   125237    case 6: return 0;
   125238    case 5: return 0;
   125239    case 4:
   125240       if (devinfo->is_g4x) {
   125241          return 0;
   125242       } else {
   125243          return 0;
   125244       }
   125245    default:
   125246       unreachable("Invalid hardware generation");
   125247    }
   125248 }
   125249 
   125250 
   125251 
   125252 /* GPGPU_WALKER */
   125253 
   125254 
   125255 #define GEN10_GPGPU_WALKER_length  15
   125256 #define GEN9_GPGPU_WALKER_length  15
   125257 #define GEN8_GPGPU_WALKER_length  15
   125258 #define GEN75_GPGPU_WALKER_length  11
   125259 #define GEN7_GPGPU_WALKER_length  11
   125260 
   125261 static inline uint32_t ATTRIBUTE_PURE
   125262 GPGPU_WALKER_length(const struct gen_device_info *devinfo)
   125263 {
   125264    switch (devinfo->gen) {
   125265    case 10: return 15;
   125266    case 9: return 15;
   125267    case 8: return 15;
   125268    case 7:
   125269       if (devinfo->is_haswell) {
   125270          return 11;
   125271       } else {
   125272          return 11;
   125273       }
   125274    case 6: return 0;
   125275    case 5: return 0;
   125276    case 4:
   125277       if (devinfo->is_g4x) {
   125278          return 0;
   125279       } else {
   125280          return 0;
   125281       }
   125282    default:
   125283       unreachable("Invalid hardware generation");
   125284    }
   125285 }
   125286 
   125287 
   125288 
   125289 /* GPGPU_WALKER::Bottom Execution Mask */
   125290 
   125291 
   125292 #define GEN10_GPGPU_WALKER_BottomExecutionMask_bits  32
   125293 #define GEN9_GPGPU_WALKER_BottomExecutionMask_bits  32
   125294 #define GEN8_GPGPU_WALKER_BottomExecutionMask_bits  32
   125295 #define GEN75_GPGPU_WALKER_BottomExecutionMask_bits  32
   125296 #define GEN7_GPGPU_WALKER_BottomExecutionMask_bits  32
   125297 
   125298 static inline uint32_t ATTRIBUTE_PURE
   125299 GPGPU_WALKER_BottomExecutionMask_bits(const struct gen_device_info *devinfo)
   125300 {
   125301    switch (devinfo->gen) {
   125302    case 10: return 32;
   125303    case 9: return 32;
   125304    case 8: return 32;
   125305    case 7:
   125306       if (devinfo->is_haswell) {
   125307          return 32;
   125308       } else {
   125309          return 32;
   125310       }
   125311    case 6: return 0;
   125312    case 5: return 0;
   125313    case 4:
   125314       if (devinfo->is_g4x) {
   125315          return 0;
   125316       } else {
   125317          return 0;
   125318       }
   125319    default:
   125320       unreachable("Invalid hardware generation");
   125321    }
   125322 }
   125323 
   125324 
   125325 
   125326 #define GEN10_GPGPU_WALKER_BottomExecutionMask_start  448
   125327 #define GEN9_GPGPU_WALKER_BottomExecutionMask_start  448
   125328 #define GEN8_GPGPU_WALKER_BottomExecutionMask_start  448
   125329 #define GEN75_GPGPU_WALKER_BottomExecutionMask_start  320
   125330 #define GEN7_GPGPU_WALKER_BottomExecutionMask_start  320
   125331 
   125332 static inline uint32_t ATTRIBUTE_PURE
   125333 GPGPU_WALKER_BottomExecutionMask_start(const struct gen_device_info *devinfo)
   125334 {
   125335    switch (devinfo->gen) {
   125336    case 10: return 448;
   125337    case 9: return 448;
   125338    case 8: return 448;
   125339    case 7:
   125340       if (devinfo->is_haswell) {
   125341          return 320;
   125342       } else {
   125343          return 320;
   125344       }
   125345    case 6: return 0;
   125346    case 5: return 0;
   125347    case 4:
   125348       if (devinfo->is_g4x) {
   125349          return 0;
   125350       } else {
   125351          return 0;
   125352       }
   125353    default:
   125354       unreachable("Invalid hardware generation");
   125355    }
   125356 }
   125357 
   125358 
   125359 
   125360 /* GPGPU_WALKER::Command Type */
   125361 
   125362 
   125363 #define GEN10_GPGPU_WALKER_CommandType_bits  3
   125364 #define GEN9_GPGPU_WALKER_CommandType_bits  3
   125365 #define GEN8_GPGPU_WALKER_CommandType_bits  3
   125366 #define GEN75_GPGPU_WALKER_CommandType_bits  3
   125367 #define GEN7_GPGPU_WALKER_CommandType_bits  3
   125368 
   125369 static inline uint32_t ATTRIBUTE_PURE
   125370 GPGPU_WALKER_CommandType_bits(const struct gen_device_info *devinfo)
   125371 {
   125372    switch (devinfo->gen) {
   125373    case 10: return 3;
   125374    case 9: return 3;
   125375    case 8: return 3;
   125376    case 7:
   125377       if (devinfo->is_haswell) {
   125378          return 3;
   125379       } else {
   125380          return 3;
   125381       }
   125382    case 6: return 0;
   125383    case 5: return 0;
   125384    case 4:
   125385       if (devinfo->is_g4x) {
   125386          return 0;
   125387       } else {
   125388          return 0;
   125389       }
   125390    default:
   125391       unreachable("Invalid hardware generation");
   125392    }
   125393 }
   125394 
   125395 
   125396 
   125397 #define GEN10_GPGPU_WALKER_CommandType_start  29
   125398 #define GEN9_GPGPU_WALKER_CommandType_start  29
   125399 #define GEN8_GPGPU_WALKER_CommandType_start  29
   125400 #define GEN75_GPGPU_WALKER_CommandType_start  29
   125401 #define GEN7_GPGPU_WALKER_CommandType_start  29
   125402 
   125403 static inline uint32_t ATTRIBUTE_PURE
   125404 GPGPU_WALKER_CommandType_start(const struct gen_device_info *devinfo)
   125405 {
   125406    switch (devinfo->gen) {
   125407    case 10: return 29;
   125408    case 9: return 29;
   125409    case 8: return 29;
   125410    case 7:
   125411       if (devinfo->is_haswell) {
   125412          return 29;
   125413       } else {
   125414          return 29;
   125415       }
   125416    case 6: return 0;
   125417    case 5: return 0;
   125418    case 4:
   125419       if (devinfo->is_g4x) {
   125420          return 0;
   125421       } else {
   125422          return 0;
   125423       }
   125424    default:
   125425       unreachable("Invalid hardware generation");
   125426    }
   125427 }
   125428 
   125429 
   125430 
   125431 /* GPGPU_WALKER::DWord Length */
   125432 
   125433 
   125434 #define GEN10_GPGPU_WALKER_DWordLength_bits  8
   125435 #define GEN9_GPGPU_WALKER_DWordLength_bits  8
   125436 #define GEN8_GPGPU_WALKER_DWordLength_bits  8
   125437 #define GEN75_GPGPU_WALKER_DWordLength_bits  8
   125438 #define GEN7_GPGPU_WALKER_DWordLength_bits  8
   125439 
   125440 static inline uint32_t ATTRIBUTE_PURE
   125441 GPGPU_WALKER_DWordLength_bits(const struct gen_device_info *devinfo)
   125442 {
   125443    switch (devinfo->gen) {
   125444    case 10: return 8;
   125445    case 9: return 8;
   125446    case 8: return 8;
   125447    case 7:
   125448       if (devinfo->is_haswell) {
   125449          return 8;
   125450       } else {
   125451          return 8;
   125452       }
   125453    case 6: return 0;
   125454    case 5: return 0;
   125455    case 4:
   125456       if (devinfo->is_g4x) {
   125457          return 0;
   125458       } else {
   125459          return 0;
   125460       }
   125461    default:
   125462       unreachable("Invalid hardware generation");
   125463    }
   125464 }
   125465 
   125466 
   125467 
   125468 #define GEN10_GPGPU_WALKER_DWordLength_start  0
   125469 #define GEN9_GPGPU_WALKER_DWordLength_start  0
   125470 #define GEN8_GPGPU_WALKER_DWordLength_start  0
   125471 #define GEN75_GPGPU_WALKER_DWordLength_start  0
   125472 #define GEN7_GPGPU_WALKER_DWordLength_start  0
   125473 
   125474 static inline uint32_t ATTRIBUTE_PURE
   125475 GPGPU_WALKER_DWordLength_start(const struct gen_device_info *devinfo)
   125476 {
   125477    switch (devinfo->gen) {
   125478    case 10: return 0;
   125479    case 9: return 0;
   125480    case 8: return 0;
   125481    case 7:
   125482       if (devinfo->is_haswell) {
   125483          return 0;
   125484       } else {
   125485          return 0;
   125486       }
   125487    case 6: return 0;
   125488    case 5: return 0;
   125489    case 4:
   125490       if (devinfo->is_g4x) {
   125491          return 0;
   125492       } else {
   125493          return 0;
   125494       }
   125495    default:
   125496       unreachable("Invalid hardware generation");
   125497    }
   125498 }
   125499 
   125500 
   125501 
   125502 /* GPGPU_WALKER::Indirect Data Length */
   125503 
   125504 
   125505 #define GEN10_GPGPU_WALKER_IndirectDataLength_bits  17
   125506 #define GEN9_GPGPU_WALKER_IndirectDataLength_bits  17
   125507 #define GEN8_GPGPU_WALKER_IndirectDataLength_bits  17
   125508 
   125509 static inline uint32_t ATTRIBUTE_PURE
   125510 GPGPU_WALKER_IndirectDataLength_bits(const struct gen_device_info *devinfo)
   125511 {
   125512    switch (devinfo->gen) {
   125513    case 10: return 17;
   125514    case 9: return 17;
   125515    case 8: return 17;
   125516    case 7:
   125517       if (devinfo->is_haswell) {
   125518          return 0;
   125519       } else {
   125520          return 0;
   125521       }
   125522    case 6: return 0;
   125523    case 5: return 0;
   125524    case 4:
   125525       if (devinfo->is_g4x) {
   125526          return 0;
   125527       } else {
   125528          return 0;
   125529       }
   125530    default:
   125531       unreachable("Invalid hardware generation");
   125532    }
   125533 }
   125534 
   125535 
   125536 
   125537 #define GEN10_GPGPU_WALKER_IndirectDataLength_start  64
   125538 #define GEN9_GPGPU_WALKER_IndirectDataLength_start  64
   125539 #define GEN8_GPGPU_WALKER_IndirectDataLength_start  64
   125540 
   125541 static inline uint32_t ATTRIBUTE_PURE
   125542 GPGPU_WALKER_IndirectDataLength_start(const struct gen_device_info *devinfo)
   125543 {
   125544    switch (devinfo->gen) {
   125545    case 10: return 64;
   125546    case 9: return 64;
   125547    case 8: return 64;
   125548    case 7:
   125549       if (devinfo->is_haswell) {
   125550          return 0;
   125551       } else {
   125552          return 0;
   125553       }
   125554    case 6: return 0;
   125555    case 5: return 0;
   125556    case 4:
   125557       if (devinfo->is_g4x) {
   125558          return 0;
   125559       } else {
   125560          return 0;
   125561       }
   125562    default:
   125563       unreachable("Invalid hardware generation");
   125564    }
   125565 }
   125566 
   125567 
   125568 
   125569 /* GPGPU_WALKER::Indirect Data Start Address */
   125570 
   125571 
   125572 #define GEN10_GPGPU_WALKER_IndirectDataStartAddress_bits  26
   125573 #define GEN9_GPGPU_WALKER_IndirectDataStartAddress_bits  26
   125574 #define GEN8_GPGPU_WALKER_IndirectDataStartAddress_bits  26
   125575 
   125576 static inline uint32_t ATTRIBUTE_PURE
   125577 GPGPU_WALKER_IndirectDataStartAddress_bits(const struct gen_device_info *devinfo)
   125578 {
   125579    switch (devinfo->gen) {
   125580    case 10: return 26;
   125581    case 9: return 26;
   125582    case 8: return 26;
   125583    case 7:
   125584       if (devinfo->is_haswell) {
   125585          return 0;
   125586       } else {
   125587          return 0;
   125588       }
   125589    case 6: return 0;
   125590    case 5: return 0;
   125591    case 4:
   125592       if (devinfo->is_g4x) {
   125593          return 0;
   125594       } else {
   125595          return 0;
   125596       }
   125597    default:
   125598       unreachable("Invalid hardware generation");
   125599    }
   125600 }
   125601 
   125602 
   125603 
   125604 #define GEN10_GPGPU_WALKER_IndirectDataStartAddress_start  102
   125605 #define GEN9_GPGPU_WALKER_IndirectDataStartAddress_start  102
   125606 #define GEN8_GPGPU_WALKER_IndirectDataStartAddress_start  102
   125607 
   125608 static inline uint32_t ATTRIBUTE_PURE
   125609 GPGPU_WALKER_IndirectDataStartAddress_start(const struct gen_device_info *devinfo)
   125610 {
   125611    switch (devinfo->gen) {
   125612    case 10: return 102;
   125613    case 9: return 102;
   125614    case 8: return 102;
   125615    case 7:
   125616       if (devinfo->is_haswell) {
   125617          return 0;
   125618       } else {
   125619          return 0;
   125620       }
   125621    case 6: return 0;
   125622    case 5: return 0;
   125623    case 4:
   125624       if (devinfo->is_g4x) {
   125625          return 0;
   125626       } else {
   125627          return 0;
   125628       }
   125629    default:
   125630       unreachable("Invalid hardware generation");
   125631    }
   125632 }
   125633 
   125634 
   125635 
   125636 /* GPGPU_WALKER::Indirect Parameter Enable */
   125637 
   125638 
   125639 #define GEN10_GPGPU_WALKER_IndirectParameterEnable_bits  1
   125640 #define GEN9_GPGPU_WALKER_IndirectParameterEnable_bits  1
   125641 #define GEN8_GPGPU_WALKER_IndirectParameterEnable_bits  1
   125642 #define GEN75_GPGPU_WALKER_IndirectParameterEnable_bits  1
   125643 #define GEN7_GPGPU_WALKER_IndirectParameterEnable_bits  1
   125644 
   125645 static inline uint32_t ATTRIBUTE_PURE
   125646 GPGPU_WALKER_IndirectParameterEnable_bits(const struct gen_device_info *devinfo)
   125647 {
   125648    switch (devinfo->gen) {
   125649    case 10: return 1;
   125650    case 9: return 1;
   125651    case 8: return 1;
   125652    case 7:
   125653       if (devinfo->is_haswell) {
   125654          return 1;
   125655       } else {
   125656          return 1;
   125657       }
   125658    case 6: return 0;
   125659    case 5: return 0;
   125660    case 4:
   125661       if (devinfo->is_g4x) {
   125662          return 0;
   125663       } else {
   125664          return 0;
   125665       }
   125666    default:
   125667       unreachable("Invalid hardware generation");
   125668    }
   125669 }
   125670 
   125671 
   125672 
   125673 #define GEN10_GPGPU_WALKER_IndirectParameterEnable_start  10
   125674 #define GEN9_GPGPU_WALKER_IndirectParameterEnable_start  10
   125675 #define GEN8_GPGPU_WALKER_IndirectParameterEnable_start  10
   125676 #define GEN75_GPGPU_WALKER_IndirectParameterEnable_start  10
   125677 #define GEN7_GPGPU_WALKER_IndirectParameterEnable_start  10
   125678 
   125679 static inline uint32_t ATTRIBUTE_PURE
   125680 GPGPU_WALKER_IndirectParameterEnable_start(const struct gen_device_info *devinfo)
   125681 {
   125682    switch (devinfo->gen) {
   125683    case 10: return 10;
   125684    case 9: return 10;
   125685    case 8: return 10;
   125686    case 7:
   125687       if (devinfo->is_haswell) {
   125688          return 10;
   125689       } else {
   125690          return 10;
   125691       }
   125692    case 6: return 0;
   125693    case 5: return 0;
   125694    case 4:
   125695       if (devinfo->is_g4x) {
   125696          return 0;
   125697       } else {
   125698          return 0;
   125699       }
   125700    default:
   125701       unreachable("Invalid hardware generation");
   125702    }
   125703 }
   125704 
   125705 
   125706 
   125707 /* GPGPU_WALKER::Interface Descriptor Offset */
   125708 
   125709 
   125710 #define GEN10_GPGPU_WALKER_InterfaceDescriptorOffset_bits  6
   125711 #define GEN9_GPGPU_WALKER_InterfaceDescriptorOffset_bits  6
   125712 #define GEN8_GPGPU_WALKER_InterfaceDescriptorOffset_bits  6
   125713 #define GEN75_GPGPU_WALKER_InterfaceDescriptorOffset_bits  6
   125714 #define GEN7_GPGPU_WALKER_InterfaceDescriptorOffset_bits  5
   125715 
   125716 static inline uint32_t ATTRIBUTE_PURE
   125717 GPGPU_WALKER_InterfaceDescriptorOffset_bits(const struct gen_device_info *devinfo)
   125718 {
   125719    switch (devinfo->gen) {
   125720    case 10: return 6;
   125721    case 9: return 6;
   125722    case 8: return 6;
   125723    case 7:
   125724       if (devinfo->is_haswell) {
   125725          return 6;
   125726       } else {
   125727          return 5;
   125728       }
   125729    case 6: return 0;
   125730    case 5: return 0;
   125731    case 4:
   125732       if (devinfo->is_g4x) {
   125733          return 0;
   125734       } else {
   125735          return 0;
   125736       }
   125737    default:
   125738       unreachable("Invalid hardware generation");
   125739    }
   125740 }
   125741 
   125742 
   125743 
   125744 #define GEN10_GPGPU_WALKER_InterfaceDescriptorOffset_start  32
   125745 #define GEN9_GPGPU_WALKER_InterfaceDescriptorOffset_start  32
   125746 #define GEN8_GPGPU_WALKER_InterfaceDescriptorOffset_start  32
   125747 #define GEN75_GPGPU_WALKER_InterfaceDescriptorOffset_start  32
   125748 #define GEN7_GPGPU_WALKER_InterfaceDescriptorOffset_start  32
   125749 
   125750 static inline uint32_t ATTRIBUTE_PURE
   125751 GPGPU_WALKER_InterfaceDescriptorOffset_start(const struct gen_device_info *devinfo)
   125752 {
   125753    switch (devinfo->gen) {
   125754    case 10: return 32;
   125755    case 9: return 32;
   125756    case 8: return 32;
   125757    case 7:
   125758       if (devinfo->is_haswell) {
   125759          return 32;
   125760       } else {
   125761          return 32;
   125762       }
   125763    case 6: return 0;
   125764    case 5: return 0;
   125765    case 4:
   125766       if (devinfo->is_g4x) {
   125767          return 0;
   125768       } else {
   125769          return 0;
   125770       }
   125771    default:
   125772       unreachable("Invalid hardware generation");
   125773    }
   125774 }
   125775 
   125776 
   125777 
   125778 /* GPGPU_WALKER::Media Command Opcode */
   125779 
   125780 
   125781 #define GEN10_GPGPU_WALKER_MediaCommandOpcode_bits  3
   125782 #define GEN9_GPGPU_WALKER_MediaCommandOpcode_bits  3
   125783 #define GEN8_GPGPU_WALKER_MediaCommandOpcode_bits  3
   125784 #define GEN75_GPGPU_WALKER_MediaCommandOpcode_bits  3
   125785 #define GEN7_GPGPU_WALKER_MediaCommandOpcode_bits  3
   125786 
   125787 static inline uint32_t ATTRIBUTE_PURE
   125788 GPGPU_WALKER_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   125789 {
   125790    switch (devinfo->gen) {
   125791    case 10: return 3;
   125792    case 9: return 3;
   125793    case 8: return 3;
   125794    case 7:
   125795       if (devinfo->is_haswell) {
   125796          return 3;
   125797       } else {
   125798          return 3;
   125799       }
   125800    case 6: return 0;
   125801    case 5: return 0;
   125802    case 4:
   125803       if (devinfo->is_g4x) {
   125804          return 0;
   125805       } else {
   125806          return 0;
   125807       }
   125808    default:
   125809       unreachable("Invalid hardware generation");
   125810    }
   125811 }
   125812 
   125813 
   125814 
   125815 #define GEN10_GPGPU_WALKER_MediaCommandOpcode_start  24
   125816 #define GEN9_GPGPU_WALKER_MediaCommandOpcode_start  24
   125817 #define GEN8_GPGPU_WALKER_MediaCommandOpcode_start  24
   125818 #define GEN75_GPGPU_WALKER_MediaCommandOpcode_start  24
   125819 #define GEN7_GPGPU_WALKER_MediaCommandOpcode_start  24
   125820 
   125821 static inline uint32_t ATTRIBUTE_PURE
   125822 GPGPU_WALKER_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   125823 {
   125824    switch (devinfo->gen) {
   125825    case 10: return 24;
   125826    case 9: return 24;
   125827    case 8: return 24;
   125828    case 7:
   125829       if (devinfo->is_haswell) {
   125830          return 24;
   125831       } else {
   125832          return 24;
   125833       }
   125834    case 6: return 0;
   125835    case 5: return 0;
   125836    case 4:
   125837       if (devinfo->is_g4x) {
   125838          return 0;
   125839       } else {
   125840          return 0;
   125841       }
   125842    default:
   125843       unreachable("Invalid hardware generation");
   125844    }
   125845 }
   125846 
   125847 
   125848 
   125849 /* GPGPU_WALKER::Pipeline */
   125850 
   125851 
   125852 #define GEN10_GPGPU_WALKER_Pipeline_bits  2
   125853 #define GEN9_GPGPU_WALKER_Pipeline_bits  2
   125854 #define GEN8_GPGPU_WALKER_Pipeline_bits  2
   125855 #define GEN75_GPGPU_WALKER_Pipeline_bits  2
   125856 #define GEN7_GPGPU_WALKER_Pipeline_bits  2
   125857 
   125858 static inline uint32_t ATTRIBUTE_PURE
   125859 GPGPU_WALKER_Pipeline_bits(const struct gen_device_info *devinfo)
   125860 {
   125861    switch (devinfo->gen) {
   125862    case 10: return 2;
   125863    case 9: return 2;
   125864    case 8: return 2;
   125865    case 7:
   125866       if (devinfo->is_haswell) {
   125867          return 2;
   125868       } else {
   125869          return 2;
   125870       }
   125871    case 6: return 0;
   125872    case 5: return 0;
   125873    case 4:
   125874       if (devinfo->is_g4x) {
   125875          return 0;
   125876       } else {
   125877          return 0;
   125878       }
   125879    default:
   125880       unreachable("Invalid hardware generation");
   125881    }
   125882 }
   125883 
   125884 
   125885 
   125886 #define GEN10_GPGPU_WALKER_Pipeline_start  27
   125887 #define GEN9_GPGPU_WALKER_Pipeline_start  27
   125888 #define GEN8_GPGPU_WALKER_Pipeline_start  27
   125889 #define GEN75_GPGPU_WALKER_Pipeline_start  27
   125890 #define GEN7_GPGPU_WALKER_Pipeline_start  27
   125891 
   125892 static inline uint32_t ATTRIBUTE_PURE
   125893 GPGPU_WALKER_Pipeline_start(const struct gen_device_info *devinfo)
   125894 {
   125895    switch (devinfo->gen) {
   125896    case 10: return 27;
   125897    case 9: return 27;
   125898    case 8: return 27;
   125899    case 7:
   125900       if (devinfo->is_haswell) {
   125901          return 27;
   125902       } else {
   125903          return 27;
   125904       }
   125905    case 6: return 0;
   125906    case 5: return 0;
   125907    case 4:
   125908       if (devinfo->is_g4x) {
   125909          return 0;
   125910       } else {
   125911          return 0;
   125912       }
   125913    default:
   125914       unreachable("Invalid hardware generation");
   125915    }
   125916 }
   125917 
   125918 
   125919 
   125920 /* GPGPU_WALKER::Predicate Enable */
   125921 
   125922 
   125923 #define GEN10_GPGPU_WALKER_PredicateEnable_bits  1
   125924 #define GEN9_GPGPU_WALKER_PredicateEnable_bits  1
   125925 #define GEN8_GPGPU_WALKER_PredicateEnable_bits  1
   125926 #define GEN75_GPGPU_WALKER_PredicateEnable_bits  1
   125927 #define GEN7_GPGPU_WALKER_PredicateEnable_bits  1
   125928 
   125929 static inline uint32_t ATTRIBUTE_PURE
   125930 GPGPU_WALKER_PredicateEnable_bits(const struct gen_device_info *devinfo)
   125931 {
   125932    switch (devinfo->gen) {
   125933    case 10: return 1;
   125934    case 9: return 1;
   125935    case 8: return 1;
   125936    case 7:
   125937       if (devinfo->is_haswell) {
   125938          return 1;
   125939       } else {
   125940          return 1;
   125941       }
   125942    case 6: return 0;
   125943    case 5: return 0;
   125944    case 4:
   125945       if (devinfo->is_g4x) {
   125946          return 0;
   125947       } else {
   125948          return 0;
   125949       }
   125950    default:
   125951       unreachable("Invalid hardware generation");
   125952    }
   125953 }
   125954 
   125955 
   125956 
   125957 #define GEN10_GPGPU_WALKER_PredicateEnable_start  8
   125958 #define GEN9_GPGPU_WALKER_PredicateEnable_start  8
   125959 #define GEN8_GPGPU_WALKER_PredicateEnable_start  8
   125960 #define GEN75_GPGPU_WALKER_PredicateEnable_start  8
   125961 #define GEN7_GPGPU_WALKER_PredicateEnable_start  8
   125962 
   125963 static inline uint32_t ATTRIBUTE_PURE
   125964 GPGPU_WALKER_PredicateEnable_start(const struct gen_device_info *devinfo)
   125965 {
   125966    switch (devinfo->gen) {
   125967    case 10: return 8;
   125968    case 9: return 8;
   125969    case 8: return 8;
   125970    case 7:
   125971       if (devinfo->is_haswell) {
   125972          return 8;
   125973       } else {
   125974          return 8;
   125975       }
   125976    case 6: return 0;
   125977    case 5: return 0;
   125978    case 4:
   125979       if (devinfo->is_g4x) {
   125980          return 0;
   125981       } else {
   125982          return 0;
   125983       }
   125984    default:
   125985       unreachable("Invalid hardware generation");
   125986    }
   125987 }
   125988 
   125989 
   125990 
   125991 /* GPGPU_WALKER::Right Execution Mask */
   125992 
   125993 
   125994 #define GEN10_GPGPU_WALKER_RightExecutionMask_bits  32
   125995 #define GEN9_GPGPU_WALKER_RightExecutionMask_bits  32
   125996 #define GEN8_GPGPU_WALKER_RightExecutionMask_bits  32
   125997 #define GEN75_GPGPU_WALKER_RightExecutionMask_bits  32
   125998 #define GEN7_GPGPU_WALKER_RightExecutionMask_bits  32
   125999 
   126000 static inline uint32_t ATTRIBUTE_PURE
   126001 GPGPU_WALKER_RightExecutionMask_bits(const struct gen_device_info *devinfo)
   126002 {
   126003    switch (devinfo->gen) {
   126004    case 10: return 32;
   126005    case 9: return 32;
   126006    case 8: return 32;
   126007    case 7:
   126008       if (devinfo->is_haswell) {
   126009          return 32;
   126010       } else {
   126011          return 32;
   126012       }
   126013    case 6: return 0;
   126014    case 5: return 0;
   126015    case 4:
   126016       if (devinfo->is_g4x) {
   126017          return 0;
   126018       } else {
   126019          return 0;
   126020       }
   126021    default:
   126022       unreachable("Invalid hardware generation");
   126023    }
   126024 }
   126025 
   126026 
   126027 
   126028 #define GEN10_GPGPU_WALKER_RightExecutionMask_start  416
   126029 #define GEN9_GPGPU_WALKER_RightExecutionMask_start  416
   126030 #define GEN8_GPGPU_WALKER_RightExecutionMask_start  416
   126031 #define GEN75_GPGPU_WALKER_RightExecutionMask_start  288
   126032 #define GEN7_GPGPU_WALKER_RightExecutionMask_start  288
   126033 
   126034 static inline uint32_t ATTRIBUTE_PURE
   126035 GPGPU_WALKER_RightExecutionMask_start(const struct gen_device_info *devinfo)
   126036 {
   126037    switch (devinfo->gen) {
   126038    case 10: return 416;
   126039    case 9: return 416;
   126040    case 8: return 416;
   126041    case 7:
   126042       if (devinfo->is_haswell) {
   126043          return 288;
   126044       } else {
   126045          return 288;
   126046       }
   126047    case 6: return 0;
   126048    case 5: return 0;
   126049    case 4:
   126050       if (devinfo->is_g4x) {
   126051          return 0;
   126052       } else {
   126053          return 0;
   126054       }
   126055    default:
   126056       unreachable("Invalid hardware generation");
   126057    }
   126058 }
   126059 
   126060 
   126061 
   126062 /* GPGPU_WALKER::SIMD Size */
   126063 
   126064 
   126065 #define GEN10_GPGPU_WALKER_SIMDSize_bits  2
   126066 #define GEN9_GPGPU_WALKER_SIMDSize_bits  2
   126067 #define GEN8_GPGPU_WALKER_SIMDSize_bits  2
   126068 #define GEN75_GPGPU_WALKER_SIMDSize_bits  2
   126069 #define GEN7_GPGPU_WALKER_SIMDSize_bits  2
   126070 
   126071 static inline uint32_t ATTRIBUTE_PURE
   126072 GPGPU_WALKER_SIMDSize_bits(const struct gen_device_info *devinfo)
   126073 {
   126074    switch (devinfo->gen) {
   126075    case 10: return 2;
   126076    case 9: return 2;
   126077    case 8: return 2;
   126078    case 7:
   126079       if (devinfo->is_haswell) {
   126080          return 2;
   126081       } else {
   126082          return 2;
   126083       }
   126084    case 6: return 0;
   126085    case 5: return 0;
   126086    case 4:
   126087       if (devinfo->is_g4x) {
   126088          return 0;
   126089       } else {
   126090          return 0;
   126091       }
   126092    default:
   126093       unreachable("Invalid hardware generation");
   126094    }
   126095 }
   126096 
   126097 
   126098 
   126099 #define GEN10_GPGPU_WALKER_SIMDSize_start  158
   126100 #define GEN9_GPGPU_WALKER_SIMDSize_start  158
   126101 #define GEN8_GPGPU_WALKER_SIMDSize_start  158
   126102 #define GEN75_GPGPU_WALKER_SIMDSize_start  94
   126103 #define GEN7_GPGPU_WALKER_SIMDSize_start  94
   126104 
   126105 static inline uint32_t ATTRIBUTE_PURE
   126106 GPGPU_WALKER_SIMDSize_start(const struct gen_device_info *devinfo)
   126107 {
   126108    switch (devinfo->gen) {
   126109    case 10: return 158;
   126110    case 9: return 158;
   126111    case 8: return 158;
   126112    case 7:
   126113       if (devinfo->is_haswell) {
   126114          return 94;
   126115       } else {
   126116          return 94;
   126117       }
   126118    case 6: return 0;
   126119    case 5: return 0;
   126120    case 4:
   126121       if (devinfo->is_g4x) {
   126122          return 0;
   126123       } else {
   126124          return 0;
   126125       }
   126126    default:
   126127       unreachable("Invalid hardware generation");
   126128    }
   126129 }
   126130 
   126131 
   126132 
   126133 /* GPGPU_WALKER::SubOpcode */
   126134 
   126135 
   126136 #define GEN10_GPGPU_WALKER_SubOpcode_bits  8
   126137 #define GEN9_GPGPU_WALKER_SubOpcode_bits  8
   126138 #define GEN8_GPGPU_WALKER_SubOpcode_bits  8
   126139 
   126140 static inline uint32_t ATTRIBUTE_PURE
   126141 GPGPU_WALKER_SubOpcode_bits(const struct gen_device_info *devinfo)
   126142 {
   126143    switch (devinfo->gen) {
   126144    case 10: return 8;
   126145    case 9: return 8;
   126146    case 8: return 8;
   126147    case 7:
   126148       if (devinfo->is_haswell) {
   126149          return 0;
   126150       } else {
   126151          return 0;
   126152       }
   126153    case 6: return 0;
   126154    case 5: return 0;
   126155    case 4:
   126156       if (devinfo->is_g4x) {
   126157          return 0;
   126158       } else {
   126159          return 0;
   126160       }
   126161    default:
   126162       unreachable("Invalid hardware generation");
   126163    }
   126164 }
   126165 
   126166 
   126167 
   126168 #define GEN10_GPGPU_WALKER_SubOpcode_start  16
   126169 #define GEN9_GPGPU_WALKER_SubOpcode_start  16
   126170 #define GEN8_GPGPU_WALKER_SubOpcode_start  16
   126171 
   126172 static inline uint32_t ATTRIBUTE_PURE
   126173 GPGPU_WALKER_SubOpcode_start(const struct gen_device_info *devinfo)
   126174 {
   126175    switch (devinfo->gen) {
   126176    case 10: return 16;
   126177    case 9: return 16;
   126178    case 8: return 16;
   126179    case 7:
   126180       if (devinfo->is_haswell) {
   126181          return 0;
   126182       } else {
   126183          return 0;
   126184       }
   126185    case 6: return 0;
   126186    case 5: return 0;
   126187    case 4:
   126188       if (devinfo->is_g4x) {
   126189          return 0;
   126190       } else {
   126191          return 0;
   126192       }
   126193    default:
   126194       unreachable("Invalid hardware generation");
   126195    }
   126196 }
   126197 
   126198 
   126199 
   126200 /* GPGPU_WALKER::SubOpcode A */
   126201 
   126202 
   126203 #define GEN75_GPGPU_WALKER_SubOpcodeA_bits  8
   126204 #define GEN7_GPGPU_WALKER_SubOpcodeA_bits  8
   126205 
   126206 static inline uint32_t ATTRIBUTE_PURE
   126207 GPGPU_WALKER_SubOpcodeA_bits(const struct gen_device_info *devinfo)
   126208 {
   126209    switch (devinfo->gen) {
   126210    case 10: return 0;
   126211    case 9: return 0;
   126212    case 8: return 0;
   126213    case 7:
   126214       if (devinfo->is_haswell) {
   126215          return 8;
   126216       } else {
   126217          return 8;
   126218       }
   126219    case 6: return 0;
   126220    case 5: return 0;
   126221    case 4:
   126222       if (devinfo->is_g4x) {
   126223          return 0;
   126224       } else {
   126225          return 0;
   126226       }
   126227    default:
   126228       unreachable("Invalid hardware generation");
   126229    }
   126230 }
   126231 
   126232 
   126233 
   126234 #define GEN75_GPGPU_WALKER_SubOpcodeA_start  16
   126235 #define GEN7_GPGPU_WALKER_SubOpcodeA_start  16
   126236 
   126237 static inline uint32_t ATTRIBUTE_PURE
   126238 GPGPU_WALKER_SubOpcodeA_start(const struct gen_device_info *devinfo)
   126239 {
   126240    switch (devinfo->gen) {
   126241    case 10: return 0;
   126242    case 9: return 0;
   126243    case 8: return 0;
   126244    case 7:
   126245       if (devinfo->is_haswell) {
   126246          return 16;
   126247       } else {
   126248          return 16;
   126249       }
   126250    case 6: return 0;
   126251    case 5: return 0;
   126252    case 4:
   126253       if (devinfo->is_g4x) {
   126254          return 0;
   126255       } else {
   126256          return 0;
   126257       }
   126258    default:
   126259       unreachable("Invalid hardware generation");
   126260    }
   126261 }
   126262 
   126263 
   126264 
   126265 /* GPGPU_WALKER::Thread Depth Counter Maximum */
   126266 
   126267 
   126268 #define GEN10_GPGPU_WALKER_ThreadDepthCounterMaximum_bits  6
   126269 #define GEN9_GPGPU_WALKER_ThreadDepthCounterMaximum_bits  6
   126270 #define GEN8_GPGPU_WALKER_ThreadDepthCounterMaximum_bits  6
   126271 #define GEN75_GPGPU_WALKER_ThreadDepthCounterMaximum_bits  6
   126272 #define GEN7_GPGPU_WALKER_ThreadDepthCounterMaximum_bits  6
   126273 
   126274 static inline uint32_t ATTRIBUTE_PURE
   126275 GPGPU_WALKER_ThreadDepthCounterMaximum_bits(const struct gen_device_info *devinfo)
   126276 {
   126277    switch (devinfo->gen) {
   126278    case 10: return 6;
   126279    case 9: return 6;
   126280    case 8: return 6;
   126281    case 7:
   126282       if (devinfo->is_haswell) {
   126283          return 6;
   126284       } else {
   126285          return 6;
   126286       }
   126287    case 6: return 0;
   126288    case 5: return 0;
   126289    case 4:
   126290       if (devinfo->is_g4x) {
   126291          return 0;
   126292       } else {
   126293          return 0;
   126294       }
   126295    default:
   126296       unreachable("Invalid hardware generation");
   126297    }
   126298 }
   126299 
   126300 
   126301 
   126302 #define GEN10_GPGPU_WALKER_ThreadDepthCounterMaximum_start  144
   126303 #define GEN9_GPGPU_WALKER_ThreadDepthCounterMaximum_start  144
   126304 #define GEN8_GPGPU_WALKER_ThreadDepthCounterMaximum_start  144
   126305 #define GEN75_GPGPU_WALKER_ThreadDepthCounterMaximum_start  80
   126306 #define GEN7_GPGPU_WALKER_ThreadDepthCounterMaximum_start  80
   126307 
   126308 static inline uint32_t ATTRIBUTE_PURE
   126309 GPGPU_WALKER_ThreadDepthCounterMaximum_start(const struct gen_device_info *devinfo)
   126310 {
   126311    switch (devinfo->gen) {
   126312    case 10: return 144;
   126313    case 9: return 144;
   126314    case 8: return 144;
   126315    case 7:
   126316       if (devinfo->is_haswell) {
   126317          return 80;
   126318       } else {
   126319          return 80;
   126320       }
   126321    case 6: return 0;
   126322    case 5: return 0;
   126323    case 4:
   126324       if (devinfo->is_g4x) {
   126325          return 0;
   126326       } else {
   126327          return 0;
   126328       }
   126329    default:
   126330       unreachable("Invalid hardware generation");
   126331    }
   126332 }
   126333 
   126334 
   126335 
   126336 /* GPGPU_WALKER::Thread Group ID Starting X */
   126337 
   126338 
   126339 #define GEN10_GPGPU_WALKER_ThreadGroupIDStartingX_bits  32
   126340 #define GEN9_GPGPU_WALKER_ThreadGroupIDStartingX_bits  32
   126341 #define GEN8_GPGPU_WALKER_ThreadGroupIDStartingX_bits  32
   126342 #define GEN75_GPGPU_WALKER_ThreadGroupIDStartingX_bits  32
   126343 #define GEN7_GPGPU_WALKER_ThreadGroupIDStartingX_bits  32
   126344 
   126345 static inline uint32_t ATTRIBUTE_PURE
   126346 GPGPU_WALKER_ThreadGroupIDStartingX_bits(const struct gen_device_info *devinfo)
   126347 {
   126348    switch (devinfo->gen) {
   126349    case 10: return 32;
   126350    case 9: return 32;
   126351    case 8: return 32;
   126352    case 7:
   126353       if (devinfo->is_haswell) {
   126354          return 32;
   126355       } else {
   126356          return 32;
   126357       }
   126358    case 6: return 0;
   126359    case 5: return 0;
   126360    case 4:
   126361       if (devinfo->is_g4x) {
   126362          return 0;
   126363       } else {
   126364          return 0;
   126365       }
   126366    default:
   126367       unreachable("Invalid hardware generation");
   126368    }
   126369 }
   126370 
   126371 
   126372 
   126373 #define GEN10_GPGPU_WALKER_ThreadGroupIDStartingX_start  160
   126374 #define GEN9_GPGPU_WALKER_ThreadGroupIDStartingX_start  160
   126375 #define GEN8_GPGPU_WALKER_ThreadGroupIDStartingX_start  160
   126376 #define GEN75_GPGPU_WALKER_ThreadGroupIDStartingX_start  96
   126377 #define GEN7_GPGPU_WALKER_ThreadGroupIDStartingX_start  96
   126378 
   126379 static inline uint32_t ATTRIBUTE_PURE
   126380 GPGPU_WALKER_ThreadGroupIDStartingX_start(const struct gen_device_info *devinfo)
   126381 {
   126382    switch (devinfo->gen) {
   126383    case 10: return 160;
   126384    case 9: return 160;
   126385    case 8: return 160;
   126386    case 7:
   126387       if (devinfo->is_haswell) {
   126388          return 96;
   126389       } else {
   126390          return 96;
   126391       }
   126392    case 6: return 0;
   126393    case 5: return 0;
   126394    case 4:
   126395       if (devinfo->is_g4x) {
   126396          return 0;
   126397       } else {
   126398          return 0;
   126399       }
   126400    default:
   126401       unreachable("Invalid hardware generation");
   126402    }
   126403 }
   126404 
   126405 
   126406 
   126407 /* GPGPU_WALKER::Thread Group ID Starting Y */
   126408 
   126409 
   126410 #define GEN10_GPGPU_WALKER_ThreadGroupIDStartingY_bits  32
   126411 #define GEN9_GPGPU_WALKER_ThreadGroupIDStartingY_bits  32
   126412 #define GEN8_GPGPU_WALKER_ThreadGroupIDStartingY_bits  32
   126413 #define GEN75_GPGPU_WALKER_ThreadGroupIDStartingY_bits  32
   126414 #define GEN7_GPGPU_WALKER_ThreadGroupIDStartingY_bits  32
   126415 
   126416 static inline uint32_t ATTRIBUTE_PURE
   126417 GPGPU_WALKER_ThreadGroupIDStartingY_bits(const struct gen_device_info *devinfo)
   126418 {
   126419    switch (devinfo->gen) {
   126420    case 10: return 32;
   126421    case 9: return 32;
   126422    case 8: return 32;
   126423    case 7:
   126424       if (devinfo->is_haswell) {
   126425          return 32;
   126426       } else {
   126427          return 32;
   126428       }
   126429    case 6: return 0;
   126430    case 5: return 0;
   126431    case 4:
   126432       if (devinfo->is_g4x) {
   126433          return 0;
   126434       } else {
   126435          return 0;
   126436       }
   126437    default:
   126438       unreachable("Invalid hardware generation");
   126439    }
   126440 }
   126441 
   126442 
   126443 
   126444 #define GEN10_GPGPU_WALKER_ThreadGroupIDStartingY_start  256
   126445 #define GEN9_GPGPU_WALKER_ThreadGroupIDStartingY_start  256
   126446 #define GEN8_GPGPU_WALKER_ThreadGroupIDStartingY_start  256
   126447 #define GEN75_GPGPU_WALKER_ThreadGroupIDStartingY_start  160
   126448 #define GEN7_GPGPU_WALKER_ThreadGroupIDStartingY_start  160
   126449 
   126450 static inline uint32_t ATTRIBUTE_PURE
   126451 GPGPU_WALKER_ThreadGroupIDStartingY_start(const struct gen_device_info *devinfo)
   126452 {
   126453    switch (devinfo->gen) {
   126454    case 10: return 256;
   126455    case 9: return 256;
   126456    case 8: return 256;
   126457    case 7:
   126458       if (devinfo->is_haswell) {
   126459          return 160;
   126460       } else {
   126461          return 160;
   126462       }
   126463    case 6: return 0;
   126464    case 5: return 0;
   126465    case 4:
   126466       if (devinfo->is_g4x) {
   126467          return 0;
   126468       } else {
   126469          return 0;
   126470       }
   126471    default:
   126472       unreachable("Invalid hardware generation");
   126473    }
   126474 }
   126475 
   126476 
   126477 
   126478 /* GPGPU_WALKER::Thread Group ID Starting Z */
   126479 
   126480 
   126481 #define GEN75_GPGPU_WALKER_ThreadGroupIDStartingZ_bits  32
   126482 #define GEN7_GPGPU_WALKER_ThreadGroupIDStartingZ_bits  32
   126483 
   126484 static inline uint32_t ATTRIBUTE_PURE
   126485 GPGPU_WALKER_ThreadGroupIDStartingZ_bits(const struct gen_device_info *devinfo)
   126486 {
   126487    switch (devinfo->gen) {
   126488    case 10: return 0;
   126489    case 9: return 0;
   126490    case 8: return 0;
   126491    case 7:
   126492       if (devinfo->is_haswell) {
   126493          return 32;
   126494       } else {
   126495          return 32;
   126496       }
   126497    case 6: return 0;
   126498    case 5: return 0;
   126499    case 4:
   126500       if (devinfo->is_g4x) {
   126501          return 0;
   126502       } else {
   126503          return 0;
   126504       }
   126505    default:
   126506       unreachable("Invalid hardware generation");
   126507    }
   126508 }
   126509 
   126510 
   126511 
   126512 #define GEN75_GPGPU_WALKER_ThreadGroupIDStartingZ_start  224
   126513 #define GEN7_GPGPU_WALKER_ThreadGroupIDStartingZ_start  224
   126514 
   126515 static inline uint32_t ATTRIBUTE_PURE
   126516 GPGPU_WALKER_ThreadGroupIDStartingZ_start(const struct gen_device_info *devinfo)
   126517 {
   126518    switch (devinfo->gen) {
   126519    case 10: return 0;
   126520    case 9: return 0;
   126521    case 8: return 0;
   126522    case 7:
   126523       if (devinfo->is_haswell) {
   126524          return 224;
   126525       } else {
   126526          return 224;
   126527       }
   126528    case 6: return 0;
   126529    case 5: return 0;
   126530    case 4:
   126531       if (devinfo->is_g4x) {
   126532          return 0;
   126533       } else {
   126534          return 0;
   126535       }
   126536    default:
   126537       unreachable("Invalid hardware generation");
   126538    }
   126539 }
   126540 
   126541 
   126542 
   126543 /* GPGPU_WALKER::Thread Group ID Starting/Resume Z */
   126544 
   126545 
   126546 #define GEN10_GPGPU_WALKER_ThreadGroupIDStartingResumeZ_bits  32
   126547 #define GEN9_GPGPU_WALKER_ThreadGroupIDStartingResumeZ_bits  32
   126548 #define GEN8_GPGPU_WALKER_ThreadGroupIDStartingResumeZ_bits  32
   126549 
   126550 static inline uint32_t ATTRIBUTE_PURE
   126551 GPGPU_WALKER_ThreadGroupIDStartingResumeZ_bits(const struct gen_device_info *devinfo)
   126552 {
   126553    switch (devinfo->gen) {
   126554    case 10: return 32;
   126555    case 9: return 32;
   126556    case 8: return 32;
   126557    case 7:
   126558       if (devinfo->is_haswell) {
   126559          return 0;
   126560       } else {
   126561          return 0;
   126562       }
   126563    case 6: return 0;
   126564    case 5: return 0;
   126565    case 4:
   126566       if (devinfo->is_g4x) {
   126567          return 0;
   126568       } else {
   126569          return 0;
   126570       }
   126571    default:
   126572       unreachable("Invalid hardware generation");
   126573    }
   126574 }
   126575 
   126576 
   126577 
   126578 #define GEN10_GPGPU_WALKER_ThreadGroupIDStartingResumeZ_start  352
   126579 #define GEN9_GPGPU_WALKER_ThreadGroupIDStartingResumeZ_start  352
   126580 #define GEN8_GPGPU_WALKER_ThreadGroupIDStartingResumeZ_start  352
   126581 
   126582 static inline uint32_t ATTRIBUTE_PURE
   126583 GPGPU_WALKER_ThreadGroupIDStartingResumeZ_start(const struct gen_device_info *devinfo)
   126584 {
   126585    switch (devinfo->gen) {
   126586    case 10: return 352;
   126587    case 9: return 352;
   126588    case 8: return 352;
   126589    case 7:
   126590       if (devinfo->is_haswell) {
   126591          return 0;
   126592       } else {
   126593          return 0;
   126594       }
   126595    case 6: return 0;
   126596    case 5: return 0;
   126597    case 4:
   126598       if (devinfo->is_g4x) {
   126599          return 0;
   126600       } else {
   126601          return 0;
   126602       }
   126603    default:
   126604       unreachable("Invalid hardware generation");
   126605    }
   126606 }
   126607 
   126608 
   126609 
   126610 /* GPGPU_WALKER::Thread Group ID X Dimension */
   126611 
   126612 
   126613 #define GEN10_GPGPU_WALKER_ThreadGroupIDXDimension_bits  32
   126614 #define GEN9_GPGPU_WALKER_ThreadGroupIDXDimension_bits  32
   126615 #define GEN8_GPGPU_WALKER_ThreadGroupIDXDimension_bits  32
   126616 #define GEN75_GPGPU_WALKER_ThreadGroupIDXDimension_bits  32
   126617 #define GEN7_GPGPU_WALKER_ThreadGroupIDXDimension_bits  32
   126618 
   126619 static inline uint32_t ATTRIBUTE_PURE
   126620 GPGPU_WALKER_ThreadGroupIDXDimension_bits(const struct gen_device_info *devinfo)
   126621 {
   126622    switch (devinfo->gen) {
   126623    case 10: return 32;
   126624    case 9: return 32;
   126625    case 8: return 32;
   126626    case 7:
   126627       if (devinfo->is_haswell) {
   126628          return 32;
   126629       } else {
   126630          return 32;
   126631       }
   126632    case 6: return 0;
   126633    case 5: return 0;
   126634    case 4:
   126635       if (devinfo->is_g4x) {
   126636          return 0;
   126637       } else {
   126638          return 0;
   126639       }
   126640    default:
   126641       unreachable("Invalid hardware generation");
   126642    }
   126643 }
   126644 
   126645 
   126646 
   126647 #define GEN10_GPGPU_WALKER_ThreadGroupIDXDimension_start  224
   126648 #define GEN9_GPGPU_WALKER_ThreadGroupIDXDimension_start  224
   126649 #define GEN8_GPGPU_WALKER_ThreadGroupIDXDimension_start  224
   126650 #define GEN75_GPGPU_WALKER_ThreadGroupIDXDimension_start  128
   126651 #define GEN7_GPGPU_WALKER_ThreadGroupIDXDimension_start  128
   126652 
   126653 static inline uint32_t ATTRIBUTE_PURE
   126654 GPGPU_WALKER_ThreadGroupIDXDimension_start(const struct gen_device_info *devinfo)
   126655 {
   126656    switch (devinfo->gen) {
   126657    case 10: return 224;
   126658    case 9: return 224;
   126659    case 8: return 224;
   126660    case 7:
   126661       if (devinfo->is_haswell) {
   126662          return 128;
   126663       } else {
   126664          return 128;
   126665       }
   126666    case 6: return 0;
   126667    case 5: return 0;
   126668    case 4:
   126669       if (devinfo->is_g4x) {
   126670          return 0;
   126671       } else {
   126672          return 0;
   126673       }
   126674    default:
   126675       unreachable("Invalid hardware generation");
   126676    }
   126677 }
   126678 
   126679 
   126680 
   126681 /* GPGPU_WALKER::Thread Group ID Y Dimension */
   126682 
   126683 
   126684 #define GEN10_GPGPU_WALKER_ThreadGroupIDYDimension_bits  32
   126685 #define GEN9_GPGPU_WALKER_ThreadGroupIDYDimension_bits  32
   126686 #define GEN8_GPGPU_WALKER_ThreadGroupIDYDimension_bits  32
   126687 #define GEN75_GPGPU_WALKER_ThreadGroupIDYDimension_bits  32
   126688 #define GEN7_GPGPU_WALKER_ThreadGroupIDYDimension_bits  32
   126689 
   126690 static inline uint32_t ATTRIBUTE_PURE
   126691 GPGPU_WALKER_ThreadGroupIDYDimension_bits(const struct gen_device_info *devinfo)
   126692 {
   126693    switch (devinfo->gen) {
   126694    case 10: return 32;
   126695    case 9: return 32;
   126696    case 8: return 32;
   126697    case 7:
   126698       if (devinfo->is_haswell) {
   126699          return 32;
   126700       } else {
   126701          return 32;
   126702       }
   126703    case 6: return 0;
   126704    case 5: return 0;
   126705    case 4:
   126706       if (devinfo->is_g4x) {
   126707          return 0;
   126708       } else {
   126709          return 0;
   126710       }
   126711    default:
   126712       unreachable("Invalid hardware generation");
   126713    }
   126714 }
   126715 
   126716 
   126717 
   126718 #define GEN10_GPGPU_WALKER_ThreadGroupIDYDimension_start  320
   126719 #define GEN9_GPGPU_WALKER_ThreadGroupIDYDimension_start  320
   126720 #define GEN8_GPGPU_WALKER_ThreadGroupIDYDimension_start  320
   126721 #define GEN75_GPGPU_WALKER_ThreadGroupIDYDimension_start  192
   126722 #define GEN7_GPGPU_WALKER_ThreadGroupIDYDimension_start  192
   126723 
   126724 static inline uint32_t ATTRIBUTE_PURE
   126725 GPGPU_WALKER_ThreadGroupIDYDimension_start(const struct gen_device_info *devinfo)
   126726 {
   126727    switch (devinfo->gen) {
   126728    case 10: return 320;
   126729    case 9: return 320;
   126730    case 8: return 320;
   126731    case 7:
   126732       if (devinfo->is_haswell) {
   126733          return 192;
   126734       } else {
   126735          return 192;
   126736       }
   126737    case 6: return 0;
   126738    case 5: return 0;
   126739    case 4:
   126740       if (devinfo->is_g4x) {
   126741          return 0;
   126742       } else {
   126743          return 0;
   126744       }
   126745    default:
   126746       unreachable("Invalid hardware generation");
   126747    }
   126748 }
   126749 
   126750 
   126751 
   126752 /* GPGPU_WALKER::Thread Group ID Z Dimension */
   126753 
   126754 
   126755 #define GEN10_GPGPU_WALKER_ThreadGroupIDZDimension_bits  32
   126756 #define GEN9_GPGPU_WALKER_ThreadGroupIDZDimension_bits  32
   126757 #define GEN8_GPGPU_WALKER_ThreadGroupIDZDimension_bits  32
   126758 #define GEN75_GPGPU_WALKER_ThreadGroupIDZDimension_bits  32
   126759 #define GEN7_GPGPU_WALKER_ThreadGroupIDZDimension_bits  32
   126760 
   126761 static inline uint32_t ATTRIBUTE_PURE
   126762 GPGPU_WALKER_ThreadGroupIDZDimension_bits(const struct gen_device_info *devinfo)
   126763 {
   126764    switch (devinfo->gen) {
   126765    case 10: return 32;
   126766    case 9: return 32;
   126767    case 8: return 32;
   126768    case 7:
   126769       if (devinfo->is_haswell) {
   126770          return 32;
   126771       } else {
   126772          return 32;
   126773       }
   126774    case 6: return 0;
   126775    case 5: return 0;
   126776    case 4:
   126777       if (devinfo->is_g4x) {
   126778          return 0;
   126779       } else {
   126780          return 0;
   126781       }
   126782    default:
   126783       unreachable("Invalid hardware generation");
   126784    }
   126785 }
   126786 
   126787 
   126788 
   126789 #define GEN10_GPGPU_WALKER_ThreadGroupIDZDimension_start  384
   126790 #define GEN9_GPGPU_WALKER_ThreadGroupIDZDimension_start  384
   126791 #define GEN8_GPGPU_WALKER_ThreadGroupIDZDimension_start  384
   126792 #define GEN75_GPGPU_WALKER_ThreadGroupIDZDimension_start  256
   126793 #define GEN7_GPGPU_WALKER_ThreadGroupIDZDimension_start  256
   126794 
   126795 static inline uint32_t ATTRIBUTE_PURE
   126796 GPGPU_WALKER_ThreadGroupIDZDimension_start(const struct gen_device_info *devinfo)
   126797 {
   126798    switch (devinfo->gen) {
   126799    case 10: return 384;
   126800    case 9: return 384;
   126801    case 8: return 384;
   126802    case 7:
   126803       if (devinfo->is_haswell) {
   126804          return 256;
   126805       } else {
   126806          return 256;
   126807       }
   126808    case 6: return 0;
   126809    case 5: return 0;
   126810    case 4:
   126811       if (devinfo->is_g4x) {
   126812          return 0;
   126813       } else {
   126814          return 0;
   126815       }
   126816    default:
   126817       unreachable("Invalid hardware generation");
   126818    }
   126819 }
   126820 
   126821 
   126822 
   126823 /* GPGPU_WALKER::Thread Height Counter Maximum */
   126824 
   126825 
   126826 #define GEN10_GPGPU_WALKER_ThreadHeightCounterMaximum_bits  6
   126827 #define GEN9_GPGPU_WALKER_ThreadHeightCounterMaximum_bits  6
   126828 #define GEN8_GPGPU_WALKER_ThreadHeightCounterMaximum_bits  6
   126829 #define GEN75_GPGPU_WALKER_ThreadHeightCounterMaximum_bits  6
   126830 #define GEN7_GPGPU_WALKER_ThreadHeightCounterMaximum_bits  6
   126831 
   126832 static inline uint32_t ATTRIBUTE_PURE
   126833 GPGPU_WALKER_ThreadHeightCounterMaximum_bits(const struct gen_device_info *devinfo)
   126834 {
   126835    switch (devinfo->gen) {
   126836    case 10: return 6;
   126837    case 9: return 6;
   126838    case 8: return 6;
   126839    case 7:
   126840       if (devinfo->is_haswell) {
   126841          return 6;
   126842       } else {
   126843          return 6;
   126844       }
   126845    case 6: return 0;
   126846    case 5: return 0;
   126847    case 4:
   126848       if (devinfo->is_g4x) {
   126849          return 0;
   126850       } else {
   126851          return 0;
   126852       }
   126853    default:
   126854       unreachable("Invalid hardware generation");
   126855    }
   126856 }
   126857 
   126858 
   126859 
   126860 #define GEN10_GPGPU_WALKER_ThreadHeightCounterMaximum_start  136
   126861 #define GEN9_GPGPU_WALKER_ThreadHeightCounterMaximum_start  136
   126862 #define GEN8_GPGPU_WALKER_ThreadHeightCounterMaximum_start  136
   126863 #define GEN75_GPGPU_WALKER_ThreadHeightCounterMaximum_start  72
   126864 #define GEN7_GPGPU_WALKER_ThreadHeightCounterMaximum_start  72
   126865 
   126866 static inline uint32_t ATTRIBUTE_PURE
   126867 GPGPU_WALKER_ThreadHeightCounterMaximum_start(const struct gen_device_info *devinfo)
   126868 {
   126869    switch (devinfo->gen) {
   126870    case 10: return 136;
   126871    case 9: return 136;
   126872    case 8: return 136;
   126873    case 7:
   126874       if (devinfo->is_haswell) {
   126875          return 72;
   126876       } else {
   126877          return 72;
   126878       }
   126879    case 6: return 0;
   126880    case 5: return 0;
   126881    case 4:
   126882       if (devinfo->is_g4x) {
   126883          return 0;
   126884       } else {
   126885          return 0;
   126886       }
   126887    default:
   126888       unreachable("Invalid hardware generation");
   126889    }
   126890 }
   126891 
   126892 
   126893 
   126894 /* GPGPU_WALKER::Thread Width Counter Maximum */
   126895 
   126896 
   126897 #define GEN10_GPGPU_WALKER_ThreadWidthCounterMaximum_bits  6
   126898 #define GEN9_GPGPU_WALKER_ThreadWidthCounterMaximum_bits  6
   126899 #define GEN8_GPGPU_WALKER_ThreadWidthCounterMaximum_bits  6
   126900 #define GEN75_GPGPU_WALKER_ThreadWidthCounterMaximum_bits  6
   126901 #define GEN7_GPGPU_WALKER_ThreadWidthCounterMaximum_bits  6
   126902 
   126903 static inline uint32_t ATTRIBUTE_PURE
   126904 GPGPU_WALKER_ThreadWidthCounterMaximum_bits(const struct gen_device_info *devinfo)
   126905 {
   126906    switch (devinfo->gen) {
   126907    case 10: return 6;
   126908    case 9: return 6;
   126909    case 8: return 6;
   126910    case 7:
   126911       if (devinfo->is_haswell) {
   126912          return 6;
   126913       } else {
   126914          return 6;
   126915       }
   126916    case 6: return 0;
   126917    case 5: return 0;
   126918    case 4:
   126919       if (devinfo->is_g4x) {
   126920          return 0;
   126921       } else {
   126922          return 0;
   126923       }
   126924    default:
   126925       unreachable("Invalid hardware generation");
   126926    }
   126927 }
   126928 
   126929 
   126930 
   126931 #define GEN10_GPGPU_WALKER_ThreadWidthCounterMaximum_start  128
   126932 #define GEN9_GPGPU_WALKER_ThreadWidthCounterMaximum_start  128
   126933 #define GEN8_GPGPU_WALKER_ThreadWidthCounterMaximum_start  128
   126934 #define GEN75_GPGPU_WALKER_ThreadWidthCounterMaximum_start  64
   126935 #define GEN7_GPGPU_WALKER_ThreadWidthCounterMaximum_start  64
   126936 
   126937 static inline uint32_t ATTRIBUTE_PURE
   126938 GPGPU_WALKER_ThreadWidthCounterMaximum_start(const struct gen_device_info *devinfo)
   126939 {
   126940    switch (devinfo->gen) {
   126941    case 10: return 128;
   126942    case 9: return 128;
   126943    case 8: return 128;
   126944    case 7:
   126945       if (devinfo->is_haswell) {
   126946          return 64;
   126947       } else {
   126948          return 64;
   126949       }
   126950    case 6: return 0;
   126951    case 5: return 0;
   126952    case 4:
   126953       if (devinfo->is_g4x) {
   126954          return 0;
   126955       } else {
   126956          return 0;
   126957       }
   126958    default:
   126959       unreachable("Invalid hardware generation");
   126960    }
   126961 }
   126962 
   126963 
   126964 
   126965 /* GS_INVOCATION_COUNT */
   126966 
   126967 
   126968 #define GEN10_GS_INVOCATION_COUNT_length  2
   126969 #define GEN9_GS_INVOCATION_COUNT_length  2
   126970 #define GEN8_GS_INVOCATION_COUNT_length  2
   126971 #define GEN75_GS_INVOCATION_COUNT_length  2
   126972 #define GEN7_GS_INVOCATION_COUNT_length  2
   126973 
   126974 static inline uint32_t ATTRIBUTE_PURE
   126975 GS_INVOCATION_COUNT_length(const struct gen_device_info *devinfo)
   126976 {
   126977    switch (devinfo->gen) {
   126978    case 10: return 2;
   126979    case 9: return 2;
   126980    case 8: return 2;
   126981    case 7:
   126982       if (devinfo->is_haswell) {
   126983          return 2;
   126984       } else {
   126985          return 2;
   126986       }
   126987    case 6: return 0;
   126988    case 5: return 0;
   126989    case 4:
   126990       if (devinfo->is_g4x) {
   126991          return 0;
   126992       } else {
   126993          return 0;
   126994       }
   126995    default:
   126996       unreachable("Invalid hardware generation");
   126997    }
   126998 }
   126999 
   127000 
   127001 
   127002 /* GS_INVOCATION_COUNT::GS Invocation Count Report */
   127003 
   127004 
   127005 #define GEN10_GS_INVOCATION_COUNT_GSInvocationCountReport_bits  64
   127006 #define GEN9_GS_INVOCATION_COUNT_GSInvocationCountReport_bits  64
   127007 #define GEN8_GS_INVOCATION_COUNT_GSInvocationCountReport_bits  64
   127008 #define GEN75_GS_INVOCATION_COUNT_GSInvocationCountReport_bits  64
   127009 #define GEN7_GS_INVOCATION_COUNT_GSInvocationCountReport_bits  64
   127010 
   127011 static inline uint32_t ATTRIBUTE_PURE
   127012 GS_INVOCATION_COUNT_GSInvocationCountReport_bits(const struct gen_device_info *devinfo)
   127013 {
   127014    switch (devinfo->gen) {
   127015    case 10: return 64;
   127016    case 9: return 64;
   127017    case 8: return 64;
   127018    case 7:
   127019       if (devinfo->is_haswell) {
   127020          return 64;
   127021       } else {
   127022          return 64;
   127023       }
   127024    case 6: return 0;
   127025    case 5: return 0;
   127026    case 4:
   127027       if (devinfo->is_g4x) {
   127028          return 0;
   127029       } else {
   127030          return 0;
   127031       }
   127032    default:
   127033       unreachable("Invalid hardware generation");
   127034    }
   127035 }
   127036 
   127037 
   127038 
   127039 #define GEN10_GS_INVOCATION_COUNT_GSInvocationCountReport_start  0
   127040 #define GEN9_GS_INVOCATION_COUNT_GSInvocationCountReport_start  0
   127041 #define GEN8_GS_INVOCATION_COUNT_GSInvocationCountReport_start  0
   127042 #define GEN75_GS_INVOCATION_COUNT_GSInvocationCountReport_start  0
   127043 #define GEN7_GS_INVOCATION_COUNT_GSInvocationCountReport_start  0
   127044 
   127045 static inline uint32_t ATTRIBUTE_PURE
   127046 GS_INVOCATION_COUNT_GSInvocationCountReport_start(const struct gen_device_info *devinfo)
   127047 {
   127048    switch (devinfo->gen) {
   127049    case 10: return 0;
   127050    case 9: return 0;
   127051    case 8: return 0;
   127052    case 7:
   127053       if (devinfo->is_haswell) {
   127054          return 0;
   127055       } else {
   127056          return 0;
   127057       }
   127058    case 6: return 0;
   127059    case 5: return 0;
   127060    case 4:
   127061       if (devinfo->is_g4x) {
   127062          return 0;
   127063       } else {
   127064          return 0;
   127065       }
   127066    default:
   127067       unreachable("Invalid hardware generation");
   127068    }
   127069 }
   127070 
   127071 
   127072 
   127073 /* GS_PRIMITIVES_COUNT */
   127074 
   127075 
   127076 #define GEN10_GS_PRIMITIVES_COUNT_length  2
   127077 #define GEN9_GS_PRIMITIVES_COUNT_length  2
   127078 #define GEN8_GS_PRIMITIVES_COUNT_length  2
   127079 #define GEN75_GS_PRIMITIVES_COUNT_length  2
   127080 #define GEN7_GS_PRIMITIVES_COUNT_length  2
   127081 
   127082 static inline uint32_t ATTRIBUTE_PURE
   127083 GS_PRIMITIVES_COUNT_length(const struct gen_device_info *devinfo)
   127084 {
   127085    switch (devinfo->gen) {
   127086    case 10: return 2;
   127087    case 9: return 2;
   127088    case 8: return 2;
   127089    case 7:
   127090       if (devinfo->is_haswell) {
   127091          return 2;
   127092       } else {
   127093          return 2;
   127094       }
   127095    case 6: return 0;
   127096    case 5: return 0;
   127097    case 4:
   127098       if (devinfo->is_g4x) {
   127099          return 0;
   127100       } else {
   127101          return 0;
   127102       }
   127103    default:
   127104       unreachable("Invalid hardware generation");
   127105    }
   127106 }
   127107 
   127108 
   127109 
   127110 /* GS_PRIMITIVES_COUNT::GS Primitives Count Report */
   127111 
   127112 
   127113 #define GEN10_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_bits  64
   127114 #define GEN9_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_bits  64
   127115 #define GEN8_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_bits  64
   127116 #define GEN75_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_bits  64
   127117 #define GEN7_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_bits  64
   127118 
   127119 static inline uint32_t ATTRIBUTE_PURE
   127120 GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_bits(const struct gen_device_info *devinfo)
   127121 {
   127122    switch (devinfo->gen) {
   127123    case 10: return 64;
   127124    case 9: return 64;
   127125    case 8: return 64;
   127126    case 7:
   127127       if (devinfo->is_haswell) {
   127128          return 64;
   127129       } else {
   127130          return 64;
   127131       }
   127132    case 6: return 0;
   127133    case 5: return 0;
   127134    case 4:
   127135       if (devinfo->is_g4x) {
   127136          return 0;
   127137       } else {
   127138          return 0;
   127139       }
   127140    default:
   127141       unreachable("Invalid hardware generation");
   127142    }
   127143 }
   127144 
   127145 
   127146 
   127147 #define GEN10_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_start  0
   127148 #define GEN9_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_start  0
   127149 #define GEN8_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_start  0
   127150 #define GEN75_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_start  0
   127151 #define GEN7_GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_start  0
   127152 
   127153 static inline uint32_t ATTRIBUTE_PURE
   127154 GS_PRIMITIVES_COUNT_GSPrimitivesCountReport_start(const struct gen_device_info *devinfo)
   127155 {
   127156    switch (devinfo->gen) {
   127157    case 10: return 0;
   127158    case 9: return 0;
   127159    case 8: return 0;
   127160    case 7:
   127161       if (devinfo->is_haswell) {
   127162          return 0;
   127163       } else {
   127164          return 0;
   127165       }
   127166    case 6: return 0;
   127167    case 5: return 0;
   127168    case 4:
   127169       if (devinfo->is_g4x) {
   127170          return 0;
   127171       } else {
   127172          return 0;
   127173       }
   127174    default:
   127175       unreachable("Invalid hardware generation");
   127176    }
   127177 }
   127178 
   127179 
   127180 
   127181 /* GS_STATE */
   127182 
   127183 
   127184 #define GEN5_GS_STATE_length  7
   127185 #define GEN45_GS_STATE_length  7
   127186 #define GEN4_GS_STATE_length  7
   127187 
   127188 static inline uint32_t ATTRIBUTE_PURE
   127189 GS_STATE_length(const struct gen_device_info *devinfo)
   127190 {
   127191    switch (devinfo->gen) {
   127192    case 10: return 0;
   127193    case 9: return 0;
   127194    case 8: return 0;
   127195    case 7:
   127196       if (devinfo->is_haswell) {
   127197          return 0;
   127198       } else {
   127199          return 0;
   127200       }
   127201    case 6: return 0;
   127202    case 5: return 7;
   127203    case 4:
   127204       if (devinfo->is_g4x) {
   127205          return 7;
   127206       } else {
   127207          return 7;
   127208       }
   127209    default:
   127210       unreachable("Invalid hardware generation");
   127211    }
   127212 }
   127213 
   127214 
   127215 
   127216 /* GS_STATE::Binding Table Entry Count */
   127217 
   127218 
   127219 #define GEN5_GS_STATE_BindingTableEntryCount_bits  8
   127220 #define GEN45_GS_STATE_BindingTableEntryCount_bits  8
   127221 #define GEN4_GS_STATE_BindingTableEntryCount_bits  8
   127222 
   127223 static inline uint32_t ATTRIBUTE_PURE
   127224 GS_STATE_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   127225 {
   127226    switch (devinfo->gen) {
   127227    case 10: return 0;
   127228    case 9: return 0;
   127229    case 8: return 0;
   127230    case 7:
   127231       if (devinfo->is_haswell) {
   127232          return 0;
   127233       } else {
   127234          return 0;
   127235       }
   127236    case 6: return 0;
   127237    case 5: return 8;
   127238    case 4:
   127239       if (devinfo->is_g4x) {
   127240          return 8;
   127241       } else {
   127242          return 8;
   127243       }
   127244    default:
   127245       unreachable("Invalid hardware generation");
   127246    }
   127247 }
   127248 
   127249 
   127250 
   127251 #define GEN5_GS_STATE_BindingTableEntryCount_start  50
   127252 #define GEN45_GS_STATE_BindingTableEntryCount_start  50
   127253 #define GEN4_GS_STATE_BindingTableEntryCount_start  50
   127254 
   127255 static inline uint32_t ATTRIBUTE_PURE
   127256 GS_STATE_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   127257 {
   127258    switch (devinfo->gen) {
   127259    case 10: return 0;
   127260    case 9: return 0;
   127261    case 8: return 0;
   127262    case 7:
   127263       if (devinfo->is_haswell) {
   127264          return 0;
   127265       } else {
   127266          return 0;
   127267       }
   127268    case 6: return 0;
   127269    case 5: return 50;
   127270    case 4:
   127271       if (devinfo->is_g4x) {
   127272          return 50;
   127273       } else {
   127274          return 50;
   127275       }
   127276    default:
   127277       unreachable("Invalid hardware generation");
   127278    }
   127279 }
   127280 
   127281 
   127282 
   127283 /* GS_STATE::Constant URB Entry Read Length */
   127284 
   127285 
   127286 #define GEN5_GS_STATE_ConstantURBEntryReadLength_bits  6
   127287 #define GEN45_GS_STATE_ConstantURBEntryReadLength_bits  6
   127288 #define GEN4_GS_STATE_ConstantURBEntryReadLength_bits  6
   127289 
   127290 static inline uint32_t ATTRIBUTE_PURE
   127291 GS_STATE_ConstantURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   127292 {
   127293    switch (devinfo->gen) {
   127294    case 10: return 0;
   127295    case 9: return 0;
   127296    case 8: return 0;
   127297    case 7:
   127298       if (devinfo->is_haswell) {
   127299          return 0;
   127300       } else {
   127301          return 0;
   127302       }
   127303    case 6: return 0;
   127304    case 5: return 6;
   127305    case 4:
   127306       if (devinfo->is_g4x) {
   127307          return 6;
   127308       } else {
   127309          return 6;
   127310       }
   127311    default:
   127312       unreachable("Invalid hardware generation");
   127313    }
   127314 }
   127315 
   127316 
   127317 
   127318 #define GEN5_GS_STATE_ConstantURBEntryReadLength_start  121
   127319 #define GEN45_GS_STATE_ConstantURBEntryReadLength_start  121
   127320 #define GEN4_GS_STATE_ConstantURBEntryReadLength_start  121
   127321 
   127322 static inline uint32_t ATTRIBUTE_PURE
   127323 GS_STATE_ConstantURBEntryReadLength_start(const struct gen_device_info *devinfo)
   127324 {
   127325    switch (devinfo->gen) {
   127326    case 10: return 0;
   127327    case 9: return 0;
   127328    case 8: return 0;
   127329    case 7:
   127330       if (devinfo->is_haswell) {
   127331          return 0;
   127332       } else {
   127333          return 0;
   127334       }
   127335    case 6: return 0;
   127336    case 5: return 121;
   127337    case 4:
   127338       if (devinfo->is_g4x) {
   127339          return 121;
   127340       } else {
   127341          return 121;
   127342       }
   127343    default:
   127344       unreachable("Invalid hardware generation");
   127345    }
   127346 }
   127347 
   127348 
   127349 
   127350 /* GS_STATE::Constant URB Entry Read Offset */
   127351 
   127352 
   127353 #define GEN5_GS_STATE_ConstantURBEntryReadOffset_bits  6
   127354 #define GEN45_GS_STATE_ConstantURBEntryReadOffset_bits  6
   127355 #define GEN4_GS_STATE_ConstantURBEntryReadOffset_bits  6
   127356 
   127357 static inline uint32_t ATTRIBUTE_PURE
   127358 GS_STATE_ConstantURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   127359 {
   127360    switch (devinfo->gen) {
   127361    case 10: return 0;
   127362    case 9: return 0;
   127363    case 8: return 0;
   127364    case 7:
   127365       if (devinfo->is_haswell) {
   127366          return 0;
   127367       } else {
   127368          return 0;
   127369       }
   127370    case 6: return 0;
   127371    case 5: return 6;
   127372    case 4:
   127373       if (devinfo->is_g4x) {
   127374          return 6;
   127375       } else {
   127376          return 6;
   127377       }
   127378    default:
   127379       unreachable("Invalid hardware generation");
   127380    }
   127381 }
   127382 
   127383 
   127384 
   127385 #define GEN5_GS_STATE_ConstantURBEntryReadOffset_start  114
   127386 #define GEN45_GS_STATE_ConstantURBEntryReadOffset_start  114
   127387 #define GEN4_GS_STATE_ConstantURBEntryReadOffset_start  114
   127388 
   127389 static inline uint32_t ATTRIBUTE_PURE
   127390 GS_STATE_ConstantURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   127391 {
   127392    switch (devinfo->gen) {
   127393    case 10: return 0;
   127394    case 9: return 0;
   127395    case 8: return 0;
   127396    case 7:
   127397       if (devinfo->is_haswell) {
   127398          return 0;
   127399       } else {
   127400          return 0;
   127401       }
   127402    case 6: return 0;
   127403    case 5: return 114;
   127404    case 4:
   127405       if (devinfo->is_g4x) {
   127406          return 114;
   127407       } else {
   127408          return 114;
   127409       }
   127410    default:
   127411       unreachable("Invalid hardware generation");
   127412    }
   127413 }
   127414 
   127415 
   127416 
   127417 /* GS_STATE::Discard Adjacency */
   127418 
   127419 
   127420 #define GEN45_GS_STATE_DiscardAdjacency_bits  1
   127421 #define GEN4_GS_STATE_DiscardAdjacency_bits  1
   127422 
   127423 static inline uint32_t ATTRIBUTE_PURE
   127424 GS_STATE_DiscardAdjacency_bits(const struct gen_device_info *devinfo)
   127425 {
   127426    switch (devinfo->gen) {
   127427    case 10: return 0;
   127428    case 9: return 0;
   127429    case 8: return 0;
   127430    case 7:
   127431       if (devinfo->is_haswell) {
   127432          return 0;
   127433       } else {
   127434          return 0;
   127435       }
   127436    case 6: return 0;
   127437    case 5: return 0;
   127438    case 4:
   127439       if (devinfo->is_g4x) {
   127440          return 1;
   127441       } else {
   127442          return 1;
   127443       }
   127444    default:
   127445       unreachable("Invalid hardware generation");
   127446    }
   127447 }
   127448 
   127449 
   127450 
   127451 #define GEN45_GS_STATE_DiscardAdjacency_start  221
   127452 #define GEN4_GS_STATE_DiscardAdjacency_start  221
   127453 
   127454 static inline uint32_t ATTRIBUTE_PURE
   127455 GS_STATE_DiscardAdjacency_start(const struct gen_device_info *devinfo)
   127456 {
   127457    switch (devinfo->gen) {
   127458    case 10: return 0;
   127459    case 9: return 0;
   127460    case 8: return 0;
   127461    case 7:
   127462       if (devinfo->is_haswell) {
   127463          return 0;
   127464       } else {
   127465          return 0;
   127466       }
   127467    case 6: return 0;
   127468    case 5: return 0;
   127469    case 4:
   127470       if (devinfo->is_g4x) {
   127471          return 221;
   127472       } else {
   127473          return 221;
   127474       }
   127475    default:
   127476       unreachable("Invalid hardware generation");
   127477    }
   127478 }
   127479 
   127480 
   127481 
   127482 /* GS_STATE::Dispatch GRF Start Register For URB Data */
   127483 
   127484 
   127485 #define GEN5_GS_STATE_DispatchGRFStartRegisterForURBData_bits  4
   127486 #define GEN45_GS_STATE_DispatchGRFStartRegisterForURBData_bits  4
   127487 #define GEN4_GS_STATE_DispatchGRFStartRegisterForURBData_bits  4
   127488 
   127489 static inline uint32_t ATTRIBUTE_PURE
   127490 GS_STATE_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   127491 {
   127492    switch (devinfo->gen) {
   127493    case 10: return 0;
   127494    case 9: return 0;
   127495    case 8: return 0;
   127496    case 7:
   127497       if (devinfo->is_haswell) {
   127498          return 0;
   127499       } else {
   127500          return 0;
   127501       }
   127502    case 6: return 0;
   127503    case 5: return 4;
   127504    case 4:
   127505       if (devinfo->is_g4x) {
   127506          return 4;
   127507       } else {
   127508          return 4;
   127509       }
   127510    default:
   127511       unreachable("Invalid hardware generation");
   127512    }
   127513 }
   127514 
   127515 
   127516 
   127517 #define GEN5_GS_STATE_DispatchGRFStartRegisterForURBData_start  96
   127518 #define GEN45_GS_STATE_DispatchGRFStartRegisterForURBData_start  96
   127519 #define GEN4_GS_STATE_DispatchGRFStartRegisterForURBData_start  96
   127520 
   127521 static inline uint32_t ATTRIBUTE_PURE
   127522 GS_STATE_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   127523 {
   127524    switch (devinfo->gen) {
   127525    case 10: return 0;
   127526    case 9: return 0;
   127527    case 8: return 0;
   127528    case 7:
   127529       if (devinfo->is_haswell) {
   127530          return 0;
   127531       } else {
   127532          return 0;
   127533       }
   127534    case 6: return 0;
   127535    case 5: return 96;
   127536    case 4:
   127537       if (devinfo->is_g4x) {
   127538          return 96;
   127539       } else {
   127540          return 96;
   127541       }
   127542    default:
   127543       unreachable("Invalid hardware generation");
   127544    }
   127545 }
   127546 
   127547 
   127548 
   127549 /* GS_STATE::Floating Point Mode */
   127550 
   127551 
   127552 #define GEN5_GS_STATE_FloatingPointMode_bits  1
   127553 #define GEN45_GS_STATE_FloatingPointMode_bits  1
   127554 #define GEN4_GS_STATE_FloatingPointMode_bits  1
   127555 
   127556 static inline uint32_t ATTRIBUTE_PURE
   127557 GS_STATE_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   127558 {
   127559    switch (devinfo->gen) {
   127560    case 10: return 0;
   127561    case 9: return 0;
   127562    case 8: return 0;
   127563    case 7:
   127564       if (devinfo->is_haswell) {
   127565          return 0;
   127566       } else {
   127567          return 0;
   127568       }
   127569    case 6: return 0;
   127570    case 5: return 1;
   127571    case 4:
   127572       if (devinfo->is_g4x) {
   127573          return 1;
   127574       } else {
   127575          return 1;
   127576       }
   127577    default:
   127578       unreachable("Invalid hardware generation");
   127579    }
   127580 }
   127581 
   127582 
   127583 
   127584 #define GEN5_GS_STATE_FloatingPointMode_start  48
   127585 #define GEN45_GS_STATE_FloatingPointMode_start  48
   127586 #define GEN4_GS_STATE_FloatingPointMode_start  48
   127587 
   127588 static inline uint32_t ATTRIBUTE_PURE
   127589 GS_STATE_FloatingPointMode_start(const struct gen_device_info *devinfo)
   127590 {
   127591    switch (devinfo->gen) {
   127592    case 10: return 0;
   127593    case 9: return 0;
   127594    case 8: return 0;
   127595    case 7:
   127596       if (devinfo->is_haswell) {
   127597          return 0;
   127598       } else {
   127599          return 0;
   127600       }
   127601    case 6: return 0;
   127602    case 5: return 48;
   127603    case 4:
   127604       if (devinfo->is_g4x) {
   127605          return 48;
   127606       } else {
   127607          return 48;
   127608       }
   127609    default:
   127610       unreachable("Invalid hardware generation");
   127611    }
   127612 }
   127613 
   127614 
   127615 
   127616 /* GS_STATE::GRF Register Count */
   127617 
   127618 
   127619 #define GEN5_GS_STATE_GRFRegisterCount_bits  3
   127620 #define GEN45_GS_STATE_GRFRegisterCount_bits  3
   127621 #define GEN4_GS_STATE_GRFRegisterCount_bits  3
   127622 
   127623 static inline uint32_t ATTRIBUTE_PURE
   127624 GS_STATE_GRFRegisterCount_bits(const struct gen_device_info *devinfo)
   127625 {
   127626    switch (devinfo->gen) {
   127627    case 10: return 0;
   127628    case 9: return 0;
   127629    case 8: return 0;
   127630    case 7:
   127631       if (devinfo->is_haswell) {
   127632          return 0;
   127633       } else {
   127634          return 0;
   127635       }
   127636    case 6: return 0;
   127637    case 5: return 3;
   127638    case 4:
   127639       if (devinfo->is_g4x) {
   127640          return 3;
   127641       } else {
   127642          return 3;
   127643       }
   127644    default:
   127645       unreachable("Invalid hardware generation");
   127646    }
   127647 }
   127648 
   127649 
   127650 
   127651 #define GEN5_GS_STATE_GRFRegisterCount_start  1
   127652 #define GEN45_GS_STATE_GRFRegisterCount_start  1
   127653 #define GEN4_GS_STATE_GRFRegisterCount_start  1
   127654 
   127655 static inline uint32_t ATTRIBUTE_PURE
   127656 GS_STATE_GRFRegisterCount_start(const struct gen_device_info *devinfo)
   127657 {
   127658    switch (devinfo->gen) {
   127659    case 10: return 0;
   127660    case 9: return 0;
   127661    case 8: return 0;
   127662    case 7:
   127663       if (devinfo->is_haswell) {
   127664          return 0;
   127665       } else {
   127666          return 0;
   127667       }
   127668    case 6: return 0;
   127669    case 5: return 1;
   127670    case 4:
   127671       if (devinfo->is_g4x) {
   127672          return 1;
   127673       } else {
   127674          return 1;
   127675       }
   127676    default:
   127677       unreachable("Invalid hardware generation");
   127678    }
   127679 }
   127680 
   127681 
   127682 
   127683 /* GS_STATE::GS Statistics Enable */
   127684 
   127685 
   127686 #define GEN5_GS_STATE_GSStatisticsEnable_bits  1
   127687 #define GEN45_GS_STATE_GSStatisticsEnable_bits  1
   127688 
   127689 static inline uint32_t ATTRIBUTE_PURE
   127690 GS_STATE_GSStatisticsEnable_bits(const struct gen_device_info *devinfo)
   127691 {
   127692    switch (devinfo->gen) {
   127693    case 10: return 0;
   127694    case 9: return 0;
   127695    case 8: return 0;
   127696    case 7:
   127697       if (devinfo->is_haswell) {
   127698          return 0;
   127699       } else {
   127700          return 0;
   127701       }
   127702    case 6: return 0;
   127703    case 5: return 1;
   127704    case 4:
   127705       if (devinfo->is_g4x) {
   127706          return 1;
   127707       } else {
   127708          return 0;
   127709       }
   127710    default:
   127711       unreachable("Invalid hardware generation");
   127712    }
   127713 }
   127714 
   127715 
   127716 
   127717 #define GEN5_GS_STATE_GSStatisticsEnable_start  138
   127718 #define GEN45_GS_STATE_GSStatisticsEnable_start  138
   127719 
   127720 static inline uint32_t ATTRIBUTE_PURE
   127721 GS_STATE_GSStatisticsEnable_start(const struct gen_device_info *devinfo)
   127722 {
   127723    switch (devinfo->gen) {
   127724    case 10: return 0;
   127725    case 9: return 0;
   127726    case 8: return 0;
   127727    case 7:
   127728       if (devinfo->is_haswell) {
   127729          return 0;
   127730       } else {
   127731          return 0;
   127732       }
   127733    case 6: return 0;
   127734    case 5: return 138;
   127735    case 4:
   127736       if (devinfo->is_g4x) {
   127737          return 138;
   127738       } else {
   127739          return 0;
   127740       }
   127741    default:
   127742       unreachable("Invalid hardware generation");
   127743    }
   127744 }
   127745 
   127746 
   127747 
   127748 /* GS_STATE::Illegal Opcode Exception Enable */
   127749 
   127750 
   127751 #define GEN5_GS_STATE_IllegalOpcodeExceptionEnable_bits  1
   127752 #define GEN45_GS_STATE_IllegalOpcodeExceptionEnable_bits  1
   127753 #define GEN4_GS_STATE_IllegalOpcodeExceptionEnable_bits  1
   127754 
   127755 static inline uint32_t ATTRIBUTE_PURE
   127756 GS_STATE_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   127757 {
   127758    switch (devinfo->gen) {
   127759    case 10: return 0;
   127760    case 9: return 0;
   127761    case 8: return 0;
   127762    case 7:
   127763       if (devinfo->is_haswell) {
   127764          return 0;
   127765       } else {
   127766          return 0;
   127767       }
   127768    case 6: return 0;
   127769    case 5: return 1;
   127770    case 4:
   127771       if (devinfo->is_g4x) {
   127772          return 1;
   127773       } else {
   127774          return 1;
   127775       }
   127776    default:
   127777       unreachable("Invalid hardware generation");
   127778    }
   127779 }
   127780 
   127781 
   127782 
   127783 #define GEN5_GS_STATE_IllegalOpcodeExceptionEnable_start  45
   127784 #define GEN45_GS_STATE_IllegalOpcodeExceptionEnable_start  45
   127785 #define GEN4_GS_STATE_IllegalOpcodeExceptionEnable_start  45
   127786 
   127787 static inline uint32_t ATTRIBUTE_PURE
   127788 GS_STATE_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   127789 {
   127790    switch (devinfo->gen) {
   127791    case 10: return 0;
   127792    case 9: return 0;
   127793    case 8: return 0;
   127794    case 7:
   127795       if (devinfo->is_haswell) {
   127796          return 0;
   127797       } else {
   127798          return 0;
   127799       }
   127800    case 6: return 0;
   127801    case 5: return 45;
   127802    case 4:
   127803       if (devinfo->is_g4x) {
   127804          return 45;
   127805       } else {
   127806          return 45;
   127807       }
   127808    default:
   127809       unreachable("Invalid hardware generation");
   127810    }
   127811 }
   127812 
   127813 
   127814 
   127815 /* GS_STATE::Kernel Start Pointer */
   127816 
   127817 
   127818 #define GEN5_GS_STATE_KernelStartPointer_bits  26
   127819 #define GEN45_GS_STATE_KernelStartPointer_bits  26
   127820 #define GEN4_GS_STATE_KernelStartPointer_bits  26
   127821 
   127822 static inline uint32_t ATTRIBUTE_PURE
   127823 GS_STATE_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   127824 {
   127825    switch (devinfo->gen) {
   127826    case 10: return 0;
   127827    case 9: return 0;
   127828    case 8: return 0;
   127829    case 7:
   127830       if (devinfo->is_haswell) {
   127831          return 0;
   127832       } else {
   127833          return 0;
   127834       }
   127835    case 6: return 0;
   127836    case 5: return 26;
   127837    case 4:
   127838       if (devinfo->is_g4x) {
   127839          return 26;
   127840       } else {
   127841          return 26;
   127842       }
   127843    default:
   127844       unreachable("Invalid hardware generation");
   127845    }
   127846 }
   127847 
   127848 
   127849 
   127850 #define GEN5_GS_STATE_KernelStartPointer_start  6
   127851 #define GEN45_GS_STATE_KernelStartPointer_start  6
   127852 #define GEN4_GS_STATE_KernelStartPointer_start  6
   127853 
   127854 static inline uint32_t ATTRIBUTE_PURE
   127855 GS_STATE_KernelStartPointer_start(const struct gen_device_info *devinfo)
   127856 {
   127857    switch (devinfo->gen) {
   127858    case 10: return 0;
   127859    case 9: return 0;
   127860    case 8: return 0;
   127861    case 7:
   127862       if (devinfo->is_haswell) {
   127863          return 0;
   127864       } else {
   127865          return 0;
   127866       }
   127867    case 6: return 0;
   127868    case 5: return 6;
   127869    case 4:
   127870       if (devinfo->is_g4x) {
   127871          return 6;
   127872       } else {
   127873          return 6;
   127874       }
   127875    default:
   127876       unreachable("Invalid hardware generation");
   127877    }
   127878 }
   127879 
   127880 
   127881 
   127882 /* GS_STATE::Mask Stack Exception Enable */
   127883 
   127884 
   127885 #define GEN5_GS_STATE_MaskStackExceptionEnable_bits  1
   127886 #define GEN45_GS_STATE_MaskStackExceptionEnable_bits  1
   127887 #define GEN4_GS_STATE_MaskStackExceptionEnable_bits  1
   127888 
   127889 static inline uint32_t ATTRIBUTE_PURE
   127890 GS_STATE_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   127891 {
   127892    switch (devinfo->gen) {
   127893    case 10: return 0;
   127894    case 9: return 0;
   127895    case 8: return 0;
   127896    case 7:
   127897       if (devinfo->is_haswell) {
   127898          return 0;
   127899       } else {
   127900          return 0;
   127901       }
   127902    case 6: return 0;
   127903    case 5: return 1;
   127904    case 4:
   127905       if (devinfo->is_g4x) {
   127906          return 1;
   127907       } else {
   127908          return 1;
   127909       }
   127910    default:
   127911       unreachable("Invalid hardware generation");
   127912    }
   127913 }
   127914 
   127915 
   127916 
   127917 #define GEN5_GS_STATE_MaskStackExceptionEnable_start  43
   127918 #define GEN45_GS_STATE_MaskStackExceptionEnable_start  43
   127919 #define GEN4_GS_STATE_MaskStackExceptionEnable_start  43
   127920 
   127921 static inline uint32_t ATTRIBUTE_PURE
   127922 GS_STATE_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   127923 {
   127924    switch (devinfo->gen) {
   127925    case 10: return 0;
   127926    case 9: return 0;
   127927    case 8: return 0;
   127928    case 7:
   127929       if (devinfo->is_haswell) {
   127930          return 0;
   127931       } else {
   127932          return 0;
   127933       }
   127934    case 6: return 0;
   127935    case 5: return 43;
   127936    case 4:
   127937       if (devinfo->is_g4x) {
   127938          return 43;
   127939       } else {
   127940          return 43;
   127941       }
   127942    default:
   127943       unreachable("Invalid hardware generation");
   127944    }
   127945 }
   127946 
   127947 
   127948 
   127949 /* GS_STATE::Maximum Number of Threads */
   127950 
   127951 
   127952 #define GEN5_GS_STATE_MaximumNumberofThreads_bits  6
   127953 #define GEN45_GS_STATE_MaximumNumberofThreads_bits  6
   127954 #define GEN4_GS_STATE_MaximumNumberofThreads_bits  6
   127955 
   127956 static inline uint32_t ATTRIBUTE_PURE
   127957 GS_STATE_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   127958 {
   127959    switch (devinfo->gen) {
   127960    case 10: return 0;
   127961    case 9: return 0;
   127962    case 8: return 0;
   127963    case 7:
   127964       if (devinfo->is_haswell) {
   127965          return 0;
   127966       } else {
   127967          return 0;
   127968       }
   127969    case 6: return 0;
   127970    case 5: return 6;
   127971    case 4:
   127972       if (devinfo->is_g4x) {
   127973          return 6;
   127974       } else {
   127975          return 6;
   127976       }
   127977    default:
   127978       unreachable("Invalid hardware generation");
   127979    }
   127980 }
   127981 
   127982 
   127983 
   127984 #define GEN5_GS_STATE_MaximumNumberofThreads_start  153
   127985 #define GEN45_GS_STATE_MaximumNumberofThreads_start  153
   127986 #define GEN4_GS_STATE_MaximumNumberofThreads_start  153
   127987 
   127988 static inline uint32_t ATTRIBUTE_PURE
   127989 GS_STATE_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   127990 {
   127991    switch (devinfo->gen) {
   127992    case 10: return 0;
   127993    case 9: return 0;
   127994    case 8: return 0;
   127995    case 7:
   127996       if (devinfo->is_haswell) {
   127997          return 0;
   127998       } else {
   127999          return 0;
   128000       }
   128001    case 6: return 0;
   128002    case 5: return 153;
   128003    case 4:
   128004       if (devinfo->is_g4x) {
   128005          return 153;
   128006       } else {
   128007          return 153;
   128008       }
   128009    default:
   128010       unreachable("Invalid hardware generation");
   128011    }
   128012 }
   128013 
   128014 
   128015 
   128016 /* GS_STATE::Maximum VPIndex */
   128017 
   128018 
   128019 #define GEN5_GS_STATE_MaximumVPIndex_bits  4
   128020 #define GEN45_GS_STATE_MaximumVPIndex_bits  4
   128021 #define GEN4_GS_STATE_MaximumVPIndex_bits  4
   128022 
   128023 static inline uint32_t ATTRIBUTE_PURE
   128024 GS_STATE_MaximumVPIndex_bits(const struct gen_device_info *devinfo)
   128025 {
   128026    switch (devinfo->gen) {
   128027    case 10: return 0;
   128028    case 9: return 0;
   128029    case 8: return 0;
   128030    case 7:
   128031       if (devinfo->is_haswell) {
   128032          return 0;
   128033       } else {
   128034          return 0;
   128035       }
   128036    case 6: return 0;
   128037    case 5: return 4;
   128038    case 4:
   128039       if (devinfo->is_g4x) {
   128040          return 4;
   128041       } else {
   128042          return 4;
   128043       }
   128044    default:
   128045       unreachable("Invalid hardware generation");
   128046    }
   128047 }
   128048 
   128049 
   128050 
   128051 #define GEN5_GS_STATE_MaximumVPIndex_start  192
   128052 #define GEN45_GS_STATE_MaximumVPIndex_start  192
   128053 #define GEN4_GS_STATE_MaximumVPIndex_start  192
   128054 
   128055 static inline uint32_t ATTRIBUTE_PURE
   128056 GS_STATE_MaximumVPIndex_start(const struct gen_device_info *devinfo)
   128057 {
   128058    switch (devinfo->gen) {
   128059    case 10: return 0;
   128060    case 9: return 0;
   128061    case 8: return 0;
   128062    case 7:
   128063       if (devinfo->is_haswell) {
   128064          return 0;
   128065       } else {
   128066          return 0;
   128067       }
   128068    case 6: return 0;
   128069    case 5: return 192;
   128070    case 4:
   128071       if (devinfo->is_g4x) {
   128072          return 192;
   128073       } else {
   128074          return 192;
   128075       }
   128076    default:
   128077       unreachable("Invalid hardware generation");
   128078    }
   128079 }
   128080 
   128081 
   128082 
   128083 /* GS_STATE::Number of URB Entries */
   128084 
   128085 
   128086 #define GEN5_GS_STATE_NumberofURBEntries_bits  8
   128087 #define GEN45_GS_STATE_NumberofURBEntries_bits  8
   128088 #define GEN4_GS_STATE_NumberofURBEntries_bits  8
   128089 
   128090 static inline uint32_t ATTRIBUTE_PURE
   128091 GS_STATE_NumberofURBEntries_bits(const struct gen_device_info *devinfo)
   128092 {
   128093    switch (devinfo->gen) {
   128094    case 10: return 0;
   128095    case 9: return 0;
   128096    case 8: return 0;
   128097    case 7:
   128098       if (devinfo->is_haswell) {
   128099          return 0;
   128100       } else {
   128101          return 0;
   128102       }
   128103    case 6: return 0;
   128104    case 5: return 8;
   128105    case 4:
   128106       if (devinfo->is_g4x) {
   128107          return 8;
   128108       } else {
   128109          return 8;
   128110       }
   128111    default:
   128112       unreachable("Invalid hardware generation");
   128113    }
   128114 }
   128115 
   128116 
   128117 
   128118 #define GEN5_GS_STATE_NumberofURBEntries_start  139
   128119 #define GEN45_GS_STATE_NumberofURBEntries_start  139
   128120 #define GEN4_GS_STATE_NumberofURBEntries_start  139
   128121 
   128122 static inline uint32_t ATTRIBUTE_PURE
   128123 GS_STATE_NumberofURBEntries_start(const struct gen_device_info *devinfo)
   128124 {
   128125    switch (devinfo->gen) {
   128126    case 10: return 0;
   128127    case 9: return 0;
   128128    case 8: return 0;
   128129    case 7:
   128130       if (devinfo->is_haswell) {
   128131          return 0;
   128132       } else {
   128133          return 0;
   128134       }
   128135    case 6: return 0;
   128136    case 5: return 139;
   128137    case 4:
   128138       if (devinfo->is_g4x) {
   128139          return 139;
   128140       } else {
   128141          return 139;
   128142       }
   128143    default:
   128144       unreachable("Invalid hardware generation");
   128145    }
   128146 }
   128147 
   128148 
   128149 
   128150 /* GS_STATE::Per-Thread Scratch Space */
   128151 
   128152 
   128153 #define GEN5_GS_STATE_PerThreadScratchSpace_bits  4
   128154 #define GEN45_GS_STATE_PerThreadScratchSpace_bits  4
   128155 #define GEN4_GS_STATE_PerThreadScratchSpace_bits  4
   128156 
   128157 static inline uint32_t ATTRIBUTE_PURE
   128158 GS_STATE_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   128159 {
   128160    switch (devinfo->gen) {
   128161    case 10: return 0;
   128162    case 9: return 0;
   128163    case 8: return 0;
   128164    case 7:
   128165       if (devinfo->is_haswell) {
   128166          return 0;
   128167       } else {
   128168          return 0;
   128169       }
   128170    case 6: return 0;
   128171    case 5: return 4;
   128172    case 4:
   128173       if (devinfo->is_g4x) {
   128174          return 4;
   128175       } else {
   128176          return 4;
   128177       }
   128178    default:
   128179       unreachable("Invalid hardware generation");
   128180    }
   128181 }
   128182 
   128183 
   128184 
   128185 #define GEN5_GS_STATE_PerThreadScratchSpace_start  64
   128186 #define GEN45_GS_STATE_PerThreadScratchSpace_start  64
   128187 #define GEN4_GS_STATE_PerThreadScratchSpace_start  64
   128188 
   128189 static inline uint32_t ATTRIBUTE_PURE
   128190 GS_STATE_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   128191 {
   128192    switch (devinfo->gen) {
   128193    case 10: return 0;
   128194    case 9: return 0;
   128195    case 8: return 0;
   128196    case 7:
   128197       if (devinfo->is_haswell) {
   128198          return 0;
   128199       } else {
   128200          return 0;
   128201       }
   128202    case 6: return 0;
   128203    case 5: return 64;
   128204    case 4:
   128205       if (devinfo->is_g4x) {
   128206          return 64;
   128207       } else {
   128208          return 64;
   128209       }
   128210    default:
   128211       unreachable("Invalid hardware generation");
   128212    }
   128213 }
   128214 
   128215 
   128216 
   128217 /* GS_STATE::Rendering Enable */
   128218 
   128219 
   128220 #define GEN45_GS_STATE_RenderingEnable_bits  1
   128221 
   128222 static inline uint32_t ATTRIBUTE_PURE
   128223 GS_STATE_RenderingEnable_bits(const struct gen_device_info *devinfo)
   128224 {
   128225    switch (devinfo->gen) {
   128226    case 10: return 0;
   128227    case 9: return 0;
   128228    case 8: return 0;
   128229    case 7:
   128230       if (devinfo->is_haswell) {
   128231          return 0;
   128232       } else {
   128233          return 0;
   128234       }
   128235    case 6: return 0;
   128236    case 5: return 0;
   128237    case 4:
   128238       if (devinfo->is_g4x) {
   128239          return 1;
   128240       } else {
   128241          return 0;
   128242       }
   128243    default:
   128244       unreachable("Invalid hardware generation");
   128245    }
   128246 }
   128247 
   128248 
   128249 
   128250 #define GEN45_GS_STATE_RenderingEnable_start  136
   128251 
   128252 static inline uint32_t ATTRIBUTE_PURE
   128253 GS_STATE_RenderingEnable_start(const struct gen_device_info *devinfo)
   128254 {
   128255    switch (devinfo->gen) {
   128256    case 10: return 0;
   128257    case 9: return 0;
   128258    case 8: return 0;
   128259    case 7:
   128260       if (devinfo->is_haswell) {
   128261          return 0;
   128262       } else {
   128263          return 0;
   128264       }
   128265    case 6: return 0;
   128266    case 5: return 0;
   128267    case 4:
   128268       if (devinfo->is_g4x) {
   128269          return 136;
   128270       } else {
   128271          return 0;
   128272       }
   128273    default:
   128274       unreachable("Invalid hardware generation");
   128275    }
   128276 }
   128277 
   128278 
   128279 
   128280 /* GS_STATE::Rendering Enabled */
   128281 
   128282 
   128283 #define GEN5_GS_STATE_RenderingEnabled_bits  1
   128284 
   128285 static inline uint32_t ATTRIBUTE_PURE
   128286 GS_STATE_RenderingEnabled_bits(const struct gen_device_info *devinfo)
   128287 {
   128288    switch (devinfo->gen) {
   128289    case 10: return 0;
   128290    case 9: return 0;
   128291    case 8: return 0;
   128292    case 7:
   128293       if (devinfo->is_haswell) {
   128294          return 0;
   128295       } else {
   128296          return 0;
   128297       }
   128298    case 6: return 0;
   128299    case 5: return 1;
   128300    case 4:
   128301       if (devinfo->is_g4x) {
   128302          return 0;
   128303       } else {
   128304          return 0;
   128305       }
   128306    default:
   128307       unreachable("Invalid hardware generation");
   128308    }
   128309 }
   128310 
   128311 
   128312 
   128313 #define GEN5_GS_STATE_RenderingEnabled_start  136
   128314 
   128315 static inline uint32_t ATTRIBUTE_PURE
   128316 GS_STATE_RenderingEnabled_start(const struct gen_device_info *devinfo)
   128317 {
   128318    switch (devinfo->gen) {
   128319    case 10: return 0;
   128320    case 9: return 0;
   128321    case 8: return 0;
   128322    case 7:
   128323       if (devinfo->is_haswell) {
   128324          return 0;
   128325       } else {
   128326          return 0;
   128327       }
   128328    case 6: return 0;
   128329    case 5: return 136;
   128330    case 4:
   128331       if (devinfo->is_g4x) {
   128332          return 0;
   128333       } else {
   128334          return 0;
   128335       }
   128336    default:
   128337       unreachable("Invalid hardware generation");
   128338    }
   128339 }
   128340 
   128341 
   128342 
   128343 /* GS_STATE::Reorder Enable */
   128344 
   128345 
   128346 #define GEN5_GS_STATE_ReorderEnable_bits  1
   128347 #define GEN45_GS_STATE_ReorderEnable_bits  1
   128348 #define GEN4_GS_STATE_ReorderEnable_bits  1
   128349 
   128350 static inline uint32_t ATTRIBUTE_PURE
   128351 GS_STATE_ReorderEnable_bits(const struct gen_device_info *devinfo)
   128352 {
   128353    switch (devinfo->gen) {
   128354    case 10: return 0;
   128355    case 9: return 0;
   128356    case 8: return 0;
   128357    case 7:
   128358       if (devinfo->is_haswell) {
   128359          return 0;
   128360       } else {
   128361          return 0;
   128362       }
   128363    case 6: return 0;
   128364    case 5: return 1;
   128365    case 4:
   128366       if (devinfo->is_g4x) {
   128367          return 1;
   128368       } else {
   128369          return 1;
   128370       }
   128371    default:
   128372       unreachable("Invalid hardware generation");
   128373    }
   128374 }
   128375 
   128376 
   128377 
   128378 #define GEN5_GS_STATE_ReorderEnable_start  222
   128379 #define GEN45_GS_STATE_ReorderEnable_start  222
   128380 #define GEN4_GS_STATE_ReorderEnable_start  222
   128381 
   128382 static inline uint32_t ATTRIBUTE_PURE
   128383 GS_STATE_ReorderEnable_start(const struct gen_device_info *devinfo)
   128384 {
   128385    switch (devinfo->gen) {
   128386    case 10: return 0;
   128387    case 9: return 0;
   128388    case 8: return 0;
   128389    case 7:
   128390       if (devinfo->is_haswell) {
   128391          return 0;
   128392       } else {
   128393          return 0;
   128394       }
   128395    case 6: return 0;
   128396    case 5: return 222;
   128397    case 4:
   128398       if (devinfo->is_g4x) {
   128399          return 222;
   128400       } else {
   128401          return 222;
   128402       }
   128403    default:
   128404       unreachable("Invalid hardware generation");
   128405    }
   128406 }
   128407 
   128408 
   128409 
   128410 /* GS_STATE::SO Statistics Enable */
   128411 
   128412 
   128413 #define GEN5_GS_STATE_SOStatisticsEnable_bits  1
   128414 
   128415 static inline uint32_t ATTRIBUTE_PURE
   128416 GS_STATE_SOStatisticsEnable_bits(const struct gen_device_info *devinfo)
   128417 {
   128418    switch (devinfo->gen) {
   128419    case 10: return 0;
   128420    case 9: return 0;
   128421    case 8: return 0;
   128422    case 7:
   128423       if (devinfo->is_haswell) {
   128424          return 0;
   128425       } else {
   128426          return 0;
   128427       }
   128428    case 6: return 0;
   128429    case 5: return 1;
   128430    case 4:
   128431       if (devinfo->is_g4x) {
   128432          return 0;
   128433       } else {
   128434          return 0;
   128435       }
   128436    default:
   128437       unreachable("Invalid hardware generation");
   128438    }
   128439 }
   128440 
   128441 
   128442 
   128443 #define GEN5_GS_STATE_SOStatisticsEnable_start  137
   128444 
   128445 static inline uint32_t ATTRIBUTE_PURE
   128446 GS_STATE_SOStatisticsEnable_start(const struct gen_device_info *devinfo)
   128447 {
   128448    switch (devinfo->gen) {
   128449    case 10: return 0;
   128450    case 9: return 0;
   128451    case 8: return 0;
   128452    case 7:
   128453       if (devinfo->is_haswell) {
   128454          return 0;
   128455       } else {
   128456          return 0;
   128457       }
   128458    case 6: return 0;
   128459    case 5: return 137;
   128460    case 4:
   128461       if (devinfo->is_g4x) {
   128462          return 0;
   128463       } else {
   128464          return 0;
   128465       }
   128466    default:
   128467       unreachable("Invalid hardware generation");
   128468    }
   128469 }
   128470 
   128471 
   128472 
   128473 /* GS_STATE::Sampler Count */
   128474 
   128475 
   128476 #define GEN5_GS_STATE_SamplerCount_bits  3
   128477 #define GEN45_GS_STATE_SamplerCount_bits  3
   128478 #define GEN4_GS_STATE_SamplerCount_bits  3
   128479 
   128480 static inline uint32_t ATTRIBUTE_PURE
   128481 GS_STATE_SamplerCount_bits(const struct gen_device_info *devinfo)
   128482 {
   128483    switch (devinfo->gen) {
   128484    case 10: return 0;
   128485    case 9: return 0;
   128486    case 8: return 0;
   128487    case 7:
   128488       if (devinfo->is_haswell) {
   128489          return 0;
   128490       } else {
   128491          return 0;
   128492       }
   128493    case 6: return 0;
   128494    case 5: return 3;
   128495    case 4:
   128496       if (devinfo->is_g4x) {
   128497          return 3;
   128498       } else {
   128499          return 3;
   128500       }
   128501    default:
   128502       unreachable("Invalid hardware generation");
   128503    }
   128504 }
   128505 
   128506 
   128507 
   128508 #define GEN5_GS_STATE_SamplerCount_start  160
   128509 #define GEN45_GS_STATE_SamplerCount_start  160
   128510 #define GEN4_GS_STATE_SamplerCount_start  160
   128511 
   128512 static inline uint32_t ATTRIBUTE_PURE
   128513 GS_STATE_SamplerCount_start(const struct gen_device_info *devinfo)
   128514 {
   128515    switch (devinfo->gen) {
   128516    case 10: return 0;
   128517    case 9: return 0;
   128518    case 8: return 0;
   128519    case 7:
   128520       if (devinfo->is_haswell) {
   128521          return 0;
   128522       } else {
   128523          return 0;
   128524       }
   128525    case 6: return 0;
   128526    case 5: return 160;
   128527    case 4:
   128528       if (devinfo->is_g4x) {
   128529          return 160;
   128530       } else {
   128531          return 160;
   128532       }
   128533    default:
   128534       unreachable("Invalid hardware generation");
   128535    }
   128536 }
   128537 
   128538 
   128539 
   128540 /* GS_STATE::Sampler State Pointer */
   128541 
   128542 
   128543 #define GEN5_GS_STATE_SamplerStatePointer_bits  27
   128544 #define GEN45_GS_STATE_SamplerStatePointer_bits  27
   128545 #define GEN4_GS_STATE_SamplerStatePointer_bits  27
   128546 
   128547 static inline uint32_t ATTRIBUTE_PURE
   128548 GS_STATE_SamplerStatePointer_bits(const struct gen_device_info *devinfo)
   128549 {
   128550    switch (devinfo->gen) {
   128551    case 10: return 0;
   128552    case 9: return 0;
   128553    case 8: return 0;
   128554    case 7:
   128555       if (devinfo->is_haswell) {
   128556          return 0;
   128557       } else {
   128558          return 0;
   128559       }
   128560    case 6: return 0;
   128561    case 5: return 27;
   128562    case 4:
   128563       if (devinfo->is_g4x) {
   128564          return 27;
   128565       } else {
   128566          return 27;
   128567       }
   128568    default:
   128569       unreachable("Invalid hardware generation");
   128570    }
   128571 }
   128572 
   128573 
   128574 
   128575 #define GEN5_GS_STATE_SamplerStatePointer_start  165
   128576 #define GEN45_GS_STATE_SamplerStatePointer_start  165
   128577 #define GEN4_GS_STATE_SamplerStatePointer_start  165
   128578 
   128579 static inline uint32_t ATTRIBUTE_PURE
   128580 GS_STATE_SamplerStatePointer_start(const struct gen_device_info *devinfo)
   128581 {
   128582    switch (devinfo->gen) {
   128583    case 10: return 0;
   128584    case 9: return 0;
   128585    case 8: return 0;
   128586    case 7:
   128587       if (devinfo->is_haswell) {
   128588          return 0;
   128589       } else {
   128590          return 0;
   128591       }
   128592    case 6: return 0;
   128593    case 5: return 165;
   128594    case 4:
   128595       if (devinfo->is_g4x) {
   128596          return 165;
   128597       } else {
   128598          return 165;
   128599       }
   128600    default:
   128601       unreachable("Invalid hardware generation");
   128602    }
   128603 }
   128604 
   128605 
   128606 
   128607 /* GS_STATE::Scratch Space Base Pointer */
   128608 
   128609 
   128610 #define GEN5_GS_STATE_ScratchSpaceBasePointer_bits  22
   128611 #define GEN45_GS_STATE_ScratchSpaceBasePointer_bits  22
   128612 #define GEN4_GS_STATE_ScratchSpaceBasePointer_bits  22
   128613 
   128614 static inline uint32_t ATTRIBUTE_PURE
   128615 GS_STATE_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   128616 {
   128617    switch (devinfo->gen) {
   128618    case 10: return 0;
   128619    case 9: return 0;
   128620    case 8: return 0;
   128621    case 7:
   128622       if (devinfo->is_haswell) {
   128623          return 0;
   128624       } else {
   128625          return 0;
   128626       }
   128627    case 6: return 0;
   128628    case 5: return 22;
   128629    case 4:
   128630       if (devinfo->is_g4x) {
   128631          return 22;
   128632       } else {
   128633          return 22;
   128634       }
   128635    default:
   128636       unreachable("Invalid hardware generation");
   128637    }
   128638 }
   128639 
   128640 
   128641 
   128642 #define GEN5_GS_STATE_ScratchSpaceBasePointer_start  74
   128643 #define GEN45_GS_STATE_ScratchSpaceBasePointer_start  74
   128644 #define GEN4_GS_STATE_ScratchSpaceBasePointer_start  74
   128645 
   128646 static inline uint32_t ATTRIBUTE_PURE
   128647 GS_STATE_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   128648 {
   128649    switch (devinfo->gen) {
   128650    case 10: return 0;
   128651    case 9: return 0;
   128652    case 8: return 0;
   128653    case 7:
   128654       if (devinfo->is_haswell) {
   128655          return 0;
   128656       } else {
   128657          return 0;
   128658       }
   128659    case 6: return 0;
   128660    case 5: return 74;
   128661    case 4:
   128662       if (devinfo->is_g4x) {
   128663          return 74;
   128664       } else {
   128665          return 74;
   128666       }
   128667    default:
   128668       unreachable("Invalid hardware generation");
   128669    }
   128670 }
   128671 
   128672 
   128673 
   128674 /* GS_STATE::Single Program Flow */
   128675 
   128676 
   128677 #define GEN5_GS_STATE_SingleProgramFlow_bits  1
   128678 #define GEN45_GS_STATE_SingleProgramFlow_bits  1
   128679 #define GEN4_GS_STATE_SingleProgramFlow_bits  1
   128680 
   128681 static inline uint32_t ATTRIBUTE_PURE
   128682 GS_STATE_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   128683 {
   128684    switch (devinfo->gen) {
   128685    case 10: return 0;
   128686    case 9: return 0;
   128687    case 8: return 0;
   128688    case 7:
   128689       if (devinfo->is_haswell) {
   128690          return 0;
   128691       } else {
   128692          return 0;
   128693       }
   128694    case 6: return 0;
   128695    case 5: return 1;
   128696    case 4:
   128697       if (devinfo->is_g4x) {
   128698          return 1;
   128699       } else {
   128700          return 1;
   128701       }
   128702    default:
   128703       unreachable("Invalid hardware generation");
   128704    }
   128705 }
   128706 
   128707 
   128708 
   128709 #define GEN5_GS_STATE_SingleProgramFlow_start  63
   128710 #define GEN45_GS_STATE_SingleProgramFlow_start  63
   128711 #define GEN4_GS_STATE_SingleProgramFlow_start  63
   128712 
   128713 static inline uint32_t ATTRIBUTE_PURE
   128714 GS_STATE_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   128715 {
   128716    switch (devinfo->gen) {
   128717    case 10: return 0;
   128718    case 9: return 0;
   128719    case 8: return 0;
   128720    case 7:
   128721       if (devinfo->is_haswell) {
   128722          return 0;
   128723       } else {
   128724          return 0;
   128725       }
   128726    case 6: return 0;
   128727    case 5: return 63;
   128728    case 4:
   128729       if (devinfo->is_g4x) {
   128730          return 63;
   128731       } else {
   128732          return 63;
   128733       }
   128734    default:
   128735       unreachable("Invalid hardware generation");
   128736    }
   128737 }
   128738 
   128739 
   128740 
   128741 /* GS_STATE::Software  Exception Enable */
   128742 
   128743 
   128744 #define GEN5_GS_STATE_SoftwareExceptionEnable_bits  1
   128745 #define GEN45_GS_STATE_SoftwareExceptionEnable_bits  1
   128746 #define GEN4_GS_STATE_SoftwareExceptionEnable_bits  1
   128747 
   128748 static inline uint32_t ATTRIBUTE_PURE
   128749 GS_STATE_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   128750 {
   128751    switch (devinfo->gen) {
   128752    case 10: return 0;
   128753    case 9: return 0;
   128754    case 8: return 0;
   128755    case 7:
   128756       if (devinfo->is_haswell) {
   128757          return 0;
   128758       } else {
   128759          return 0;
   128760       }
   128761    case 6: return 0;
   128762    case 5: return 1;
   128763    case 4:
   128764       if (devinfo->is_g4x) {
   128765          return 1;
   128766       } else {
   128767          return 1;
   128768       }
   128769    default:
   128770       unreachable("Invalid hardware generation");
   128771    }
   128772 }
   128773 
   128774 
   128775 
   128776 #define GEN5_GS_STATE_SoftwareExceptionEnable_start  39
   128777 #define GEN45_GS_STATE_SoftwareExceptionEnable_start  39
   128778 #define GEN4_GS_STATE_SoftwareExceptionEnable_start  39
   128779 
   128780 static inline uint32_t ATTRIBUTE_PURE
   128781 GS_STATE_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   128782 {
   128783    switch (devinfo->gen) {
   128784    case 10: return 0;
   128785    case 9: return 0;
   128786    case 8: return 0;
   128787    case 7:
   128788       if (devinfo->is_haswell) {
   128789          return 0;
   128790       } else {
   128791          return 0;
   128792       }
   128793    case 6: return 0;
   128794    case 5: return 39;
   128795    case 4:
   128796       if (devinfo->is_g4x) {
   128797          return 39;
   128798       } else {
   128799          return 39;
   128800       }
   128801    default:
   128802       unreachable("Invalid hardware generation");
   128803    }
   128804 }
   128805 
   128806 
   128807 
   128808 /* GS_STATE::URB Entry Allocation Size */
   128809 
   128810 
   128811 #define GEN5_GS_STATE_URBEntryAllocationSize_bits  5
   128812 #define GEN45_GS_STATE_URBEntryAllocationSize_bits  5
   128813 #define GEN4_GS_STATE_URBEntryAllocationSize_bits  5
   128814 
   128815 static inline uint32_t ATTRIBUTE_PURE
   128816 GS_STATE_URBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   128817 {
   128818    switch (devinfo->gen) {
   128819    case 10: return 0;
   128820    case 9: return 0;
   128821    case 8: return 0;
   128822    case 7:
   128823       if (devinfo->is_haswell) {
   128824          return 0;
   128825       } else {
   128826          return 0;
   128827       }
   128828    case 6: return 0;
   128829    case 5: return 5;
   128830    case 4:
   128831       if (devinfo->is_g4x) {
   128832          return 5;
   128833       } else {
   128834          return 5;
   128835       }
   128836    default:
   128837       unreachable("Invalid hardware generation");
   128838    }
   128839 }
   128840 
   128841 
   128842 
   128843 #define GEN5_GS_STATE_URBEntryAllocationSize_start  147
   128844 #define GEN45_GS_STATE_URBEntryAllocationSize_start  147
   128845 #define GEN4_GS_STATE_URBEntryAllocationSize_start  147
   128846 
   128847 static inline uint32_t ATTRIBUTE_PURE
   128848 GS_STATE_URBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   128849 {
   128850    switch (devinfo->gen) {
   128851    case 10: return 0;
   128852    case 9: return 0;
   128853    case 8: return 0;
   128854    case 7:
   128855       if (devinfo->is_haswell) {
   128856          return 0;
   128857       } else {
   128858          return 0;
   128859       }
   128860    case 6: return 0;
   128861    case 5: return 147;
   128862    case 4:
   128863       if (devinfo->is_g4x) {
   128864          return 147;
   128865       } else {
   128866          return 147;
   128867       }
   128868    default:
   128869       unreachable("Invalid hardware generation");
   128870    }
   128871 }
   128872 
   128873 
   128874 
   128875 /* GS_STATE::Vertex URB Entry Read Length */
   128876 
   128877 
   128878 #define GEN5_GS_STATE_VertexURBEntryReadLength_bits  6
   128879 #define GEN45_GS_STATE_VertexURBEntryReadLength_bits  6
   128880 #define GEN4_GS_STATE_VertexURBEntryReadLength_bits  6
   128881 
   128882 static inline uint32_t ATTRIBUTE_PURE
   128883 GS_STATE_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   128884 {
   128885    switch (devinfo->gen) {
   128886    case 10: return 0;
   128887    case 9: return 0;
   128888    case 8: return 0;
   128889    case 7:
   128890       if (devinfo->is_haswell) {
   128891          return 0;
   128892       } else {
   128893          return 0;
   128894       }
   128895    case 6: return 0;
   128896    case 5: return 6;
   128897    case 4:
   128898       if (devinfo->is_g4x) {
   128899          return 6;
   128900       } else {
   128901          return 6;
   128902       }
   128903    default:
   128904       unreachable("Invalid hardware generation");
   128905    }
   128906 }
   128907 
   128908 
   128909 
   128910 #define GEN5_GS_STATE_VertexURBEntryReadLength_start  107
   128911 #define GEN45_GS_STATE_VertexURBEntryReadLength_start  107
   128912 #define GEN4_GS_STATE_VertexURBEntryReadLength_start  107
   128913 
   128914 static inline uint32_t ATTRIBUTE_PURE
   128915 GS_STATE_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   128916 {
   128917    switch (devinfo->gen) {
   128918    case 10: return 0;
   128919    case 9: return 0;
   128920    case 8: return 0;
   128921    case 7:
   128922       if (devinfo->is_haswell) {
   128923          return 0;
   128924       } else {
   128925          return 0;
   128926       }
   128927    case 6: return 0;
   128928    case 5: return 107;
   128929    case 4:
   128930       if (devinfo->is_g4x) {
   128931          return 107;
   128932       } else {
   128933          return 107;
   128934       }
   128935    default:
   128936       unreachable("Invalid hardware generation");
   128937    }
   128938 }
   128939 
   128940 
   128941 
   128942 /* GS_STATE::Vertex URB Entry Read Offset */
   128943 
   128944 
   128945 #define GEN5_GS_STATE_VertexURBEntryReadOffset_bits  6
   128946 #define GEN45_GS_STATE_VertexURBEntryReadOffset_bits  6
   128947 #define GEN4_GS_STATE_VertexURBEntryReadOffset_bits  6
   128948 
   128949 static inline uint32_t ATTRIBUTE_PURE
   128950 GS_STATE_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   128951 {
   128952    switch (devinfo->gen) {
   128953    case 10: return 0;
   128954    case 9: return 0;
   128955    case 8: return 0;
   128956    case 7:
   128957       if (devinfo->is_haswell) {
   128958          return 0;
   128959       } else {
   128960          return 0;
   128961       }
   128962    case 6: return 0;
   128963    case 5: return 6;
   128964    case 4:
   128965       if (devinfo->is_g4x) {
   128966          return 6;
   128967       } else {
   128968          return 6;
   128969       }
   128970    default:
   128971       unreachable("Invalid hardware generation");
   128972    }
   128973 }
   128974 
   128975 
   128976 
   128977 #define GEN5_GS_STATE_VertexURBEntryReadOffset_start  100
   128978 #define GEN45_GS_STATE_VertexURBEntryReadOffset_start  100
   128979 #define GEN4_GS_STATE_VertexURBEntryReadOffset_start  100
   128980 
   128981 static inline uint32_t ATTRIBUTE_PURE
   128982 GS_STATE_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   128983 {
   128984    switch (devinfo->gen) {
   128985    case 10: return 0;
   128986    case 9: return 0;
   128987    case 8: return 0;
   128988    case 7:
   128989       if (devinfo->is_haswell) {
   128990          return 0;
   128991       } else {
   128992          return 0;
   128993       }
   128994    case 6: return 0;
   128995    case 5: return 100;
   128996    case 4:
   128997       if (devinfo->is_g4x) {
   128998          return 100;
   128999       } else {
   129000          return 100;
   129001       }
   129002    default:
   129003       unreachable("Invalid hardware generation");
   129004    }
   129005 }
   129006 
   129007 
   129008 
   129009 /* HS_INVOCATION_COUNT */
   129010 
   129011 
   129012 #define GEN10_HS_INVOCATION_COUNT_length  2
   129013 #define GEN9_HS_INVOCATION_COUNT_length  2
   129014 #define GEN8_HS_INVOCATION_COUNT_length  2
   129015 #define GEN75_HS_INVOCATION_COUNT_length  2
   129016 #define GEN7_HS_INVOCATION_COUNT_length  2
   129017 
   129018 static inline uint32_t ATTRIBUTE_PURE
   129019 HS_INVOCATION_COUNT_length(const struct gen_device_info *devinfo)
   129020 {
   129021    switch (devinfo->gen) {
   129022    case 10: return 2;
   129023    case 9: return 2;
   129024    case 8: return 2;
   129025    case 7:
   129026       if (devinfo->is_haswell) {
   129027          return 2;
   129028       } else {
   129029          return 2;
   129030       }
   129031    case 6: return 0;
   129032    case 5: return 0;
   129033    case 4:
   129034       if (devinfo->is_g4x) {
   129035          return 0;
   129036       } else {
   129037          return 0;
   129038       }
   129039    default:
   129040       unreachable("Invalid hardware generation");
   129041    }
   129042 }
   129043 
   129044 
   129045 
   129046 /* HS_INVOCATION_COUNT::HS Invocation Count Report */
   129047 
   129048 
   129049 #define GEN10_HS_INVOCATION_COUNT_HSInvocationCountReport_bits  64
   129050 #define GEN9_HS_INVOCATION_COUNT_HSInvocationCountReport_bits  64
   129051 #define GEN8_HS_INVOCATION_COUNT_HSInvocationCountReport_bits  64
   129052 #define GEN75_HS_INVOCATION_COUNT_HSInvocationCountReport_bits  64
   129053 #define GEN7_HS_INVOCATION_COUNT_HSInvocationCountReport_bits  64
   129054 
   129055 static inline uint32_t ATTRIBUTE_PURE
   129056 HS_INVOCATION_COUNT_HSInvocationCountReport_bits(const struct gen_device_info *devinfo)
   129057 {
   129058    switch (devinfo->gen) {
   129059    case 10: return 64;
   129060    case 9: return 64;
   129061    case 8: return 64;
   129062    case 7:
   129063       if (devinfo->is_haswell) {
   129064          return 64;
   129065       } else {
   129066          return 64;
   129067       }
   129068    case 6: return 0;
   129069    case 5: return 0;
   129070    case 4:
   129071       if (devinfo->is_g4x) {
   129072          return 0;
   129073       } else {
   129074          return 0;
   129075       }
   129076    default:
   129077       unreachable("Invalid hardware generation");
   129078    }
   129079 }
   129080 
   129081 
   129082 
   129083 #define GEN10_HS_INVOCATION_COUNT_HSInvocationCountReport_start  0
   129084 #define GEN9_HS_INVOCATION_COUNT_HSInvocationCountReport_start  0
   129085 #define GEN8_HS_INVOCATION_COUNT_HSInvocationCountReport_start  0
   129086 #define GEN75_HS_INVOCATION_COUNT_HSInvocationCountReport_start  0
   129087 #define GEN7_HS_INVOCATION_COUNT_HSInvocationCountReport_start  0
   129088 
   129089 static inline uint32_t ATTRIBUTE_PURE
   129090 HS_INVOCATION_COUNT_HSInvocationCountReport_start(const struct gen_device_info *devinfo)
   129091 {
   129092    switch (devinfo->gen) {
   129093    case 10: return 0;
   129094    case 9: return 0;
   129095    case 8: return 0;
   129096    case 7:
   129097       if (devinfo->is_haswell) {
   129098          return 0;
   129099       } else {
   129100          return 0;
   129101       }
   129102    case 6: return 0;
   129103    case 5: return 0;
   129104    case 4:
   129105       if (devinfo->is_g4x) {
   129106          return 0;
   129107       } else {
   129108          return 0;
   129109       }
   129110    default:
   129111       unreachable("Invalid hardware generation");
   129112    }
   129113 }
   129114 
   129115 
   129116 
   129117 /* IA_PRIMITIVES_COUNT */
   129118 
   129119 
   129120 #define GEN10_IA_PRIMITIVES_COUNT_length  2
   129121 #define GEN9_IA_PRIMITIVES_COUNT_length  2
   129122 #define GEN8_IA_PRIMITIVES_COUNT_length  2
   129123 #define GEN75_IA_PRIMITIVES_COUNT_length  2
   129124 #define GEN7_IA_PRIMITIVES_COUNT_length  2
   129125 
   129126 static inline uint32_t ATTRIBUTE_PURE
   129127 IA_PRIMITIVES_COUNT_length(const struct gen_device_info *devinfo)
   129128 {
   129129    switch (devinfo->gen) {
   129130    case 10: return 2;
   129131    case 9: return 2;
   129132    case 8: return 2;
   129133    case 7:
   129134       if (devinfo->is_haswell) {
   129135          return 2;
   129136       } else {
   129137          return 2;
   129138       }
   129139    case 6: return 0;
   129140    case 5: return 0;
   129141    case 4:
   129142       if (devinfo->is_g4x) {
   129143          return 0;
   129144       } else {
   129145          return 0;
   129146       }
   129147    default:
   129148       unreachable("Invalid hardware generation");
   129149    }
   129150 }
   129151 
   129152 
   129153 
   129154 /* IA_PRIMITIVES_COUNT::IA Primitives Count Report */
   129155 
   129156 
   129157 #define GEN10_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_bits  64
   129158 #define GEN9_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_bits  64
   129159 #define GEN8_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_bits  64
   129160 #define GEN75_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_bits  64
   129161 #define GEN7_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_bits  64
   129162 
   129163 static inline uint32_t ATTRIBUTE_PURE
   129164 IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_bits(const struct gen_device_info *devinfo)
   129165 {
   129166    switch (devinfo->gen) {
   129167    case 10: return 64;
   129168    case 9: return 64;
   129169    case 8: return 64;
   129170    case 7:
   129171       if (devinfo->is_haswell) {
   129172          return 64;
   129173       } else {
   129174          return 64;
   129175       }
   129176    case 6: return 0;
   129177    case 5: return 0;
   129178    case 4:
   129179       if (devinfo->is_g4x) {
   129180          return 0;
   129181       } else {
   129182          return 0;
   129183       }
   129184    default:
   129185       unreachable("Invalid hardware generation");
   129186    }
   129187 }
   129188 
   129189 
   129190 
   129191 #define GEN10_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_start  0
   129192 #define GEN9_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_start  0
   129193 #define GEN8_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_start  0
   129194 #define GEN75_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_start  0
   129195 #define GEN7_IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_start  0
   129196 
   129197 static inline uint32_t ATTRIBUTE_PURE
   129198 IA_PRIMITIVES_COUNT_IAPrimitivesCountReport_start(const struct gen_device_info *devinfo)
   129199 {
   129200    switch (devinfo->gen) {
   129201    case 10: return 0;
   129202    case 9: return 0;
   129203    case 8: return 0;
   129204    case 7:
   129205       if (devinfo->is_haswell) {
   129206          return 0;
   129207       } else {
   129208          return 0;
   129209       }
   129210    case 6: return 0;
   129211    case 5: return 0;
   129212    case 4:
   129213       if (devinfo->is_g4x) {
   129214          return 0;
   129215       } else {
   129216          return 0;
   129217       }
   129218    default:
   129219       unreachable("Invalid hardware generation");
   129220    }
   129221 }
   129222 
   129223 
   129224 
   129225 /* IA_VERTICES_COUNT */
   129226 
   129227 
   129228 #define GEN10_IA_VERTICES_COUNT_length  2
   129229 #define GEN9_IA_VERTICES_COUNT_length  2
   129230 #define GEN8_IA_VERTICES_COUNT_length  2
   129231 #define GEN75_IA_VERTICES_COUNT_length  2
   129232 #define GEN7_IA_VERTICES_COUNT_length  2
   129233 
   129234 static inline uint32_t ATTRIBUTE_PURE
   129235 IA_VERTICES_COUNT_length(const struct gen_device_info *devinfo)
   129236 {
   129237    switch (devinfo->gen) {
   129238    case 10: return 2;
   129239    case 9: return 2;
   129240    case 8: return 2;
   129241    case 7:
   129242       if (devinfo->is_haswell) {
   129243          return 2;
   129244       } else {
   129245          return 2;
   129246       }
   129247    case 6: return 0;
   129248    case 5: return 0;
   129249    case 4:
   129250       if (devinfo->is_g4x) {
   129251          return 0;
   129252       } else {
   129253          return 0;
   129254       }
   129255    default:
   129256       unreachable("Invalid hardware generation");
   129257    }
   129258 }
   129259 
   129260 
   129261 
   129262 /* IA_VERTICES_COUNT::IA Vertices Count Report */
   129263 
   129264 
   129265 #define GEN10_IA_VERTICES_COUNT_IAVerticesCountReport_bits  64
   129266 #define GEN9_IA_VERTICES_COUNT_IAVerticesCountReport_bits  64
   129267 #define GEN8_IA_VERTICES_COUNT_IAVerticesCountReport_bits  64
   129268 #define GEN75_IA_VERTICES_COUNT_IAVerticesCountReport_bits  64
   129269 #define GEN7_IA_VERTICES_COUNT_IAVerticesCountReport_bits  64
   129270 
   129271 static inline uint32_t ATTRIBUTE_PURE
   129272 IA_VERTICES_COUNT_IAVerticesCountReport_bits(const struct gen_device_info *devinfo)
   129273 {
   129274    switch (devinfo->gen) {
   129275    case 10: return 64;
   129276    case 9: return 64;
   129277    case 8: return 64;
   129278    case 7:
   129279       if (devinfo->is_haswell) {
   129280          return 64;
   129281       } else {
   129282          return 64;
   129283       }
   129284    case 6: return 0;
   129285    case 5: return 0;
   129286    case 4:
   129287       if (devinfo->is_g4x) {
   129288          return 0;
   129289       } else {
   129290          return 0;
   129291       }
   129292    default:
   129293       unreachable("Invalid hardware generation");
   129294    }
   129295 }
   129296 
   129297 
   129298 
   129299 #define GEN10_IA_VERTICES_COUNT_IAVerticesCountReport_start  0
   129300 #define GEN9_IA_VERTICES_COUNT_IAVerticesCountReport_start  0
   129301 #define GEN8_IA_VERTICES_COUNT_IAVerticesCountReport_start  0
   129302 #define GEN75_IA_VERTICES_COUNT_IAVerticesCountReport_start  0
   129303 #define GEN7_IA_VERTICES_COUNT_IAVerticesCountReport_start  0
   129304 
   129305 static inline uint32_t ATTRIBUTE_PURE
   129306 IA_VERTICES_COUNT_IAVerticesCountReport_start(const struct gen_device_info *devinfo)
   129307 {
   129308    switch (devinfo->gen) {
   129309    case 10: return 0;
   129310    case 9: return 0;
   129311    case 8: return 0;
   129312    case 7:
   129313       if (devinfo->is_haswell) {
   129314          return 0;
   129315       } else {
   129316          return 0;
   129317       }
   129318    case 6: return 0;
   129319    case 5: return 0;
   129320    case 4:
   129321       if (devinfo->is_g4x) {
   129322          return 0;
   129323       } else {
   129324          return 0;
   129325       }
   129326    default:
   129327       unreachable("Invalid hardware generation");
   129328    }
   129329 }
   129330 
   129331 
   129332 
   129333 /* INSTDONE_1 */
   129334 
   129335 
   129336 #define GEN10_INSTDONE_1_length  1
   129337 #define GEN9_INSTDONE_1_length  1
   129338 #define GEN8_INSTDONE_1_length  1
   129339 #define GEN75_INSTDONE_1_length  1
   129340 #define GEN7_INSTDONE_1_length  1
   129341 #define GEN6_INSTDONE_1_length  1
   129342 
   129343 static inline uint32_t ATTRIBUTE_PURE
   129344 INSTDONE_1_length(const struct gen_device_info *devinfo)
   129345 {
   129346    switch (devinfo->gen) {
   129347    case 10: return 1;
   129348    case 9: return 1;
   129349    case 8: return 1;
   129350    case 7:
   129351       if (devinfo->is_haswell) {
   129352          return 1;
   129353       } else {
   129354          return 1;
   129355       }
   129356    case 6: return 1;
   129357    case 5: return 0;
   129358    case 4:
   129359       if (devinfo->is_g4x) {
   129360          return 0;
   129361       } else {
   129362          return 0;
   129363       }
   129364    default:
   129365       unreachable("Invalid hardware generation");
   129366    }
   129367 }
   129368 
   129369 
   129370 
   129371 /* INSTDONE_1::AVS Done */
   129372 
   129373 
   129374 #define GEN6_INSTDONE_1_AVSDone_bits  1
   129375 
   129376 static inline uint32_t ATTRIBUTE_PURE
   129377 INSTDONE_1_AVSDone_bits(const struct gen_device_info *devinfo)
   129378 {
   129379    switch (devinfo->gen) {
   129380    case 10: return 0;
   129381    case 9: return 0;
   129382    case 8: return 0;
   129383    case 7:
   129384       if (devinfo->is_haswell) {
   129385          return 0;
   129386       } else {
   129387          return 0;
   129388       }
   129389    case 6: return 1;
   129390    case 5: return 0;
   129391    case 4:
   129392       if (devinfo->is_g4x) {
   129393          return 0;
   129394       } else {
   129395          return 0;
   129396       }
   129397    default:
   129398       unreachable("Invalid hardware generation");
   129399    }
   129400 }
   129401 
   129402 
   129403 
   129404 #define GEN6_INSTDONE_1_AVSDone_start  1
   129405 
   129406 static inline uint32_t ATTRIBUTE_PURE
   129407 INSTDONE_1_AVSDone_start(const struct gen_device_info *devinfo)
   129408 {
   129409    switch (devinfo->gen) {
   129410    case 10: return 0;
   129411    case 9: return 0;
   129412    case 8: return 0;
   129413    case 7:
   129414       if (devinfo->is_haswell) {
   129415          return 0;
   129416       } else {
   129417          return 0;
   129418       }
   129419    case 6: return 1;
   129420    case 5: return 0;
   129421    case 4:
   129422       if (devinfo->is_g4x) {
   129423          return 0;
   129424       } else {
   129425          return 0;
   129426       }
   129427    default:
   129428       unreachable("Invalid hardware generation");
   129429    }
   129430 }
   129431 
   129432 
   129433 
   129434 /* INSTDONE_1::CL Done */
   129435 
   129436 
   129437 #define GEN10_INSTDONE_1_CLDone_bits  1
   129438 #define GEN9_INSTDONE_1_CLDone_bits  1
   129439 #define GEN8_INSTDONE_1_CLDone_bits  1
   129440 #define GEN75_INSTDONE_1_CLDone_bits  1
   129441 #define GEN7_INSTDONE_1_CLDone_bits  1
   129442 
   129443 static inline uint32_t ATTRIBUTE_PURE
   129444 INSTDONE_1_CLDone_bits(const struct gen_device_info *devinfo)
   129445 {
   129446    switch (devinfo->gen) {
   129447    case 10: return 1;
   129448    case 9: return 1;
   129449    case 8: return 1;
   129450    case 7:
   129451       if (devinfo->is_haswell) {
   129452          return 1;
   129453       } else {
   129454          return 1;
   129455       }
   129456    case 6: return 0;
   129457    case 5: return 0;
   129458    case 4:
   129459       if (devinfo->is_g4x) {
   129460          return 0;
   129461       } else {
   129462          return 0;
   129463       }
   129464    default:
   129465       unreachable("Invalid hardware generation");
   129466    }
   129467 }
   129468 
   129469 
   129470 
   129471 #define GEN10_INSTDONE_1_CLDone_start  8
   129472 #define GEN9_INSTDONE_1_CLDone_start  8
   129473 #define GEN8_INSTDONE_1_CLDone_start  8
   129474 #define GEN75_INSTDONE_1_CLDone_start  8
   129475 #define GEN7_INSTDONE_1_CLDone_start  8
   129476 
   129477 static inline uint32_t ATTRIBUTE_PURE
   129478 INSTDONE_1_CLDone_start(const struct gen_device_info *devinfo)
   129479 {
   129480    switch (devinfo->gen) {
   129481    case 10: return 8;
   129482    case 9: return 8;
   129483    case 8: return 8;
   129484    case 7:
   129485       if (devinfo->is_haswell) {
   129486          return 8;
   129487       } else {
   129488          return 8;
   129489       }
   129490    case 6: return 0;
   129491    case 5: return 0;
   129492    case 4:
   129493       if (devinfo->is_g4x) {
   129494          return 0;
   129495       } else {
   129496          return 0;
   129497       }
   129498    default:
   129499       unreachable("Invalid hardware generation");
   129500    }
   129501 }
   129502 
   129503 
   129504 
   129505 /* INSTDONE_1::CS Done */
   129506 
   129507 
   129508 #define GEN10_INSTDONE_1_CSDone_bits  1
   129509 #define GEN9_INSTDONE_1_CSDone_bits  1
   129510 #define GEN8_INSTDONE_1_CSDone_bits  1
   129511 #define GEN75_INSTDONE_1_CSDone_bits  1
   129512 
   129513 static inline uint32_t ATTRIBUTE_PURE
   129514 INSTDONE_1_CSDone_bits(const struct gen_device_info *devinfo)
   129515 {
   129516    switch (devinfo->gen) {
   129517    case 10: return 1;
   129518    case 9: return 1;
   129519    case 8: return 1;
   129520    case 7:
   129521       if (devinfo->is_haswell) {
   129522          return 1;
   129523       } else {
   129524          return 0;
   129525       }
   129526    case 6: return 0;
   129527    case 5: return 0;
   129528    case 4:
   129529       if (devinfo->is_g4x) {
   129530          return 0;
   129531       } else {
   129532          return 0;
   129533       }
   129534    default:
   129535       unreachable("Invalid hardware generation");
   129536    }
   129537 }
   129538 
   129539 
   129540 
   129541 #define GEN10_INSTDONE_1_CSDone_start  21
   129542 #define GEN9_INSTDONE_1_CSDone_start  21
   129543 #define GEN8_INSTDONE_1_CSDone_start  21
   129544 #define GEN75_INSTDONE_1_CSDone_start  21
   129545 
   129546 static inline uint32_t ATTRIBUTE_PURE
   129547 INSTDONE_1_CSDone_start(const struct gen_device_info *devinfo)
   129548 {
   129549    switch (devinfo->gen) {
   129550    case 10: return 21;
   129551    case 9: return 21;
   129552    case 8: return 21;
   129553    case 7:
   129554       if (devinfo->is_haswell) {
   129555          return 21;
   129556       } else {
   129557          return 0;
   129558       }
   129559    case 6: return 0;
   129560    case 5: return 0;
   129561    case 4:
   129562       if (devinfo->is_g4x) {
   129563          return 0;
   129564       } else {
   129565          return 0;
   129566       }
   129567    default:
   129568       unreachable("Invalid hardware generation");
   129569    }
   129570 }
   129571 
   129572 
   129573 
   129574 /* INSTDONE_1::DS Done */
   129575 
   129576 
   129577 #define GEN10_INSTDONE_1_DSDone_bits  1
   129578 #define GEN9_INSTDONE_1_DSDone_bits  1
   129579 #define GEN8_INSTDONE_1_DSDone_bits  1
   129580 #define GEN75_INSTDONE_1_DSDone_bits  1
   129581 #define GEN7_INSTDONE_1_DSDone_bits  1
   129582 
   129583 static inline uint32_t ATTRIBUTE_PURE
   129584 INSTDONE_1_DSDone_bits(const struct gen_device_info *devinfo)
   129585 {
   129586    switch (devinfo->gen) {
   129587    case 10: return 1;
   129588    case 9: return 1;
   129589    case 8: return 1;
   129590    case 7:
   129591       if (devinfo->is_haswell) {
   129592          return 1;
   129593       } else {
   129594          return 1;
   129595       }
   129596    case 6: return 0;
   129597    case 5: return 0;
   129598    case 4:
   129599       if (devinfo->is_g4x) {
   129600          return 0;
   129601       } else {
   129602          return 0;
   129603       }
   129604    default:
   129605       unreachable("Invalid hardware generation");
   129606    }
   129607 }
   129608 
   129609 
   129610 
   129611 #define GEN10_INSTDONE_1_DSDone_start  5
   129612 #define GEN9_INSTDONE_1_DSDone_start  5
   129613 #define GEN8_INSTDONE_1_DSDone_start  5
   129614 #define GEN75_INSTDONE_1_DSDone_start  5
   129615 #define GEN7_INSTDONE_1_DSDone_start  5
   129616 
   129617 static inline uint32_t ATTRIBUTE_PURE
   129618 INSTDONE_1_DSDone_start(const struct gen_device_info *devinfo)
   129619 {
   129620    switch (devinfo->gen) {
   129621    case 10: return 5;
   129622    case 9: return 5;
   129623    case 8: return 5;
   129624    case 7:
   129625       if (devinfo->is_haswell) {
   129626          return 5;
   129627       } else {
   129628          return 5;
   129629       }
   129630    case 6: return 0;
   129631    case 5: return 0;
   129632    case 4:
   129633       if (devinfo->is_g4x) {
   129634          return 0;
   129635       } else {
   129636          return 0;
   129637       }
   129638    default:
   129639       unreachable("Invalid hardware generation");
   129640    }
   129641 }
   129642 
   129643 
   129644 
   129645 /* INSTDONE_1::EU00 Done */
   129646 
   129647 
   129648 #define GEN6_INSTDONE_1_EU00Done_bits  1
   129649 
   129650 static inline uint32_t ATTRIBUTE_PURE
   129651 INSTDONE_1_EU00Done_bits(const struct gen_device_info *devinfo)
   129652 {
   129653    switch (devinfo->gen) {
   129654    case 10: return 0;
   129655    case 9: return 0;
   129656    case 8: return 0;
   129657    case 7:
   129658       if (devinfo->is_haswell) {
   129659          return 0;
   129660       } else {
   129661          return 0;
   129662       }
   129663    case 6: return 1;
   129664    case 5: return 0;
   129665    case 4:
   129666       if (devinfo->is_g4x) {
   129667          return 0;
   129668       } else {
   129669          return 0;
   129670       }
   129671    default:
   129672       unreachable("Invalid hardware generation");
   129673    }
   129674 }
   129675 
   129676 
   129677 
   129678 #define GEN6_INSTDONE_1_EU00Done_start  16
   129679 
   129680 static inline uint32_t ATTRIBUTE_PURE
   129681 INSTDONE_1_EU00Done_start(const struct gen_device_info *devinfo)
   129682 {
   129683    switch (devinfo->gen) {
   129684    case 10: return 0;
   129685    case 9: return 0;
   129686    case 8: return 0;
   129687    case 7:
   129688       if (devinfo->is_haswell) {
   129689          return 0;
   129690       } else {
   129691          return 0;
   129692       }
   129693    case 6: return 16;
   129694    case 5: return 0;
   129695    case 4:
   129696       if (devinfo->is_g4x) {
   129697          return 0;
   129698       } else {
   129699          return 0;
   129700       }
   129701    default:
   129702       unreachable("Invalid hardware generation");
   129703    }
   129704 }
   129705 
   129706 
   129707 
   129708 /* INSTDONE_1::EU01 Done */
   129709 
   129710 
   129711 #define GEN6_INSTDONE_1_EU01Done_bits  1
   129712 
   129713 static inline uint32_t ATTRIBUTE_PURE
   129714 INSTDONE_1_EU01Done_bits(const struct gen_device_info *devinfo)
   129715 {
   129716    switch (devinfo->gen) {
   129717    case 10: return 0;
   129718    case 9: return 0;
   129719    case 8: return 0;
   129720    case 7:
   129721       if (devinfo->is_haswell) {
   129722          return 0;
   129723       } else {
   129724          return 0;
   129725       }
   129726    case 6: return 1;
   129727    case 5: return 0;
   129728    case 4:
   129729       if (devinfo->is_g4x) {
   129730          return 0;
   129731       } else {
   129732          return 0;
   129733       }
   129734    default:
   129735       unreachable("Invalid hardware generation");
   129736    }
   129737 }
   129738 
   129739 
   129740 
   129741 #define GEN6_INSTDONE_1_EU01Done_start  17
   129742 
   129743 static inline uint32_t ATTRIBUTE_PURE
   129744 INSTDONE_1_EU01Done_start(const struct gen_device_info *devinfo)
   129745 {
   129746    switch (devinfo->gen) {
   129747    case 10: return 0;
   129748    case 9: return 0;
   129749    case 8: return 0;
   129750    case 7:
   129751       if (devinfo->is_haswell) {
   129752          return 0;
   129753       } else {
   129754          return 0;
   129755       }
   129756    case 6: return 17;
   129757    case 5: return 0;
   129758    case 4:
   129759       if (devinfo->is_g4x) {
   129760          return 0;
   129761       } else {
   129762          return 0;
   129763       }
   129764    default:
   129765       unreachable("Invalid hardware generation");
   129766    }
   129767 }
   129768 
   129769 
   129770 
   129771 /* INSTDONE_1::EU02 Done */
   129772 
   129773 
   129774 #define GEN6_INSTDONE_1_EU02Done_bits  1
   129775 
   129776 static inline uint32_t ATTRIBUTE_PURE
   129777 INSTDONE_1_EU02Done_bits(const struct gen_device_info *devinfo)
   129778 {
   129779    switch (devinfo->gen) {
   129780    case 10: return 0;
   129781    case 9: return 0;
   129782    case 8: return 0;
   129783    case 7:
   129784       if (devinfo->is_haswell) {
   129785          return 0;
   129786       } else {
   129787          return 0;
   129788       }
   129789    case 6: return 1;
   129790    case 5: return 0;
   129791    case 4:
   129792       if (devinfo->is_g4x) {
   129793          return 0;
   129794       } else {
   129795          return 0;
   129796       }
   129797    default:
   129798       unreachable("Invalid hardware generation");
   129799    }
   129800 }
   129801 
   129802 
   129803 
   129804 #define GEN6_INSTDONE_1_EU02Done_start  18
   129805 
   129806 static inline uint32_t ATTRIBUTE_PURE
   129807 INSTDONE_1_EU02Done_start(const struct gen_device_info *devinfo)
   129808 {
   129809    switch (devinfo->gen) {
   129810    case 10: return 0;
   129811    case 9: return 0;
   129812    case 8: return 0;
   129813    case 7:
   129814       if (devinfo->is_haswell) {
   129815          return 0;
   129816       } else {
   129817          return 0;
   129818       }
   129819    case 6: return 18;
   129820    case 5: return 0;
   129821    case 4:
   129822       if (devinfo->is_g4x) {
   129823          return 0;
   129824       } else {
   129825          return 0;
   129826       }
   129827    default:
   129828       unreachable("Invalid hardware generation");
   129829    }
   129830 }
   129831 
   129832 
   129833 
   129834 /* INSTDONE_1::EU10 Done */
   129835 
   129836 
   129837 #define GEN6_INSTDONE_1_EU10Done_bits  1
   129838 
   129839 static inline uint32_t ATTRIBUTE_PURE
   129840 INSTDONE_1_EU10Done_bits(const struct gen_device_info *devinfo)
   129841 {
   129842    switch (devinfo->gen) {
   129843    case 10: return 0;
   129844    case 9: return 0;
   129845    case 8: return 0;
   129846    case 7:
   129847       if (devinfo->is_haswell) {
   129848          return 0;
   129849       } else {
   129850          return 0;
   129851       }
   129852    case 6: return 1;
   129853    case 5: return 0;
   129854    case 4:
   129855       if (devinfo->is_g4x) {
   129856          return 0;
   129857       } else {
   129858          return 0;
   129859       }
   129860    default:
   129861       unreachable("Invalid hardware generation");
   129862    }
   129863 }
   129864 
   129865 
   129866 
   129867 #define GEN6_INSTDONE_1_EU10Done_start  20
   129868 
   129869 static inline uint32_t ATTRIBUTE_PURE
   129870 INSTDONE_1_EU10Done_start(const struct gen_device_info *devinfo)
   129871 {
   129872    switch (devinfo->gen) {
   129873    case 10: return 0;
   129874    case 9: return 0;
   129875    case 8: return 0;
   129876    case 7:
   129877       if (devinfo->is_haswell) {
   129878          return 0;
   129879       } else {
   129880          return 0;
   129881       }
   129882    case 6: return 20;
   129883    case 5: return 0;
   129884    case 4:
   129885       if (devinfo->is_g4x) {
   129886          return 0;
   129887       } else {
   129888          return 0;
   129889       }
   129890    default:
   129891       unreachable("Invalid hardware generation");
   129892    }
   129893 }
   129894 
   129895 
   129896 
   129897 /* INSTDONE_1::EU11 Done */
   129898 
   129899 
   129900 #define GEN6_INSTDONE_1_EU11Done_bits  1
   129901 
   129902 static inline uint32_t ATTRIBUTE_PURE
   129903 INSTDONE_1_EU11Done_bits(const struct gen_device_info *devinfo)
   129904 {
   129905    switch (devinfo->gen) {
   129906    case 10: return 0;
   129907    case 9: return 0;
   129908    case 8: return 0;
   129909    case 7:
   129910       if (devinfo->is_haswell) {
   129911          return 0;
   129912       } else {
   129913          return 0;
   129914       }
   129915    case 6: return 1;
   129916    case 5: return 0;
   129917    case 4:
   129918       if (devinfo->is_g4x) {
   129919          return 0;
   129920       } else {
   129921          return 0;
   129922       }
   129923    default:
   129924       unreachable("Invalid hardware generation");
   129925    }
   129926 }
   129927 
   129928 
   129929 
   129930 #define GEN6_INSTDONE_1_EU11Done_start  21
   129931 
   129932 static inline uint32_t ATTRIBUTE_PURE
   129933 INSTDONE_1_EU11Done_start(const struct gen_device_info *devinfo)
   129934 {
   129935    switch (devinfo->gen) {
   129936    case 10: return 0;
   129937    case 9: return 0;
   129938    case 8: return 0;
   129939    case 7:
   129940       if (devinfo->is_haswell) {
   129941          return 0;
   129942       } else {
   129943          return 0;
   129944       }
   129945    case 6: return 21;
   129946    case 5: return 0;
   129947    case 4:
   129948       if (devinfo->is_g4x) {
   129949          return 0;
   129950       } else {
   129951          return 0;
   129952       }
   129953    default:
   129954       unreachable("Invalid hardware generation");
   129955    }
   129956 }
   129957 
   129958 
   129959 
   129960 /* INSTDONE_1::EU12 Done */
   129961 
   129962 
   129963 #define GEN6_INSTDONE_1_EU12Done_bits  1
   129964 
   129965 static inline uint32_t ATTRIBUTE_PURE
   129966 INSTDONE_1_EU12Done_bits(const struct gen_device_info *devinfo)
   129967 {
   129968    switch (devinfo->gen) {
   129969    case 10: return 0;
   129970    case 9: return 0;
   129971    case 8: return 0;
   129972    case 7:
   129973       if (devinfo->is_haswell) {
   129974          return 0;
   129975       } else {
   129976          return 0;
   129977       }
   129978    case 6: return 1;
   129979    case 5: return 0;
   129980    case 4:
   129981       if (devinfo->is_g4x) {
   129982          return 0;
   129983       } else {
   129984          return 0;
   129985       }
   129986    default:
   129987       unreachable("Invalid hardware generation");
   129988    }
   129989 }
   129990 
   129991 
   129992 
   129993 #define GEN6_INSTDONE_1_EU12Done_start  22
   129994 
   129995 static inline uint32_t ATTRIBUTE_PURE
   129996 INSTDONE_1_EU12Done_start(const struct gen_device_info *devinfo)
   129997 {
   129998    switch (devinfo->gen) {
   129999    case 10: return 0;
   130000    case 9: return 0;
   130001    case 8: return 0;
   130002    case 7:
   130003       if (devinfo->is_haswell) {
   130004          return 0;
   130005       } else {
   130006          return 0;
   130007       }
   130008    case 6: return 22;
   130009    case 5: return 0;
   130010    case 4:
   130011       if (devinfo->is_g4x) {
   130012          return 0;
   130013       } else {
   130014          return 0;
   130015       }
   130016    default:
   130017       unreachable("Invalid hardware generation");
   130018    }
   130019 }
   130020 
   130021 
   130022 
   130023 /* INSTDONE_1::EU20 Done */
   130024 
   130025 
   130026 #define GEN6_INSTDONE_1_EU20Done_bits  1
   130027 
   130028 static inline uint32_t ATTRIBUTE_PURE
   130029 INSTDONE_1_EU20Done_bits(const struct gen_device_info *devinfo)
   130030 {
   130031    switch (devinfo->gen) {
   130032    case 10: return 0;
   130033    case 9: return 0;
   130034    case 8: return 0;
   130035    case 7:
   130036       if (devinfo->is_haswell) {
   130037          return 0;
   130038       } else {
   130039          return 0;
   130040       }
   130041    case 6: return 1;
   130042    case 5: return 0;
   130043    case 4:
   130044       if (devinfo->is_g4x) {
   130045          return 0;
   130046       } else {
   130047          return 0;
   130048       }
   130049    default:
   130050       unreachable("Invalid hardware generation");
   130051    }
   130052 }
   130053 
   130054 
   130055 
   130056 #define GEN6_INSTDONE_1_EU20Done_start  24
   130057 
   130058 static inline uint32_t ATTRIBUTE_PURE
   130059 INSTDONE_1_EU20Done_start(const struct gen_device_info *devinfo)
   130060 {
   130061    switch (devinfo->gen) {
   130062    case 10: return 0;
   130063    case 9: return 0;
   130064    case 8: return 0;
   130065    case 7:
   130066       if (devinfo->is_haswell) {
   130067          return 0;
   130068       } else {
   130069          return 0;
   130070       }
   130071    case 6: return 24;
   130072    case 5: return 0;
   130073    case 4:
   130074       if (devinfo->is_g4x) {
   130075          return 0;
   130076       } else {
   130077          return 0;
   130078       }
   130079    default:
   130080       unreachable("Invalid hardware generation");
   130081    }
   130082 }
   130083 
   130084 
   130085 
   130086 /* INSTDONE_1::EU21 Done */
   130087 
   130088 
   130089 #define GEN6_INSTDONE_1_EU21Done_bits  1
   130090 
   130091 static inline uint32_t ATTRIBUTE_PURE
   130092 INSTDONE_1_EU21Done_bits(const struct gen_device_info *devinfo)
   130093 {
   130094    switch (devinfo->gen) {
   130095    case 10: return 0;
   130096    case 9: return 0;
   130097    case 8: return 0;
   130098    case 7:
   130099       if (devinfo->is_haswell) {
   130100          return 0;
   130101       } else {
   130102          return 0;
   130103       }
   130104    case 6: return 1;
   130105    case 5: return 0;
   130106    case 4:
   130107       if (devinfo->is_g4x) {
   130108          return 0;
   130109       } else {
   130110          return 0;
   130111       }
   130112    default:
   130113       unreachable("Invalid hardware generation");
   130114    }
   130115 }
   130116 
   130117 
   130118 
   130119 #define GEN6_INSTDONE_1_EU21Done_start  25
   130120 
   130121 static inline uint32_t ATTRIBUTE_PURE
   130122 INSTDONE_1_EU21Done_start(const struct gen_device_info *devinfo)
   130123 {
   130124    switch (devinfo->gen) {
   130125    case 10: return 0;
   130126    case 9: return 0;
   130127    case 8: return 0;
   130128    case 7:
   130129       if (devinfo->is_haswell) {
   130130          return 0;
   130131       } else {
   130132          return 0;
   130133       }
   130134    case 6: return 25;
   130135    case 5: return 0;
   130136    case 4:
   130137       if (devinfo->is_g4x) {
   130138          return 0;
   130139       } else {
   130140          return 0;
   130141       }
   130142    default:
   130143       unreachable("Invalid hardware generation");
   130144    }
   130145 }
   130146 
   130147 
   130148 
   130149 /* INSTDONE_1::EU22 Done */
   130150 
   130151 
   130152 #define GEN6_INSTDONE_1_EU22Done_bits  1
   130153 
   130154 static inline uint32_t ATTRIBUTE_PURE
   130155 INSTDONE_1_EU22Done_bits(const struct gen_device_info *devinfo)
   130156 {
   130157    switch (devinfo->gen) {
   130158    case 10: return 0;
   130159    case 9: return 0;
   130160    case 8: return 0;
   130161    case 7:
   130162       if (devinfo->is_haswell) {
   130163          return 0;
   130164       } else {
   130165          return 0;
   130166       }
   130167    case 6: return 1;
   130168    case 5: return 0;
   130169    case 4:
   130170       if (devinfo->is_g4x) {
   130171          return 0;
   130172       } else {
   130173          return 0;
   130174       }
   130175    default:
   130176       unreachable("Invalid hardware generation");
   130177    }
   130178 }
   130179 
   130180 
   130181 
   130182 #define GEN6_INSTDONE_1_EU22Done_start  26
   130183 
   130184 static inline uint32_t ATTRIBUTE_PURE
   130185 INSTDONE_1_EU22Done_start(const struct gen_device_info *devinfo)
   130186 {
   130187    switch (devinfo->gen) {
   130188    case 10: return 0;
   130189    case 9: return 0;
   130190    case 8: return 0;
   130191    case 7:
   130192       if (devinfo->is_haswell) {
   130193          return 0;
   130194       } else {
   130195          return 0;
   130196       }
   130197    case 6: return 26;
   130198    case 5: return 0;
   130199    case 4:
   130200       if (devinfo->is_g4x) {
   130201          return 0;
   130202       } else {
   130203          return 0;
   130204       }
   130205    default:
   130206       unreachable("Invalid hardware generation");
   130207    }
   130208 }
   130209 
   130210 
   130211 
   130212 /* INSTDONE_1::EU30 Done */
   130213 
   130214 
   130215 #define GEN6_INSTDONE_1_EU30Done_bits  1
   130216 
   130217 static inline uint32_t ATTRIBUTE_PURE
   130218 INSTDONE_1_EU30Done_bits(const struct gen_device_info *devinfo)
   130219 {
   130220    switch (devinfo->gen) {
   130221    case 10: return 0;
   130222    case 9: return 0;
   130223    case 8: return 0;
   130224    case 7:
   130225       if (devinfo->is_haswell) {
   130226          return 0;
   130227       } else {
   130228          return 0;
   130229       }
   130230    case 6: return 1;
   130231    case 5: return 0;
   130232    case 4:
   130233       if (devinfo->is_g4x) {
   130234          return 0;
   130235       } else {
   130236          return 0;
   130237       }
   130238    default:
   130239       unreachable("Invalid hardware generation");
   130240    }
   130241 }
   130242 
   130243 
   130244 
   130245 #define GEN6_INSTDONE_1_EU30Done_start  28
   130246 
   130247 static inline uint32_t ATTRIBUTE_PURE
   130248 INSTDONE_1_EU30Done_start(const struct gen_device_info *devinfo)
   130249 {
   130250    switch (devinfo->gen) {
   130251    case 10: return 0;
   130252    case 9: return 0;
   130253    case 8: return 0;
   130254    case 7:
   130255       if (devinfo->is_haswell) {
   130256          return 0;
   130257       } else {
   130258          return 0;
   130259       }
   130260    case 6: return 28;
   130261    case 5: return 0;
   130262    case 4:
   130263       if (devinfo->is_g4x) {
   130264          return 0;
   130265       } else {
   130266          return 0;
   130267       }
   130268    default:
   130269       unreachable("Invalid hardware generation");
   130270    }
   130271 }
   130272 
   130273 
   130274 
   130275 /* INSTDONE_1::EU31 Done */
   130276 
   130277 
   130278 #define GEN6_INSTDONE_1_EU31Done_bits  1
   130279 
   130280 static inline uint32_t ATTRIBUTE_PURE
   130281 INSTDONE_1_EU31Done_bits(const struct gen_device_info *devinfo)
   130282 {
   130283    switch (devinfo->gen) {
   130284    case 10: return 0;
   130285    case 9: return 0;
   130286    case 8: return 0;
   130287    case 7:
   130288       if (devinfo->is_haswell) {
   130289          return 0;
   130290       } else {
   130291          return 0;
   130292       }
   130293    case 6: return 1;
   130294    case 5: return 0;
   130295    case 4:
   130296       if (devinfo->is_g4x) {
   130297          return 0;
   130298       } else {
   130299          return 0;
   130300       }
   130301    default:
   130302       unreachable("Invalid hardware generation");
   130303    }
   130304 }
   130305 
   130306 
   130307 
   130308 #define GEN6_INSTDONE_1_EU31Done_start  29
   130309 
   130310 static inline uint32_t ATTRIBUTE_PURE
   130311 INSTDONE_1_EU31Done_start(const struct gen_device_info *devinfo)
   130312 {
   130313    switch (devinfo->gen) {
   130314    case 10: return 0;
   130315    case 9: return 0;
   130316    case 8: return 0;
   130317    case 7:
   130318       if (devinfo->is_haswell) {
   130319          return 0;
   130320       } else {
   130321          return 0;
   130322       }
   130323    case 6: return 29;
   130324    case 5: return 0;
   130325    case 4:
   130326       if (devinfo->is_g4x) {
   130327          return 0;
   130328       } else {
   130329          return 0;
   130330       }
   130331    default:
   130332       unreachable("Invalid hardware generation");
   130333    }
   130334 }
   130335 
   130336 
   130337 
   130338 /* INSTDONE_1::EU32 Done */
   130339 
   130340 
   130341 #define GEN6_INSTDONE_1_EU32Done_bits  1
   130342 
   130343 static inline uint32_t ATTRIBUTE_PURE
   130344 INSTDONE_1_EU32Done_bits(const struct gen_device_info *devinfo)
   130345 {
   130346    switch (devinfo->gen) {
   130347    case 10: return 0;
   130348    case 9: return 0;
   130349    case 8: return 0;
   130350    case 7:
   130351       if (devinfo->is_haswell) {
   130352          return 0;
   130353       } else {
   130354          return 0;
   130355       }
   130356    case 6: return 1;
   130357    case 5: return 0;
   130358    case 4:
   130359       if (devinfo->is_g4x) {
   130360          return 0;
   130361       } else {
   130362          return 0;
   130363       }
   130364    default:
   130365       unreachable("Invalid hardware generation");
   130366    }
   130367 }
   130368 
   130369 
   130370 
   130371 #define GEN6_INSTDONE_1_EU32Done_start  30
   130372 
   130373 static inline uint32_t ATTRIBUTE_PURE
   130374 INSTDONE_1_EU32Done_start(const struct gen_device_info *devinfo)
   130375 {
   130376    switch (devinfo->gen) {
   130377    case 10: return 0;
   130378    case 9: return 0;
   130379    case 8: return 0;
   130380    case 7:
   130381       if (devinfo->is_haswell) {
   130382          return 0;
   130383       } else {
   130384          return 0;
   130385       }
   130386    case 6: return 30;
   130387    case 5: return 0;
   130388    case 4:
   130389       if (devinfo->is_g4x) {
   130390          return 0;
   130391       } else {
   130392          return 0;
   130393       }
   130394    default:
   130395       unreachable("Invalid hardware generation");
   130396    }
   130397 }
   130398 
   130399 
   130400 
   130401 /* INSTDONE_1::GAFM Done */
   130402 
   130403 
   130404 #define GEN10_INSTDONE_1_GAFMDone_bits  1
   130405 #define GEN9_INSTDONE_1_GAFMDone_bits  1
   130406 #define GEN8_INSTDONE_1_GAFMDone_bits  1
   130407 #define GEN75_INSTDONE_1_GAFMDone_bits  1
   130408 #define GEN7_INSTDONE_1_GAFMDone_bits  1
   130409 
   130410 static inline uint32_t ATTRIBUTE_PURE
   130411 INSTDONE_1_GAFMDone_bits(const struct gen_device_info *devinfo)
   130412 {
   130413    switch (devinfo->gen) {
   130414    case 10: return 1;
   130415    case 9: return 1;
   130416    case 8: return 1;
   130417    case 7:
   130418       if (devinfo->is_haswell) {
   130419          return 1;
   130420       } else {
   130421          return 1;
   130422       }
   130423    case 6: return 0;
   130424    case 5: return 0;
   130425    case 4:
   130426       if (devinfo->is_g4x) {
   130427          return 0;
   130428       } else {
   130429          return 0;
   130430       }
   130431    default:
   130432       unreachable("Invalid hardware generation");
   130433    }
   130434 }
   130435 
   130436 
   130437 
   130438 #define GEN10_INSTDONE_1_GAFMDone_start  18
   130439 #define GEN9_INSTDONE_1_GAFMDone_start  18
   130440 #define GEN8_INSTDONE_1_GAFMDone_start  18
   130441 #define GEN75_INSTDONE_1_GAFMDone_start  18
   130442 #define GEN7_INSTDONE_1_GAFMDone_start  18
   130443 
   130444 static inline uint32_t ATTRIBUTE_PURE
   130445 INSTDONE_1_GAFMDone_start(const struct gen_device_info *devinfo)
   130446 {
   130447    switch (devinfo->gen) {
   130448    case 10: return 18;
   130449    case 9: return 18;
   130450    case 8: return 18;
   130451    case 7:
   130452       if (devinfo->is_haswell) {
   130453          return 18;
   130454       } else {
   130455          return 18;
   130456       }
   130457    case 6: return 0;
   130458    case 5: return 0;
   130459    case 4:
   130460       if (devinfo->is_g4x) {
   130461          return 0;
   130462       } else {
   130463          return 0;
   130464       }
   130465    default:
   130466       unreachable("Invalid hardware generation");
   130467    }
   130468 }
   130469 
   130470 
   130471 
   130472 /* INSTDONE_1::GAFS Done */
   130473 
   130474 
   130475 #define GEN10_INSTDONE_1_GAFSDone_bits  1
   130476 #define GEN9_INSTDONE_1_GAFSDone_bits  1
   130477 #define GEN8_INSTDONE_1_GAFSDone_bits  1
   130478 #define GEN75_INSTDONE_1_GAFSDone_bits  1
   130479 #define GEN7_INSTDONE_1_GAFSDone_bits  1
   130480 
   130481 static inline uint32_t ATTRIBUTE_PURE
   130482 INSTDONE_1_GAFSDone_bits(const struct gen_device_info *devinfo)
   130483 {
   130484    switch (devinfo->gen) {
   130485    case 10: return 1;
   130486    case 9: return 1;
   130487    case 8: return 1;
   130488    case 7:
   130489       if (devinfo->is_haswell) {
   130490          return 1;
   130491       } else {
   130492          return 1;
   130493       }
   130494    case 6: return 0;
   130495    case 5: return 0;
   130496    case 4:
   130497       if (devinfo->is_g4x) {
   130498          return 0;
   130499       } else {
   130500          return 0;
   130501       }
   130502    default:
   130503       unreachable("Invalid hardware generation");
   130504    }
   130505 }
   130506 
   130507 
   130508 
   130509 #define GEN10_INSTDONE_1_GAFSDone_start  15
   130510 #define GEN9_INSTDONE_1_GAFSDone_start  15
   130511 #define GEN8_INSTDONE_1_GAFSDone_start  15
   130512 #define GEN75_INSTDONE_1_GAFSDone_start  15
   130513 #define GEN7_INSTDONE_1_GAFSDone_start  15
   130514 
   130515 static inline uint32_t ATTRIBUTE_PURE
   130516 INSTDONE_1_GAFSDone_start(const struct gen_device_info *devinfo)
   130517 {
   130518    switch (devinfo->gen) {
   130519    case 10: return 15;
   130520    case 9: return 15;
   130521    case 8: return 15;
   130522    case 7:
   130523       if (devinfo->is_haswell) {
   130524          return 15;
   130525       } else {
   130526          return 15;
   130527       }
   130528    case 6: return 0;
   130529    case 5: return 0;
   130530    case 4:
   130531       if (devinfo->is_g4x) {
   130532          return 0;
   130533       } else {
   130534          return 0;
   130535       }
   130536    default:
   130537       unreachable("Invalid hardware generation");
   130538    }
   130539 }
   130540 
   130541 
   130542 
   130543 /* INSTDONE_1::GAM Done */
   130544 
   130545 
   130546 #define GEN10_INSTDONE_1_GAMDone_bits  1
   130547 #define GEN9_INSTDONE_1_GAMDone_bits  1
   130548 #define GEN8_INSTDONE_1_GAMDone_bits  1
   130549 #define GEN75_INSTDONE_1_GAMDone_bits  1
   130550 #define GEN7_INSTDONE_1_GAMDone_bits  1
   130551 
   130552 static inline uint32_t ATTRIBUTE_PURE
   130553 INSTDONE_1_GAMDone_bits(const struct gen_device_info *devinfo)
   130554 {
   130555    switch (devinfo->gen) {
   130556    case 10: return 1;
   130557    case 9: return 1;
   130558    case 8: return 1;
   130559    case 7:
   130560       if (devinfo->is_haswell) {
   130561          return 1;
   130562       } else {
   130563          return 1;
   130564       }
   130565    case 6: return 0;
   130566    case 5: return 0;
   130567    case 4:
   130568       if (devinfo->is_g4x) {
   130569          return 0;
   130570       } else {
   130571          return 0;
   130572       }
   130573    default:
   130574       unreachable("Invalid hardware generation");
   130575    }
   130576 }
   130577 
   130578 
   130579 
   130580 #define GEN10_INSTDONE_1_GAMDone_start  19
   130581 #define GEN9_INSTDONE_1_GAMDone_start  19
   130582 #define GEN8_INSTDONE_1_GAMDone_start  19
   130583 #define GEN75_INSTDONE_1_GAMDone_start  19
   130584 #define GEN7_INSTDONE_1_GAMDone_start  19
   130585 
   130586 static inline uint32_t ATTRIBUTE_PURE
   130587 INSTDONE_1_GAMDone_start(const struct gen_device_info *devinfo)
   130588 {
   130589    switch (devinfo->gen) {
   130590    case 10: return 19;
   130591    case 9: return 19;
   130592    case 8: return 19;
   130593    case 7:
   130594       if (devinfo->is_haswell) {
   130595          return 19;
   130596       } else {
   130597          return 19;
   130598       }
   130599    case 6: return 0;
   130600    case 5: return 0;
   130601    case 4:
   130602       if (devinfo->is_g4x) {
   130603          return 0;
   130604       } else {
   130605          return 0;
   130606       }
   130607    default:
   130608       unreachable("Invalid hardware generation");
   130609    }
   130610 }
   130611 
   130612 
   130613 
   130614 /* INSTDONE_1::GS Done */
   130615 
   130616 
   130617 #define GEN10_INSTDONE_1_GSDone_bits  1
   130618 #define GEN9_INSTDONE_1_GSDone_bits  1
   130619 #define GEN8_INSTDONE_1_GSDone_bits  1
   130620 #define GEN75_INSTDONE_1_GSDone_bits  1
   130621 #define GEN7_INSTDONE_1_GSDone_bits  1
   130622 
   130623 static inline uint32_t ATTRIBUTE_PURE
   130624 INSTDONE_1_GSDone_bits(const struct gen_device_info *devinfo)
   130625 {
   130626    switch (devinfo->gen) {
   130627    case 10: return 1;
   130628    case 9: return 1;
   130629    case 8: return 1;
   130630    case 7:
   130631       if (devinfo->is_haswell) {
   130632          return 1;
   130633       } else {
   130634          return 1;
   130635       }
   130636    case 6: return 0;
   130637    case 5: return 0;
   130638    case 4:
   130639       if (devinfo->is_g4x) {
   130640          return 0;
   130641       } else {
   130642          return 0;
   130643       }
   130644    default:
   130645       unreachable("Invalid hardware generation");
   130646    }
   130647 }
   130648 
   130649 
   130650 
   130651 #define GEN10_INSTDONE_1_GSDone_start  6
   130652 #define GEN9_INSTDONE_1_GSDone_start  6
   130653 #define GEN8_INSTDONE_1_GSDone_start  6
   130654 #define GEN75_INSTDONE_1_GSDone_start  6
   130655 #define GEN7_INSTDONE_1_GSDone_start  6
   130656 
   130657 static inline uint32_t ATTRIBUTE_PURE
   130658 INSTDONE_1_GSDone_start(const struct gen_device_info *devinfo)
   130659 {
   130660    switch (devinfo->gen) {
   130661    case 10: return 6;
   130662    case 9: return 6;
   130663    case 8: return 6;
   130664    case 7:
   130665       if (devinfo->is_haswell) {
   130666          return 6;
   130667       } else {
   130668          return 6;
   130669       }
   130670    case 6: return 0;
   130671    case 5: return 0;
   130672    case 4:
   130673       if (devinfo->is_g4x) {
   130674          return 0;
   130675       } else {
   130676          return 0;
   130677       }
   130678    default:
   130679       unreachable("Invalid hardware generation");
   130680    }
   130681 }
   130682 
   130683 
   130684 
   130685 /* INSTDONE_1::GW Done */
   130686 
   130687 
   130688 #define GEN6_INSTDONE_1_GWDone_bits  1
   130689 
   130690 static inline uint32_t ATTRIBUTE_PURE
   130691 INSTDONE_1_GWDone_bits(const struct gen_device_info *devinfo)
   130692 {
   130693    switch (devinfo->gen) {
   130694    case 10: return 0;
   130695    case 9: return 0;
   130696    case 8: return 0;
   130697    case 7:
   130698       if (devinfo->is_haswell) {
   130699          return 0;
   130700       } else {
   130701          return 0;
   130702       }
   130703    case 6: return 1;
   130704    case 5: return 0;
   130705    case 4:
   130706       if (devinfo->is_g4x) {
   130707          return 0;
   130708       } else {
   130709          return 0;
   130710       }
   130711    default:
   130712       unreachable("Invalid hardware generation");
   130713    }
   130714 }
   130715 
   130716 
   130717 
   130718 #define GEN6_INSTDONE_1_GWDone_start  3
   130719 
   130720 static inline uint32_t ATTRIBUTE_PURE
   130721 INSTDONE_1_GWDone_start(const struct gen_device_info *devinfo)
   130722 {
   130723    switch (devinfo->gen) {
   130724    case 10: return 0;
   130725    case 9: return 0;
   130726    case 8: return 0;
   130727    case 7:
   130728       if (devinfo->is_haswell) {
   130729          return 0;
   130730       } else {
   130731          return 0;
   130732       }
   130733    case 6: return 3;
   130734    case 5: return 0;
   130735    case 4:
   130736       if (devinfo->is_g4x) {
   130737          return 0;
   130738       } else {
   130739          return 0;
   130740       }
   130741    default:
   130742       unreachable("Invalid hardware generation");
   130743    }
   130744 }
   130745 
   130746 
   130747 
   130748 /* INSTDONE_1::HIZ Done */
   130749 
   130750 
   130751 #define GEN6_INSTDONE_1_HIZDone_bits  1
   130752 
   130753 static inline uint32_t ATTRIBUTE_PURE
   130754 INSTDONE_1_HIZDone_bits(const struct gen_device_info *devinfo)
   130755 {
   130756    switch (devinfo->gen) {
   130757    case 10: return 0;
   130758    case 9: return 0;
   130759    case 8: return 0;
   130760    case 7:
   130761       if (devinfo->is_haswell) {
   130762          return 0;
   130763       } else {
   130764          return 0;
   130765       }
   130766    case 6: return 1;
   130767    case 5: return 0;
   130768    case 4:
   130769       if (devinfo->is_g4x) {
   130770          return 0;
   130771       } else {
   130772          return 0;
   130773       }
   130774    default:
   130775       unreachable("Invalid hardware generation");
   130776    }
   130777 }
   130778 
   130779 
   130780 
   130781 #define GEN6_INSTDONE_1_HIZDone_start  2
   130782 
   130783 static inline uint32_t ATTRIBUTE_PURE
   130784 INSTDONE_1_HIZDone_start(const struct gen_device_info *devinfo)
   130785 {
   130786    switch (devinfo->gen) {
   130787    case 10: return 0;
   130788    case 9: return 0;
   130789    case 8: return 0;
   130790    case 7:
   130791       if (devinfo->is_haswell) {
   130792          return 0;
   130793       } else {
   130794          return 0;
   130795       }
   130796    case 6: return 2;
   130797    case 5: return 0;
   130798    case 4:
   130799       if (devinfo->is_g4x) {
   130800          return 0;
   130801       } else {
   130802          return 0;
   130803       }
   130804    default:
   130805       unreachable("Invalid hardware generation");
   130806    }
   130807 }
   130808 
   130809 
   130810 
   130811 /* INSTDONE_1::HS Done */
   130812 
   130813 
   130814 #define GEN10_INSTDONE_1_HSDone_bits  1
   130815 #define GEN9_INSTDONE_1_HSDone_bits  1
   130816 #define GEN8_INSTDONE_1_HSDone_bits  1
   130817 #define GEN75_INSTDONE_1_HSDone_bits  1
   130818 #define GEN7_INSTDONE_1_HSDone_bits  1
   130819 
   130820 static inline uint32_t ATTRIBUTE_PURE
   130821 INSTDONE_1_HSDone_bits(const struct gen_device_info *devinfo)
   130822 {
   130823    switch (devinfo->gen) {
   130824    case 10: return 1;
   130825    case 9: return 1;
   130826    case 8: return 1;
   130827    case 7:
   130828       if (devinfo->is_haswell) {
   130829          return 1;
   130830       } else {
   130831          return 1;
   130832       }
   130833    case 6: return 0;
   130834    case 5: return 0;
   130835    case 4:
   130836       if (devinfo->is_g4x) {
   130837          return 0;
   130838       } else {
   130839          return 0;
   130840       }
   130841    default:
   130842       unreachable("Invalid hardware generation");
   130843    }
   130844 }
   130845 
   130846 
   130847 
   130848 #define GEN10_INSTDONE_1_HSDone_start  3
   130849 #define GEN9_INSTDONE_1_HSDone_start  3
   130850 #define GEN8_INSTDONE_1_HSDone_start  3
   130851 #define GEN75_INSTDONE_1_HSDone_start  3
   130852 #define GEN7_INSTDONE_1_HSDone_start  3
   130853 
   130854 static inline uint32_t ATTRIBUTE_PURE
   130855 INSTDONE_1_HSDone_start(const struct gen_device_info *devinfo)
   130856 {
   130857    switch (devinfo->gen) {
   130858    case 10: return 3;
   130859    case 9: return 3;
   130860    case 8: return 3;
   130861    case 7:
   130862       if (devinfo->is_haswell) {
   130863          return 3;
   130864       } else {
   130865          return 3;
   130866       }
   130867    case 6: return 0;
   130868    case 5: return 0;
   130869    case 4:
   130870       if (devinfo->is_g4x) {
   130871          return 0;
   130872       } else {
   130873          return 0;
   130874       }
   130875    default:
   130876       unreachable("Invalid hardware generation");
   130877    }
   130878 }
   130879 
   130880 
   130881 
   130882 /* INSTDONE_1::IC0 Done */
   130883 
   130884 
   130885 #define GEN6_INSTDONE_1_IC0Done_bits  1
   130886 
   130887 static inline uint32_t ATTRIBUTE_PURE
   130888 INSTDONE_1_IC0Done_bits(const struct gen_device_info *devinfo)
   130889 {
   130890    switch (devinfo->gen) {
   130891    case 10: return 0;
   130892    case 9: return 0;
   130893    case 8: return 0;
   130894    case 7:
   130895       if (devinfo->is_haswell) {
   130896          return 0;
   130897       } else {
   130898          return 0;
   130899       }
   130900    case 6: return 1;
   130901    case 5: return 0;
   130902    case 4:
   130903       if (devinfo->is_g4x) {
   130904          return 0;
   130905       } else {
   130906          return 0;
   130907       }
   130908    default:
   130909       unreachable("Invalid hardware generation");
   130910    }
   130911 }
   130912 
   130913 
   130914 
   130915 #define GEN6_INSTDONE_1_IC0Done_start  12
   130916 
   130917 static inline uint32_t ATTRIBUTE_PURE
   130918 INSTDONE_1_IC0Done_start(const struct gen_device_info *devinfo)
   130919 {
   130920    switch (devinfo->gen) {
   130921    case 10: return 0;
   130922    case 9: return 0;
   130923    case 8: return 0;
   130924    case 7:
   130925       if (devinfo->is_haswell) {
   130926          return 0;
   130927       } else {
   130928          return 0;
   130929       }
   130930    case 6: return 12;
   130931    case 5: return 0;
   130932    case 4:
   130933       if (devinfo->is_g4x) {
   130934          return 0;
   130935       } else {
   130936          return 0;
   130937       }
   130938    default:
   130939       unreachable("Invalid hardware generation");
   130940    }
   130941 }
   130942 
   130943 
   130944 
   130945 /* INSTDONE_1::IC1 Done */
   130946 
   130947 
   130948 #define GEN6_INSTDONE_1_IC1Done_bits  1
   130949 
   130950 static inline uint32_t ATTRIBUTE_PURE
   130951 INSTDONE_1_IC1Done_bits(const struct gen_device_info *devinfo)
   130952 {
   130953    switch (devinfo->gen) {
   130954    case 10: return 0;
   130955    case 9: return 0;
   130956    case 8: return 0;
   130957    case 7:
   130958       if (devinfo->is_haswell) {
   130959          return 0;
   130960       } else {
   130961          return 0;
   130962       }
   130963    case 6: return 1;
   130964    case 5: return 0;
   130965    case 4:
   130966       if (devinfo->is_g4x) {
   130967          return 0;
   130968       } else {
   130969          return 0;
   130970       }
   130971    default:
   130972       unreachable("Invalid hardware generation");
   130973    }
   130974 }
   130975 
   130976 
   130977 
   130978 #define GEN6_INSTDONE_1_IC1Done_start  13
   130979 
   130980 static inline uint32_t ATTRIBUTE_PURE
   130981 INSTDONE_1_IC1Done_start(const struct gen_device_info *devinfo)
   130982 {
   130983    switch (devinfo->gen) {
   130984    case 10: return 0;
   130985    case 9: return 0;
   130986    case 8: return 0;
   130987    case 7:
   130988       if (devinfo->is_haswell) {
   130989          return 0;
   130990       } else {
   130991          return 0;
   130992       }
   130993    case 6: return 13;
   130994    case 5: return 0;
   130995    case 4:
   130996       if (devinfo->is_g4x) {
   130997          return 0;
   130998       } else {
   130999          return 0;
   131000       }
   131001    default:
   131002       unreachable("Invalid hardware generation");
   131003    }
   131004 }
   131005 
   131006 
   131007 
   131008 /* INSTDONE_1::IC2 Done */
   131009 
   131010 
   131011 #define GEN6_INSTDONE_1_IC2Done_bits  1
   131012 
   131013 static inline uint32_t ATTRIBUTE_PURE
   131014 INSTDONE_1_IC2Done_bits(const struct gen_device_info *devinfo)
   131015 {
   131016    switch (devinfo->gen) {
   131017    case 10: return 0;
   131018    case 9: return 0;
   131019    case 8: return 0;
   131020    case 7:
   131021       if (devinfo->is_haswell) {
   131022          return 0;
   131023       } else {
   131024          return 0;
   131025       }
   131026    case 6: return 1;
   131027    case 5: return 0;
   131028    case 4:
   131029       if (devinfo->is_g4x) {
   131030          return 0;
   131031       } else {
   131032          return 0;
   131033       }
   131034    default:
   131035       unreachable("Invalid hardware generation");
   131036    }
   131037 }
   131038 
   131039 
   131040 
   131041 #define GEN6_INSTDONE_1_IC2Done_start  14
   131042 
   131043 static inline uint32_t ATTRIBUTE_PURE
   131044 INSTDONE_1_IC2Done_start(const struct gen_device_info *devinfo)
   131045 {
   131046    switch (devinfo->gen) {
   131047    case 10: return 0;
   131048    case 9: return 0;
   131049    case 8: return 0;
   131050    case 7:
   131051       if (devinfo->is_haswell) {
   131052          return 0;
   131053       } else {
   131054          return 0;
   131055       }
   131056    case 6: return 14;
   131057    case 5: return 0;
   131058    case 4:
   131059       if (devinfo->is_g4x) {
   131060          return 0;
   131061       } else {
   131062          return 0;
   131063       }
   131064    default:
   131065       unreachable("Invalid hardware generation");
   131066    }
   131067 }
   131068 
   131069 
   131070 
   131071 /* INSTDONE_1::IC3 Done */
   131072 
   131073 
   131074 #define GEN6_INSTDONE_1_IC3Done_bits  1
   131075 
   131076 static inline uint32_t ATTRIBUTE_PURE
   131077 INSTDONE_1_IC3Done_bits(const struct gen_device_info *devinfo)
   131078 {
   131079    switch (devinfo->gen) {
   131080    case 10: return 0;
   131081    case 9: return 0;
   131082    case 8: return 0;
   131083    case 7:
   131084       if (devinfo->is_haswell) {
   131085          return 0;
   131086       } else {
   131087          return 0;
   131088       }
   131089    case 6: return 1;
   131090    case 5: return 0;
   131091    case 4:
   131092       if (devinfo->is_g4x) {
   131093          return 0;
   131094       } else {
   131095          return 0;
   131096       }
   131097    default:
   131098       unreachable("Invalid hardware generation");
   131099    }
   131100 }
   131101 
   131102 
   131103 
   131104 #define GEN6_INSTDONE_1_IC3Done_start  15
   131105 
   131106 static inline uint32_t ATTRIBUTE_PURE
   131107 INSTDONE_1_IC3Done_start(const struct gen_device_info *devinfo)
   131108 {
   131109    switch (devinfo->gen) {
   131110    case 10: return 0;
   131111    case 9: return 0;
   131112    case 8: return 0;
   131113    case 7:
   131114       if (devinfo->is_haswell) {
   131115          return 0;
   131116       } else {
   131117          return 0;
   131118       }
   131119    case 6: return 15;
   131120    case 5: return 0;
   131121    case 4:
   131122       if (devinfo->is_g4x) {
   131123          return 0;
   131124       } else {
   131125          return 0;
   131126       }
   131127    default:
   131128       unreachable("Invalid hardware generation");
   131129    }
   131130 }
   131131 
   131132 
   131133 
   131134 /* INSTDONE_1::IEF Done */
   131135 
   131136 
   131137 #define GEN6_INSTDONE_1_IEFDone_bits  1
   131138 
   131139 static inline uint32_t ATTRIBUTE_PURE
   131140 INSTDONE_1_IEFDone_bits(const struct gen_device_info *devinfo)
   131141 {
   131142    switch (devinfo->gen) {
   131143    case 10: return 0;
   131144    case 9: return 0;
   131145    case 8: return 0;
   131146    case 7:
   131147       if (devinfo->is_haswell) {
   131148          return 0;
   131149       } else {
   131150          return 0;
   131151       }
   131152    case 6: return 1;
   131153    case 5: return 0;
   131154    case 4:
   131155       if (devinfo->is_g4x) {
   131156          return 0;
   131157       } else {
   131158          return 0;
   131159       }
   131160    default:
   131161       unreachable("Invalid hardware generation");
   131162    }
   131163 }
   131164 
   131165 
   131166 
   131167 #define GEN6_INSTDONE_1_IEFDone_start  8
   131168 
   131169 static inline uint32_t ATTRIBUTE_PURE
   131170 INSTDONE_1_IEFDone_start(const struct gen_device_info *devinfo)
   131171 {
   131172    switch (devinfo->gen) {
   131173    case 10: return 0;
   131174    case 9: return 0;
   131175    case 8: return 0;
   131176    case 7:
   131177       if (devinfo->is_haswell) {
   131178          return 0;
   131179       } else {
   131180          return 0;
   131181       }
   131182    case 6: return 8;
   131183    case 5: return 0;
   131184    case 4:
   131185       if (devinfo->is_g4x) {
   131186          return 0;
   131187       } else {
   131188          return 0;
   131189       }
   131190    default:
   131191       unreachable("Invalid hardware generation");
   131192    }
   131193 }
   131194 
   131195 
   131196 
   131197 /* INSTDONE_1::ISC1/0 Done */
   131198 
   131199 
   131200 #define GEN6_INSTDONE_1_ISC10Done_bits  1
   131201 
   131202 static inline uint32_t ATTRIBUTE_PURE
   131203 INSTDONE_1_ISC10Done_bits(const struct gen_device_info *devinfo)
   131204 {
   131205    switch (devinfo->gen) {
   131206    case 10: return 0;
   131207    case 9: return 0;
   131208    case 8: return 0;
   131209    case 7:
   131210       if (devinfo->is_haswell) {
   131211          return 0;
   131212       } else {
   131213          return 0;
   131214       }
   131215    case 6: return 1;
   131216    case 5: return 0;
   131217    case 4:
   131218       if (devinfo->is_g4x) {
   131219          return 0;
   131220       } else {
   131221          return 0;
   131222       }
   131223    default:
   131224       unreachable("Invalid hardware generation");
   131225    }
   131226 }
   131227 
   131228 
   131229 
   131230 #define GEN6_INSTDONE_1_ISC10Done_start  11
   131231 
   131232 static inline uint32_t ATTRIBUTE_PURE
   131233 INSTDONE_1_ISC10Done_start(const struct gen_device_info *devinfo)
   131234 {
   131235    switch (devinfo->gen) {
   131236    case 10: return 0;
   131237    case 9: return 0;
   131238    case 8: return 0;
   131239    case 7:
   131240       if (devinfo->is_haswell) {
   131241          return 0;
   131242       } else {
   131243          return 0;
   131244       }
   131245    case 6: return 11;
   131246    case 5: return 0;
   131247    case 4:
   131248       if (devinfo->is_g4x) {
   131249          return 0;
   131250       } else {
   131251          return 0;
   131252       }
   131253    default:
   131254       unreachable("Invalid hardware generation");
   131255    }
   131256 }
   131257 
   131258 
   131259 
   131260 /* INSTDONE_1::ISC2/3 Done */
   131261 
   131262 
   131263 #define GEN6_INSTDONE_1_ISC23Done_bits  1
   131264 
   131265 static inline uint32_t ATTRIBUTE_PURE
   131266 INSTDONE_1_ISC23Done_bits(const struct gen_device_info *devinfo)
   131267 {
   131268    switch (devinfo->gen) {
   131269    case 10: return 0;
   131270    case 9: return 0;
   131271    case 8: return 0;
   131272    case 7:
   131273       if (devinfo->is_haswell) {
   131274          return 0;
   131275       } else {
   131276          return 0;
   131277       }
   131278    case 6: return 1;
   131279    case 5: return 0;
   131280    case 4:
   131281       if (devinfo->is_g4x) {
   131282          return 0;
   131283       } else {
   131284          return 0;
   131285       }
   131286    default:
   131287       unreachable("Invalid hardware generation");
   131288    }
   131289 }
   131290 
   131291 
   131292 
   131293 #define GEN6_INSTDONE_1_ISC23Done_start  10
   131294 
   131295 static inline uint32_t ATTRIBUTE_PURE
   131296 INSTDONE_1_ISC23Done_start(const struct gen_device_info *devinfo)
   131297 {
   131298    switch (devinfo->gen) {
   131299    case 10: return 0;
   131300    case 9: return 0;
   131301    case 8: return 0;
   131302    case 7:
   131303       if (devinfo->is_haswell) {
   131304          return 0;
   131305       } else {
   131306          return 0;
   131307       }
   131308    case 6: return 10;
   131309    case 5: return 0;
   131310    case 4:
   131311       if (devinfo->is_g4x) {
   131312          return 0;
   131313       } else {
   131314          return 0;
   131315       }
   131316    default:
   131317       unreachable("Invalid hardware generation");
   131318    }
   131319 }
   131320 
   131321 
   131322 
   131323 /* INSTDONE_1::MA0 Done */
   131324 
   131325 
   131326 #define GEN6_INSTDONE_1_MA0Done_bits  1
   131327 
   131328 static inline uint32_t ATTRIBUTE_PURE
   131329 INSTDONE_1_MA0Done_bits(const struct gen_device_info *devinfo)
   131330 {
   131331    switch (devinfo->gen) {
   131332    case 10: return 0;
   131333    case 9: return 0;
   131334    case 8: return 0;
   131335    case 7:
   131336       if (devinfo->is_haswell) {
   131337          return 0;
   131338       } else {
   131339          return 0;
   131340       }
   131341    case 6: return 1;
   131342    case 5: return 0;
   131343    case 4:
   131344       if (devinfo->is_g4x) {
   131345          return 0;
   131346       } else {
   131347          return 0;
   131348       }
   131349    default:
   131350       unreachable("Invalid hardware generation");
   131351    }
   131352 }
   131353 
   131354 
   131355 
   131356 #define GEN6_INSTDONE_1_MA0Done_start  19
   131357 
   131358 static inline uint32_t ATTRIBUTE_PURE
   131359 INSTDONE_1_MA0Done_start(const struct gen_device_info *devinfo)
   131360 {
   131361    switch (devinfo->gen) {
   131362    case 10: return 0;
   131363    case 9: return 0;
   131364    case 8: return 0;
   131365    case 7:
   131366       if (devinfo->is_haswell) {
   131367          return 0;
   131368       } else {
   131369          return 0;
   131370       }
   131371    case 6: return 19;
   131372    case 5: return 0;
   131373    case 4:
   131374       if (devinfo->is_g4x) {
   131375          return 0;
   131376       } else {
   131377          return 0;
   131378       }
   131379    default:
   131380       unreachable("Invalid hardware generation");
   131381    }
   131382 }
   131383 
   131384 
   131385 
   131386 /* INSTDONE_1::MA1 Done */
   131387 
   131388 
   131389 #define GEN6_INSTDONE_1_MA1Done_bits  1
   131390 
   131391 static inline uint32_t ATTRIBUTE_PURE
   131392 INSTDONE_1_MA1Done_bits(const struct gen_device_info *devinfo)
   131393 {
   131394    switch (devinfo->gen) {
   131395    case 10: return 0;
   131396    case 9: return 0;
   131397    case 8: return 0;
   131398    case 7:
   131399       if (devinfo->is_haswell) {
   131400          return 0;
   131401       } else {
   131402          return 0;
   131403       }
   131404    case 6: return 1;
   131405    case 5: return 0;
   131406    case 4:
   131407       if (devinfo->is_g4x) {
   131408          return 0;
   131409       } else {
   131410          return 0;
   131411       }
   131412    default:
   131413       unreachable("Invalid hardware generation");
   131414    }
   131415 }
   131416 
   131417 
   131418 
   131419 #define GEN6_INSTDONE_1_MA1Done_start  23
   131420 
   131421 static inline uint32_t ATTRIBUTE_PURE
   131422 INSTDONE_1_MA1Done_start(const struct gen_device_info *devinfo)
   131423 {
   131424    switch (devinfo->gen) {
   131425    case 10: return 0;
   131426    case 9: return 0;
   131427    case 8: return 0;
   131428    case 7:
   131429       if (devinfo->is_haswell) {
   131430          return 0;
   131431       } else {
   131432          return 0;
   131433       }
   131434    case 6: return 23;
   131435    case 5: return 0;
   131436    case 4:
   131437       if (devinfo->is_g4x) {
   131438          return 0;
   131439       } else {
   131440          return 0;
   131441       }
   131442    default:
   131443       unreachable("Invalid hardware generation");
   131444    }
   131445 }
   131446 
   131447 
   131448 
   131449 /* INSTDONE_1::MA2 Done */
   131450 
   131451 
   131452 #define GEN6_INSTDONE_1_MA2Done_bits  1
   131453 
   131454 static inline uint32_t ATTRIBUTE_PURE
   131455 INSTDONE_1_MA2Done_bits(const struct gen_device_info *devinfo)
   131456 {
   131457    switch (devinfo->gen) {
   131458    case 10: return 0;
   131459    case 9: return 0;
   131460    case 8: return 0;
   131461    case 7:
   131462       if (devinfo->is_haswell) {
   131463          return 0;
   131464       } else {
   131465          return 0;
   131466       }
   131467    case 6: return 1;
   131468    case 5: return 0;
   131469    case 4:
   131470       if (devinfo->is_g4x) {
   131471          return 0;
   131472       } else {
   131473          return 0;
   131474       }
   131475    default:
   131476       unreachable("Invalid hardware generation");
   131477    }
   131478 }
   131479 
   131480 
   131481 
   131482 #define GEN6_INSTDONE_1_MA2Done_start  27
   131483 
   131484 static inline uint32_t ATTRIBUTE_PURE
   131485 INSTDONE_1_MA2Done_start(const struct gen_device_info *devinfo)
   131486 {
   131487    switch (devinfo->gen) {
   131488    case 10: return 0;
   131489    case 9: return 0;
   131490    case 8: return 0;
   131491    case 7:
   131492       if (devinfo->is_haswell) {
   131493          return 0;
   131494       } else {
   131495          return 0;
   131496       }
   131497    case 6: return 27;
   131498    case 5: return 0;
   131499    case 4:
   131500       if (devinfo->is_g4x) {
   131501          return 0;
   131502       } else {
   131503          return 0;
   131504       }
   131505    default:
   131506       unreachable("Invalid hardware generation");
   131507    }
   131508 }
   131509 
   131510 
   131511 
   131512 /* INSTDONE_1::MA3 Done */
   131513 
   131514 
   131515 #define GEN6_INSTDONE_1_MA3Done_bits  1
   131516 
   131517 static inline uint32_t ATTRIBUTE_PURE
   131518 INSTDONE_1_MA3Done_bits(const struct gen_device_info *devinfo)
   131519 {
   131520    switch (devinfo->gen) {
   131521    case 10: return 0;
   131522    case 9: return 0;
   131523    case 8: return 0;
   131524    case 7:
   131525       if (devinfo->is_haswell) {
   131526          return 0;
   131527       } else {
   131528          return 0;
   131529       }
   131530    case 6: return 1;
   131531    case 5: return 0;
   131532    case 4:
   131533       if (devinfo->is_g4x) {
   131534          return 0;
   131535       } else {
   131536          return 0;
   131537       }
   131538    default:
   131539       unreachable("Invalid hardware generation");
   131540    }
   131541 }
   131542 
   131543 
   131544 
   131545 #define GEN6_INSTDONE_1_MA3Done_start  31
   131546 
   131547 static inline uint32_t ATTRIBUTE_PURE
   131548 INSTDONE_1_MA3Done_start(const struct gen_device_info *devinfo)
   131549 {
   131550    switch (devinfo->gen) {
   131551    case 10: return 0;
   131552    case 9: return 0;
   131553    case 8: return 0;
   131554    case 7:
   131555       if (devinfo->is_haswell) {
   131556          return 0;
   131557       } else {
   131558          return 0;
   131559       }
   131560    case 6: return 31;
   131561    case 5: return 0;
   131562    case 4:
   131563       if (devinfo->is_g4x) {
   131564          return 0;
   131565       } else {
   131566          return 0;
   131567       }
   131568    default:
   131569       unreachable("Invalid hardware generation");
   131570    }
   131571 }
   131572 
   131573 
   131574 
   131575 /* INSTDONE_1::PRB0 Ring Enable */
   131576 
   131577 
   131578 #define GEN10_INSTDONE_1_PRB0RingEnable_bits  1
   131579 #define GEN9_INSTDONE_1_PRB0RingEnable_bits  1
   131580 #define GEN8_INSTDONE_1_PRB0RingEnable_bits  1
   131581 #define GEN75_INSTDONE_1_PRB0RingEnable_bits  1
   131582 #define GEN7_INSTDONE_1_PRB0RingEnable_bits  1
   131583 #define GEN6_INSTDONE_1_PRB0RingEnable_bits  1
   131584 
   131585 static inline uint32_t ATTRIBUTE_PURE
   131586 INSTDONE_1_PRB0RingEnable_bits(const struct gen_device_info *devinfo)
   131587 {
   131588    switch (devinfo->gen) {
   131589    case 10: return 1;
   131590    case 9: return 1;
   131591    case 8: return 1;
   131592    case 7:
   131593       if (devinfo->is_haswell) {
   131594          return 1;
   131595       } else {
   131596          return 1;
   131597       }
   131598    case 6: return 1;
   131599    case 5: return 0;
   131600    case 4:
   131601       if (devinfo->is_g4x) {
   131602          return 0;
   131603       } else {
   131604          return 0;
   131605       }
   131606    default:
   131607       unreachable("Invalid hardware generation");
   131608    }
   131609 }
   131610 
   131611 
   131612 
   131613 #define GEN10_INSTDONE_1_PRB0RingEnable_start  0
   131614 #define GEN9_INSTDONE_1_PRB0RingEnable_start  0
   131615 #define GEN8_INSTDONE_1_PRB0RingEnable_start  0
   131616 #define GEN75_INSTDONE_1_PRB0RingEnable_start  0
   131617 #define GEN7_INSTDONE_1_PRB0RingEnable_start  0
   131618 #define GEN6_INSTDONE_1_PRB0RingEnable_start  0
   131619 
   131620 static inline uint32_t ATTRIBUTE_PURE
   131621 INSTDONE_1_PRB0RingEnable_start(const struct gen_device_info *devinfo)
   131622 {
   131623    switch (devinfo->gen) {
   131624    case 10: return 0;
   131625    case 9: return 0;
   131626    case 8: return 0;
   131627    case 7:
   131628       if (devinfo->is_haswell) {
   131629          return 0;
   131630       } else {
   131631          return 0;
   131632       }
   131633    case 6: return 0;
   131634    case 5: return 0;
   131635    case 4:
   131636       if (devinfo->is_g4x) {
   131637          return 0;
   131638       } else {
   131639          return 0;
   131640       }
   131641    default:
   131642       unreachable("Invalid hardware generation");
   131643    }
   131644 }
   131645 
   131646 
   131647 
   131648 /* INSTDONE_1::RCCFBC CS Done */
   131649 
   131650 
   131651 #define GEN10_INSTDONE_1_RCCFBCCSDone_bits  1
   131652 #define GEN9_INSTDONE_1_RCCFBCCSDone_bits  1
   131653 #define GEN8_INSTDONE_1_RCCFBCCSDone_bits  1
   131654 #define GEN75_INSTDONE_1_RCCFBCCSDone_bits  1
   131655 #define GEN7_INSTDONE_1_RCCFBCCSDone_bits  1
   131656 
   131657 static inline uint32_t ATTRIBUTE_PURE
   131658 INSTDONE_1_RCCFBCCSDone_bits(const struct gen_device_info *devinfo)
   131659 {
   131660    switch (devinfo->gen) {
   131661    case 10: return 1;
   131662    case 9: return 1;
   131663    case 8: return 1;
   131664    case 7:
   131665       if (devinfo->is_haswell) {
   131666          return 1;
   131667       } else {
   131668          return 1;
   131669       }
   131670    case 6: return 0;
   131671    case 5: return 0;
   131672    case 4:
   131673       if (devinfo->is_g4x) {
   131674          return 0;
   131675       } else {
   131676          return 0;
   131677       }
   131678    default:
   131679       unreachable("Invalid hardware generation");
   131680    }
   131681 }
   131682 
   131683 
   131684 
   131685 #define GEN10_INSTDONE_1_RCCFBCCSDone_start  23
   131686 #define GEN9_INSTDONE_1_RCCFBCCSDone_start  23
   131687 #define GEN8_INSTDONE_1_RCCFBCCSDone_start  23
   131688 #define GEN75_INSTDONE_1_RCCFBCCSDone_start  23
   131689 #define GEN7_INSTDONE_1_RCCFBCCSDone_start  23
   131690 
   131691 static inline uint32_t ATTRIBUTE_PURE
   131692 INSTDONE_1_RCCFBCCSDone_start(const struct gen_device_info *devinfo)
   131693 {
   131694    switch (devinfo->gen) {
   131695    case 10: return 23;
   131696    case 9: return 23;
   131697    case 8: return 23;
   131698    case 7:
   131699       if (devinfo->is_haswell) {
   131700          return 23;
   131701       } else {
   131702          return 23;
   131703       }
   131704    case 6: return 0;
   131705    case 5: return 0;
   131706    case 4:
   131707       if (devinfo->is_g4x) {
   131708          return 0;
   131709       } else {
   131710          return 0;
   131711       }
   131712    default:
   131713       unreachable("Invalid hardware generation");
   131714    }
   131715 }
   131716 
   131717 
   131718 
   131719 /* INSTDONE_1::RS Done */
   131720 
   131721 
   131722 #define GEN10_INSTDONE_1_RSDone_bits  1
   131723 #define GEN9_INSTDONE_1_RSDone_bits  1
   131724 #define GEN8_INSTDONE_1_RSDone_bits  1
   131725 #define GEN75_INSTDONE_1_RSDone_bits  1
   131726 
   131727 static inline uint32_t ATTRIBUTE_PURE
   131728 INSTDONE_1_RSDone_bits(const struct gen_device_info *devinfo)
   131729 {
   131730    switch (devinfo->gen) {
   131731    case 10: return 1;
   131732    case 9: return 1;
   131733    case 8: return 1;
   131734    case 7:
   131735       if (devinfo->is_haswell) {
   131736          return 1;
   131737       } else {
   131738          return 0;
   131739       }
   131740    case 6: return 0;
   131741    case 5: return 0;
   131742    case 4:
   131743       if (devinfo->is_g4x) {
   131744          return 0;
   131745       } else {
   131746          return 0;
   131747       }
   131748    default:
   131749       unreachable("Invalid hardware generation");
   131750    }
   131751 }
   131752 
   131753 
   131754 
   131755 #define GEN10_INSTDONE_1_RSDone_start  20
   131756 #define GEN9_INSTDONE_1_RSDone_start  20
   131757 #define GEN8_INSTDONE_1_RSDone_start  20
   131758 #define GEN75_INSTDONE_1_RSDone_start  20
   131759 
   131760 static inline uint32_t ATTRIBUTE_PURE
   131761 INSTDONE_1_RSDone_start(const struct gen_device_info *devinfo)
   131762 {
   131763    switch (devinfo->gen) {
   131764    case 10: return 20;
   131765    case 9: return 20;
   131766    case 8: return 20;
   131767    case 7:
   131768       if (devinfo->is_haswell) {
   131769          return 20;
   131770       } else {
   131771          return 0;
   131772       }
   131773    case 6: return 0;
   131774    case 5: return 0;
   131775    case 4:
   131776       if (devinfo->is_g4x) {
   131777          return 0;
   131778       } else {
   131779          return 0;
   131780       }
   131781    default:
   131782       unreachable("Invalid hardware generation");
   131783    }
   131784 }
   131785 
   131786 
   131787 
   131788 /* INSTDONE_1::SDE Done */
   131789 
   131790 
   131791 #define GEN10_INSTDONE_1_SDEDone_bits  1
   131792 #define GEN9_INSTDONE_1_SDEDone_bits  1
   131793 #define GEN8_INSTDONE_1_SDEDone_bits  1
   131794 #define GEN75_INSTDONE_1_SDEDone_bits  1
   131795 #define GEN7_INSTDONE_1_SDEDone_bits  1
   131796 
   131797 static inline uint32_t ATTRIBUTE_PURE
   131798 INSTDONE_1_SDEDone_bits(const struct gen_device_info *devinfo)
   131799 {
   131800    switch (devinfo->gen) {
   131801    case 10: return 1;
   131802    case 9: return 1;
   131803    case 8: return 1;
   131804    case 7:
   131805       if (devinfo->is_haswell) {
   131806          return 1;
   131807       } else {
   131808          return 1;
   131809       }
   131810    case 6: return 0;
   131811    case 5: return 0;
   131812    case 4:
   131813       if (devinfo->is_g4x) {
   131814          return 0;
   131815       } else {
   131816          return 0;
   131817       }
   131818    default:
   131819       unreachable("Invalid hardware generation");
   131820    }
   131821 }
   131822 
   131823 
   131824 
   131825 #define GEN10_INSTDONE_1_SDEDone_start  22
   131826 #define GEN9_INSTDONE_1_SDEDone_start  22
   131827 #define GEN8_INSTDONE_1_SDEDone_start  22
   131828 #define GEN75_INSTDONE_1_SDEDone_start  22
   131829 #define GEN7_INSTDONE_1_SDEDone_start  22
   131830 
   131831 static inline uint32_t ATTRIBUTE_PURE
   131832 INSTDONE_1_SDEDone_start(const struct gen_device_info *devinfo)
   131833 {
   131834    switch (devinfo->gen) {
   131835    case 10: return 22;
   131836    case 9: return 22;
   131837    case 8: return 22;
   131838    case 7:
   131839       if (devinfo->is_haswell) {
   131840          return 22;
   131841       } else {
   131842          return 22;
   131843       }
   131844    case 6: return 0;
   131845    case 5: return 0;
   131846    case 4:
   131847       if (devinfo->is_g4x) {
   131848          return 0;
   131849       } else {
   131850          return 0;
   131851       }
   131852    default:
   131853       unreachable("Invalid hardware generation");
   131854    }
   131855 }
   131856 
   131857 
   131858 
   131859 /* INSTDONE_1::SF Done */
   131860 
   131861 
   131862 #define GEN10_INSTDONE_1_SFDone_bits  1
   131863 #define GEN9_INSTDONE_1_SFDone_bits  1
   131864 #define GEN8_INSTDONE_1_SFDone_bits  1
   131865 #define GEN75_INSTDONE_1_SFDone_bits  1
   131866 #define GEN7_INSTDONE_1_SFDone_bits  1
   131867 
   131868 static inline uint32_t ATTRIBUTE_PURE
   131869 INSTDONE_1_SFDone_bits(const struct gen_device_info *devinfo)
   131870 {
   131871    switch (devinfo->gen) {
   131872    case 10: return 1;
   131873    case 9: return 1;
   131874    case 8: return 1;
   131875    case 7:
   131876       if (devinfo->is_haswell) {
   131877          return 1;
   131878       } else {
   131879          return 1;
   131880       }
   131881    case 6: return 0;
   131882    case 5: return 0;
   131883    case 4:
   131884       if (devinfo->is_g4x) {
   131885          return 0;
   131886       } else {
   131887          return 0;
   131888       }
   131889    default:
   131890       unreachable("Invalid hardware generation");
   131891    }
   131892 }
   131893 
   131894 
   131895 
   131896 #define GEN10_INSTDONE_1_SFDone_start  9
   131897 #define GEN9_INSTDONE_1_SFDone_start  9
   131898 #define GEN8_INSTDONE_1_SFDone_start  9
   131899 #define GEN75_INSTDONE_1_SFDone_start  9
   131900 #define GEN7_INSTDONE_1_SFDone_start  9
   131901 
   131902 static inline uint32_t ATTRIBUTE_PURE
   131903 INSTDONE_1_SFDone_start(const struct gen_device_info *devinfo)
   131904 {
   131905    switch (devinfo->gen) {
   131906    case 10: return 9;
   131907    case 9: return 9;
   131908    case 8: return 9;
   131909    case 7:
   131910       if (devinfo->is_haswell) {
   131911          return 9;
   131912       } else {
   131913          return 9;
   131914       }
   131915    case 6: return 0;
   131916    case 5: return 0;
   131917    case 4:
   131918       if (devinfo->is_g4x) {
   131919          return 0;
   131920       } else {
   131921          return 0;
   131922       }
   131923    default:
   131924       unreachable("Invalid hardware generation");
   131925    }
   131926 }
   131927 
   131928 
   131929 
   131930 /* INSTDONE_1::SOL Done */
   131931 
   131932 
   131933 #define GEN10_INSTDONE_1_SOLDone_bits  1
   131934 #define GEN9_INSTDONE_1_SOLDone_bits  1
   131935 #define GEN8_INSTDONE_1_SOLDone_bits  1
   131936 #define GEN75_INSTDONE_1_SOLDone_bits  1
   131937 #define GEN7_INSTDONE_1_SOLDone_bits  1
   131938 
   131939 static inline uint32_t ATTRIBUTE_PURE
   131940 INSTDONE_1_SOLDone_bits(const struct gen_device_info *devinfo)
   131941 {
   131942    switch (devinfo->gen) {
   131943    case 10: return 1;
   131944    case 9: return 1;
   131945    case 8: return 1;
   131946    case 7:
   131947       if (devinfo->is_haswell) {
   131948          return 1;
   131949       } else {
   131950          return 1;
   131951       }
   131952    case 6: return 0;
   131953    case 5: return 0;
   131954    case 4:
   131955       if (devinfo->is_g4x) {
   131956          return 0;
   131957       } else {
   131958          return 0;
   131959       }
   131960    default:
   131961       unreachable("Invalid hardware generation");
   131962    }
   131963 }
   131964 
   131965 
   131966 
   131967 #define GEN10_INSTDONE_1_SOLDone_start  7
   131968 #define GEN9_INSTDONE_1_SOLDone_start  7
   131969 #define GEN8_INSTDONE_1_SOLDone_start  7
   131970 #define GEN75_INSTDONE_1_SOLDone_start  7
   131971 #define GEN7_INSTDONE_1_SOLDone_start  7
   131972 
   131973 static inline uint32_t ATTRIBUTE_PURE
   131974 INSTDONE_1_SOLDone_start(const struct gen_device_info *devinfo)
   131975 {
   131976    switch (devinfo->gen) {
   131977    case 10: return 7;
   131978    case 9: return 7;
   131979    case 8: return 7;
   131980    case 7:
   131981       if (devinfo->is_haswell) {
   131982          return 7;
   131983       } else {
   131984          return 7;
   131985       }
   131986    case 6: return 0;
   131987    case 5: return 0;
   131988    case 4:
   131989       if (devinfo->is_g4x) {
   131990          return 0;
   131991       } else {
   131992          return 0;
   131993       }
   131994    default:
   131995       unreachable("Invalid hardware generation");
   131996    }
   131997 }
   131998 
   131999 
   132000 
   132001 /* INSTDONE_1::SVG Done */
   132002 
   132003 
   132004 #define GEN10_INSTDONE_1_SVGDone_bits  1
   132005 #define GEN9_INSTDONE_1_SVGDone_bits  1
   132006 #define GEN8_INSTDONE_1_SVGDone_bits  1
   132007 #define GEN75_INSTDONE_1_SVGDone_bits  1
   132008 #define GEN7_INSTDONE_1_SVGDone_bits  1
   132009 
   132010 static inline uint32_t ATTRIBUTE_PURE
   132011 INSTDONE_1_SVGDone_bits(const struct gen_device_info *devinfo)
   132012 {
   132013    switch (devinfo->gen) {
   132014    case 10: return 1;
   132015    case 9: return 1;
   132016    case 8: return 1;
   132017    case 7:
   132018       if (devinfo->is_haswell) {
   132019          return 1;
   132020       } else {
   132021          return 1;
   132022       }
   132023    case 6: return 0;
   132024    case 5: return 0;
   132025    case 4:
   132026       if (devinfo->is_g4x) {
   132027          return 0;
   132028       } else {
   132029          return 0;
   132030       }
   132031    default:
   132032       unreachable("Invalid hardware generation");
   132033    }
   132034 }
   132035 
   132036 
   132037 
   132038 #define GEN10_INSTDONE_1_SVGDone_start  14
   132039 #define GEN9_INSTDONE_1_SVGDone_start  14
   132040 #define GEN8_INSTDONE_1_SVGDone_start  14
   132041 #define GEN75_INSTDONE_1_SVGDone_start  14
   132042 #define GEN7_INSTDONE_1_SVGDone_start  14
   132043 
   132044 static inline uint32_t ATTRIBUTE_PURE
   132045 INSTDONE_1_SVGDone_start(const struct gen_device_info *devinfo)
   132046 {
   132047    switch (devinfo->gen) {
   132048    case 10: return 14;
   132049    case 9: return 14;
   132050    case 8: return 14;
   132051    case 7:
   132052       if (devinfo->is_haswell) {
   132053          return 14;
   132054       } else {
   132055          return 14;
   132056       }
   132057    case 6: return 0;
   132058    case 5: return 0;
   132059    case 4:
   132060       if (devinfo->is_g4x) {
   132061          return 0;
   132062       } else {
   132063          return 0;
   132064       }
   132065    default:
   132066       unreachable("Invalid hardware generation");
   132067    }
   132068 }
   132069 
   132070 
   132071 
   132072 /* INSTDONE_1::TD Done */
   132073 
   132074 
   132075 #define GEN6_INSTDONE_1_TDDone_bits  1
   132076 
   132077 static inline uint32_t ATTRIBUTE_PURE
   132078 INSTDONE_1_TDDone_bits(const struct gen_device_info *devinfo)
   132079 {
   132080    switch (devinfo->gen) {
   132081    case 10: return 0;
   132082    case 9: return 0;
   132083    case 8: return 0;
   132084    case 7:
   132085       if (devinfo->is_haswell) {
   132086          return 0;
   132087       } else {
   132088          return 0;
   132089       }
   132090    case 6: return 1;
   132091    case 5: return 0;
   132092    case 4:
   132093       if (devinfo->is_g4x) {
   132094          return 0;
   132095       } else {
   132096          return 0;
   132097       }
   132098    default:
   132099       unreachable("Invalid hardware generation");
   132100    }
   132101 }
   132102 
   132103 
   132104 
   132105 #define GEN6_INSTDONE_1_TDDone_start  6
   132106 
   132107 static inline uint32_t ATTRIBUTE_PURE
   132108 INSTDONE_1_TDDone_start(const struct gen_device_info *devinfo)
   132109 {
   132110    switch (devinfo->gen) {
   132111    case 10: return 0;
   132112    case 9: return 0;
   132113    case 8: return 0;
   132114    case 7:
   132115       if (devinfo->is_haswell) {
   132116          return 0;
   132117       } else {
   132118          return 0;
   132119       }
   132120    case 6: return 6;
   132121    case 5: return 0;
   132122    case 4:
   132123       if (devinfo->is_g4x) {
   132124          return 0;
   132125       } else {
   132126          return 0;
   132127       }
   132128    default:
   132129       unreachable("Invalid hardware generation");
   132130    }
   132131 }
   132132 
   132133 
   132134 
   132135 /* INSTDONE_1::TDG Done */
   132136 
   132137 
   132138 #define GEN10_INSTDONE_1_TDGDone_bits  1
   132139 #define GEN9_INSTDONE_1_TDGDone_bits  1
   132140 #define GEN8_INSTDONE_1_TDGDone_bits  1
   132141 #define GEN75_INSTDONE_1_TDGDone_bits  1
   132142 #define GEN7_INSTDONE_1_TDGDone_bits  1
   132143 
   132144 static inline uint32_t ATTRIBUTE_PURE
   132145 INSTDONE_1_TDGDone_bits(const struct gen_device_info *devinfo)
   132146 {
   132147    switch (devinfo->gen) {
   132148    case 10: return 1;
   132149    case 9: return 1;
   132150    case 8: return 1;
   132151    case 7:
   132152       if (devinfo->is_haswell) {
   132153          return 1;
   132154       } else {
   132155          return 1;
   132156       }
   132157    case 6: return 0;
   132158    case 5: return 0;
   132159    case 4:
   132160       if (devinfo->is_g4x) {
   132161          return 0;
   132162       } else {
   132163          return 0;
   132164       }
   132165    default:
   132166       unreachable("Invalid hardware generation");
   132167    }
   132168 }
   132169 
   132170 
   132171 
   132172 #define GEN10_INSTDONE_1_TDGDone_start  12
   132173 #define GEN9_INSTDONE_1_TDGDone_start  12
   132174 #define GEN8_INSTDONE_1_TDGDone_start  12
   132175 #define GEN75_INSTDONE_1_TDGDone_start  12
   132176 #define GEN7_INSTDONE_1_TDGDone_start  12
   132177 
   132178 static inline uint32_t ATTRIBUTE_PURE
   132179 INSTDONE_1_TDGDone_start(const struct gen_device_info *devinfo)
   132180 {
   132181    switch (devinfo->gen) {
   132182    case 10: return 12;
   132183    case 9: return 12;
   132184    case 8: return 12;
   132185    case 7:
   132186       if (devinfo->is_haswell) {
   132187          return 12;
   132188       } else {
   132189          return 12;
   132190       }
   132191    case 6: return 0;
   132192    case 5: return 0;
   132193    case 4:
   132194       if (devinfo->is_g4x) {
   132195          return 0;
   132196       } else {
   132197          return 0;
   132198       }
   132199    default:
   132200       unreachable("Invalid hardware generation");
   132201    }
   132202 }
   132203 
   132204 
   132205 
   132206 /* INSTDONE_1::TE Done */
   132207 
   132208 
   132209 #define GEN10_INSTDONE_1_TEDone_bits  1
   132210 #define GEN9_INSTDONE_1_TEDone_bits  1
   132211 #define GEN8_INSTDONE_1_TEDone_bits  1
   132212 #define GEN75_INSTDONE_1_TEDone_bits  1
   132213 #define GEN7_INSTDONE_1_TEDone_bits  1
   132214 
   132215 static inline uint32_t ATTRIBUTE_PURE
   132216 INSTDONE_1_TEDone_bits(const struct gen_device_info *devinfo)
   132217 {
   132218    switch (devinfo->gen) {
   132219    case 10: return 1;
   132220    case 9: return 1;
   132221    case 8: return 1;
   132222    case 7:
   132223       if (devinfo->is_haswell) {
   132224          return 1;
   132225       } else {
   132226          return 1;
   132227       }
   132228    case 6: return 0;
   132229    case 5: return 0;
   132230    case 4:
   132231       if (devinfo->is_g4x) {
   132232          return 0;
   132233       } else {
   132234          return 0;
   132235       }
   132236    default:
   132237       unreachable("Invalid hardware generation");
   132238    }
   132239 }
   132240 
   132241 
   132242 
   132243 #define GEN10_INSTDONE_1_TEDone_start  4
   132244 #define GEN9_INSTDONE_1_TEDone_start  4
   132245 #define GEN8_INSTDONE_1_TEDone_start  4
   132246 #define GEN75_INSTDONE_1_TEDone_start  4
   132247 #define GEN7_INSTDONE_1_TEDone_start  4
   132248 
   132249 static inline uint32_t ATTRIBUTE_PURE
   132250 INSTDONE_1_TEDone_start(const struct gen_device_info *devinfo)
   132251 {
   132252    switch (devinfo->gen) {
   132253    case 10: return 4;
   132254    case 9: return 4;
   132255    case 8: return 4;
   132256    case 7:
   132257       if (devinfo->is_haswell) {
   132258          return 4;
   132259       } else {
   132260          return 4;
   132261       }
   132262    case 6: return 0;
   132263    case 5: return 0;
   132264    case 4:
   132265       if (devinfo->is_g4x) {
   132266          return 0;
   132267       } else {
   132268          return 0;
   132269       }
   132270    default:
   132271       unreachable("Invalid hardware generation");
   132272    }
   132273 }
   132274 
   132275 
   132276 
   132277 /* INSTDONE_1::TS Done */
   132278 
   132279 
   132280 #define GEN6_INSTDONE_1_TSDone_bits  1
   132281 
   132282 static inline uint32_t ATTRIBUTE_PURE
   132283 INSTDONE_1_TSDone_bits(const struct gen_device_info *devinfo)
   132284 {
   132285    switch (devinfo->gen) {
   132286    case 10: return 0;
   132287    case 9: return 0;
   132288    case 8: return 0;
   132289    case 7:
   132290       if (devinfo->is_haswell) {
   132291          return 0;
   132292       } else {
   132293          return 0;
   132294       }
   132295    case 6: return 1;
   132296    case 5: return 0;
   132297    case 4:
   132298       if (devinfo->is_g4x) {
   132299          return 0;
   132300       } else {
   132301          return 0;
   132302       }
   132303    default:
   132304       unreachable("Invalid hardware generation");
   132305    }
   132306 }
   132307 
   132308 
   132309 
   132310 #define GEN6_INSTDONE_1_TSDone_start  4
   132311 
   132312 static inline uint32_t ATTRIBUTE_PURE
   132313 INSTDONE_1_TSDone_start(const struct gen_device_info *devinfo)
   132314 {
   132315    switch (devinfo->gen) {
   132316    case 10: return 0;
   132317    case 9: return 0;
   132318    case 8: return 0;
   132319    case 7:
   132320       if (devinfo->is_haswell) {
   132321          return 0;
   132322       } else {
   132323          return 0;
   132324       }
   132325    case 6: return 4;
   132326    case 5: return 0;
   132327    case 4:
   132328       if (devinfo->is_g4x) {
   132329          return 0;
   132330       } else {
   132331          return 0;
   132332       }
   132333    default:
   132334       unreachable("Invalid hardware generation");
   132335    }
   132336 }
   132337 
   132338 
   132339 
   132340 /* INSTDONE_1::TSG Done */
   132341 
   132342 
   132343 #define GEN10_INSTDONE_1_TSGDone_bits  1
   132344 #define GEN9_INSTDONE_1_TSGDone_bits  1
   132345 #define GEN8_INSTDONE_1_TSGDone_bits  1
   132346 #define GEN75_INSTDONE_1_TSGDone_bits  1
   132347 #define GEN7_INSTDONE_1_TSGDone_bits  1
   132348 
   132349 static inline uint32_t ATTRIBUTE_PURE
   132350 INSTDONE_1_TSGDone_bits(const struct gen_device_info *devinfo)
   132351 {
   132352    switch (devinfo->gen) {
   132353    case 10: return 1;
   132354    case 9: return 1;
   132355    case 8: return 1;
   132356    case 7:
   132357       if (devinfo->is_haswell) {
   132358          return 1;
   132359       } else {
   132360          return 1;
   132361       }
   132362    case 6: return 0;
   132363    case 5: return 0;
   132364    case 4:
   132365       if (devinfo->is_g4x) {
   132366          return 0;
   132367       } else {
   132368          return 0;
   132369       }
   132370    default:
   132371       unreachable("Invalid hardware generation");
   132372    }
   132373 }
   132374 
   132375 
   132376 
   132377 #define GEN10_INSTDONE_1_TSGDone_start  17
   132378 #define GEN9_INSTDONE_1_TSGDone_start  17
   132379 #define GEN8_INSTDONE_1_TSGDone_start  17
   132380 #define GEN75_INSTDONE_1_TSGDone_start  17
   132381 #define GEN7_INSTDONE_1_TSGDone_start  17
   132382 
   132383 static inline uint32_t ATTRIBUTE_PURE
   132384 INSTDONE_1_TSGDone_start(const struct gen_device_info *devinfo)
   132385 {
   132386    switch (devinfo->gen) {
   132387    case 10: return 17;
   132388    case 9: return 17;
   132389    case 8: return 17;
   132390    case 7:
   132391       if (devinfo->is_haswell) {
   132392          return 17;
   132393       } else {
   132394          return 17;
   132395       }
   132396    case 6: return 0;
   132397    case 5: return 0;
   132398    case 4:
   132399       if (devinfo->is_g4x) {
   132400          return 0;
   132401       } else {
   132402          return 0;
   132403       }
   132404    default:
   132405       unreachable("Invalid hardware generation");
   132406    }
   132407 }
   132408 
   132409 
   132410 
   132411 /* INSTDONE_1::URBM Done */
   132412 
   132413 
   132414 #define GEN10_INSTDONE_1_URBMDone_bits  1
   132415 #define GEN9_INSTDONE_1_URBMDone_bits  1
   132416 #define GEN8_INSTDONE_1_URBMDone_bits  1
   132417 #define GEN75_INSTDONE_1_URBMDone_bits  1
   132418 #define GEN7_INSTDONE_1_URBMDone_bits  1
   132419 
   132420 static inline uint32_t ATTRIBUTE_PURE
   132421 INSTDONE_1_URBMDone_bits(const struct gen_device_info *devinfo)
   132422 {
   132423    switch (devinfo->gen) {
   132424    case 10: return 1;
   132425    case 9: return 1;
   132426    case 8: return 1;
   132427    case 7:
   132428       if (devinfo->is_haswell) {
   132429          return 1;
   132430       } else {
   132431          return 1;
   132432       }
   132433    case 6: return 0;
   132434    case 5: return 0;
   132435    case 4:
   132436       if (devinfo->is_g4x) {
   132437          return 0;
   132438       } else {
   132439          return 0;
   132440       }
   132441    default:
   132442       unreachable("Invalid hardware generation");
   132443    }
   132444 }
   132445 
   132446 
   132447 
   132448 #define GEN10_INSTDONE_1_URBMDone_start  13
   132449 #define GEN9_INSTDONE_1_URBMDone_start  13
   132450 #define GEN8_INSTDONE_1_URBMDone_start  13
   132451 #define GEN75_INSTDONE_1_URBMDone_start  13
   132452 #define GEN7_INSTDONE_1_URBMDone_start  13
   132453 
   132454 static inline uint32_t ATTRIBUTE_PURE
   132455 INSTDONE_1_URBMDone_start(const struct gen_device_info *devinfo)
   132456 {
   132457    switch (devinfo->gen) {
   132458    case 10: return 13;
   132459    case 9: return 13;
   132460    case 8: return 13;
   132461    case 7:
   132462       if (devinfo->is_haswell) {
   132463          return 13;
   132464       } else {
   132465          return 13;
   132466       }
   132467    case 6: return 0;
   132468    case 5: return 0;
   132469    case 4:
   132470       if (devinfo->is_g4x) {
   132471          return 0;
   132472       } else {
   132473          return 0;
   132474       }
   132475    default:
   132476       unreachable("Invalid hardware generation");
   132477    }
   132478 }
   132479 
   132480 
   132481 
   132482 /* INSTDONE_1::VFE Done */
   132483 
   132484 
   132485 #define GEN10_INSTDONE_1_VFEDone_bits  1
   132486 #define GEN9_INSTDONE_1_VFEDone_bits  1
   132487 #define GEN8_INSTDONE_1_VFEDone_bits  1
   132488 #define GEN75_INSTDONE_1_VFEDone_bits  1
   132489 #define GEN7_INSTDONE_1_VFEDone_bits  1
   132490 #define GEN6_INSTDONE_1_VFEDone_bits  1
   132491 
   132492 static inline uint32_t ATTRIBUTE_PURE
   132493 INSTDONE_1_VFEDone_bits(const struct gen_device_info *devinfo)
   132494 {
   132495    switch (devinfo->gen) {
   132496    case 10: return 1;
   132497    case 9: return 1;
   132498    case 8: return 1;
   132499    case 7:
   132500       if (devinfo->is_haswell) {
   132501          return 1;
   132502       } else {
   132503          return 1;
   132504       }
   132505    case 6: return 1;
   132506    case 5: return 0;
   132507    case 4:
   132508       if (devinfo->is_g4x) {
   132509          return 0;
   132510       } else {
   132511          return 0;
   132512       }
   132513    default:
   132514       unreachable("Invalid hardware generation");
   132515    }
   132516 }
   132517 
   132518 
   132519 
   132520 #define GEN10_INSTDONE_1_VFEDone_start  16
   132521 #define GEN9_INSTDONE_1_VFEDone_start  16
   132522 #define GEN8_INSTDONE_1_VFEDone_start  16
   132523 #define GEN75_INSTDONE_1_VFEDone_start  16
   132524 #define GEN7_INSTDONE_1_VFEDone_start  16
   132525 #define GEN6_INSTDONE_1_VFEDone_start  7
   132526 
   132527 static inline uint32_t ATTRIBUTE_PURE
   132528 INSTDONE_1_VFEDone_start(const struct gen_device_info *devinfo)
   132529 {
   132530    switch (devinfo->gen) {
   132531    case 10: return 16;
   132532    case 9: return 16;
   132533    case 8: return 16;
   132534    case 7:
   132535       if (devinfo->is_haswell) {
   132536          return 16;
   132537       } else {
   132538          return 16;
   132539       }
   132540    case 6: return 7;
   132541    case 5: return 0;
   132542    case 4:
   132543       if (devinfo->is_g4x) {
   132544          return 0;
   132545       } else {
   132546          return 0;
   132547       }
   132548    default:
   132549       unreachable("Invalid hardware generation");
   132550    }
   132551 }
   132552 
   132553 
   132554 
   132555 /* INSTDONE_1::VFG Done */
   132556 
   132557 
   132558 #define GEN10_INSTDONE_1_VFGDone_bits  1
   132559 #define GEN9_INSTDONE_1_VFGDone_bits  1
   132560 #define GEN8_INSTDONE_1_VFGDone_bits  1
   132561 #define GEN75_INSTDONE_1_VFGDone_bits  1
   132562 #define GEN7_INSTDONE_1_VFGDone_bits  1
   132563 
   132564 static inline uint32_t ATTRIBUTE_PURE
   132565 INSTDONE_1_VFGDone_bits(const struct gen_device_info *devinfo)
   132566 {
   132567    switch (devinfo->gen) {
   132568    case 10: return 1;
   132569    case 9: return 1;
   132570    case 8: return 1;
   132571    case 7:
   132572       if (devinfo->is_haswell) {
   132573          return 1;
   132574       } else {
   132575          return 1;
   132576       }
   132577    case 6: return 0;
   132578    case 5: return 0;
   132579    case 4:
   132580       if (devinfo->is_g4x) {
   132581          return 0;
   132582       } else {
   132583          return 0;
   132584       }
   132585    default:
   132586       unreachable("Invalid hardware generation");
   132587    }
   132588 }
   132589 
   132590 
   132591 
   132592 #define GEN10_INSTDONE_1_VFGDone_start  1
   132593 #define GEN9_INSTDONE_1_VFGDone_start  1
   132594 #define GEN8_INSTDONE_1_VFGDone_start  1
   132595 #define GEN75_INSTDONE_1_VFGDone_start  1
   132596 #define GEN7_INSTDONE_1_VFGDone_start  1
   132597 
   132598 static inline uint32_t ATTRIBUTE_PURE
   132599 INSTDONE_1_VFGDone_start(const struct gen_device_info *devinfo)
   132600 {
   132601    switch (devinfo->gen) {
   132602    case 10: return 1;
   132603    case 9: return 1;
   132604    case 8: return 1;
   132605    case 7:
   132606       if (devinfo->is_haswell) {
   132607          return 1;
   132608       } else {
   132609          return 1;
   132610       }
   132611    case 6: return 0;
   132612    case 5: return 0;
   132613    case 4:
   132614       if (devinfo->is_g4x) {
   132615          return 0;
   132616       } else {
   132617          return 0;
   132618       }
   132619    default:
   132620       unreachable("Invalid hardware generation");
   132621    }
   132622 }
   132623 
   132624 
   132625 
   132626 /* INSTDONE_1::VS Done */
   132627 
   132628 
   132629 #define GEN10_INSTDONE_1_VSDone_bits  1
   132630 #define GEN9_INSTDONE_1_VSDone_bits  1
   132631 #define GEN8_INSTDONE_1_VSDone_bits  1
   132632 #define GEN75_INSTDONE_1_VSDone_bits  1
   132633 #define GEN7_INSTDONE_1_VSDone_bits  1
   132634 
   132635 static inline uint32_t ATTRIBUTE_PURE
   132636 INSTDONE_1_VSDone_bits(const struct gen_device_info *devinfo)
   132637 {
   132638    switch (devinfo->gen) {
   132639    case 10: return 1;
   132640    case 9: return 1;
   132641    case 8: return 1;
   132642    case 7:
   132643       if (devinfo->is_haswell) {
   132644          return 1;
   132645       } else {
   132646          return 1;
   132647       }
   132648    case 6: return 0;
   132649    case 5: return 0;
   132650    case 4:
   132651       if (devinfo->is_g4x) {
   132652          return 0;
   132653       } else {
   132654          return 0;
   132655       }
   132656    default:
   132657       unreachable("Invalid hardware generation");
   132658    }
   132659 }
   132660 
   132661 
   132662 
   132663 #define GEN10_INSTDONE_1_VSDone_start  2
   132664 #define GEN9_INSTDONE_1_VSDone_start  2
   132665 #define GEN8_INSTDONE_1_VSDone_start  2
   132666 #define GEN75_INSTDONE_1_VSDone_start  2
   132667 #define GEN7_INSTDONE_1_VSDone_start  2
   132668 
   132669 static inline uint32_t ATTRIBUTE_PURE
   132670 INSTDONE_1_VSDone_start(const struct gen_device_info *devinfo)
   132671 {
   132672    switch (devinfo->gen) {
   132673    case 10: return 2;
   132674    case 9: return 2;
   132675    case 8: return 2;
   132676    case 7:
   132677       if (devinfo->is_haswell) {
   132678          return 2;
   132679       } else {
   132680          return 2;
   132681       }
   132682    case 6: return 0;
   132683    case 5: return 0;
   132684    case 4:
   132685       if (devinfo->is_g4x) {
   132686          return 0;
   132687       } else {
   132688          return 0;
   132689       }
   132690    default:
   132691       unreachable("Invalid hardware generation");
   132692    }
   132693 }
   132694 
   132695 
   132696 
   132697 /* INSTDONE_1::VSC Done */
   132698 
   132699 
   132700 #define GEN6_INSTDONE_1_VSCDone_bits  1
   132701 
   132702 static inline uint32_t ATTRIBUTE_PURE
   132703 INSTDONE_1_VSCDone_bits(const struct gen_device_info *devinfo)
   132704 {
   132705    switch (devinfo->gen) {
   132706    case 10: return 0;
   132707    case 9: return 0;
   132708    case 8: return 0;
   132709    case 7:
   132710       if (devinfo->is_haswell) {
   132711          return 0;
   132712       } else {
   132713          return 0;
   132714       }
   132715    case 6: return 1;
   132716    case 5: return 0;
   132717    case 4:
   132718       if (devinfo->is_g4x) {
   132719          return 0;
   132720       } else {
   132721          return 0;
   132722       }
   132723    default:
   132724       unreachable("Invalid hardware generation");
   132725    }
   132726 }
   132727 
   132728 
   132729 
   132730 #define GEN6_INSTDONE_1_VSCDone_start  9
   132731 
   132732 static inline uint32_t ATTRIBUTE_PURE
   132733 INSTDONE_1_VSCDone_start(const struct gen_device_info *devinfo)
   132734 {
   132735    switch (devinfo->gen) {
   132736    case 10: return 0;
   132737    case 9: return 0;
   132738    case 8: return 0;
   132739    case 7:
   132740       if (devinfo->is_haswell) {
   132741          return 0;
   132742       } else {
   132743          return 0;
   132744       }
   132745    case 6: return 9;
   132746    case 5: return 0;
   132747    case 4:
   132748       if (devinfo->is_g4x) {
   132749          return 0;
   132750       } else {
   132751          return 0;
   132752       }
   132753    default:
   132754       unreachable("Invalid hardware generation");
   132755    }
   132756 }
   132757 
   132758 
   132759 
   132760 /* INSTDONE_2 */
   132761 
   132762 
   132763 #define GEN6_INSTDONE_2_length  1
   132764 
   132765 static inline uint32_t ATTRIBUTE_PURE
   132766 INSTDONE_2_length(const struct gen_device_info *devinfo)
   132767 {
   132768    switch (devinfo->gen) {
   132769    case 10: return 0;
   132770    case 9: return 0;
   132771    case 8: return 0;
   132772    case 7:
   132773       if (devinfo->is_haswell) {
   132774          return 0;
   132775       } else {
   132776          return 0;
   132777       }
   132778    case 6: return 1;
   132779    case 5: return 0;
   132780    case 4:
   132781       if (devinfo->is_g4x) {
   132782          return 0;
   132783       } else {
   132784          return 0;
   132785       }
   132786    default:
   132787       unreachable("Invalid hardware generation");
   132788    }
   132789 }
   132790 
   132791 
   132792 
   132793 /* INSTDONE_2::CL Done */
   132794 
   132795 
   132796 #define GEN6_INSTDONE_2_CLDone_bits  1
   132797 
   132798 static inline uint32_t ATTRIBUTE_PURE
   132799 INSTDONE_2_CLDone_bits(const struct gen_device_info *devinfo)
   132800 {
   132801    switch (devinfo->gen) {
   132802    case 10: return 0;
   132803    case 9: return 0;
   132804    case 8: return 0;
   132805    case 7:
   132806       if (devinfo->is_haswell) {
   132807          return 0;
   132808       } else {
   132809          return 0;
   132810       }
   132811    case 6: return 1;
   132812    case 5: return 0;
   132813    case 4:
   132814       if (devinfo->is_g4x) {
   132815          return 0;
   132816       } else {
   132817          return 0;
   132818       }
   132819    default:
   132820       unreachable("Invalid hardware generation");
   132821    }
   132822 }
   132823 
   132824 
   132825 
   132826 #define GEN6_INSTDONE_2_CLDone_start  3
   132827 
   132828 static inline uint32_t ATTRIBUTE_PURE
   132829 INSTDONE_2_CLDone_start(const struct gen_device_info *devinfo)
   132830 {
   132831    switch (devinfo->gen) {
   132832    case 10: return 0;
   132833    case 9: return 0;
   132834    case 8: return 0;
   132835    case 7:
   132836       if (devinfo->is_haswell) {
   132837          return 0;
   132838       } else {
   132839          return 0;
   132840       }
   132841    case 6: return 3;
   132842    case 5: return 0;
   132843    case 4:
   132844       if (devinfo->is_g4x) {
   132845          return 0;
   132846       } else {
   132847          return 0;
   132848       }
   132849    default:
   132850       unreachable("Invalid hardware generation");
   132851    }
   132852 }
   132853 
   132854 
   132855 
   132856 /* INSTDONE_2::CS Done */
   132857 
   132858 
   132859 #define GEN6_INSTDONE_2_CSDone_bits  1
   132860 
   132861 static inline uint32_t ATTRIBUTE_PURE
   132862 INSTDONE_2_CSDone_bits(const struct gen_device_info *devinfo)
   132863 {
   132864    switch (devinfo->gen) {
   132865    case 10: return 0;
   132866    case 9: return 0;
   132867    case 8: return 0;
   132868    case 7:
   132869       if (devinfo->is_haswell) {
   132870          return 0;
   132871       } else {
   132872          return 0;
   132873       }
   132874    case 6: return 1;
   132875    case 5: return 0;
   132876    case 4:
   132877       if (devinfo->is_g4x) {
   132878          return 0;
   132879       } else {
   132880          return 0;
   132881       }
   132882    default:
   132883       unreachable("Invalid hardware generation");
   132884    }
   132885 }
   132886 
   132887 
   132888 
   132889 #define GEN6_INSTDONE_2_CSDone_start  30
   132890 
   132891 static inline uint32_t ATTRIBUTE_PURE
   132892 INSTDONE_2_CSDone_start(const struct gen_device_info *devinfo)
   132893 {
   132894    switch (devinfo->gen) {
   132895    case 10: return 0;
   132896    case 9: return 0;
   132897    case 8: return 0;
   132898    case 7:
   132899       if (devinfo->is_haswell) {
   132900          return 0;
   132901       } else {
   132902          return 0;
   132903       }
   132904    case 6: return 30;
   132905    case 5: return 0;
   132906    case 4:
   132907       if (devinfo->is_g4x) {
   132908          return 0;
   132909       } else {
   132910          return 0;
   132911       }
   132912    default:
   132913       unreachable("Invalid hardware generation");
   132914    }
   132915 }
   132916 
   132917 
   132918 
   132919 /* INSTDONE_2::DAP Done */
   132920 
   132921 
   132922 #define GEN6_INSTDONE_2_DAPDone_bits  1
   132923 
   132924 static inline uint32_t ATTRIBUTE_PURE
   132925 INSTDONE_2_DAPDone_bits(const struct gen_device_info *devinfo)
   132926 {
   132927    switch (devinfo->gen) {
   132928    case 10: return 0;
   132929    case 9: return 0;
   132930    case 8: return 0;
   132931    case 7:
   132932       if (devinfo->is_haswell) {
   132933          return 0;
   132934       } else {
   132935          return 0;
   132936       }
   132937    case 6: return 1;
   132938    case 5: return 0;
   132939    case 4:
   132940       if (devinfo->is_g4x) {
   132941          return 0;
   132942       } else {
   132943          return 0;
   132944       }
   132945    default:
   132946       unreachable("Invalid hardware generation");
   132947    }
   132948 }
   132949 
   132950 
   132951 
   132952 #define GEN6_INSTDONE_2_DAPDone_start  19
   132953 
   132954 static inline uint32_t ATTRIBUTE_PURE
   132955 INSTDONE_2_DAPDone_start(const struct gen_device_info *devinfo)
   132956 {
   132957    switch (devinfo->gen) {
   132958    case 10: return 0;
   132959    case 9: return 0;
   132960    case 8: return 0;
   132961    case 7:
   132962       if (devinfo->is_haswell) {
   132963          return 0;
   132964       } else {
   132965          return 0;
   132966       }
   132967    case 6: return 19;
   132968    case 5: return 0;
   132969    case 4:
   132970       if (devinfo->is_g4x) {
   132971          return 0;
   132972       } else {
   132973          return 0;
   132974       }
   132975    default:
   132976       unreachable("Invalid hardware generation");
   132977    }
   132978 }
   132979 
   132980 
   132981 
   132982 /* INSTDONE_2::DG Done */
   132983 
   132984 
   132985 #define GEN6_INSTDONE_2_DGDone_bits  1
   132986 
   132987 static inline uint32_t ATTRIBUTE_PURE
   132988 INSTDONE_2_DGDone_bits(const struct gen_device_info *devinfo)
   132989 {
   132990    switch (devinfo->gen) {
   132991    case 10: return 0;
   132992    case 9: return 0;
   132993    case 8: return 0;
   132994    case 7:
   132995       if (devinfo->is_haswell) {
   132996          return 0;
   132997       } else {
   132998          return 0;
   132999       }
   133000    case 6: return 1;
   133001    case 5: return 0;
   133002    case 4:
   133003       if (devinfo->is_g4x) {
   133004          return 0;
   133005       } else {
   133006          return 0;
   133007       }
   133008    default:
   133009       unreachable("Invalid hardware generation");
   133010    }
   133011 }
   133012 
   133013 
   133014 
   133015 #define GEN6_INSTDONE_2_DGDone_start  9
   133016 
   133017 static inline uint32_t ATTRIBUTE_PURE
   133018 INSTDONE_2_DGDone_start(const struct gen_device_info *devinfo)
   133019 {
   133020    switch (devinfo->gen) {
   133021    case 10: return 0;
   133022    case 9: return 0;
   133023    case 8: return 0;
   133024    case 7:
   133025       if (devinfo->is_haswell) {
   133026          return 0;
   133027       } else {
   133028          return 0;
   133029       }
   133030    case 6: return 9;
   133031    case 5: return 0;
   133032    case 4:
   133033       if (devinfo->is_g4x) {
   133034          return 0;
   133035       } else {
   133036          return 0;
   133037       }
   133038    default:
   133039       unreachable("Invalid hardware generation");
   133040    }
   133041 }
   133042 
   133043 
   133044 
   133045 /* INSTDONE_2::DM Done */
   133046 
   133047 
   133048 #define GEN6_INSTDONE_2_DMDone_bits  1
   133049 
   133050 static inline uint32_t ATTRIBUTE_PURE
   133051 INSTDONE_2_DMDone_bits(const struct gen_device_info *devinfo)
   133052 {
   133053    switch (devinfo->gen) {
   133054    case 10: return 0;
   133055    case 9: return 0;
   133056    case 8: return 0;
   133057    case 7:
   133058       if (devinfo->is_haswell) {
   133059          return 0;
   133060       } else {
   133061          return 0;
   133062       }
   133063    case 6: return 1;
   133064    case 5: return 0;
   133065    case 4:
   133066       if (devinfo->is_g4x) {
   133067          return 0;
   133068       } else {
   133069          return 0;
   133070       }
   133071    default:
   133072       unreachable("Invalid hardware generation");
   133073    }
   133074 }
   133075 
   133076 
   133077 
   133078 #define GEN6_INSTDONE_2_DMDone_start  11
   133079 
   133080 static inline uint32_t ATTRIBUTE_PURE
   133081 INSTDONE_2_DMDone_start(const struct gen_device_info *devinfo)
   133082 {
   133083    switch (devinfo->gen) {
   133084    case 10: return 0;
   133085    case 9: return 0;
   133086    case 8: return 0;
   133087    case 7:
   133088       if (devinfo->is_haswell) {
   133089          return 0;
   133090       } else {
   133091          return 0;
   133092       }
   133093    case 6: return 11;
   133094    case 5: return 0;
   133095    case 4:
   133096       if (devinfo->is_g4x) {
   133097          return 0;
   133098       } else {
   133099          return 0;
   133100       }
   133101    default:
   133102       unreachable("Invalid hardware generation");
   133103    }
   133104 }
   133105 
   133106 
   133107 
   133108 /* INSTDONE_2::FL Done */
   133109 
   133110 
   133111 #define GEN6_INSTDONE_2_FLDone_bits  1
   133112 
   133113 static inline uint32_t ATTRIBUTE_PURE
   133114 INSTDONE_2_FLDone_bits(const struct gen_device_info *devinfo)
   133115 {
   133116    switch (devinfo->gen) {
   133117    case 10: return 0;
   133118    case 9: return 0;
   133119    case 8: return 0;
   133120    case 7:
   133121       if (devinfo->is_haswell) {
   133122          return 0;
   133123       } else {
   133124          return 0;
   133125       }
   133126    case 6: return 1;
   133127    case 5: return 0;
   133128    case 4:
   133129       if (devinfo->is_g4x) {
   133130          return 0;
   133131       } else {
   133132          return 0;
   133133       }
   133134    default:
   133135       unreachable("Invalid hardware generation");
   133136    }
   133137 }
   133138 
   133139 
   133140 
   133141 #define GEN6_INSTDONE_2_FLDone_start  13
   133142 
   133143 static inline uint32_t ATTRIBUTE_PURE
   133144 INSTDONE_2_FLDone_start(const struct gen_device_info *devinfo)
   133145 {
   133146    switch (devinfo->gen) {
   133147    case 10: return 0;
   133148    case 9: return 0;
   133149    case 8: return 0;
   133150    case 7:
   133151       if (devinfo->